Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update lib/saulabs/trueskill/factors/likelihood.rb

Fix for when index is not an integer
  • Loading branch information...
commit a99e4ad4a8b31dacab11df238278c17f1429ed2f 1 parent d0c4468
@ChrisLundquist ChrisLundquist authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/saulabs/trueskill/factors/likelihood.rb
View
3  lib/saulabs/trueskill/factors/likelihood.rb
@@ -15,10 +15,11 @@ def initialize(beta_squared, variable1, variable2)
end
def update_message_at(index)
- raise "illegal message index: #{index}" if index < 0 || index > 1
case index
when 0 then update_helper(@messages[0], @messages[1], @variables[0], @variables[1])
when 1 then update_helper(@messages[1], @messages[0], @variables[1], @variables[0])
+ else
+ raise "illegal message index: #{index}"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.