[Jmatlink-commitlog] jmatlink/src/jmatlink/testsuite/jmatlink testEngGetColumnVector.java,NONE,1.1 t
Brought to you by:
st_mueller
|
From: Stefan M. <st_...@us...> - 2006-01-17 18:29:55
|
Update of /cvsroot/jmatlink/jmatlink/src/jmatlink/testsuite/jmatlink In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29515/src/jmatlink/testsuite/jmatlink Added Files: testEngGetColumnVector.java testEngGetRowVector.java Log Message: added support for engGetRowVector(name) and engGetColumnVector(name) --- NEW FILE: testEngGetColumnVector.java --- /* * Created on 04.07.2005 * */ package jmatlink.testsuite.jmatlink; import jmatlink.JMatLink; import junit.framework.TestCase; /** * @author stefan */ public class testEngGetColumnVector extends TestCase { JMatLink jmatlink = new JMatLink(); public void testEngGetColumnVector01() { jmatlink.engOpen(); double[] testA = {8.0, 6.0, 4.0}; jmatlink.engEvalString("aaa=[8,2,3,4,5; 6,7,8,9,0; 4,7,2,5,5]"); double[] row = jmatlink.engGetColumnVector("aaa"); for (int i=0; i<testA.length; i++) { assertTrue(Math.abs(testA[i] - row[i]) <0.00001); } jmatlink.engClose(); } public void testEngGetColumnVector02() { jmatlink.engOpen(); double[] testA = {7.0, 1.0}; jmatlink.engEvalString("bbb=[7,8,9,0;1,2,3,4]"); double[] row = jmatlink.engGetColumnVector("bbb"); for (int i=0; i<testA.length; i++) { assertTrue(Math.abs(testA[i] - row[i]) <0.00001); } jmatlink.engClose(); } public void testEngGetColumnVector03() { jmatlink.engOpen(); double[] testA = {7.0, 8.0, 9.0, 2.0, 3.0, 4.0}; jmatlink.engEvalString("bbb=[7,8,9,2,3,4]'"); double[] row = jmatlink.engGetColumnVector("bbb"); for (int i=0; i<testA.length; i++) { assertTrue(Math.abs(testA[i] - row[i]) <0.00001); } jmatlink.engClose(); } } --- NEW FILE: testEngGetRowVector.java --- /* * Created on 04.07.2005 * */ package jmatlink.testsuite.jmatlink; import jmatlink.JMatLink; import junit.framework.TestCase; /** * @author stefan */ public class testEngGetRowVector extends TestCase { JMatLink jmatlink = new JMatLink(); public void testEngGetRowVector01() { jmatlink.engOpen(); double[] testA = {1.0, 2.0, 3.0, 4.0, 5.0}; jmatlink.engEvalString("aaa=[1,2,3,4,5;6,7,8,9,0]"); double[] row = jmatlink.engGetRowVector("aaa"); for (int i=0; i<testA.length; i++) { assertTrue(Math.abs(testA[i] - row[i]) <0.00001); } jmatlink.engClose(); } public void testEngGetRowVector02() { jmatlink.engOpen(); double[] testA = {7.0, 8.0, 9.0, 0.0}; jmatlink.engEvalString("bbb=[7,8,9,0]"); double[] row = jmatlink.engGetRowVector("bbb"); for (int i=0; i<testA.length; i++) { assertTrue(Math.abs(testA[i] - row[i]) <0.00001); } jmatlink.engClose(); } public void testEngGetRowVector03() { jmatlink.engOpen(); double[] testA = {7.0}; jmatlink.engEvalString("ccc=[7,8,9,0]'"); double[] row = jmatlink.engGetRowVector("ccc"); for (int i=0; i<testA.length; i++) { assertTrue(Math.abs(testA[i] - row[i]) <0.00001); } jmatlink.engClose(); } } |