Skip to content

Commit f1ec18a

Browse files
rikardnisuruf
andcommitted
Update symengine/lib/symengine_wrapper.pyx
Co-authored-by: Isuru Fernando <[email protected]>
1 parent 9550a2b commit f1ec18a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

symengine/lib/symengine_wrapper.pyx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4047,13 +4047,9 @@ cdef class ImmutableDenseMatrix(DenseMatrixBase):
40474047
raise TypeError("Cannot set values of {}".format(self.__class__))
40484048

40494049
def _applyfunc(self, f):
4050-
cdef int nr = self.nrows()
4051-
cdef int nc = self.ncols()
4052-
temp = DenseMatrix(self)
4053-
for i in range(nr):
4054-
for j in range(nc):
4055-
temp._set(i, j, f(temp._get(i, j)))
4056-
return ImmutableDenseMatrix(temp)
4050+
res = DenseMatrix(self)
4051+
res._applyfunc(f)
4052+
return ImmutableDenseMatrix(res)
40574053

40584054

40594055
ImmutableMatrix = ImmutableDenseMatrix

0 commit comments

Comments
 (0)