Esempio n. 1
0
 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")));
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 public void testAbs02() {
   ml.executeExpression("a=abs(-3);");
   assertTrue(3 == ml.getScalarValueRe("a"));
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 public void testSign07() {
   ml.executeExpression("a=sign(-55i);");
   assertTrue(0.0 == ml.getScalarValueRe("a"));
   assertTrue(-1.0 == ml.getScalarValueIm("a"));
 }
Esempio n. 6
0
 public void testSign05() {
   ml.executeExpression("a=sign(0);");
   assertTrue(0.0 == ml.getScalarValueRe("a"));
 }
Esempio n. 7
0
 public void testMtimes06() {
   ml.executeExpression("b=mtimes([2,3],[3;4])");
   assertTrue(18 == ml.getScalarValueRe("b"));
 }
Esempio n. 8
0
 public void testMtimes04() {
   ml.executeExpression("b=mtimes(0,0)");
   assertTrue(0 == ml.getScalarValueRe("b"));
 }
Esempio n. 9
0
 /** ************************************************************** */
 public void testMtimes01() {
   ml.executeExpression("a=mtimes(5,5);");
   assertTrue(25 == ml.getScalarValueRe("a"));
 }
Esempio n. 10
0
 /** *********** simple expressions *************************************** */
 public void test001() {
   ml.executeExpression("a=2+3");
   assertTrue(5 == ml.getScalarValueRe("a"));
 }
Esempio n. 11
0
 public void testFloor03() {
   ml.executeExpression("a=floor(5);");
   assertTrue(5.0 == ml.getScalarValueRe("a"));
 }