APIdock / Ruby
/
method

inner_product

ruby latest stable - Class: Vector
inner_product(v)
public

Returns the inner product of this vector with the other.

Vector [4,7].inner_product  Vector [10,1] => 47
# File lib/matrix.rb, line 1972
 def inner_product(v)
 Vector.Raise ErrDimensionMismatch if size != v.size
 p = 0
 each2(v) {|v1, v2|
 p += v1 * v2.conj
 }
 p
 end

AltStyle によって変換されたページ (->オリジナル) /