Class: RealxSemiring

Inherits:
Semiring show all
Defined in:
lib/zipf/semirings.rb

Overview

for longest/worst paths

Instance Attribute Summary

Attributes inherited from Semiring

#add, #convert, #multiply, #null, #one

Instance Method Summary collapse

Constructor Details

#initializeRealxSemiring

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