Thread: [Mathlib-commitlog] SF.net SVN: mathlib:[485] JMathLib/trunk/src/jmathlib/toolbox/general
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2008-11-23 11:22:16
|
Revision: 485
http://mathlib.svn.sourceforge.net/mathlib/?rev=485&view=rev
Author: st_mueller
Date: 2008-11-23 11:22:13 +0000 (Sun, 23 Nov 2008)
Log Message:
-----------
added information for each toolbox
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/general/changelog.txt
JMathLib/trunk/src/jmathlib/toolbox/general/license.txt
JMathLib/trunk/src/jmathlib/toolbox/general/readme.txt
JMathLib/trunk/src/jmathlib/toolbox/general/version_info.txt
Added: JMathLib/trunk/src/jmathlib/toolbox/general/version_info.txt
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/version_info.txt (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/version_info.txt 2008-11-23 11:22:13 UTC (rev 485)
@@ -0,0 +1,12 @@
+# JMathLib
+# Toolbox: toolbox_skeleton
+#
+# (c) 2008 Stefan Mueller (st...@he...)
+#
+jmathlib.toolboxes.toolbox_skeleton.name="skeleton"
+jmathlib.toolboxes.toolbox_skeleton.version=0.0.1
+jmathlib.toolboxes.toolbox_skeleton.release=major 0.0.1
+jmathlib.toolboxes.toolbox_skeleton.description=splines
+jmathlib.toolboxes.toolbox_skeleton.date=2008/01/01
+jmathlib.toolboxes.toolbox_skeleton.copyright=(c) 2008 Stefan Mueller (st...@he...)
+jmathlib.toolboxes.toolbox_skeleton.message=This is a skeleton for toolbox information
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-26 18:55:25
|
Revision: 564
http://mathlib.svn.sourceforge.net/mathlib/?rev=564&view=rev
Author: st_mueller
Date: 2008-12-26 18:55:18 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
comments for test scripts
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/lookup.m
JMathLib/trunk/src/jmathlib/toolbox/general/mod.m
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/lookup.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/lookup.m 2008-12-26 18:53:59 UTC (rev 563)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/lookup.m 2008-12-26 18:55:18 UTC (rev 564)
@@ -86,16 +86,16 @@
endif
endfunction
-%!assert (lookup(1:3, 0.5), 0) # value before table
-%!assert (lookup(1:3, 3.5), 3) # value after table error
-%!assert (lookup(1:3, 1.5), 1) # value within table error
-%!assert (lookup(1:3, [3,2,1]), [3,2,1])
-%!assert (lookup([1:4]', [1.2, 3.5]'), [1, 3]');
-%!assert (lookup([1:4], [1.2, 3.5]'), [1, 3]');
-%!assert (lookup([1:4]', [1.2, 3.5]), [1, 3]);
-%!assert (lookup([1:4], [1.2, 3.5]), [1, 3]);
-%!assert (lookup(1:3, [3, 2, 1]), [3, 2, 1]);
-%!assert (lookup([3:-1:1], [3.5, 3, 1.2, 2.5, 2.5]), [0, 1, 2, 1, 1])
-%!assert (isempty(lookup([1:3], [])))
-%!assert (isempty(lookup([1:3]', [])))
-%!assert (lookup(1:3, [1, 2; 3, 0.5]), [1, 2; 3, 0]);
+//%!assert (lookup(1:3, 0.5), 0) # value before table
+//%!assert (lookup(1:3, 3.5), 3) # value after table error
+//%!assert (lookup(1:3, 1.5), 1) # value within table error
+//%!assert (lookup(1:3, [3,2,1]), [3,2,1])
+//%!assert (lookup([1:4]', [1.2, 3.5]'), [1, 3]');
+//%!assert (lookup([1:4], [1.2, 3.5]'), [1, 3]');
+//%!assert (lookup([1:4]', [1.2, 3.5]), [1, 3]);
+//%!assert (lookup([1:4], [1.2, 3.5]), [1, 3]);
+//%!assert (lookup(1:3, [3, 2, 1]), [3, 2, 1]);
+//%!assert (lookup([3:-1:1], [3.5, 3, 1.2, 2.5, 2.5]), [0, 1, 2, 1, 1])
+//%!assert (isempty(lookup([1:3], [])))
+//%!assert (isempty(lookup([1:3]', [])))
+//%!assert (lookup(1:3, [1, 2; 3, 0.5]), [1, 2; 3, 0]);
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/mod.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/mod.m 2008-12-26 18:53:59 UTC (rev 563)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/mod.m 2008-12-26 18:55:18 UTC (rev 564)
@@ -77,28 +77,28 @@
endfunction
## empty input test
-%!assert (isempty(mod([], [])));
+//%!assert (isempty(mod([], [])));
## x mod y, y != 0 tests
-%!assert (mod(5, 3), 2);
-%!assert (mod(-5, 3), 1);
-%!assert (mod(0, 3), 0);
-%!assert (mod([-5, 5, 0], [3, 3, 3]), [1, 2, 0]);
-%!assert (mod([-5; 5; 0], [3; 3; 3]), [1; 2; 0]);
-%!assert (mod([-5, 5; 0, 3], [3, 3 ; 3, 1]), [1, 2 ; 0, 0]);
+//%!assert (mod(5, 3), 2);
+//%!assert (mod(-5, 3), 1);
+//%!assert (mod(0, 3), 0);
+//%!assert (mod([-5, 5, 0], [3, 3, 3]), [1, 2, 0]);
+//%!assert (mod([-5; 5; 0], [3; 3; 3]), [1; 2; 0]);
+//%!assert (mod([-5, 5; 0, 3], [3, 3 ; 3, 1]), [1, 2 ; 0, 0]);
## x mod 0 tests
-%!assert (mod(5, 0), 5);
-%!assert (mod(-5, 0), -5);
-%!assert (mod([-5, 5, 0], [3, 0, 3]), [1, 5, 0]);
-%!assert (mod([-5; 5; 0], [3; 0; 3]), [1; 5; 0]);
-%!assert (mod([-5, 5; 0, 3], [3, 0 ; 3, 1]), [1, 5 ; 0, 0]);
-%!assert (mod([-5, 5; 0, 3], [0, 0 ; 0, 0]), [-5, 5; 0, 3]);
+//%!assert (mod(5, 0), 5);
+//%!assert (mod(-5, 0), -5);
+//%!assert (mod([-5, 5, 0], [3, 0, 3]), [1, 5, 0]);
+//%!assert (mod([-5; 5; 0], [3; 0; 3]), [1; 5; 0]);
+//%!assert (mod([-5, 5; 0, 3], [3, 0 ; 3, 1]), [1, 5 ; 0, 0]);
+//%!assert (mod([-5, 5; 0, 3], [0, 0 ; 0, 0]), [-5, 5; 0, 3]);
## mixed scalar/matrix tests
-%!assert (mod([-5, 5; 0, 3], 0), [-5, 5; 0, 3]);
-%!assert (mod([-5, 5; 0, 3], 3), [1, 2; 0, 0]);
-%!assert (mod(-5,[0,0; 0,0]), [-5, -5; -5, -5]);
-%!assert (mod(-5,[3,0; 3,1]), [1, -5; 1, 0]);
-%!assert (mod(-5,[3,2; 3,1]), [1, 1; 1, 0]);
+//%!assert (mod([-5, 5; 0, 3], 0), [-5, 5; 0, 3]);
+//%!assert (mod([-5, 5; 0, 3], 3), [1, 2; 0, 0]);
+//%!assert (mod(-5,[0,0; 0,0]), [-5, -5; -5, -5]);
+//%!assert (mod(-5,[3,0; 3,1]), [1, -5; 1, 0]);
+//%!assert (mod(-5,[3,2; 3,1]), [1, 1; 1, 0]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-05 15:13:44
|
Revision: 625
http://mathlib.svn.sourceforge.net/mathlib/?rev=625&view=rev
Author: st_mueller
Date: 2009-01-05 15:13:40 +0000 (Mon, 05 Jan 2009)
Log Message:
-----------
changed handling of global variables
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/who.java
JMathLib/trunk/src/jmathlib/toolbox/general/whos.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/who.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/who.java 2009-01-05 15:11:55 UTC (rev 624)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/who.java 2009-01-05 15:13:40 UTC (rev 625)
@@ -4,8 +4,8 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.interpreter.*;
import jmathlib.core.functions.ExternalFunction;
+import java.util.*;
-import java.util.*;
/**An external function for getting the stored variables*/
public class who extends ExternalFunction
{
@@ -19,7 +19,7 @@
getInterpreter().displayText("\nYour variables are:\n");
- Iterator iter = getVariables().getIterator();
+ Iterator iter = getLocalVariables().getIterator();
while(iter.hasNext())
{
Map.Entry next = ((Map.Entry)iter.next());
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/whos.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/whos.java 2009-01-05 15:11:55 UTC (rev 624)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/whos.java 2009-01-05 15:13:40 UTC (rev 625)
@@ -11,7 +11,7 @@
public OperandToken evaluate(Token[] operands)
{
- Iterator iter = getVariables().getIterator();
+ Iterator iter = getLocalVariables().getIterator();
// display header information
getInterpreter().displayText("\nYour variables are:\n");
@@ -22,21 +22,28 @@
{
if ((operands[0] instanceof CharToken))
{
- String data = ((CharToken)operands[0]).getValue().toLowerCase();
+ String data = ((CharToken)operands[0]).getValue();
if (data.equals("global"))
iter = getGlobalVariables().getIterator();
}
}
+ // iterate through the complete local variable list
while(iter.hasNext())
{
- Map.Entry next = ((Map.Entry)iter.next());
- Variable var = (Variable)next.getValue();
- OperandToken op = (OperandToken)var.getData();
- String line = "";
+ Map.Entry next = ((Map.Entry)iter.next());
+ Variable var = (Variable)next.getValue();
+ OperandToken op = (OperandToken)var.getData();
+ Boolean global = var.isGlobal();
+ String name = var.getName();
+ String line = "";
- line = var.getName()+" \t";
+ line = name + " \t";
+ // if variable is global get data from global context
+ if (global)
+ op = (OperandToken)getGlobalVariables().getVariable(name).getData();
+
// check which type of variable
if (op instanceof DataToken)
{
@@ -48,8 +55,9 @@
line += " \t unknown";
}
- if (getGlobalVariables().isVariable(var.getName()))
- line += "(global)";
+ //if (getLocalVariables().isVariable(var.getName()))
+ if (global)
+ line += "(global)";
getInterpreter().displayText(line);
}
@@ -85,11 +93,12 @@
general
@SYNTAX
whos
+whos("global")
@DOC
Returns a list of all the variables in the system.
@EXAMPLES
@NOTES
@SEE
-who
+who, clear, global
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 19:36:55
|
Revision: 651
http://mathlib.svn.sourceforge.net/mathlib/?rev=651&view=rev
Author: st_mueller
Date: 2009-01-08 19:36:47 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
added more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/int16.java
JMathLib/trunk/src/jmathlib/toolbox/general/int32.java
JMathLib/trunk/src/jmathlib/toolbox/general/int64.java
JMathLib/trunk/src/jmathlib/toolbox/general/int8.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int16.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int16.java 2009-01-07 20:16:46 UTC (rev 650)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int16.java 2009-01-08 19:36:47 UTC (rev 651)
@@ -68,6 +68,13 @@
</programlisting>
@SEE
-double, int8, uint8, uint16
+double, int8, uint8, uint16, uint32
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=int16(8);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "int16", ml.getString("b"));
+%!
+*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int32.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int32.java 2009-01-07 20:16:46 UTC (rev 650)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int32.java 2009-01-08 19:36:47 UTC (rev 651)
@@ -68,6 +68,13 @@
</programlisting>
@SEE
-double, int8, uint8, uint16
+double, int8, uint8, uint16, int16, int32, int64
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=int32(8);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "int32", ml.getString("b"));
+%!
+*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int64.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int64.java 2009-01-07 20:16:46 UTC (rev 650)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int64.java 2009-01-08 19:36:47 UTC (rev 651)
@@ -71,3 +71,10 @@
double, int8, uint8, uint16
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=int64(8);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "int64", ml.getString("b"));
+%!
+*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int8.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int8.java 2009-01-07 20:16:46 UTC (rev 650)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int8.java 2009-01-08 19:36:47 UTC (rev 651)
@@ -68,6 +68,13 @@
</programlisting>
@SEE
-double, int16, uint8, uint16
+double, int16, uint8, uint16, uint32
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=int8(88);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "int8", ml.getString("b"));
+%!
+*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 19:40:32
|
Revision: 652
http://mathlib.svn.sourceforge.net/mathlib/?rev=652&view=rev
Author: st_mueller
Date: 2009-01-08 19:40:24 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
added more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/issingle.m
JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java
JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/issingle.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/issingle.m 2009-01-08 19:36:47 UTC (rev 651)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/issingle.m 2009-01-08 19:40:24 UTC (rev 652)
@@ -17,6 +17,6 @@
@NOTES
.
@SEE
-ischar, iscell, isnumeric, ismatrix, isprime
+ischar, iscell, isnumeric, ismatrix, isprime, double, int8, isint8, isuint16, isint16, isint32, isint64
*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java 2009-01-08 19:36:47 UTC (rev 651)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java 2009-01-08 19:40:24 UTC (rev 652)
@@ -62,7 +62,7 @@
@SYNTAX
uint8(x)
@DOC
-converts a double array into an array of uint8 (range 0 up to +255)
+converts a double array into an array of uint16
@EXAMPLES
<programlisting>
@@ -71,3 +71,11 @@
double, int16, int8, uint16
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=uint16(88);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "uint16", ml.getString("b"));
+%!
+*/
+
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java 2009-01-08 19:36:47 UTC (rev 651)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java 2009-01-08 19:40:24 UTC (rev 652)
@@ -68,6 +68,14 @@
</programlisting>
@SEE
-double, int16, int8, uint16
+double, int16, int8, uint16, uint32, uint64
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=uint16(88);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "uint16", ml.getString("b"));
+%!
+*/
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-19 20:34:21
|
Revision: 692
http://mathlib.svn.sourceforge.net/mathlib/?rev=692&view=rev
Author: st_mueller
Date: 2009-01-19 20:34:14 +0000 (Mon, 19 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/_class.java
JMathLib/trunk/src/jmathlib/toolbox/general/angle.java
JMathLib/trunk/src/jmathlib/toolbox/general/beep.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/_class.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/_class.java 2009-01-19 20:33:26 UTC (rev 691)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/_class.java 2009-01-19 20:34:14 UTC (rev 692)
@@ -5,10 +5,11 @@
import jmathlib.core.tokens.DataToken;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class _class extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/angle.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/angle.java 2009-01-19 20:33:26 UTC (rev 691)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/angle.java 2009-01-19 20:34:14 UTC (rev 692)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class angle extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/beep.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/beep.java 2009-01-19 20:33:26 UTC (rev 691)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/beep.java 2009-01-19 20:34:14 UTC (rev 692)
@@ -3,13 +3,15 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
+
import java.awt.Toolkit;
/**An external function for emitting a beep sound*/
public class beep extends ExternalFunction
{
/**Emits a beeping sound*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
Toolkit.getDefaultToolkit().beep();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-19 20:35:00
|
Revision: 693
http://mathlib.svn.sourceforge.net/mathlib/?rev=693&view=rev
Author: st_mueller
Date: 2009-01-19 20:34:52 +0000 (Mon, 19 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/int16.java
JMathLib/trunk/src/jmathlib/toolbox/general/int32.java
JMathLib/trunk/src/jmathlib/toolbox/general/int64.java
JMathLib/trunk/src/jmathlib/toolbox/general/int8.java
JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java
JMathLib/trunk/src/jmathlib/toolbox/general/uint32.java
JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int16.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int16.java 2009-01-19 20:34:14 UTC (rev 692)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int16.java 2009-01-19 20:34:52 UTC (rev 693)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class int16 extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int32.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int32.java 2009-01-19 20:34:14 UTC (rev 692)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int32.java 2009-01-19 20:34:52 UTC (rev 693)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class int32 extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int64.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int64.java 2009-01-19 20:34:14 UTC (rev 692)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int64.java 2009-01-19 20:34:52 UTC (rev 693)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class int64 extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int8.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int8.java 2009-01-19 20:34:14 UTC (rev 692)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int8.java 2009-01-19 20:34:52 UTC (rev 693)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class int8 extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java 2009-01-19 20:34:14 UTC (rev 692)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java 2009-01-19 20:34:52 UTC (rev 693)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class uint16 extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/uint32.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint32.java 2009-01-19 20:34:14 UTC (rev 692)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint32.java 2009-01-19 20:34:52 UTC (rev 693)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class uint32 extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java 2009-01-19 20:34:14 UTC (rev 692)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java 2009-01-19 20:34:52 UTC (rev 693)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class uint8 extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-23 12:42:29
|
Revision: 719
http://mathlib.svn.sourceforge.net/mathlib/?rev=719&view=rev
Author: st_mueller
Date: 2009-01-23 12:39:30 +0000 (Fri, 23 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/who.java
JMathLib/trunk/src/jmathlib/toolbox/general/whos.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/who.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/who.java 2009-01-23 12:28:36 UTC (rev 718)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/who.java 2009-01-23 12:39:30 UTC (rev 719)
@@ -9,7 +9,7 @@
/**An external function for getting the stored variables*/
public class who extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
//if (operands != null)
@@ -17,14 +17,14 @@
Variable var;
- getInterpreter().displayText("\nYour variables are:\n");
+ globals.getInterpreter().displayText("\nYour variables are:\n");
- Iterator iter = getLocalVariables().getIterator();
+ Iterator iter = globals.getLocalVariables().getIterator();
while(iter.hasNext())
{
Map.Entry next = ((Map.Entry)iter.next());
var = ((Variable)next.getValue());
- getInterpreter().displayText(var.getName());
+ globals.getInterpreter().displayText(var.getName());
}
return null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/whos.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/whos.java 2009-01-23 12:28:36 UTC (rev 718)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/whos.java 2009-01-23 12:39:30 UTC (rev 719)
@@ -8,14 +8,14 @@
/**An external function for getting the stored variables*/
public class whos extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
- Iterator iter = getLocalVariables().getIterator();
+ Iterator iter = globals.getLocalVariables().getIterator();
// display header information
- getInterpreter().displayText("\nYour variables are:\n");
- getInterpreter().displayText("\nName: \t size: \t type \n");
+ globals.getInterpreter().displayText("\nYour variables are:\n");
+ globals.getInterpreter().displayText("\nName: \t size: \t type \n");
// check if global context is requested
if (getNArgIn(operands) == 1)
@@ -24,7 +24,7 @@
{
String data = ((CharToken)operands[0]).getValue();
if (data.equals("global"))
- iter = getGlobalVariables().getIterator();
+ iter = globals.getGlobalVariables().getIterator();
}
}
@@ -42,7 +42,7 @@
// if variable is global get data from global context
if (global)
- op = (OperandToken)getGlobalVariables().getVariable(name).getData();
+ op = (OperandToken)globals.getGlobalVariables().getVariable(name).getData();
// check which type of variable
if (op instanceof DataToken)
@@ -59,7 +59,7 @@
if (global)
line += "(global)";
- getInterpreter().displayText(line);
+ globals.getInterpreter().displayText(line);
}
return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-23 12:42:39
|
Revision: 718
http://mathlib.svn.sourceforge.net/mathlib/?rev=718&view=rev
Author: st_mueller
Date: 2009-01-23 12:28:36 +0000 (Fri, 23 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/isa.java
JMathLib/trunk/src/jmathlib/toolbox/general/iscell.java
JMathLib/trunk/src/jmathlib/toolbox/general/ischar.java
JMathLib/trunk/src/jmathlib/toolbox/general/isfunctionhandle.java
JMathLib/trunk/src/jmathlib/toolbox/general/isglobal.java
JMathLib/trunk/src/jmathlib/toolbox/general/islogical.java
JMathLib/trunk/src/jmathlib/toolbox/general/isnumeric.java
JMathLib/trunk/src/jmathlib/toolbox/general/isprime.java
JMathLib/trunk/src/jmathlib/toolbox/general/isstruct.java
JMathLib/trunk/src/jmathlib/toolbox/general/isstudent.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/isa.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/isa.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/isa.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -2,12 +2,12 @@
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.tokens.*;
-import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class isa extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 2)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/iscell.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/iscell.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/iscell.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -2,13 +2,13 @@
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.tokens.*;
-import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function which checks if the argument is numeric*/
public class iscell extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/ischar.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/ischar.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/ischar.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -2,13 +2,13 @@
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.tokens.*;
-import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function which checks if the argument is a char*/
public class ischar extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/isfunctionhandle.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/isfunctionhandle.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/isfunctionhandle.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -5,13 +5,14 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.FunctionHandleToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function to check if an argument is of type function hanlde*/
public class isfunctionhandle extends ExternalFunction
{
/**@param operands[0] = a matrix of numbers
@return a matrix the same size with 1 if the number is a prime*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
throwMathLibException("isfunctionhandle: number of arguments != 1");
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/isglobal.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/isglobal.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/isglobal.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -2,13 +2,13 @@
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.tokens.*;
-import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function which checks if the argument is numeric*/
public class isglobal extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
@@ -18,8 +18,9 @@
throwMathLibException("isglobal: only works on variables");
VariableToken var = (VariableToken)operands[0];
-
- if (var.getVariable().isGlobal())
+ String name = var.getName();
+
+ if (globals.getVariable(name).isGlobal())
return new DoubleNumberToken(1.0);
else
return new DoubleNumberToken(0.0);
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/islogical.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/islogical.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/islogical.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -5,11 +5,12 @@
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.tokens.LogicalToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function which checks if the argument is a char*/
public class islogical extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/isnumeric.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/isnumeric.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/isnumeric.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -4,11 +4,12 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function which checks if the argument is numeric*/
public class isnumeric extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/isprime.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/isprime.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/isprime.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -4,13 +4,14 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function to check if a number is a prime*/
public class isprime extends ExternalFunction
{
/**@param operands[0] = a matrix of numbers
@return a matrix the same size with 1 if the number is a prime*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
throwMathLibException("isPrime: number of arguments != 1");
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/isstruct.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/isstruct.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/isstruct.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -5,11 +5,12 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.MathLibObject;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function which checks if the argument is a struct*/
public class isstruct extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/isstudent.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/isstudent.java 2009-01-23 12:26:46 UTC (rev 717)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/isstudent.java 2009-01-23 12:28:36 UTC (rev 718)
@@ -4,13 +4,14 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/** */
public class isstudent extends ExternalFunction
{
/**@param operands[0] = a matrix of numbers
@return a matrix the same size with 1 if the number is a prime*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 0)
throwMathLibException("isstudent: number of arguments != 0");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-23 13:22:10
|
Revision: 717
http://mathlib.svn.sourceforge.net/mathlib/?rev=717&view=rev
Author: st_mueller
Date: 2009-01-23 12:26:46 +0000 (Fri, 23 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/bitand.java
JMathLib/trunk/src/jmathlib/toolbox/general/bitor.java
JMathLib/trunk/src/jmathlib/toolbox/general/bitshift.java
JMathLib/trunk/src/jmathlib/toolbox/general/bitxor.java
JMathLib/trunk/src/jmathlib/toolbox/general/cell.java
JMathLib/trunk/src/jmathlib/toolbox/general/clear.java
JMathLib/trunk/src/jmathlib/toolbox/general/clock.java
JMathLib/trunk/src/jmathlib/toolbox/general/combinations.java
JMathLib/trunk/src/jmathlib/toolbox/general/complex.java
JMathLib/trunk/src/jmathlib/toolbox/general/conj.java
JMathLib/trunk/src/jmathlib/toolbox/general/factor.java
JMathLib/trunk/src/jmathlib/toolbox/general/fft.java
JMathLib/trunk/src/jmathlib/toolbox/general/fibonacci.java
JMathLib/trunk/src/jmathlib/toolbox/general/fix.java
JMathLib/trunk/src/jmathlib/toolbox/general/func2str.java
JMathLib/trunk/src/jmathlib/toolbox/general/getpfilecaching.java
JMathLib/trunk/src/jmathlib/toolbox/general/global.java
JMathLib/trunk/src/jmathlib/toolbox/general/harmonic.java
JMathLib/trunk/src/jmathlib/toolbox/general/imag.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/bitand.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/bitand.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/bitand.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.interpreter.Errors;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.core.functions.*;
/**An external function to compute the binary and of two numbers*/
@@ -13,7 +14,7 @@
@param operands[0] - The first number
@param operands[1] - The second number
@return the result of the function as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
DoubleNumberToken result = DoubleNumberToken.zero;
if (getNArgIn(operands) != 2)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/bitor.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/bitor.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/bitor.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.interpreter.Errors;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.core.functions.*;
/**An external function to compute the binary inclusive or of two numbers*/
@@ -13,7 +14,7 @@
@param operands[0] - The first number
@param operands[1] - The second number
@return the result of the function as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
DoubleNumberToken result = DoubleNumberToken.zero;
if (getNArgIn(operands) != 2)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/bitshift.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/bitshift.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/bitshift.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.interpreter.Errors;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.core.functions.*;
/**An external function to shift the bit pattern of a number*/
@@ -13,7 +14,7 @@
@param operands[0] - The number to shift
@param operands[1] - The number of binary places to shift
@return the result of the function as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
DoubleNumberToken result = DoubleNumberToken.zero;
if (getNArgIn(operands) != 2)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/bitxor.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/bitxor.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/bitxor.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.numbertokens.*;
import jmathlib.core.interpreter.Errors;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.core.functions.*;
/**An external function to compute the binary exclusive or of two numbers*/
@@ -13,7 +14,7 @@
@param operands[0] - The first number
@param operands[1] - The second number
@return the result of the function as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
DoubleNumberToken result = DoubleNumberToken.zero;
if (getNArgIn(operands) != 2)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/cell.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/cell.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/cell.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -3,6 +3,7 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for creating matrices that consist of zeros *
* everywhere except in the diagonal. The diagonal consists of ones. *
@@ -13,7 +14,7 @@
/**returns a cell array
@param operands[0] = number of rows
@param operands[1] = number of columns */
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
// at least one operands (e.g. cell(n) )
if (getNArgIn(operands) < 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/clear.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/clear.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/clear.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -10,7 +10,7 @@
/**An external function for clearing stored variables*/
public class clear extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
Variable var;
@@ -34,38 +34,38 @@
if (s.equals("variables"))
{
// only clear local variables
- getLocalVariables().clear();
+ globals.getLocalVariables().clear();
}
else if (s.equals("globals"))
{
// clear global variables
- getGlobalVariables().clear();
- getLocalVariables().clear();
+ globals.getGlobalVariables().clear();
+ globals.getLocalVariables().clear();
//TODO: when removing global variables also remove
// pointers from local to global varaibles in "getLocalVariables"
}
else if (s.equals("functions"))
{
// clear cache for m-files, class-files, script-files
- getFunctionManager().clear();
+ globals.getFunctionManager().clear();
}
else if (s.equals("all"))
{
// clear everything
- getLocalVariables().clear();
- getGlobalVariables().clear();
- getFunctionManager().clear();
+ globals.getLocalVariables().clear();
+ globals.getGlobalVariables().clear();
+ globals.getFunctionManager().clear();
}
else if (!s.equals(" "))
{
// remove one variable from local workspace
- getLocalVariables().remove(s);
+ globals.getLocalVariables().remove(s);
}
else
{
// clear without any arguments only clears the local workspace
- getLocalVariables().clear();
+ globals.getLocalVariables().clear();
}
return null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/clock.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/clock.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/clock.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,8 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
+
import java.util.Date;
import java.util.Calendar;
@@ -12,7 +14,7 @@
{
/**@return the current date and time as a 6 by 1 vector containing
[year month day hours minutes seconds]*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
Date now = new Date();
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/combinations.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/combinations.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/combinations.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function to calculate the number of combinations
when k objects are taken from a set of k*/
@@ -14,7 +15,7 @@
@param operand[1] = The total number of objects
@return the number of combinations
*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = new DoubleNumberToken(0);
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/complex.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/complex.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/complex.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**Display the debug information of an expression*/
public class complex extends ExternalFunction
@@ -12,7 +13,7 @@
@param operand[0] = real part
@param operand[2] = imaginary part
@return the complex number*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = null;
if (getNArgIn(operands) != 2)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/conj.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/conj.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/conj.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,10 +4,11 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class conj extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/factor.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/factor.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/factor.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function to create a vector of the prime
factors of a number*/
@@ -11,7 +12,7 @@
{
/**@param operands[0] = the number
@return a vector containing the prime factors*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
DoubleNumberToken result = null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/fft.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/fft.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/fft.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,11 +4,12 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function which checks if the argument is a struct*/
public class fft extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/fibonacci.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/fibonacci.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/fibonacci.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function to calculate the nth fibonacci number*/
public class fibonacci extends ExternalFunction
@@ -12,7 +13,7 @@
@param operand[0] = The index of the Fibonacci number
@return the Fibonacci number
*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
throwMathLibException("fibonacci: number of arguments != 1");
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/fix.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/fix.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/fix.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class fix extends ExternalFunction
@@ -11,7 +12,7 @@
/**rounds the element to the nearest element towards zero.
@param operands[0] = value to round
@return a matrix of the same size as the operands*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
// exactly one operand
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/func2str.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/func2str.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/func2str.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -5,13 +5,14 @@
import jmathlib.core.tokens.CharToken;
import jmathlib.core.tokens.FunctionHandleToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function */
public class func2str extends ExternalFunction
{
/**@param operands[0] = a matrix of numbers
@return a matrix the same size with 1 if the number is a prime*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
throwMathLibException("func2str: number of arguments != 1");
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/getpfilecaching.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/getpfilecaching.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/getpfilecaching.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -5,6 +5,7 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for enabling/disabling of caching of p-files */
public class getpfilecaching extends ExternalFunction
@@ -12,12 +13,12 @@
/**status of caching of p-files
* @return whether or not caching of p-files is enabled/disabled
*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands)!=0)
throwMathLibException("getPFileCaching: number of input arguments != 0");
- boolean cachingEnabled = getFunctionManager().getPFileCaching();
+ boolean cachingEnabled = globals.getFunctionManager().getPFileCaching();
if (cachingEnabled)
return new DoubleNumberToken(1);
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/global.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/global.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/global.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -3,13 +3,14 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.VariableToken;
import jmathlib.core.tokens.OperandToken;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.core.interpreter.Variable;
import jmathlib.core.functions.ExternalFunction;
/**An external function which checks if the argument is numeric*/
public class global extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
@@ -23,8 +24,8 @@
debugLine("global "+operands[0].toString());
- debugLine("global: local variable:"+getLocalVariables().isVariable(var.getName()));
- debugLine("global: global variable:"+getGlobalVariables().isVariable(var.getName()));
+ debugLine("global: local variable:"+globals.getLocalVariables().isVariable(var.getName()));
+ debugLine("global: global variable:"+globals.getGlobalVariables().isVariable(var.getName()));
// this is the procedure for global variables:
// - normally all variables a local to each workspace
@@ -40,22 +41,22 @@
// check if variable is already created in global context
- if (getGlobalVariables().isVariable(name))
+ if (globals.getGlobalVariables().isVariable(name))
{
// variable is already created in global context
// check if local context already contains variable
- if (getLocalVariables().isVariable(name))
+ if (globals.getLocalVariables().isVariable(name))
{
// variable is already created in local context
// remove variable from current workspace (may delete current value)
// create empty variable and set pointer to "global" property
- getLocalVariables().remove(name);
- getLocalVariables().createVariable(name);
- getLocalVariables().getVariable(name).setGlobal(true);
+ globals.getLocalVariables().remove(name);
+ globals.getLocalVariables().createVariable(name);
+ globals.getLocalVariables().getVariable(name).setGlobal(true);
- getInterpreter().displayText("WARNING global: variable "+name+
+ globals.getInterpreter().displayText("WARNING global: variable "+name+
" already existed in the local workspace. \n"+
" It has been overwritten with the value from"+
" the global workspace.\n" +
@@ -67,8 +68,8 @@
// variable is not yet created in local context
// create empty variable and set "global" property
- getLocalVariables().createVariable(name);
- getLocalVariables().getVariable(name).setGlobal(true);
+ globals.getLocalVariables().createVariable(name);
+ globals.getLocalVariables().getVariable(name).setGlobal(true);
}
}
@@ -77,28 +78,28 @@
// variable not yet created in global context
// create variable in global context (data only in global context)
- getGlobalVariables().createVariable(name);
- getGlobalVariables().getVariable(name).setGlobal(true);
+ globals.getGlobalVariables().createVariable(name);
+ globals.getGlobalVariables().getVariable(name).setGlobal(true);
// check if current context already contains variable
- if (getLocalVariables().isVariable(name))
+ if (globals.getLocalVariables().isVariable(name))
{
// current context already contains variable
- Variable varCurrent = getLocalVariables().getVariable(name);
- getGlobalVariables().getVariable(name).assign(varCurrent.getData());
+ Variable varCurrent = globals.getLocalVariables().getVariable(name);
+ globals.getGlobalVariables().getVariable(name).assign(varCurrent.getData());
// remove variable, create new one and set variable to global
- getLocalVariables().remove(name);
+ globals.getLocalVariables().remove(name);
}
}
// create new variable in current context and set variable to global
- getLocalVariables().createVariable(name);
- getLocalVariables().getVariable(name).setGlobal(true);
+ globals.getLocalVariables().createVariable(name);
+ globals.getLocalVariables().getVariable(name).setGlobal(true);
- debugLine("global:global var:"+name+" global="+getGlobalVariables().getVariable(name).isGlobal());
- debugLine("global:local var:"+name+" global="+getLocalVariables().getVariable(name).isGlobal());
+ debugLine("global:global var:"+name+" global="+globals.getGlobalVariables().getVariable(name).isGlobal());
+ debugLine("global:local var:"+name+" global="+globals.getLocalVariables().getVariable(name).isGlobal());
return null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/harmonic.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/harmonic.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/harmonic.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function to calculate the nth harmonic number*/
public class harmonic extends ExternalFunction
@@ -12,7 +13,7 @@
@param operand[0] = The index of the harmonic number
@return the harmonic number
*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = new DoubleNumberToken(0);
if(operands.length >= 1 && operands[0] instanceof DoubleNumberToken)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/imag.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/imag.java 2009-01-23 12:24:35 UTC (rev 716)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/imag.java 2009-01-23 12:26:46 UTC (rev 717)
@@ -3,10 +3,11 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class imag extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-23 13:22:33
|
Revision: 716
http://mathlib.svn.sourceforge.net/mathlib/?rev=716&view=rev
Author: st_mueller
Date: 2009-01-23 12:24:35 +0000 (Fri, 23 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/kbhit.java
JMathLib/trunk/src/jmathlib/toolbox/general/length.java
JMathLib/trunk/src/jmathlib/toolbox/general/linspace.java
JMathLib/trunk/src/jmathlib/toolbox/general/logical.java
JMathLib/trunk/src/jmathlib/toolbox/general/ndims.java
JMathLib/trunk/src/jmathlib/toolbox/general/performfunction.java
JMathLib/trunk/src/jmathlib/toolbox/general/permutations.java
JMathLib/trunk/src/jmathlib/toolbox/general/primes.java
JMathLib/trunk/src/jmathlib/toolbox/general/rand.java
JMathLib/trunk/src/jmathlib/toolbox/general/real.java
JMathLib/trunk/src/jmathlib/toolbox/general/setpfilecaching.java
JMathLib/trunk/src/jmathlib/toolbox/general/size.java
JMathLib/trunk/src/jmathlib/toolbox/general/str2func.java
JMathLib/trunk/src/jmathlib/toolbox/general/struct.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/kbhit.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/kbhit.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/kbhit.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -3,6 +3,8 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
+
import java.awt.event.*;
import jmathlib.ui.common.*;
@@ -13,12 +15,12 @@
boolean lock = false;
/** waits until a key is hit on the keyboard*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
lock = true;
- ((Console)(getInterpreter().getOutputPanel())).addKeyListener(this); // this = null?
- ((Console)getInterpreter().getOutputPanel()).displayText("asdfasdf");
+ ((Console)(globals.getInterpreter().getOutputPanel())).addKeyListener(this); // this = null?
+ ((Console)globals.getInterpreter().getOutputPanel()).displayText("asdfasdf");
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/length.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/length.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/length.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -6,11 +6,12 @@
import jmathlib.core.tokens.DataToken;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for getting the size of matrices*/
public class length extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
// at least one operand
if (getNArgIn(operands) != 1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/linspace.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/linspace.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/linspace.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -4,11 +4,12 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for creating equaly spaced vectors*/
public class linspace extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 3)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/logical.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/logical.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/logical.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -5,11 +5,12 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.LogicalToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class logical extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/ndims.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/ndims.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/ndims.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -7,6 +7,7 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class ndims extends ExternalFunction
@@ -14,7 +15,7 @@
/**returns the dimensions of an array 1,2,3,4-dimensional
*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands)!=1)
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/performfunction.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/performfunction.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/performfunction.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -5,13 +5,14 @@
import jmathlib.core.tokens.FunctionToken;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for performing functions*/
public class performfunction extends ExternalFunction
{
/**Perform the named function on the operands
@param operand[0] = the name of the function*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
FunctionToken function = null;
@@ -38,7 +39,7 @@
function.setOperands(op);
- return function.evaluate(null);
+ return function.evaluate(null, globals);
}
}
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/permutations.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/permutations.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/permutations.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function to calculate the number of permutations
when k objects are taken from a set of k*/
@@ -14,7 +15,7 @@
@param operand[1] = The total number of objects
@return the number of permutations
*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = new DoubleNumberToken(0);
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/primes.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/primes.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/primes.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -5,13 +5,14 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
import jmathlib.core.interpreter.Errors;
+import jmathlib.core.interpreter.GlobalValues;
/**External function to create a vector of primes*/
public class primes extends ExternalFunction
{
/**@param operands[0] = the maximum number
@return a vector containing the prime values*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
DoubleNumberToken result = null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/rand.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/rand.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/rand.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -4,11 +4,12 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for creating random numbers*/
public class rand extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
//if ( (getNArgIn(operands) < 0) ||
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/real.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/real.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/real.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -4,10 +4,11 @@
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class real extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1 )
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/setpfilecaching.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/setpfilecaching.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/setpfilecaching.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -5,6 +5,7 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for enabling/disabling of caching of p-files */
public class setpfilecaching extends ExternalFunction
@@ -12,7 +13,7 @@
/**enable or disable caching of p-files
* @param operands[0] 1, 0 , 'on', 'off'
*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
// one operand (e.g. setPFileCaching(1)
// one operand (e.g. setPFileCaching('on')
@@ -23,16 +24,16 @@
if (operands[0] instanceof DoubleNumberToken)
{
if ( ((DoubleNumberToken)operands[0]).getValueRe()==0)
- getFunctionManager().setPFileCaching(false);
+ globals.getFunctionManager().setPFileCaching(false);
else
- getFunctionManager().setPFileCaching(true);
+ globals.getFunctionManager().setPFileCaching(true);
}
else if (operands[0] instanceof CharToken)
{
if ( ((CharToken)operands[0]).getValue().equals("on"))
- getFunctionManager().setPFileCaching(true);
+ globals.getFunctionManager().setPFileCaching(true);
else
- getFunctionManager().setPFileCaching(false);
+ globals.getFunctionManager().setPFileCaching(false);
}
return null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/size.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/size.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/size.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -5,11 +5,12 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for getting the size of matrices*/
public class size extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
// at least one operand
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/str2func.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/str2func.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/str2func.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -5,13 +5,14 @@
import jmathlib.core.tokens.CharToken;
import jmathlib.core.tokens.FunctionHandleToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**External function */
public class str2func extends ExternalFunction
{
/**@param operands[0] = a matrix of numbers
@return a matrix the same size with 1 if the number is a prime*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 1)
throwMathLibException("str2func: number of arguments != 1");
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/struct.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/struct.java 2009-01-21 19:38:33 UTC (rev 715)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/struct.java 2009-01-23 12:24:35 UTC (rev 716)
@@ -12,7 +12,7 @@
/**create a structure
@param operands[n] = name of field
@param operands[n+1] = field value*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
MathLibObject obj;
int length = operands.length;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-01 17:37:55
|
Revision: 821
http://mathlib.svn.sourceforge.net/mathlib/?rev=821&view=rev
Author: st_mueller
Date: 2009-02-01 17:37:46 +0000 (Sun, 01 Feb 2009)
Log Message:
-----------
documentation bugfixes
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/global.java
JMathLib/trunk/src/jmathlib/toolbox/general/size.java
JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/global.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/global.java 2009-02-01 17:36:26 UTC (rev 820)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/global.java 2009-02-01 17:37:46 UTC (rev 821)
@@ -121,6 +121,6 @@
</programlisting>
@NOTES
@SEE
-isglobal, isvarname
+isglobal
*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/size.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/size.java 2009-02-01 17:36:26 UTC (rev 820)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/size.java 2009-02-01 17:37:46 UTC (rev 821)
@@ -78,6 +78,6 @@
</programlisting>
@NOTES
@SEE
-rowcount, colcount, row, col, ndims
+rows, columns, row, col, ndims
*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java 2009-02-01 17:36:26 UTC (rev 820)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java 2009-02-01 17:37:46 UTC (rev 821)
@@ -69,7 +69,7 @@
</programlisting>
@SEE
-double, int16, int8, uint16, uint32, uint64
+double, int16, int8, uint16, uint32
*/
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|