@@ -1802,7 +1802,7 @@ cdef class DenseMatrixBase(MatrixBase):
1802
1802
cdef Basic e_
1803
1803
for i in range (self .rows):
1804
1804
for j in range (self .cols):
1805
- e_ = _sympify( self ._get(i, j) )
1805
+ e_ = self ._get(i, j)
1806
1806
deref(result.thisptr).set(i, j, e_.thisptr)
1807
1807
for i in range (o.rows):
1808
1808
for j in range (o.cols):
@@ -1818,7 +1818,7 @@ cdef class DenseMatrixBase(MatrixBase):
1818
1818
cdef Basic e_
1819
1819
for i in range (self .rows):
1820
1820
for j in range (self .cols):
1821
- e_ = _sympify( self ._get(i, j) )
1821
+ e_ = self ._get(i, j)
1822
1822
deref(result.thisptr).set(i, j, e_.thisptr)
1823
1823
for i in range (o.rows):
1824
1824
for j in range (o.cols):
@@ -2128,7 +2128,7 @@ cdef class DenseMatrixBase(MatrixBase):
2128
2128
return self .free_symbols
2129
2129
2130
2130
def simplify (self , *args , **kwargs ):
2131
- return self .applyfunc (lambda x : x.simplify(* args, ** kwargs))
2131
+ return self ._applyfunc (lambda x : x.simplify(* args, ** kwargs))
2132
2132
2133
2133
def expand (self , *args , **kwargs ):
2134
2134
return self .applyfunc(lambda x : x.expand())
@@ -2166,14 +2166,12 @@ cdef class MutableDenseMatrix(DenseMatrixBase):
2166
2166
for k in range (0 , self .cols):
2167
2167
self [i, k], self [j, k] = self [j, k], self [i, k]
2168
2168
2169
- def applyfunc (self , f ):
2170
- cdef DenseMatrixBase out = self .__class__ (self )
2169
+ def _applyfunc (self , f ):
2171
2170
cdef int nr = self .nrows()
2172
2171
cdef int nc = self .ncols()
2173
2172
for i in range (nr):
2174
2173
for j in range (nc):
2175
- out._set(i, j, f(self ._get(i, j)))
2176
- return out
2174
+ self ._set(i, j, f(self ._get(i, j)))
2177
2175
2178
2176
Matrix = DenseMatrix = MutableDenseMatrix
2179
2177
0 commit comments