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