module Algebra::InnerProductSpace

Public Instance Methods

inner_product(other) click to toggle source
# File lib/algebra/matrix-algebra.rb, line 561
def inner_product(other)
  ip = defined?(ground) ? ground.zero : first.zero
  each_with_index do |x, i|
    ip += x * other[i]
  end
  ip
end
inner_product_complex(other) click to toggle source
# File lib/algebra/matrix-algebra.rb, line 569
def inner_product_complex(other)
  inner_product(other.conjugate)
end
norm2() click to toggle source
# File lib/algebra/matrix-algebra.rb, line 573
def norm2
  inner_product(self)
end
norm2_complex() click to toggle source
# File lib/algebra/matrix-algebra.rb, line 577
def norm2_complex
  inner_product_complex(self)
end