- changed status to resolved
Problem with division
Issue #121
resolved
Hi,
When I use
B=A/2.
with A an aij matrix, I observe that B = 2*A.
I got the same with
B=A.__div__(2)
I seems that petscmat.pxi
call self.scale
function for multiplication and division.
cdef Mat mat_imul(Mat self, other):
if (isinstance(other, tuple) or
isinstance(other, list)):
L, R = other
self.diagonalScale(L, R)
else:
self.scale(other) # <---------there
return self
cdef Mat mat_idiv(Mat self, other):
if isinstance(other, (tuple, list)):
L, R = other
if isinstance(L, Vec):
L = L.copy()
L.reciprocal()
if isinstance(R, Vec):
R = R.copy()
R.reciprocal()
self.diagonalScale(L, R)
else:
self.scale(other) # <---------there
return self
Best regards,
Benoit
Comments (2)
-
-
reporter Thanks !
- Log in to comment
Mat: Fix issue
#121→ <<cset b11a1232d5ae>>