use of org.apache.ignite.ml.math.primitives.vector.impl.DelegatingVector in project ignite by apache.
the class DelegatingVectorConstructorTest method basicTest.
/**
*/
@Test
public void basicTest() {
final Vector parent = new DenseVector(new double[] { 0, 1 });
final DelegatingVector delegate = new DelegatingVector(parent);
final int size = parent.size();
assertEquals("Delegate size differs from expected.", size, delegate.size());
assertEquals("Delegate vector differs from expected.", parent, delegate.getVector());
for (int idx = 0; idx < size; idx++) assertDelegate(parent, delegate, idx);
}
use of org.apache.ignite.ml.math.primitives.vector.impl.DelegatingVector in project ignite by apache.
the class ExternalizeTest method test.
/**
*/
@Test
@SuppressWarnings("unchecked")
public void test() {
externalizeTest(new DelegatingVector(new DenseVector(1)));
externalizeTest(new VectorizedViewMatrix(new DenseMatrix(2, 2), 1, 1, 1, 1));
externalizeTest(new ManhattanDistance());
externalizeTest(new HammingDistance());
externalizeTest(new EuclideanDistance());
externalizeTest(new FeatureMetadata());
externalizeTest(new VectorizedViewMatrix(new DenseMatrix(2, 2), 1, 1, 1, 1));
externalizeTest(new DatasetRow<>(new DenseVector()));
externalizeTest(new LabeledVector<>(new DenseVector(), null));
externalizeTest(new Dataset<DatasetRow<Vector>>(new DatasetRow[] {}, new FeatureMetadata[] {}));
}
Aggregations