*(x)
public
Multiplies the vector by x, where x is a number or
another vector.
Show source
def *(x)
case x
when Numeric
els = @elements.collect{|e| e * x}
self.class.elements(els, false)
when Matrix
Matrix.column_vector(self) * x
when Vector
Vector.Raise ErrOperationNotDefined, "*", self.class, x.class
else
apply_through_coercion(x, __method__)
end
end