danielkorzekwa / bayes-scala

Bayesian Networks in Scala
Other
205 stars 39 forks source link

CanonicalGaussianTest#constructor_linear_gaussian fail #7

Closed BertrandDechoux closed 10 years ago

BertrandDechoux commented 10 years ago

Command line for replication of the issue :

mvn -Dtest=CanonicalGaussianTest#constructor_linear_gaussian test
Results :

Failed tests:   constructor_linear_gaussian(dk.bayes.math.gaussian.CanonicalGaussianTest): expected:<-1.828012123484645[4]> but was:<-1.828012123484645[1]>

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

The test is concise so there is an obvious fix.

  def apply(a: Matrix, b: Double, v: Double): CanonicalGaussian = apply(a,Matrix(b),Matrix(v))

Is there a reason not for doing so? Performance? Better numeric stability?

danielkorzekwa commented 10 years ago

I removed redundant code. This test was actually failing due to using string comparison.

Thanks.