use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class ProdTest method testGeneral.
@Test
public void testGeneral() {
int rows = 10;
int cols = 10;
TestConfiguration config = getTestConfiguration(TEST_GENERAL);
config.addVariable("rows", rows);
config.addVariable("cols", cols);
loadTestConfiguration(config);
createHelperMatrix();
double[][] vector = getRandomMatrix(rows, 1, 0, 1, 1, -1);
double vectorSum = 1;
for (int i = 0; i < rows; i++) {
vectorSum *= vector[i][0];
}
writeInputMatrix("vector", vector);
writeExpectedHelperMatrix("vector_prod", vectorSum);
double[][] matrix = getRandomMatrix(rows, cols, 0, 1, 1, -1);
double matrixSum = 1;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
matrixSum *= matrix[i][j];
}
}
writeInputMatrix("matrix", matrix);
writeExpectedHelperMatrix("matrix_prod", matrixSum);
runTest();
compareResults();
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class PushdownSumBinaryTest method setUp.
@Override
public void setUp() {
addTestConfiguration(TEST_NAME1, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME1, new String[] { "C" }));
addTestConfiguration(TEST_NAME2, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME2, new String[] { "C" }));
TestUtils.clearAssertionInformation();
if (TEST_CACHE_ENABLED) {
setOutAndExpectedDeletionDisabled(true);
}
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class RowSumTest method setUp.
@Override
public void setUp() {
// positive tests
addTestConfiguration(TEST_GENERAL, new TestConfiguration(TEST_CLASS_DIR, "RowSumTest", new String[] { "vector_rowsum", "matrix_rowsum" }));
// negative tests
addTestConfiguration(TEST_SCALAR, new TestConfiguration(TEST_CLASS_DIR, "RowSumScalarTest", new String[] { "vector_rowsum", "matrix_rowsum" }));
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class RowSumTest method testScalar.
@Test
public void testScalar() {
int scalar = 12;
TestConfiguration config = getTestConfiguration(TEST_SCALAR);
config.addVariable("scalar", scalar);
createHelperMatrix();
loadTestConfiguration(config);
runTest(true, DMLException.class);
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class SumSqTest method setUp.
@Override
public void setUp() {
TestUtils.clearAssertionInformation();
TestConfiguration config = new TestConfiguration(TEST_CLASS_DIR, TEST_NAME);
addTestConfiguration(TEST_NAME, config);
}
Aggregations