Class: RealxSemiring
Overview
for longest/worst paths
Instance Attribute Summary
Attributes inherited from Semiring
#add, #convert, #multiply, #null, #one
Instance Method Summary collapse
-
#initialize ⇒ RealxSemiring
constructor
A new instance of RealxSemiring.
Constructor Details
#initialize ⇒ RealxSemiring
Returns a new instance of RealxSemiring.
63 64 65 66 67 68 69 |
# File 'lib/zipf/semirings.rb', line 63 def initialize @add = Proc.new { |a,b| [a,b].max } @multiply = Proc.new { |a,b| a+b } @one = -1.0/0.0 @null = 0.0 @convert = Proc.new { |v| v } end |