def vdot(a, b): """Returns the dot product of 2 vectors (or anything that can be made into a vector). NB: this is not the same as `dot`, as it takes the conjugate of its first argument if complex and always returns a scalar.""" try: return _dotblas.vdot(Numeric.ravel(a), Numeric.ravel(b)) # in case we get an integer Value except TypeError: return multiarray.matrixproduct(multiarray.array(a).flat, multiarray.array(b).flat)
def dot(a, b): """dot(a,b) returns matrix-multiplication between a and b. The product-sum is over the last dimension of a and the second-to-last dimension of b. """ try: return multiarray.matrixproduct(a, b) except TypeError, detail: if array(a).shape == () or array(b).shape == (): return a * b else: raise TypeError, detail or "invalid types for dot"
def dot(a, b): """dot(a,b) returns matrix-multiplication between a and b. The product-sum is over the last dimension of a and the second-to-last dimension of b. """ try: return multiarray.matrixproduct(a, b) except TypeError,detail: if array(a).shape == () or array(b).shape == (): return a*b else: raise TypeError, detail or "invalid types for dot"
def dot(a, b): """returns matrix-multiplication between a and b. The product-sum is over the last dimension of a and the second-to-last dimension of b. NB: No conjugation of complex arguments is performed. This version uses the BLAS optimized routines where possible. """ try: return _dotblas.matrixproduct(a, b) except: try: return multiarray.matrixproduct(a, b) except TypeError,detail: if multiarray.array(a).shape == () or multiarray.array(b).shape == (): return a*b else: raise TypeError, detail or "invalid types for matrixproduct"
def vdot(a, b): """Returns the dot product of 2 vectors (or anything that can be made into a vector). NB: this is not the same as `dot`, as it takes the conjugate of its first argument if complex and always returns a scalar.""" return multiarray.matrixproduct(conjugate(ravel(a)), ravel(b))
"""Numeric module defining a multi-dimensional array and useful procedures for