def dot(self, vec):
        """Dot product with another vector"""
        if not isinstance(vec, self.__class__):
            raise TypeError('Dot product operand must be a VectorArray')
        if self.nV != 1 and vec.nV != 1 and self.nV != vec.nV:
            raise ValueError('Dot product operands must have the same '
                             'number of elements.')
        return np.sum((getattr(self, d)*getattr(vec, d) for d in self.dims), 1)
def dot ( self , vec ) : if not isinstance ( vec , self . __class__ ) : raise TypeError ( 'Dot product operand must be a VectorArray' ) if self . nV != 1 and vec . nV != 1 and self . nV != vec . nV : raise ValueError ( 'Dot product operands must have the same ' 'number of elements.' ) return np . sum ( ( getattr ( self , d ) * getattr ( vec , d ) for d in self . dims ) , 1 )
Dot product with another vector