use of org.apache.commons.rng.UniformRandomProvider in project GDSC-SMLM by aherbert.
the class PeakResultDigestTest method sameResultsAreEqualWithDeviation.
@SeededTest
void sameResultsAreEqualWithDeviation(RandomSeed seed) {
final UniformRandomProvider r = RngUtils.create(seed.getSeed());
final PeakResult[] r1 = createResults(r, 10, 5, true, false, false, false);
final PeakResultsDigest digest = new PeakResultsDigest(r1);
Assertions.assertTrue(digest.matches(r1));
Assertions.assertTrue(digest.matches(digest));
}
use of org.apache.commons.rng.UniformRandomProvider in project GDSC-SMLM by aherbert.
the class PeakResultDigestTest method differentResultsAreNotEqual.
@SeededTest
void differentResultsAreNotEqual(RandomSeed seed) {
final UniformRandomProvider r = RngUtils.create(seed.getSeed());
final PeakResult[] r1 = createResults(r, 10, 5, false, false, false, false);
final PeakResultsDigest digest = new PeakResultsDigest(r1);
for (final int size : new int[] { 10, 1, 0 }) {
final PeakResult[] r2 = createResults(r, size, 5, false, false, false, false);
Assertions.assertFalse(digest.matches(r2));
Assertions.assertFalse(digest.matches(new PeakResultsDigest(r2)));
}
}
use of org.apache.commons.rng.UniformRandomProvider in project GDSC-SMLM by aherbert.
the class PeakResultDigestTest method sameEmptyResultsAreEqual.
@SeededTest
void sameEmptyResultsAreEqual(RandomSeed seed) {
final UniformRandomProvider r = RngUtils.create(seed.getSeed());
final PeakResult[] r1 = createResults(r, 0, 5, false, false, false, false);
final PeakResultsDigest digest = new PeakResultsDigest(r1);
Assertions.assertTrue(digest.matches(r1));
Assertions.assertTrue(digest.matches(digest));
}
use of org.apache.commons.rng.UniformRandomProvider in project GDSC-SMLM by aherbert.
the class PeakResultDigestTest method sameResultsAreEqualWithId.
@SeededTest
void sameResultsAreEqualWithId(RandomSeed seed) {
final UniformRandomProvider r = RngUtils.create(seed.getSeed());
final PeakResult[] r1 = createResults(r, 10, 5, false, true, false, false);
final PeakResultsDigest digest = new PeakResultsDigest(r1);
Assertions.assertTrue(digest.matches(r1));
Assertions.assertTrue(digest.matches(digest));
}
use of org.apache.commons.rng.UniformRandomProvider in project GDSC-SMLM by aherbert.
the class PeakResultDigestTest method digestMatchesPeakResultDigest.
@SeededTest
void digestMatchesPeakResultDigest(RandomSeed seed) {
final UniformRandomProvider r = RngUtils.create(seed.getSeed());
for (int size = 1; size < 5; size++) {
final PeakResult[] r1 = createResults(r, size, 5, false, false, false, false);
final PeakResultsDigest digest = new PeakResultsDigest(r1);
final PeakResultDigest d = new PeakResultDigest();
for (final PeakResult rr : r1) {
d.update(rr);
}
Assertions.assertEquals(d.digest(), digest.getDigest());
}
}
Aggregations