public void testMtimes05() { double[][] c = {{6.0, 28.0}, {6.0, 35.0}}; ml.executeExpression("a=[1,3; 2,3]"); ml.executeExpression("b=[0,7; 2,7]"); ml.executeExpression("z = mtimes(a,b)"); assertTrue(Compare.ArrayEquals(c, ml.getArrayValueRe("z"))); }
public void testFloor05() { // test check for number of parameters ml.throwErrorsB = true; try { ml.executeExpression("m=floor(45) "); } catch (Exception e) { assertTrue(false); return; } assertTrue(true); }
public void testAbs02() { ml.executeExpression("a=abs(-3);"); assertTrue(3 == ml.getScalarValueRe("a")); }
public void testSign08() { ml.executeExpression("a=sign(3+4i);"); assertEquals(0.6, ml.getScalarValueRe("a"), 0.01); assertEquals(0.8, ml.getScalarValueIm("a"), 0.01); }
public void testSign07() { ml.executeExpression("a=sign(-55i);"); assertTrue(0.0 == ml.getScalarValueRe("a")); assertTrue(-1.0 == ml.getScalarValueIm("a")); }
public void testSign05() { ml.executeExpression("a=sign(0);"); assertTrue(0.0 == ml.getScalarValueRe("a")); }
public void testMtimes06() { ml.executeExpression("b=mtimes([2,3],[3;4])"); assertTrue(18 == ml.getScalarValueRe("b")); }
public void testMtimes04() { ml.executeExpression("b=mtimes(0,0)"); assertTrue(0 == ml.getScalarValueRe("b")); }
/** ************************************************************** */ public void testMtimes01() { ml.executeExpression("a=mtimes(5,5);"); assertTrue(25 == ml.getScalarValueRe("a")); }
/** *********** simple expressions *************************************** */ public void test001() { ml.executeExpression("a=2+3"); assertTrue(5 == ml.getScalarValueRe("a")); }
public void testFloor03() { ml.executeExpression("a=floor(5);"); assertTrue(5.0 == ml.getScalarValueRe("a")); }