use of org.apache.sysml.hops.codegen.cplan.CNode in project systemml by apache.
the class CPlanComparisonTest method testEqualMatrixDataNode.
@Test
public void testEqualMatrixDataNode() {
Hop data = createDataOp(DataType.MATRIX);
CNode c1 = new CNodeData(data);
CNode c2 = new CNodeData(data);
Assert.assertEquals(c1.hashCode(), c2.hashCode());
Assert.assertEquals(c1, c2);
}
use of org.apache.sysml.hops.codegen.cplan.CNode in project systemml by apache.
the class CPlanComparisonTest method testNotEqualUnaryNodes.
@Test
public void testNotEqualUnaryNodes() {
CNode c0 = createCNodeData(DataType.MATRIX);
CNode c1 = new CNodeUnary(c0, UnaryType.EXP);
CNode c2 = new CNodeUnary(c0, UnaryType.LOG);
Assert.assertNotEquals(c1, c2);
}
use of org.apache.sysml.hops.codegen.cplan.CNode in project systemml by apache.
the class CPlanComparisonTest method testEqualTernaryNodes.
@Test
public void testEqualTernaryNodes() {
CNode c1 = createCNodeData(DataType.MATRIX);
CNode c2 = createCNodeData(DataType.SCALAR);
CNode c3 = createCNodeData(DataType.MATRIX);
CNode ter1 = new CNodeTernary(c1, c2, c3, TernaryType.MINUS_MULT);
CNode ter2 = new CNodeTernary(c1, c2, c3, TernaryType.MINUS_MULT);
Assert.assertEquals(ter1.hashCode(), ter2.hashCode());
Assert.assertEquals(ter1, ter2);
}
use of org.apache.sysml.hops.codegen.cplan.CNode in project systemml by apache.
the class CPlanComparisonTest method testNotEqualBinaryDAG3.
@Test
public void testNotEqualBinaryDAG3() {
CNode c1 = createCNodeData(DataType.MATRIX);
CNode c2 = createCNodeData(DataType.MATRIX);
CNode c3 = createCNodeData(DataType.MATRIX);
// DAG 3a: (c1+c3)*(c2+c3)
CNode b1a = new CNodeBinary(c1, c3, BinType.PLUS);
CNode b2a = new CNodeBinary(c2, c3, BinType.PLUS);
CNode b3a = new CNodeBinary(b1a, b2a, BinType.MULT);
// DAG 3b: (c1+c2)*(c3+c3)
CNode b1b = new CNodeBinary(c1, c2, BinType.PLUS);
CNode b2b = new CNodeBinary(c3, c3, BinType.PLUS);
CNode b3b = new CNodeBinary(b1b, b2b, BinType.MULT);
Assert.assertNotEquals(b3a, b3b);
}
Aggregations