dot(a,b) Returns the dot product of a and b for arrays of floating point types. Like the generic numpy equivalent the product sum is over the last dimension of a and the second-to-last dimension of b. NB: The first argument is not conjugated.;
This is for use by PyArray_MatrixProduct2. It is assumed on entry that the arrays ap1 and ap2 have a common data type given by typenum that is float, double, cfloat, or cdouble and have dimension <= 2. The __numpy_ufunc__ nonsense is also assumed to have been taken care of.
One of ap1 or ap2 is a scalar
Make ap2 the scalar
nd = 0 or 1 or 2. If nd == 0 do nothing ...
Fix it so that dot(shape=(N,1), shape=(1,)) and dot(shape=(1,), shape=(1,N)) both return an (N,) array (but use the fast scalar code)
We need to make sure that dot(shape=(1,1), shape=(1,N)) and dot(shape=(N,1),shape=(1,1)) uses scalar multiplication appropriately
Check if the summation dimension is 0-sized
Choose which subtype to return
verify that out is usable
Multiplication by a scalar -- Level 1 BLAS if ap1shape is a matrix and we are not contiguous, then we can't just blast through the entire array using a single striding factor
Dot product between two vectors -- Level 1 BLAS
Matrix vector multiplication -- Level 2 BLAS
Vector matrix multiplication -- Level 2 BLAS
System Message: ERROR/3 (<string>
, line 3) Unexpected indentation.
<blockquote> L x M multiplied by M x N</blockquote>
Optimization possible:
We may be able to handle single-segment arrays here using appropriate values of Order, Trans1, and Trans2.
Avoid temporary copies for arrays in Fortran order
Use syrk if we have a case of a matrix times its transpose. Otherwise, use gemm for all other cases.
References NPY_ANYORDER, and PyArray_NewCopy().