mathlib-commitlog Mailing List for JMathLib - Octave, Matlab clone in java (Page 10)
Status: Beta
Brought to you by:
st_mueller
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(4) |
Aug
(150) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(233) |
Feb
(86) |
Mar
(32) |
Apr
(26) |
May
(73) |
Jun
(45) |
Jul
(23) |
Aug
(23) |
Sep
(5) |
Oct
(80) |
Nov
(11) |
Dec
(11) |
| 2008 |
Jan
|
Feb
|
Mar
(13) |
Apr
(3) |
May
(7) |
Jun
(30) |
Jul
(12) |
Aug
(12) |
Sep
|
Oct
|
Nov
(78) |
Dec
(78) |
| 2009 |
Jan
(214) |
Feb
(79) |
Mar
(20) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <st_...@us...> - 2009-01-14 20:27:44
|
Revision: 685
http://mathlib.svn.sourceforge.net/mathlib/?rev=685&view=rev
Author: st_mueller
Date: 2009-01-14 20:27:34 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
added new Assert method AssertStringEquals
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java
Modified: JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java
===================================================================
--- JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java 2009-01-14 20:16:28 UTC (rev 684)
+++ JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java 2009-01-14 20:27:34 UTC (rev 685)
@@ -26,7 +26,7 @@
ml.executeExpression(s);
}
- public void assertEquals(String a, String b)
+ public void assertStringEquals(String a, String b)
{
ml.executeExpression(a);
double[][]ans1D = ml.getArrayValueRe("ans");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-14 20:16:35
|
Revision: 684
http://mathlib.svn.sourceforge.net/mathlib/?rev=684&view=rev
Author: st_mueller
Date: 2009-01-14 20:16:28 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
removed toLowerCase()
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java
JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java 2009-01-11 19:12:17 UTC (rev 683)
+++ JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java 2009-01-14 20:16:28 UTC (rev 684)
@@ -90,7 +90,7 @@
@return the Function found*/
public Function findFunction(FunctionToken token) throws java.lang.Exception {
Function func = null;
- String funcName = token.getName().toLowerCase();
+ String funcName = token.getName();
int index = -1;
//then check the external functions
Modified: JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2009-01-11 19:12:17 UTC (rev 683)
+++ JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2009-01-14 20:16:28 UTC (rev 684)
@@ -7,8 +7,6 @@
/**Class for storing and managing the m- and p-functions
- *
- * JMH Should be more aptly named "WebFunctionLoader"
*/
public class WebFunctionLoader extends FunctionLoader
{
@@ -84,7 +82,7 @@
functionPath = ((String)functionListV.elementAt(i));
// !! Remark: the command toLowerCase() is necessary, because some filenames have upper case letters (e.g. Disp.class)
- if ( functionPath.toLowerCase().endsWith("/"+functionName+".class") )
+ if ( functionPath.endsWith("/"+functionName+".class") )
{
foundClassFileB = true; // indicate that class file was found
functionPath = functionPath.substring(0,functionPath.length()-6);
@@ -94,7 +92,7 @@
break;
}
- if ( functionPath.toLowerCase().endsWith("/"+functionName+".m") )
+ if ( functionPath.endsWith("/"+functionName+".m") )
{
// functionsPath contains the path AND the m-filename
foundMFileB = true; // indicate that m-file was found
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-11 19:12:27
|
Revision: 683
http://mathlib.svn.sourceforge.net/mathlib/?rev=683&view=rev
Author: st_mueller
Date: 2009-01-11 19:12:17 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
add more comments
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java
Modified: JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java
===================================================================
--- JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java 2009-01-11 14:54:38 UTC (rev 682)
+++ JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java 2009-01-11 19:12:17 UTC (rev 683)
@@ -145,13 +145,13 @@
public void createTestCase (String fileS, Stack testCaseStack)
{
- fileS = fileS.replaceFirst("src/", "");
- fileS = fileS.replace(".java", "");
- fileS = fileS.replace(".m", "");
- fileS = fileS.replace(".int", "");
- fileS = fileS.replace('/', '_');
- fileS = fileS.replace('.', '_');
- fileS = "test_"+fileS;
+ fileS = fileS.replaceFirst("src/", ""); // remove src/ at beginning
+ fileS = fileS.replace(".java", ""); // remove .java suffix
+ fileS = fileS.replace(".m", ""); // remove .m suffix
+ fileS = fileS.replace(".int", ""); // remove .int suffix
+ fileS = fileS.replace('/', '_'); // change directory-sign into underline
+ fileS = fileS.replace('.', '_'); // change directory-sign into underline
+ fileS = "test_"+fileS; // add "test_" to make JUnit aware of this class
// put filename on tests-stack
testStack.push(fileS);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-11 14:54:47
|
Revision: 682
http://mathlib.svn.sourceforge.net/mathlib/?rev=682&view=rev
Author: st_mueller
Date: 2009-01-11 14:54:38 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
added new ant targets for documentation
Modified Paths:
--------------
JMathLib/trunk/build.xml
Modified: JMathLib/trunk/build.xml
===================================================================
--- JMathLib/trunk/build.xml 2009-01-11 14:50:36 UTC (rev 681)
+++ JMathLib/trunk/build.xml 2009-01-11 14:54:38 UTC (rev 682)
@@ -145,20 +145,34 @@
<!-- Copy image-files to handbook directory -->
<target name = "imageFiles">
- <copy todir="${dist.dir}/handbook">
- <fileset dir="${doc.src}">
- <include name="**/*.gif" />
- <include name="**/*.jpg" />
- <include name="**/*.svg" />
- </fileset>
- </copy>
- <copy todir="${upload.dir}/handbook_php/">
- <fileset dir="${doc.src}">
- <include name="**/*.gif" />
- <include name="**/*.jpg" />
- <include name="**/*.svg" />
- </fileset>
- </copy>
+ <copy todir="${dist.dir}/handbook">
+ <fileset dir="${doc.src}">
+ <include name="**/*.gif" />
+ <include name="**/*.jpg" />
+ <include name="**/*.svg" />
+ </fileset>
+ </copy>
+ <copy todir="${upload.dir}/handbook_php/">
+ <fileset dir="${doc.src}">
+ <include name="**/*.gif" />
+ <include name="**/*.jpg" />
+ <include name="**/*.svg" />
+ </fileset>
+ </copy>
+ <copy todir="${upload.dir}/handbook_epub/">
+ <fileset dir="${doc.src}">
+ <include name="**/*.gif" />
+ <include name="**/*.jpg" />
+ <include name="**/*.svg" />
+ </fileset>
+ </copy>
+ <copy todir="${upload.dir}/handbook_eclipse/">
+ <fileset dir="${doc.src}">
+ <include name="**/*.gif" />
+ <include name="**/*.jpg" />
+ <include name="**/*.svg" />
+ </fileset>
+ </copy>
</target>
<!-- xml to php -->
@@ -205,7 +219,7 @@
<target name="xmltofo" description="convert xml to fo" depends="">
<java jar="libs/saxon.jar" fork="true">
<arg line="-o doc/src/doc.fo doc/src/doc.xml
- doc/DocBook/xsl/fo/docbook2.xsl" />
+ doc/DocBook/xsl/fo/docbook.xsl" />
<arg value='paper.type="A4"' />
<arg value='chunk.section.depth="0"' />
<arg value='chunk.first.sections="0"' />
@@ -225,24 +239,75 @@
</java>
</target>
- <!-- zip doc files -->
+ <!-- xml to epub -->
+ <target name="xmltoepub" description="convert xml to epub" depends="">
+ <java jar="libs/saxon.jar" fork="true">
+ <arg value='doc/src/doc.xml' />
+ <arg value='doc/DocBook/xsl/epub/docbook.xsl' />
+ <arg value="base.dir=${upload.dir}/handbook_epub/" />
+ <arg value='chunk.section.depth="1"' />
+ <arg value='chunk.first.sections="0"' />
+ <arg value='generate.section.toc.level="0"' />
+ <arg value='toc.section.depth="1"' />
+ <arg value='toc.max.depth="3"' />
+ <arg value='generate.index="1"' />
+ <arg value='use.id.as.filename="1"' />
+ <arg value='html.extra.head.links="0"' />
+ <arg value='html.stylesheet="../../formats.css"' />
+ <arg value='ignore.image.scaling="1"' />
+ </java>
+ </target>
+
+ <!-- xml to eclipse -->
+ <target name="xmltoeclipse" description="convert xml to eclipse" depends="">
+ <java jar="libs/saxon.jar" fork="true">
+ <arg value='doc/src/doc.xml' />
+ <arg value='doc/DocBook/xsl/eclipse/eclipse.xsl' />
+ <arg value="base.dir=${upload.dir}/handbook_eclipse/" />
+ <arg value='chunk.section.depth="1"' />
+ <arg value='chunk.first.sections="0"' />
+ <arg value='generate.section.toc.level="0"' />
+ <arg value='toc.section.depth="1"' />
+ <arg value='toc.max.depth="3"' />
+ <arg value='generate.index="1"' />
+ <arg value='use.id.as.filename="1"' />
+ <arg value='html.extra.head.links="0"' />
+ <arg value='html.stylesheet="../../formats.css"' />
+ <arg value='ignore.image.scaling="1"' />
+ </java>
+ </target>
+
+ <!-- zip doc files -->
<target name = "zip_docs" description="zip doc files" depends="">
- <zip zipfile="${upload.dir}/${final.name}_docs_php.zip" >
- <zipfileset dir="${upload.dir}/handbook_php" >
- <include name="**"/>
- </zipfileset>
- </zip>
- <zip zipfile="${upload.dir}/${final.name}_docs_html.zip" >
- <zipfileset dir="${dist.dir}/handbook/" >
- <include name="**"/>
- </zipfileset>
- </zip>
+ <zip zipfile="${upload.dir}/${final.name}_docs_php.zip" >
+ <zipfileset dir="${upload.dir}/handbook_php" >
+ <include name="**"/>
+ </zipfileset>
+ </zip>
+
+ <zip zipfile="${upload.dir}/${final.name}_docs_html.zip" >
+ <zipfileset dir="${dist.dir}/handbook/" >
+ <include name="**"/>
+ </zipfileset>
+ </zip>
+
+ <zip zipfile="${upload.dir}/${final.name}_docs_epub.zip" >
+ <zipfileset dir="${upload.dir}/handbook_epub" >
+ <include name="**"/>
+ </zipfileset>
+ </zip>
+
+ <zip zipfile="${upload.dir}/${final.name}_docs_eclipse.zip" >
+ <zipfileset dir="${upload.dir}/handbook_eclipse" >
+ <include name="**"/>
+ </zipfileset>
+ </zip>
</target>
<!-- AllDocs: create all documenation files -->
<target name="alldocs" description="all doc targets"
depends="functiondocs, imageFiles, xmltophp,
- xmltohtml, xmltofo, fotopdf, zip_docs">
+ xmltohtml, xmltofo, fotopdf, xmltoepub, xmltoeclipse, zip_docs">
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-11 14:50:39
|
Revision: 681
http://mathlib.svn.sourceforge.net/mathlib/?rev=681&view=rev
Author: st_mueller
Date: 2009-01-11 14:50:36 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
added release 0.9.3
Modified Paths:
--------------
JMathLib/trunk/readme_creation_of_distribution.txt
Modified: JMathLib/trunk/readme_creation_of_distribution.txt
===================================================================
--- JMathLib/trunk/readme_creation_of_distribution.txt 2009-01-11 14:48:37 UTC (rev 680)
+++ JMathLib/trunk/readme_creation_of_distribution.txt 2009-01-11 14:50:36 UTC (rev 681)
@@ -13,6 +13,7 @@
to the new version
- run JMathLib and call createFunctionsList()
+ (this is done by the ant process)
- change file: JMathLib.properties
and change to the release date
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-11 14:48:42
|
Revision: 680
http://mathlib.svn.sourceforge.net/mathlib/?rev=680&view=rev
Author: st_mueller
Date: 2009-01-11 14:48:37 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
added release 0.9.3
Modified Paths:
--------------
JMathLib/trunk/JMathLib.local.properties
Modified: JMathLib/trunk/JMathLib.local.properties
===================================================================
--- JMathLib/trunk/JMathLib.local.properties 2009-01-11 14:47:40 UTC (rev 679)
+++ JMathLib/trunk/JMathLib.local.properties 2009-01-11 14:48:37 UTC (rev 680)
@@ -1,10 +1,10 @@
#JMathLib local property file
#Sat Nov 30 20:00:00 CEST 2008
update.auto=yes
-jmathlib.release.date=2008/11/30
+jmathlib.release.date=2009/01/11
update.errors=0
update.site.primary=http://www.jmathlib.de/checkForUpdates/
update.site.backup=http://mathlib.sourceforge.net/checkForUpdates/
update.date.next=00.00.00
update.intervall=1
-update.date.last=2008/11/30
+update.date.last=2009/01/11
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-11 14:47:47
|
Revision: 679
http://mathlib.svn.sourceforge.net/mathlib/?rev=679&view=rev
Author: st_mueller
Date: 2009-01-11 14:47:40 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
added release 0.9.3
Modified Paths:
--------------
JMathLib/trunk/JMathLib.properties
Modified: JMathLib/trunk/JMathLib.properties
===================================================================
--- JMathLib/trunk/JMathLib.properties 2009-01-11 14:46:38 UTC (rev 678)
+++ JMathLib/trunk/JMathLib.properties 2009-01-11 14:47:40 UTC (rev 679)
@@ -5,11 +5,11 @@
# current version of JMathLib
-jmathlib.version=0.9.2
-jmathlib.release.date=2008/11/30
-jmathlib.release.name=release V0.9.2
+jmathlib.version=0.9.3
+jmathlib.release.date=2009/01/11
+jmathlib.release.name=release V0.9.3
jmathlib.release.description=mayer release
-jmathlib.copyright=(c) 2007,2008 Stefan Mueller and others
+jmathlib.copyright=(c) 2007,2008, 2009 Stefan Mueller and others
# website
jmathlib.website.primary=http://www.jmathlib.de
@@ -20,8 +20,8 @@
update.site.primary=http://www.jmathlib.de/checkForUpdates/
update.site.backup=http://mathlib.sourceforge.net/checkForUpdates/
update.intervall=1
-update.date.last=2008/10/30
-update.date.next=2008/11/01
+update.date.last=2009/01/11
+update.date.next=2009/01/13
update.errors=0
update.message="welcome to the new version of JMathLib"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-11 14:46:44
|
Revision: 678
http://mathlib.svn.sourceforge.net/mathlib/?rev=678&view=rev
Author: st_mueller
Date: 2009-01-11 14:46:38 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
added release 0.9.3
Modified Paths:
--------------
JMathLib/trunk/build.properties
Modified: JMathLib/trunk/build.properties
===================================================================
--- JMathLib/trunk/build.properties 2009-01-11 14:45:51 UTC (rev 677)
+++ JMathLib/trunk/build.properties 2009-01-11 14:46:38 UTC (rev 678)
@@ -6,8 +6,11 @@
project=JMathLib
# Project version
-version=0.9.2
+version=0.9.3
+# Release date
+release_date=2009/01/11
+
# final project name
final.name=${project}_${version}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-11 14:45:56
|
Revision: 677
http://mathlib.svn.sourceforge.net/mathlib/?rev=677&view=rev
Author: st_mueller
Date: 2009-01-11 14:45:51 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
added release 0.9.3
Modified Paths:
--------------
JMathLib/trunk/doc/src/doc.xml
Modified: JMathLib/trunk/doc/src/doc.xml
===================================================================
--- JMathLib/trunk/doc/src/doc.xml 2009-01-11 13:39:11 UTC (rev 676)
+++ JMathLib/trunk/doc/src/doc.xml 2009-01-11 14:45:51 UTC (rev 677)
@@ -74,11 +74,11 @@
</para>
</abstract>
-<pubdate>January 1, 2009</pubdate>
+<pubdate>January 11, 2009</pubdate>
<releaseinfo><para><emphasis>
-This release is connected to JMathLib in Version 0.9.2 and following versions
+This release is connected to JMathLib in Version 0.9.3 and following versions
</emphasis></para></releaseinfo>
</bookinfo>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-11 13:39:18
|
Revision: 676
http://mathlib.svn.sourceforge.net/mathlib/?rev=676&view=rev
Author: st_mueller
Date: 2009-01-11 13:39:11 +0000 (Sun, 11 Jan 2009)
Log Message:
-----------
added more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java
Modified: JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java
===================================================================
--- JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java 2009-01-10 18:35:04 UTC (rev 675)
+++ JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java 2009-01-11 13:39:11 UTC (rev 676)
@@ -40,4 +40,82 @@
assertTrue(Compare.ArrayEquals(ans1I, ans2I));
}
+
+
+ public void assertScalarEquals(String var, double varRe )
+ {
+ double ansRe = ml.getScalarValueRe(var);
+
+ assertEquals(ansRe, varRe);
+ }
+
+ public void assertScalarEquals(String var, double varRe, double tol )
+ {
+ double ansRe = ml.getScalarValueRe(var);
+
+ assertEquals(ansRe, varRe, tol);
+ }
+
+ public void assertScalarEquals(String var, double varRe, double varIm, double tol )
+ {
+ double ansRe = ml.getScalarValueRe(var);
+ double ansIm = ml.getScalarValueIm(var);
+
+ assertEquals(ansRe, varRe, tol);
+ assertEquals(ansIm, varIm, tol);
+ }
+
+ public void assertEvalScalarEquals(String func, String var, double varRe)
+ {
+ ml.executeExpression(func);
+ double ansRe = ml.getScalarValueRe(var);
+
+ assertEquals(ansRe, varRe);
+ }
+
+ public void assertEvalScalarEquals(String func, String var, double varRe, double tol )
+ {
+ ml.executeExpression(func);
+ double ansRe = ml.getScalarValueRe(var);
+
+ assertEquals(ansRe, varRe, tol);
+ }
+
+ public void assertEvalScalarEquals(String func, String var, double varRe, double varIm, double tol )
+ {
+ ml.executeExpression(func);
+ double ansRe = ml.getScalarValueRe(var);
+ double ansIm = ml.getScalarValueIm(var);
+
+ assertEquals(ansRe, varRe, tol);
+ assertEquals(ansIm, varIm, tol);
+ }
+
+ public void assertEvalArrayEquals(String func, String var, double[][] varRe)
+ {
+ ml.executeExpression(func);
+ double[][]ansRe = ml.getArrayValueRe(var);
+
+ assertTrue(Compare.ArrayEquals(ansRe, varRe));
+ }
+
+ public void assertEvalArrayEquals(String func, String var, double[][] varRe, double tol )
+ {
+ ml.executeExpression(func);
+ double[][]ansRe = ml.getArrayValueRe(var);
+
+ assertTrue(Compare.ArrayEquals(ansRe, varRe, tol));
+ }
+
+ public void assertEvalArrayEquals(String func, String var, double[][] varRe, double[][] varIm, double tol )
+ {
+ ml.executeExpression(func);
+ double[][]ansRe = ml.getArrayValueRe(var);
+ double[][]ansIm = ml.getArrayValueIm(var);
+
+ assertTrue(Compare.ArrayEquals(ansRe, varRe, tol));
+ assertTrue(Compare.ArrayEquals(ansIm, varIm, tol));
+ }
+
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 18:35:18
|
Revision: 675
http://mathlib.svn.sourceforge.net/mathlib/?rev=675&view=rev
Author: st_mueller
Date: 2009-01-10 18:35:04 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
Removed Paths:
-------------
JMathLib/trunk/src/jmathlib/toolbox/general/template.java
Deleted: JMathLib/trunk/src/jmathlib/toolbox/general/template.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/template.java 2009-01-10 18:33:56 UTC (rev 674)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/template.java 2009-01-10 18:35:04 UTC (rev 675)
@@ -1,81 +0,0 @@
-package jmathlib.toolbox.general;
-
-/* This file is part or JMathLib
- * author: 2005/xx/xx
- * */
-
-import jmathlib.core.tokens.*;
-import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
-import jmathlib.core.functions.ExternalFunction;
-
-
-/**An external function for computing a mesh of a matrix */
-public class template extends ExternalFunction
-{
- /**returns two matrices
- * @param operands[0] = x values (e.g. [-2:0.2:2])
- * @param operands[1] = y values (e.g. [-2:0.2:2])
- * @return [X,Y] as matrices */
- public OperandToken evaluate(Token[] operands)
- {
-
- // one operand (e.g. [x,y]=template([-2:0.2:2],[-2:0.2:2]) )
- if (getNArgIn(operands)!=2)
- throwMathLibException("template: number of input arguments != 2");
-
- // Check number of return arguments
- if (getNoOfLeftHandArguments()!=2)
- throwMathLibException("template: number of output arguments != 2");
-
- if ( !(operands[0] instanceof DoubleNumberToken) ||
- !(operands[0] instanceof DoubleNumberToken) )
- throwMathLibException("template: works only on numbers");
-
- // get data from arguments
- double[][] x = ((DoubleNumberToken)operands[0]).getReValues();
- double[][] y = ((DoubleNumberToken)operands[1]).getReValues();
-
- if ((x.length != 1) ||
- (y.length != 1) )
- throwMathLibException("template: works only row vectors");
-
- int sizeX = x[0].length;
- int sizeY = y[0].length;
-
- double[][] X = new double[sizeY][sizeX];
- double[][] Y = new double[sizeY][sizeX];
-
- for (int i=0; i<sizeY; i++)
- {
- for (int j=0; j<sizeX; j++)
- {
- X[i][j] = x[0][j];
- Y[i][j] = y[0][i];
- }
- }
-
- OperandToken values[][] = new OperandToken[1][2];
- values[0][0] = new DoubleNumberToken(X);
- values[0][1] = new DoubleNumberToken(Y);
- return new MatrixToken( values );
-
- } // end eval
-}
-
-
-/*
-@GROUP
-General
-@SYNTAX
-answer = template (value)
-@DOC
-Returns the sign of value.
-@EXAMPLES
-<programlisting>
-SIGN(-10)=-1
-SIGN(10)=1
-</programlisting>
-@NOTES
-@SEE
-template
-*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 18:34:05
|
Revision: 674
http://mathlib.svn.sourceforge.net/mathlib/?rev=674&view=rev
Author: st_mueller
Date: 2009-01-10 18:33:56 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/toolbox_skeleton/template.java
Copied: JMathLib/trunk/src/jmathlib/toolbox/toolbox_skeleton/template.java (from rev 413, JMathLib/trunk/src/jmathlib/toolbox/general/template.java)
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/toolbox_skeleton/template.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/toolbox_skeleton/template.java 2009-01-10 18:33:56 UTC (rev 674)
@@ -0,0 +1,81 @@
+package jmathlib.toolbox.toolbox_skeleton;
+
+/* This file is part or JMathLib
+ * author: stefan 2009
+ * */
+
+import jmathlib.core.tokens.*;
+import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
+import jmathlib.core.functions.ExternalFunction;
+
+
+/**An external function for computing a mesh of a matrix */
+public class template extends ExternalFunction
+{
+ /**returns two matrices
+ * @param operands[0] = x values (e.g. [-2:0.2:2])
+ * @param operands[1] = y values (e.g. [-2:0.2:2])
+ * @return [X,Y] as matrices */
+ public OperandToken evaluate(Token[] operands)
+ {
+
+ // one operand (e.g. [x,y]=template([-2:0.2:2],[-2:0.2:2]) )
+ if (getNArgIn(operands)!=2)
+ throwMathLibException("template: number of input arguments != 2");
+
+ // Check number of return arguments
+ if (getNoOfLeftHandArguments()!=2)
+ throwMathLibException("template: number of output arguments != 2");
+
+ if ( !(operands[0] instanceof DoubleNumberToken) ||
+ !(operands[0] instanceof DoubleNumberToken) )
+ throwMathLibException("template: works only on numbers");
+
+ // get data from arguments
+ double[][] x = ((DoubleNumberToken)operands[0]).getReValues();
+ double[][] y = ((DoubleNumberToken)operands[1]).getReValues();
+
+ if ((x.length != 1) ||
+ (y.length != 1) )
+ throwMathLibException("template: works only row vectors");
+
+ int sizeX = x[0].length;
+ int sizeY = y[0].length;
+
+ double[][] X = new double[sizeY][sizeX];
+ double[][] Y = new double[sizeY][sizeX];
+
+ for (int i=0; i<sizeY; i++)
+ {
+ for (int j=0; j<sizeX; j++)
+ {
+ X[i][j] = x[0][j];
+ Y[i][j] = y[0][i];
+ }
+ }
+
+ OperandToken values[][] = new OperandToken[1][2];
+ values[0][0] = new DoubleNumberToken(X);
+ values[0][1] = new DoubleNumberToken(Y);
+ return new MatrixToken( values );
+
+ } // end eval
+}
+
+
+/*
+@GROUP
+General
+@SYNTAX
+answer = template (value)
+@DOC
+Returns the sign of value.
+@EXAMPLES
+<programlisting>
+SIGN(-10)=-1
+SIGN(10)=1
+</programlisting>
+@NOTES
+@SEE
+template
+*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 17:50:49
|
Revision: 673
http://mathlib.svn.sourceforge.net/mathlib/?rev=673&view=rev
Author: st_mueller
Date: 2009-01-10 17:50:46 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
added more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/string/AllTests.java
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrcmp.java
JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrcmpi.java
JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrncmp.java
JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrncmpi.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/string/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/string/AllTests.java 2009-01-10 15:32:11 UTC (rev 672)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/string/AllTests.java 2009-01-10 17:50:46 UTC (rev 673)
@@ -24,6 +24,10 @@
suite.addTest(jmathlibtests.toolbox.string.testLower.suite());
suite.addTest(jmathlibtests.toolbox.string.testNum2str.suite());
suite.addTest(jmathlibtests.toolbox.string.testStr2num.suite());
+ suite.addTest(jmathlibtests.toolbox.string.testStrcmp.suite());
+ suite.addTest(jmathlibtests.toolbox.string.testStrcmpi.suite());
+ suite.addTest(jmathlibtests.toolbox.string.testStrncmp.suite());
+ suite.addTest(jmathlibtests.toolbox.string.testStrncmpi.suite());
suite.addTest(jmathlibtests.toolbox.string.testUpper.suite());
return suite;
Added: JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrcmp.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrcmp.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrcmp.java 2009-01-10 17:50:46 UTC (rev 673)
@@ -0,0 +1,42 @@
+package jmathlibtests.toolbox.string;
+
+import jmathlib.tools.junit.framework.*;
+
+public class testStrcmp extends JMathLibTestCase {
+
+ public testStrcmp(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testStrcmp.class);
+ }
+
+ public void testStrcmp01() {
+ assertEvalScalarEquals("a=strcmp('abcd','abcd');", "a", 1);
+ }
+ public void testStrcmp02() {
+ assertEvalScalarEquals("a=strcmp('abcd','ABCD');", "a", 0);
+ }
+ public void testStrcmp03() {
+ assertEvalScalarEquals("a=strcmp('abcd','AbCd');", "a", 0);
+ }
+ public void testStrcmp04() {
+ assertEvalScalarEquals("a=strcmp('abcd','ABCd');", "a", 0);
+ }
+ public void testStrcmp05() {
+ assertEvalScalarEquals("a=strcmp('aBCd','abcd');", "a", 0);
+ }
+ public void testStrcmp06() {
+ assertEvalScalarEquals("a=strcmp('aBCd','axcd');", "a", 0);
+ }
+ public void testStrcmp07() {
+ assertEvalScalarEquals("a=strcmp('abcd','abcde');", "a", 0);
+ }
+
+
+
+}
Added: JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrcmpi.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrcmpi.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrcmpi.java 2009-01-10 17:50:46 UTC (rev 673)
@@ -0,0 +1,42 @@
+package jmathlibtests.toolbox.string;
+
+import jmathlib.tools.junit.framework.*;
+
+public class testStrcmpi extends JMathLibTestCase {
+
+ public testStrcmpi(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testStrcmpi.class);
+ }
+
+ public void testStrcmpi01() {
+ assertEvalScalarEquals("a=strcmpi('abcd','abcd');", "a", 1);
+ }
+ public void testStrcmpi02() {
+ assertEvalScalarEquals("a=strcmpi('abcd','ABCD');", "a", 1);
+ }
+ public void testStrcmpi03() {
+ assertEvalScalarEquals("a=strcmpi('abcd','AbCd');", "a", 1);
+ }
+ public void testStrcmpi04() {
+ assertEvalScalarEquals("a=strcmpi('abcd','ABCd');", "a", 1);
+ }
+ public void testStrcmpi05() {
+ assertEvalScalarEquals("a=strcmpi('aBCd','abcd');", "a", 1);
+ }
+ public void testStrcmpi06() {
+ assertEvalScalarEquals("a=strcmpi('aBCd','axcd');", "a", 0);
+ }
+ public void testStrcmpi07() {
+ assertEvalScalarEquals("a=strcmpi('abcd','abcde');", "a", 0);
+ }
+
+
+
+}
Added: JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrncmp.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrncmp.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrncmp.java 2009-01-10 17:50:46 UTC (rev 673)
@@ -0,0 +1,42 @@
+package jmathlibtests.toolbox.string;
+
+import jmathlib.tools.junit.framework.*;
+
+public class testStrncmp extends JMathLibTestCase {
+
+ public testStrncmp(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testStrncmp.class);
+ }
+
+ public void testStrcmpi01() {
+ assertEvalScalarEquals("a=strncmp('abcdxxx','abcddd', 3);", "a", 1);
+ }
+ public void testStrcmpi02() {
+ assertEvalScalarEquals("a=strncmp('abcDDD','abcDD', 3);", "a", 1);
+ }
+ public void testStrcmpi03() {
+ assertEvalScalarEquals("a=strncmp('abxxxd','abcd', 3);", "a", 0);
+ }
+ public void testStrcmpi04() {
+ assertEvalScalarEquals("a=strncmp('abc','abcdd', 3);", "a", 1);
+ }
+ public void testStrcmpi05() {
+ assertEvalScalarEquals("a=strncmp('ab','abcd', 3);", "a", 0);
+ }
+ public void testStrcmpi06() {
+ assertEvalScalarEquals("a=strncmpi('abcd','ab', 3);", "a", 0);
+ }
+ public void testStrcmpi07() {
+ assertEvalScalarEquals("a=strncmp('abcd','abcXx', 3);", "a", 1);
+ }
+
+
+
+}
Added: JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrncmpi.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrncmpi.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/string/testStrncmpi.java 2009-01-10 17:50:46 UTC (rev 673)
@@ -0,0 +1,42 @@
+package jmathlibtests.toolbox.string;
+
+import jmathlib.tools.junit.framework.*;
+
+public class testStrncmpi extends JMathLibTestCase {
+
+ public testStrncmpi(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testStrncmpi.class);
+ }
+
+ public void testStrcmpi01() {
+ assertEvalScalarEquals("a=strncmpi('abcdxxx','abcddd', 3);", "a", 1);
+ }
+ public void testStrcmpi02() {
+ assertEvalScalarEquals("a=strncmpi('abcDDD','ABCD', 3);", "a", 1);
+ }
+ public void testStrcmpi03() {
+ assertEvalScalarEquals("a=strncmpi('abXxxd','AbCd', 3);", "a", 0);
+ }
+ public void testStrcmpi04() {
+ assertEvalScalarEquals("a=strncmpi('abc','ABCDDd', 3);", "a", 1);
+ }
+ public void testStrcmpi05() {
+ assertEvalScalarEquals("a=strncmpi('aB','abcd', 3);", "a", 0);
+ }
+ public void testStrcmpi06() {
+ assertEvalScalarEquals("a=strncmpi('aBCd','ab', 3);", "a", 0);
+ }
+ public void testStrcmpi07() {
+ assertEvalScalarEquals("a=strncmpi('abcd','abcXx', 3);", "a", 1);
+ }
+
+
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 15:32:16
|
Revision: 672
http://mathlib.svn.sourceforge.net/mathlib/?rev=672&view=rev
Author: st_mueller
Date: 2009-01-10 15:32:11 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
adde more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/core/interpreter/testLexicalAnalyser.java
Modified: JMathLib/trunk/src/jmathlibtests/core/interpreter/testLexicalAnalyser.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/core/interpreter/testLexicalAnalyser.java 2009-01-10 15:10:48 UTC (rev 671)
+++ JMathLib/trunk/src/jmathlibtests/core/interpreter/testLexicalAnalyser.java 2009-01-10 15:32:11 UTC (rev 672)
@@ -184,17 +184,24 @@
public void testReservedWord()
{
- String expression = " break exit for help if load save while";
+ String expression = " break catch continue for foreach global if persistent return switch try while global isglobal ";
+
analyser.analyseExpression(expression);
assertEquals(analyser.getNextToken(0), new FunctionToken("break"));
- assertEquals(analyser.getNextToken(0), new FunctionToken("exit"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("catch"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("continue"));
assertEquals(analyser.getNextToken(0), new FunctionToken("for"));
- assertEquals(analyser.getNextToken(0), new FunctionToken("help"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("foreach"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("global"));
assertEquals(analyser.getNextToken(0), new FunctionToken("if"));
- assertEquals(analyser.getNextToken(0), new FunctionToken("load"));
- assertEquals(analyser.getNextToken(0), new FunctionToken("save"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("persistent"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("return"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("switch"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("try"));
assertEquals(analyser.getNextToken(0), new FunctionToken("while"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("global"));
+ assertEquals(analyser.getNextToken(0), new FunctionToken("isglobal"));
}
public void testDelimiterWords()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 15:10:51
|
Revision: 671
http://mathlib.svn.sourceforge.net/mathlib/?rev=671&view=rev
Author: st_mueller
Date: 2009-01-10 15:10:48 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
adde more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/polynomial/testBinomial.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/polynomial/testBinomial.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/polynomial/testBinomial.java 2009-01-10 15:01:05 UTC (rev 670)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/polynomial/testBinomial.java 2009-01-10 15:10:48 UTC (rev 671)
@@ -1,6 +1,5 @@
package jmathlibtests.toolbox.polynomial;
-import jmathlib.core.interpreter.Interpreter;
import jmathlib.tools.junit.framework.*;
public class testBinomial extends JMathLibTestCase {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 15:01:11
|
Revision: 670
http://mathlib.svn.sourceforge.net/mathlib/?rev=670&view=rev
Author: st_mueller
Date: 2009-01-10 15:01:05 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
adde more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/polynomial/testBinomial.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/polynomial/testBinomial.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/polynomial/testBinomial.java 2009-01-10 14:05:35 UTC (rev 669)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/polynomial/testBinomial.java 2009-01-10 15:01:05 UTC (rev 670)
@@ -3,8 +3,7 @@
import jmathlib.core.interpreter.Interpreter;
import jmathlib.tools.junit.framework.*;
-public class testBinomial extends TestCase {
- protected Interpreter ml;
+public class testBinomial extends JMathLibTestCase {
public testBinomial(String name) {
super(name);
@@ -12,26 +11,41 @@
public static void main (String[] args) {
jmathlib.tools.junit.textui.TestRunner.run (suite());
}
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
public static Test suite() {
return new TestSuite(testBinomial.class);
}
- public void testAbs01() {
- ml.executeExpression("a=abs(1);");
- assertTrue(1 == ml.getScalarValueRe("a"));
+ public void testBinomial01() {
+ assertEvalArrayEquals("a=binomial(2);",
+ "a",
+ new double[][] {{1, 2, 1}},
+ 0.001);
}
- public void testAbs02() {
- ml.executeExpression("a=abs(-3);");
- assertTrue(3 == ml.getScalarValueRe("a"));
+ public void testBinomial02() {
+ assertEvalArrayEquals("a=binomial(3);",
+ "a",
+ new double[][] {{1, 3, 3, 1}},
+ 0.001);
}
+ public void testBinomial03() {
+ assertEvalArrayEquals("a=binomial(4);",
+ "a",
+ new double[][] {{1, 4, 6, 4, 1}},
+ 0.001);
+ }
+ public void testBinomial04() {
+ assertEvalArrayEquals("a=binomial(5);",
+ "a",
+ new double[][] {{1, 5, 10, 10, 5, 1}},
+ 0.001);
+ }
+ public void testBinomial05() {
+ assertEvalArrayEquals("a=binomial(6);",
+ "a",
+ new double[][] {{1, 6, 15, 20, 15, 6, 1}},
+ 0.001);
+ }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 14:05:46
|
Revision: 669
http://mathlib.svn.sourceforge.net/mathlib/?rev=669&view=rev
Author: st_mueller
Date: 2009-01-10 14:05:35 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
adde more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/core/interpreter/testLexicalAnalyser.java
Modified: JMathLib/trunk/src/jmathlibtests/core/interpreter/testLexicalAnalyser.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/core/interpreter/testLexicalAnalyser.java 2009-01-10 14:03:06 UTC (rev 668)
+++ JMathLib/trunk/src/jmathlibtests/core/interpreter/testLexicalAnalyser.java 2009-01-10 14:05:35 UTC (rev 669)
@@ -184,11 +184,10 @@
public void testReservedWord()
{
- String expression = " break do exit for help if load save while";
+ String expression = " break exit for help if load save while";
analyser.analyseExpression(expression);
assertEquals(analyser.getNextToken(0), new FunctionToken("break"));
- assertEquals(analyser.getNextToken(0), new FunctionToken("do"));
assertEquals(analyser.getNextToken(0), new FunctionToken("exit"));
assertEquals(analyser.getNextToken(0), new FunctionToken("for"));
assertEquals(analyser.getNextToken(0), new FunctionToken("help"));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 14:03:21
|
Revision: 668
http://mathlib.svn.sourceforge.net/mathlib/?rev=668&view=rev
Author: st_mueller
Date: 2009-01-10 14:03:06 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
adde more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/AllTests.java
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testAbs.java
JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testAll.java
JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testCeil.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/AllTests.java 2009-01-10 13:55:45 UTC (rev 667)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/AllTests.java 2009-01-10 14:03:06 UTC (rev 668)
@@ -18,9 +18,12 @@
// none
/* include tests in this directory here */
+ suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testAbs.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testAdjoint.suite());
+ suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testAll.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testAnd.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testAny.suite());
+ suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testCeil.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testChol.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testColumns.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testCtranspose.suite());
Added: JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testAbs.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testAbs.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testAbs.java 2009-01-10 14:03:06 UTC (rev 668)
@@ -0,0 +1,45 @@
+package jmathlibtests.toolbox.jmathlib.matrix;
+
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class testAbs extends JMathLibTestCase {
+
+ public testAbs(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testAbs.class);
+ }
+
+ public void testAbs01() {
+ ml.executeExpression("a=abs(5);");
+ assertTrue(5 == ml.getScalarValueRe("a"));
+ }
+ public void testAbs02() {
+ ml.executeExpression("a=abs(0);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ }
+ public void testAbs03() {
+ ml.executeExpression("a=abs(-55);");
+ assertTrue(55 == ml.getScalarValueRe("a"));
+ }
+ public void testAbs04() {
+ ml.executeExpression("a=abs(7i);");
+ assertTrue(7 == ml.getScalarValueRe("a"));
+ }
+ public void testAbs05() {
+ ml.executeExpression("a=abs(-555i);");
+ assertTrue(555 == ml.getScalarValueRe("a"));
+ }
+ public void testAbs06() {
+ ml.executeExpression("a=abs(333);");
+ assertTrue(333 == ml.getScalarValueRe("a"));
+ }
+
+
+}
\ No newline at end of file
Added: JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testAll.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testAll.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testAll.java 2009-01-10 14:03:06 UTC (rev 668)
@@ -0,0 +1,45 @@
+package jmathlibtests.toolbox.jmathlib.matrix;
+
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class testAll extends JMathLibTestCase {
+
+ public testAll(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testAll.class);
+ }
+
+ public void testAll1() {
+ ml.executeExpression("a=all(5);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+ }
+ public void testAll2() {
+ ml.executeExpression("a=all(0);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ }
+ public void testAll3() {
+ ml.executeExpression("a=all([1,2,3;4,5,6]);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+ }
+ public void testAlll4() {
+ ml.executeExpression("a=all([1,2,0;4,5,6]);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ }
+ public void testAll5() {
+ ml.executeExpression("a=all([1,2,3i;4,-5i,6]);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+ }
+ public void testAll6() {
+ ml.executeExpression("a=all([0,2,3i;4,-5i,6]);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ }
+
+
+}
\ No newline at end of file
Added: JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testCeil.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testCeil.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testCeil.java 2009-01-10 14:03:06 UTC (rev 668)
@@ -0,0 +1,53 @@
+package jmathlibtests.toolbox.jmathlib.matrix;
+
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class testCeil extends JMathLibTestCase {
+
+ public testCeil(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testCeil.class);
+ }
+
+ public void testCeil1() {
+ ml.executeExpression("a=ceil(5);");
+ assertTrue(5 == ml.getScalarValueRe("a"));
+ }
+ public void testCeil2() {
+ ml.executeExpression("a=ceil(5.2);");
+ assertTrue(6 == ml.getScalarValueRe("a"));
+ }
+ public void testCeil3() {
+ ml.executeExpression("a=ceil(6.5);");
+ assertTrue(7 == ml.getScalarValueRe("a"));
+ }
+ public void testCeil4() {
+ ml.executeExpression("a=ceil(8.7);");
+ assertTrue(9 == ml.getScalarValueRe("a"));
+ }
+ public void testCeil5() {
+ ml.executeExpression("a=ceil(-5);");
+ assertTrue(-5 == ml.getScalarValueRe("a"));
+ }
+ public void testCeil6() {
+ ml.executeExpression("a=ceil(-5.4);");
+ assertTrue(-5 == ml.getScalarValueRe("a"));
+ }
+ public void testCeil7() {
+ ml.executeExpression("a=ceil(-0.3);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ }
+ public void testCeil8() {
+ ml.executeExpression("a=ceil(-5.9);");
+ assertTrue(-5 == ml.getScalarValueRe("a"));
+ }
+
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 13:55:57
|
Revision: 667
http://mathlib.svn.sourceforge.net/mathlib/?rev=667&view=rev
Author: st_mueller
Date: 2009-01-10 13:55:45 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
more comments
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/matrix/all.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/matrix/all.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/matrix/all.java 2009-01-10 13:42:47 UTC (rev 666)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/matrix/all.java 2009-01-10 13:55:45 UTC (rev 667)
@@ -9,7 +9,7 @@
/**An external function that return 1.0 is all elements of the argument are nonzero */
public class all extends ExternalFunction
{
- /**return a matrix
+ /**
* @param operands[0] = matrix
* @return 1.0 if all elements of the argument are nonzero */
public OperandToken evaluate(Token[] operands)
@@ -59,12 +59,12 @@
@SYNTAX
answer = all(matrix)
@DOC
-Returns 1 if any of the elements of the supplied matrix are not zero.
+Returns 1 if all of the elements of the supplied matrix are not zero.
@NOTES
@EXAMPLES
-any([0,0;0,0]) = 0
-any([1,0;0,0]) = 1
+all([0,0;0,0]) = 0
+all([1,2;2i,-6]) = 1
@SEE
-any
+any, and, not, abs
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 13:43:00
|
Revision: 666
http://mathlib.svn.sourceforge.net/mathlib/?rev=666&view=rev
Author: st_mueller
Date: 2009-01-10 13:42:47 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
prearranged test case for JMathLib
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java
Added: JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java
===================================================================
--- JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java 2009-01-10 13:42:47 UTC (rev 666)
@@ -0,0 +1,43 @@
+package jmathlib.tools.junit.framework;
+
+import jmathlib.core.interpreter.Interpreter;
+import jmathlibtests.Compare;
+
+
+public class JMathLibTestCase extends TestCase
+{
+
+ protected Interpreter ml;
+
+ public JMathLibTestCase (String name)
+ {
+ super(name);
+ }
+
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public void eval(String s)
+ {
+ ml.executeExpression(s);
+ }
+
+ public void assertEquals(String a, String b)
+ {
+ ml.executeExpression(a);
+ double[][]ans1D = ml.getArrayValueRe("ans");
+ double[][]ans1I = ml.getArrayValueIm("ans");
+
+ ml.executeExpression(b);
+ double[][]ans2D = ml.getArrayValueRe("ans");
+ double[][]ans2I = ml.getArrayValueIm("ans");
+
+ assertTrue(Compare.ArrayEquals(ans1D, ans2D));
+ assertTrue(Compare.ArrayEquals(ans1I, ans2I));
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 13:39:47
|
Revision: 665
http://mathlib.svn.sourceforge.net/mathlib/?rev=665&view=rev
Author: st_mueller
Date: 2009-01-10 13:39:37 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
adde more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/control/util/AllTests.java
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/toolbox/control/util/testSwap.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/control/util/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/control/util/AllTests.java 2009-01-10 13:31:27 UTC (rev 664)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/control/util/AllTests.java 2009-01-10 13:39:37 UTC (rev 665)
@@ -19,8 +19,9 @@
//suite.addTest(MathLib.Tools.TestSuite.Functions.Control.system.AllTests.suite());
/* include tests in this directory here */
- //suite.addTest(MathLib.Tools.TestSuite.Functions.Control.testXXX.suite());
+ suite.addTest(jmathlibtests.toolbox.control.util.testSwap.suite());
+
return suite;
}
}
Added: JMathLib/trunk/src/jmathlibtests/toolbox/control/util/testSwap.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/control/util/testSwap.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/control/util/testSwap.java 2009-01-10 13:39:37 UTC (rev 665)
@@ -0,0 +1,33 @@
+package jmathlibtests.toolbox.control.util;
+
+import jmathlib.tools.junit.framework.*;
+
+public class testSwap extends JMathLibTestCase {
+
+ public testSwap(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testSwap.class);
+ }
+
+ public void testSwap01() {
+ ml.executeExpression("[a,b]=swap(3,4)");
+ assertTrue(ml.getScalarValueRe("a") == 4);
+ assertTrue(ml.getScalarValueRe("b") == 3);
+ }
+
+ public void testSwap02() {
+ ml.executeExpression("a=88;");
+ ml.executeExpression("b=77;");
+ ml.executeExpression("[a,b]=swap(a,b)");
+ assertTrue(ml.getScalarValueRe("a") == 77);
+ assertTrue(ml.getScalarValueRe("b") == 88);
+ }
+
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 13:31:33
|
Revision: 664
http://mathlib.svn.sourceforge.net/mathlib/?rev=664&view=rev
Author: st_mueller
Date: 2009-01-10 13:31:27 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
adde more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/AllTests.java
JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/testIsstr.java
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/testFinite.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/AllTests.java 2009-01-10 10:30:39 UTC (rev 663)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/AllTests.java 2009-01-10 13:31:27 UTC (rev 664)
@@ -18,6 +18,7 @@
// none
/* include tests in this directory here */
+ suite.addTest(jmathlibtests.toolbox.deprecated.testFinite.suite());
suite.addTest(jmathlibtests.toolbox.deprecated.testIsstr.suite());
return suite;
Added: JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/testFinite.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/testFinite.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/testFinite.java 2009-01-10 13:31:27 UTC (rev 664)
@@ -0,0 +1,28 @@
+package jmathlibtests.toolbox.deprecated;
+
+import jmathlib.tools.junit.framework.*;
+
+public class testFinite extends JMathLibTestCase {
+
+ public testFinite(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(testFinite.class);
+ }
+
+ public void testFinite01() {
+ ml.executeExpression("a=finite([2]);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+ }
+ public void testFinite02() {
+ ml.executeExpression("a=finite([NaN]);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ }
+
+
+}
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/testIsstr.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/testIsstr.java 2009-01-10 10:30:39 UTC (rev 663)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/deprecated/testIsstr.java 2009-01-10 13:31:27 UTC (rev 664)
@@ -1,10 +1,8 @@
package jmathlibtests.toolbox.deprecated;
-import jmathlib.core.interpreter.Interpreter;
import jmathlib.tools.junit.framework.*;
-public class testIsstr extends TestCase {
- protected Interpreter ml;
+public class testIsstr extends JMathLibTestCase {
public testIsstr(String name) {
super(name);
@@ -12,12 +10,6 @@
public static void main (String[] args) {
jmathlib.tools.junit.textui.TestRunner.run (suite());
}
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
public static Test suite() {
return new TestSuite(testIsstr.class);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-10 10:30:49
|
Revision: 663
http://mathlib.svn.sourceforge.net/mathlib/?rev=663&view=rev
Author: st_mueller
Date: 2009-01-10 10:30:39 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
added a semicolon
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/deprecated/finite.m
Modified: JMathLib/trunk/src/jmathlib/toolbox/deprecated/finite.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/deprecated/finite.m 2009-01-09 19:23:10 UTC (rev 662)
+++ JMathLib/trunk/src/jmathlib/toolbox/deprecated/finite.m 2009-01-10 10:30:39 UTC (rev 663)
@@ -1,6 +1,6 @@
function y = finite(x)
-y = isfinite(x)
+y = isfinite(x);
disp('isfinite: is deprecated')
endfunction
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-09 19:23:17
|
Revision: 662
http://mathlib.svn.sourceforge.net/mathlib/?rev=662&view=rev
Author: st_mueller
Date: 2009-01-09 19:23:10 +0000 (Fri, 09 Jan 2009)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2009-01-09 19:22:29 UTC (rev 661)
+++ JMathLib/trunk/ChangeLog.txt 2009-01-09 19:23:10 UTC (rev 662)
@@ -16,6 +16,10 @@
2009/01/xx
stefan *
+2009/01/09
+stefan * changed the parser, now parsing of cd somedirectory is possible.
+ Also cd("somedirectory") still works.
+
2009/01/04
stefan + added the euler number to VariableToken.java as predefined variable
stefan + pi.int documentation for pi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-09 19:22:36
|
Revision: 661
http://mathlib.svn.sourceforge.net/mathlib/?rev=661&view=rev
Author: st_mueller
Date: 2009-01-09 19:22:29 +0000 (Fri, 09 Jan 2009)
Log Message:
-----------
changed Parser, now parsing of cd somedirectory is possible. Also cd("somedirectory") still works.
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/LexicalAnalyser.java
JMathLib/trunk/src/jmathlib/core/interpreter/Parser.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/LexicalAnalyser.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/LexicalAnalyser.java 2009-01-09 19:20:18 UTC (rev 660)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/LexicalAnalyser.java 2009-01-09 19:22:29 UTC (rev 661)
@@ -64,12 +64,10 @@
/**default constructor - creates the lexical analyser object with an empty string*/
public LexicalAnalyser()
{
- reservedWords = " break do exit try catch continue ";
- reservedWords += " for help history hold if load more return ";
- reservedWords += " load dir ls save set show who whos ";
- reservedWords += " cd chdir clear diary echo format ";
- reservedWords += " type global isglobal ";
- reservedWords += " save switch while "; // trailing " " is very important !!
+ reservedWords = " break catch continue ";
+ reservedWords += " for foreach global if ";
+ reservedWords += " persistent return switch try while ";
+ reservedWords += " global isglobal "; // trailing " " is very important !!
delimiterWords = " end endif else elseif endfunction endwhile endfor ";
delimiterWords += " case default otherwise endswitch ";
delimiterChars = ",()[];{}\n";
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Parser.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Parser.java 2009-01-09 19:20:18 UTC (rev 660)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Parser.java 2009-01-09 19:22:29 UTC (rev 661)
@@ -177,7 +177,7 @@
OperandToken retToken = null; // holds token to be returned
Token peekToken = peekNextToken(deliTyp); // holds next (actual) token
-
+
if (peekToken == null)
{
// No more tokens available
@@ -241,6 +241,9 @@
{
// variables (e.g. aaa or b)
retToken = (OperandToken)getNextToken(deliTyp);
+
+ ErrorLogger.debugLine("Parser parseSingle ppp "+retToken.toString());
+
// check if the variable is followed by a dot operator
if (peekNextToken(deliTyp) instanceof DotOperatorToken)
@@ -267,6 +270,44 @@
retToken = parseFunctionAndParameters( new FunctionToken(name), null );
}
}
+ else if ( (peekNextToken(deliTyp) instanceof VariableToken) ||
+ (peekNextToken(deliTyp) instanceof CharToken) )
+ {
+ // parse something like disp hello instead of disp("hello")
+ // parse something like disp "hello" instead of disp("hello")
+ // convert arguments into char arrays
+
+ String name = ((VariableToken)retToken).getName();
+ FunctionToken func = new FunctionToken(name);
+
+ Token next = null ;
+ while(true)
+ {
+ next = peekNextToken();
+ if (next==null)
+ break;
+
+ //ErrorLogger.debugLine("Parser: var var "+next.toString());
+
+ if (next instanceof DelimiterToken)
+ {
+ break;
+ }
+ else if ( (next instanceof VariableToken) ||
+ (next instanceof CharToken) )
+ {
+ String s = next.toString();
+ ErrorLogger.debugLine("Parser: var var variable "+next.toString());
+ getNextToken();
+ func.setOperands(new OperandToken[] {(OperandToken)new CharToken(s)});
+ }
+ else
+ Errors.throwMathLibException("Parser: var var");
+ }
+
+ return func;
+
+ }
else
ErrorLogger.debugLine("Parser: VariableToken: " + retToken.toString());
}
@@ -931,7 +972,7 @@
FunctionToken func = (FunctionToken)nextToken;
// check if it is a special function e.g. "global a b c"
- if (func.getName().equals("global") || func.getName().equals("isglobal"))
+ if ( func.getName().equals("global") || func.getName().equals("isglobal"))
{
ErrorLogger.debugLine("Parser: found global");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|