File tree 1 file changed +17
-12
lines changed
1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -3088,19 +3088,10 @@ cdef class DenseMatrixBase(MatrixBase):
3088
3088
return NotImplemented
3089
3089
3090
3090
def __div__ (a , b ):
3091
- a = _sympify(a, False )
3092
- b = _sympify(b, False )
3093
- if isinstance (a, MatrixBase):
3094
- if isinstance (b, MatrixBase):
3095
- return a.mul_matrix(b.inv())
3096
- elif isinstance (b, Basic):
3097
- return a.mul_scalar(1 / b)
3098
- else :
3099
- return NotImplemented
3100
- else :
3101
- return NotImplemented
3091
+ return div_matrices(a, b)
3102
3092
3103
- __truediv__ = __div__
3093
+ def __truediv__ (a , b ):
3094
+ return div_matrices(a, b)
3104
3095
3105
3096
def __sub__ (a , b ):
3106
3097
a = _sympify(a, False )
@@ -3571,6 +3562,20 @@ cdef class DenseMatrixBase(MatrixBase):
3571
3562
def expand (self , *args , **kwargs ):
3572
3563
return self .applyfunc(lambda x : x.expand())
3573
3564
3565
+
3566
+ def div_matrices (a , b ):
3567
+ a = _sympify(a, False )
3568
+ b = _sympify(b, False )
3569
+ if isinstance (a, MatrixBase):
3570
+ if isinstance (b, MatrixBase):
3571
+ return a.mul_matrix(b.inv())
3572
+ elif isinstance (b, Basic):
3573
+ return a.mul_scalar(1 / b)
3574
+ else :
3575
+ return NotImplemented
3576
+ else :
3577
+ return NotImplemented
3578
+
3574
3579
class DenseMatrixBaseIter (object ):
3575
3580
3576
3581
def __init__ (self , d ):
You can’t perform that action at this time.
0 commit comments