use of org.junit.internal.ArrayComparisonFailure in project ignite by apache.
the class VectorGeneratorTest method duplicateRandomFeatures.
/**
*/
@Test
public void duplicateRandomFeatures() {
VectorGenerator g1 = VectorGeneratorPrimitives.constant(VectorUtils.of(1., 2., 3., 4.)).duplicateRandomFeatures(2, 1L);
double[] exp = { 1., 2., 3., 4., 3., 1. };
Vector v1 = g1.get();
Vector v2 = g1.get();
assertArrayEquals(exp, v1.asArray(), 1e-7);
try {
assertArrayEquals(v1.asArray(), v2.asArray(), 1e-7);
} catch (ArrayComparisonFailure e) {
// this is valid situation - duplicator should get different features
}
}
Aggregations