unit_matrix(r,c) can return an evaluated matrix object.
authorRichard Kreckel <kreckel@ginac.de>
Mon, 23 Nov 2015 20:38:30 +0000 (21:38 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Mon, 23 Nov 2015 20:38:30 +0000 (21:38 +0100)
ginac/matrix.cpp

index 871c3f15d1c5f433238b6f5a3b354d1f17ef1ea2..52a1f1b423cd4b3eafea7a3b8c6d8a185565d26c 100644 (file)
@@ -1589,7 +1589,7 @@ ex diag_matrix(const lst & l)
 ex unit_matrix(unsigned r, unsigned c)
 {
        matrix &Id = *new matrix(r, c);
 ex unit_matrix(unsigned r, unsigned c)
 {
        matrix &Id = *new matrix(r, c);
-       Id.setflag(status_flags::dynallocated);
+       Id.setflag(status_flags::dynallocated | status_flags::evaluated);
        for (unsigned i=0; i<r && i<c; i++)
                Id(i,i) = _ex1;
 
        for (unsigned i=0; i<r && i<c; i++)
                Id(i,i) = _ex1;