Skip to content

Commit

Permalink
Allow test tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
aherbert committed Sep 11, 2024
1 parent 1f23349 commit bc4b11e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ void canComputeCovariance(RandomSeed seed) {
MultivariateGaussianMixtureExpectationMaximization.covariance(means, data);
final double[][] exp = new Covariance(data).getCovarianceMatrix().getData();

Assertions.assertArrayEquals(exp, obs);
// Can be different if the means are different. Commons Math uses a double pass
// mean computation but this code uses a simple sum then divide.
TestAssertions.assertArrayTest(exp, obs, Predicates.doublesAreUlpClose(10));
}

@Test
Expand Down

0 comments on commit bc4b11e

Please sign in to comment.