@@ -3230,6 +3230,8 @@ cdef class DenseMatrixBase(MatrixBase):
3230
3230
raise ValueError (" sizes don't match." )
3231
3231
else :
3232
3232
self .thisptr = new symengine.DenseMatrix(0 , 0 , v_)
3233
+ elif col is not None and (row* col != v_.size()):
3234
+ raise ValueError (" Number of elements should equal rows*columns." )
3233
3235
else :
3234
3236
self .thisptr = new symengine.DenseMatrix(row, v_.size() / row, v_)
3235
3237
@@ -3271,6 +3273,13 @@ cdef class DenseMatrixBase(MatrixBase):
3271
3273
else :
3272
3274
return NotImplemented
3273
3275
3276
+ def __matmul__ (a , b ):
3277
+ a = _sympify(a, False )
3278
+ b = _sympify(b, False )
3279
+ if (a.ncols() != b.nrows()):
3280
+ raise ShapeError(" Invalid shapes for matrix multiplication. Got %s %s " % (a.shape, b.shape))
3281
+ return a.mul_matrix(b)
3282
+
3274
3283
def __truediv__ (a , b ):
3275
3284
return div_matrices(a, b)
3276
3285
@@ -4889,7 +4898,7 @@ cdef class LambdaDouble(_Lambdify):
4889
4898
c_inp = np.ascontiguousarray(inp.ravel(order = self .order), dtype = self .numpy_dtype)
4890
4899
c_out = out
4891
4900
for idx in range (nbroadcast):
4892
- self .lambda_double[0 ].call(& c_out[idx* self .tot_out_size], & c_inp[idx* self .args_size])
4901
+ self .lambda_double[0 ].call(& c_out[idx* self .tot_out_size], & c_inp[idx* self .args_size])
4893
4902
4894
4903
cpdef as_scipy_low_level_callable(self ):
4895
4904
from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE
@@ -5135,7 +5144,7 @@ def Lambdify(args, *exprs, cppbool real=True, backend=None, order='C',
5135
5144
raise ValueError (" Long double not supported on this platform" )
5136
5145
else :
5137
5146
raise ValueError (" Unknown numpy dtype." )
5138
-
5147
+
5139
5148
if as_scipy:
5140
5149
return ret.as_scipy_low_level_callable()
5141
5150
return ret
0 commit comments