Search in sources :

Example 6 with TestConfiguration

use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.

the class MinTest method setUp.

@Override
public void setUp() {
    // positive tests
    addTestConfiguration(TEST_GENERAL, new TestConfiguration(TEST_CLASS_DIR, "MinTest", new String[] { "vector_min", "matrix_min" }));
    // negative tests
    addTestConfiguration(TEST_SCALAR, new TestConfiguration(TEST_CLASS_DIR, "MinScalarTest", new String[] { "vector_min", "matrix_min" }));
}
Also used : TestConfiguration(org.apache.sysml.test.integration.TestConfiguration)

Example 7 with TestConfiguration

use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.

the class NColTest 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);
    writeInputMatrix("vector", vector);
    writeExpectedHelperMatrix("vector_cols", 1);
    double[][] matrix = getRandomMatrix(rows, cols, 0, 1, 1, -1);
    writeInputMatrix("matrix", matrix);
    writeExpectedHelperMatrix("matrix_cols", cols);
    runTest();
    compareResults();
}
Also used : TestConfiguration(org.apache.sysml.test.integration.TestConfiguration) Test(org.junit.Test)

Example 8 with TestConfiguration

use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.

the class ColStdDevsTest method setUp.

@Override
public void setUp() {
    TestUtils.clearAssertionInformation();
    TestConfiguration config = new TestConfiguration(TEST_CLASS_DIR, TEST_NAME);
    addTestConfiguration(TEST_NAME, config);
}
Also used : TestConfiguration(org.apache.sysml.test.integration.TestConfiguration)

Example 9 with TestConfiguration

use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.

the class ColSumTest 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);
    double[][] vector = getRandomMatrix(rows, 1, 0, 1, 1, -1);
    double[][] vectorColSum = new double[1][1];
    for (int i = 0; i < rows; i++) {
        vectorColSum[0][0] += vector[i][0];
    }
    writeInputMatrix("vector", vector);
    writeExpectedMatrix("vector_colsum", vectorColSum);
    double[][] matrix = getRandomMatrix(rows, cols, 0, 1, 1, -1);
    double[][] matrixColSum = new double[1][cols];
    for (int i = 0; i < rows; i++) {
        for (int j = 0; j < cols; j++) {
            matrixColSum[0][j] += matrix[i][j];
        }
    }
    writeInputMatrix("matrix", matrix);
    writeExpectedMatrix("matrix_colsum", matrixColSum);
    runTest();
    compareResults(1e-14);
}
Also used : TestConfiguration(org.apache.sysml.test.integration.TestConfiguration) Test(org.junit.Test)

Example 10 with TestConfiguration

use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.

the class ColSumTest 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);
}
Also used : TestConfiguration(org.apache.sysml.test.integration.TestConfiguration) Test(org.junit.Test)

Aggregations

TestConfiguration (org.apache.sysml.test.integration.TestConfiguration)781 Test (org.junit.Test)298 CellIndex (org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex)169 RUNTIME_PLATFORM (org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM)138 MatrixCharacteristics (org.apache.sysml.runtime.matrix.MatrixCharacteristics)48 IOException (java.io.IOException)18 MatrixBlock (org.apache.sysml.runtime.matrix.data.MatrixBlock)13 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)10 Modulus (org.apache.sysml.runtime.functionobjects.Modulus)9 HashMap (java.util.HashMap)8 FrameBlock (org.apache.sysml.runtime.matrix.data.FrameBlock)8 Random (java.util.Random)6 DMLException (org.apache.sysml.api.DMLException)6 ValueType (org.apache.sysml.parser.Expression.ValueType)5 Date (java.util.Date)3 BufferedReader (java.io.BufferedReader)2 FileReader (java.io.FileReader)2 Connection (org.apache.sysml.api.jmlc.Connection)2 DMLConfig (org.apache.sysml.conf.DMLConfig)2 DMLProgram (org.apache.sysml.parser.DMLProgram)2