Module: Stick::Vector::Norm

Defined in:
lib/stick/matrix.rb

Class Method Summary collapse

Class Method Details

.sqnorm(obj, p) ⇒ Object



19
20
21
22
23
# File 'lib/stick/matrix.rb', line 19

def Norm.sqnorm(obj, p)
  sum = 0
  obj.each{|x| sum += x ** p}
  sum
end