use of org.apache.ignite.ml.math.primitives.matrix.storage.ViewMatrixStorage in project ignite by apache.
the class MatrixViewConstructorTest method attributeTest.
/**
*/
@Test
public void attributeTest() {
for (Matrix m : new Matrix[] { new DenseMatrix(3, 3), new DenseMatrix(3, 4), new DenseMatrix(4, 3) }) {
ViewMatrix matrixView = new ViewMatrix(m, 0, 0, m.rowSize(), m.columnSize());
ViewMatrixStorage delegateStorage = (ViewMatrixStorage) matrixView.getStorage();
assertEquals(m.rowSize(), matrixView.rowSize());
assertEquals(m.columnSize(), matrixView.columnSize());
assertEquals(m.rowSize(), (delegateStorage).rowsLength());
assertEquals(m.columnSize(), (delegateStorage).columnsLength());
assertEquals(m.isDense(), delegateStorage.isDense());
assertEquals(m.isArrayBased(), delegateStorage.isArrayBased());
assertArrayEquals(m.getStorage().data(), delegateStorage.data(), 0.0);
}
}
Aggregations