Class: RealSemiring
Instance Attribute Summary
Attributes inherited from Semiring
#add, #convert, #multiply, #null, #one
Instance Method Summary collapse
-
#initialize ⇒ RealSemiring
constructor
A new instance of RealSemiring.
Constructor Details
#initialize ⇒ RealSemiring
Returns a new instance of RealSemiring.
52 53 54 55 56 57 58 |
# File 'lib/zipf/semirings.rb', line 52 def initialize @add = Proc.new { |a,b| [a,b].min } @multiply = Proc.new { |a,b| a+b } @one = 0.0 @null = 1.0/0.0 @convert = Proc.new { |v| v } end |