mathlib-commitlog Mailing List for JMathLib - Octave, Matlab clone in java (Page 6)
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-26 19:52:33
|
Revision: 785
http://mathlib.svn.sourceforge.net/mathlib/?rev=785&view=rev
Author: st_mueller
Date: 2009-01-26 19:52:31 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
renamed MathLibException into JMathLibException
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/general/testGlobal.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/general/testGlobal.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/general/testGlobal.java 2009-01-26 19:52:01 UTC (rev 784)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/general/testGlobal.java 2009-01-26 19:52:31 UTC (rev 785)
@@ -72,7 +72,7 @@
doit = funcParser.parseFunction(b.toString());
doit.evaluate(null, ml.globals);
}
- catch (MathLibException ex) {
+ catch (JMathLibException ex) {
exCaught = true;
}
assertTrue(exCaught);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-26 19:52:04
|
Revision: 784
http://mathlib.svn.sourceforge.net/mathlib/?rev=784&view=rev
Author: st_mueller
Date: 2009-01-26 19:52:01 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
renamed MathLibException into JMathLibException
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java
JMathLib/trunk/src/jmathlib/core/interpreter/Interpreter.java
JMathLib/trunk/src/jmathlib/core/interpreter/LexicalAnalyser.java
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/core/interpreter/JMathLibException.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java 2009-01-26 19:49:18 UTC (rev 783)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java 2009-01-26 19:52:01 UTC (rev 784)
@@ -26,7 +26,7 @@
public static void throwMathLibException(int errorCode)
{
String text = getErrorText(errorCode);
- throw (new MathLibException(text));
+ throw (new JMathLibException(text));
}
@@ -36,7 +36,7 @@
@param errorCode = the error message*/
public static void throwMathLibException(String errorMessage)
{
- throw (new MathLibException("ERROR: "+errorMessage));
+ throw (new JMathLibException("ERROR: "+errorMessage));
}
/**
@@ -46,7 +46,7 @@
*/
public static void throwParserException(String errorMessage)
{
- throw (new MathLibException("PARSER: "+errorMessage));
+ throw (new JMathLibException("PARSER: "+errorMessage));
}
@@ -57,7 +57,7 @@
*/
public static void throwUsageException(String errorMessage)
{
- throw (new MathLibException("USAGE: "+errorMessage));
+ throw (new JMathLibException("USAGE: "+errorMessage));
}
/**returns the localised error string for a specific code,
@@ -68,7 +68,7 @@
public static String getErrorText(int errorCode, Object[] params)
{
String text = "";
- ResourceBundle bundle = ResourceBundle.getBundle("MathLib.ResourceBundles.ErrorBundle");
+ ResourceBundle bundle = ResourceBundle.getBundle("jmathlib.resourcebundles.ErrorBundle");
text = MessageFormat.format(bundle.getString(Integer.toString(errorCode)), params);
return text;
@@ -81,7 +81,7 @@
public static void throwMathLibException(int errorCode, Object[] params)
{
String text = getErrorText(errorCode, params);
- throw (new MathLibException(text));
+ throw (new JMathLibException(text));
}
}
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Interpreter.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Interpreter.java 2009-01-26 19:49:18 UTC (rev 783)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Interpreter.java 2009-01-26 19:52:01 UTC (rev 784)
@@ -132,7 +132,7 @@
//getVariables().listVariables();
}
- catch(MathLibException e)
+ catch(JMathLibException e)
{
answer = e.getMessage();
Copied: JMathLib/trunk/src/jmathlib/core/interpreter/JMathLibException.java (from rev 413, JMathLib/trunk/src/jmathlib/core/interpreter/MathLibException.java)
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/JMathLibException.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/JMathLibException.java 2009-01-26 19:52:01 UTC (rev 784)
@@ -0,0 +1,31 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2002-2009
+ */
+
+
+package jmathlib.core.interpreter;
+
+/**MathLib specific exception */
+public class JMathLibException extends ArithmeticException
+{
+ /**Create a new exception object*/
+ public JMathLibException()
+ {
+
+ }
+
+ /**Set the message text
+ * @param text = the text to display
+ */
+ public JMathLibException(String text)
+ {
+ super(text);
+ }
+
+
+}
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/LexicalAnalyser.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/LexicalAnalyser.java 2009-01-26 19:49:18 UTC (rev 783)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/LexicalAnalyser.java 2009-01-26 19:52:01 UTC (rev 784)
@@ -220,7 +220,7 @@
For each character it calls a series of functions until it
finds one that can handle the character
@return the next token contained within the expression string */
- private boolean scanNextToken() throws MathLibException
+ private boolean scanNextToken() throws JMathLibException
{
negative = false; // reset sign indicator
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-26 19:49:22
|
Revision: 783
http://mathlib.svn.sourceforge.net/mathlib/?rev=783&view=rev
Author: st_mueller
Date: 2009-01-26 19:49:18 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
added more comments
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/Context.java
JMathLib/trunk/src/jmathlib/core/interpreter/ContextList.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Context.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Context.java 2009-01-26 19:47:27 UTC (rev 782)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Context.java 2009-01-26 19:49:18 UTC (rev 783)
@@ -1,6 +1,14 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2002-2009
+ */
+
package jmathlib.core.interpreter;
-//import MathLib.Tokens.*;
/**A context object contains the variables and code for the executing function*/
public class Context implements java.io.Serializable
@@ -11,8 +19,6 @@
/**Reference to the contexts calling context*/
private Context parent;
- /**The name of the function that defined this context, used for diagnostics*/
- //private String functionName;
/**Create a Context with an empty variable list, used to construct the global context*/
public Context()
@@ -22,8 +28,9 @@
}
/**Create a Context with the supplied values
- @param _variables = the variable list of the new context
- @param _parent = the calling context*/
+ * @param _variables = the variable list of the new context
+ * @param _parent = the calling context
+ */
public Context(VariableList _variables, Context _parent)
{
variables = _variables;
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/ContextList.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/ContextList.java 2009-01-26 19:47:27 UTC (rev 782)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/ContextList.java 2009-01-26 19:49:18 UTC (rev 783)
@@ -1,3 +1,12 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2002-2009
+ */
+
package jmathlib.core.interpreter;
import jmathlib.core.tokens.OperandToken;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-26 19:47:31
|
Revision: 782
http://mathlib.svn.sourceforge.net/mathlib/?rev=782&view=rev
Author: st_mueller
Date: 2009-01-26 19:47:27 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
removed debug output
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/Parser.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Parser.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Parser.java 2009-01-25 22:23:40 UTC (rev 781)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Parser.java 2009-01-26 19:47:27 UTC (rev 782)
@@ -1506,15 +1506,14 @@
boolean numberIndicatorB = false; //
boolean singleIndicatorB = false; //
boolean imagIndicatorB = false; //
- System.out.println("*+*");
+
// remove spaces between "[" and first element (e.g. [ 2,3] -> [2,3]
while (isExpectedDelimiter(peekNextToken(MATRIX), ' '))
getNextToken();
- System.out.println("*++*");
+
// parse code of matrices (e.g. [1,2,3;4,5,6] or [1 sin(2) 3; 4 5+1 a]
while(!endMatrix)
{
- System.out.println("**");
// get next parameter (whitespaces are treated as delimiter, too)
OperandToken nextParameter = parseArithExpression(MATRIX);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 22:23:54
|
Revision: 781
http://mathlib.svn.sourceforge.net/mathlib/?rev=781&view=rev
Author: st_mueller
Date: 2009-01-25 22:23:40 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/ui/swing/AutoCompletion.java
JMathLib/trunk/src/jmathlib/ui/swing/SearchPathSelection.java
JMathLib/trunk/src/jmathlib/ui/swing/WorkingDirectoryPanel.java
Modified: JMathLib/trunk/src/jmathlib/ui/swing/AutoCompletion.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/swing/AutoCompletion.java 2009-01-25 22:18:57 UTC (rev 780)
+++ JMathLib/trunk/src/jmathlib/ui/swing/AutoCompletion.java 2009-01-25 22:23:40 UTC (rev 781)
@@ -41,7 +41,7 @@
i++;
}
- KeyHandler.runningReference.interpreter.getFunctionManager().clearCustomFunctionLoaders();
+ KeyHandler.runningReference.interpreter.globals.getFunctionManager().clearCustomFunctionLoaders();
s = System.getProperty("AUTOCOMP_SEARCH_DIRS");
st = new StringTokenizer(s," ");
String[] fileDirectories = new String[st.countTokens()];
@@ -96,7 +96,7 @@
{
try
{
- KeyHandler.runningReference.interpreter.getFunctionManager().addFunctionLoader(new FileFunctionLoader(fa[i].getCanonicalFile(), false));
+ KeyHandler.runningReference.interpreter.globals.getFunctionManager().addFunctionLoader(new FileFunctionLoader(fa[i].getCanonicalFile(), false));
}
catch (IOException ioe) { ; }
}
Modified: JMathLib/trunk/src/jmathlib/ui/swing/SearchPathSelection.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/swing/SearchPathSelection.java 2009-01-25 22:18:57 UTC (rev 780)
+++ JMathLib/trunk/src/jmathlib/ui/swing/SearchPathSelection.java 2009-01-25 22:23:40 UTC (rev 781)
@@ -67,7 +67,7 @@
*/
public static void showPathSelectionDialog(Component container) {
SearchPathSelection p = new SearchPathSelection();
- FunctionManager fm = KeyHandler.runningReference.interpreter.getFunctionManager();
+ FunctionManager fm = KeyHandler.runningReference.interpreter.globals.getFunctionManager();
for (int i = 0; i < fm.getFunctionLoaderCount(); i++) {
FunctionLoader fl = fm.getFunctionLoader(i);
if (fl instanceof FileFunctionLoader) {
Modified: JMathLib/trunk/src/jmathlib/ui/swing/WorkingDirectoryPanel.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/swing/WorkingDirectoryPanel.java 2009-01-25 22:18:57 UTC (rev 780)
+++ JMathLib/trunk/src/jmathlib/ui/swing/WorkingDirectoryPanel.java 2009-01-25 22:23:40 UTC (rev 781)
@@ -23,7 +23,7 @@
public WorkingDirectoryPanel() {
initialiseGUI();
registerListeners();
- File cwd = KeyHandler.runningReference.interpreter.getFunctionManager().getWorkingDirectory();
+ File cwd = KeyHandler.runningReference.interpreter.globals.getFunctionManager().getWorkingDirectory();
if (cwd != null) {
setWorkingDirectory(cwd, false);
}
@@ -195,7 +195,7 @@
}
//Set the working directory in Mathlib (to find function files)
- KeyHandler.runningReference.interpreter.getFunctionManager().setWorkingDirectory(dir);
+ KeyHandler.runningReference.interpreter.globals.getFunctionManager().setWorkingDirectory(dir);
//Update the list view (ie files in the current working directory)
updateFileList(dir);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 22:19:01
|
Revision: 780
http://mathlib.svn.sourceforge.net/mathlib/?rev=780&view=rev
Author: st_mueller
Date: 2009-01-25 22:18:57 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/Interpreter.java
JMathLib/trunk/src/jmathlib/core/interpreter/Variable.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Interpreter.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Interpreter.java 2009-01-25 21:03:22 UTC (rev 779)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Interpreter.java 2009-01-25 22:18:57 UTC (rev 780)
@@ -54,6 +54,8 @@
// all expressions for access to function manager, variable lists, contexts,...
globals = new GlobalValues(this, runningStandalone, _applet);;
+ // set output panel to NULL
+ // ?? needed? outputPanel is initialized with NULl anyway (see above)
outputPanel = null;
// read preferences from a file on the disc or on the web
@@ -111,9 +113,7 @@
// if required rehash m-files
if(runningStandalone)
- {
globals.getFunctionManager().checkAndRehashTimeStamps();
- }
try
{
@@ -167,6 +167,7 @@
var.assign(new CharToken(answer));
}
+ ErrorLogger.debugLine("Interpreter: done");
return answer;
}
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Variable.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Variable.java 2009-01-25 21:03:22 UTC (rev 779)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Variable.java 2009-01-25 22:18:57 UTC (rev 780)
@@ -5,16 +5,16 @@
/**class for binding a variable name to some data*/
public class Variable extends RootObject
{
- /**The variable name*/
+ /**variable name*/
private String name;
- /**Variable data*/
+ /**variable data*/
private OperandToken data;
- // local or global context
+ /** local or global context */
private boolean globalB = false;
- /**Default constructor*/
+ /**default constructor*/
public Variable()
{
super();
@@ -22,7 +22,8 @@
data = null;
}
- /**constructor containing a variable name*/
+ /**constructor containing a variable name
+ * @param _name*/
public Variable(String _name)
{
super();
@@ -30,7 +31,9 @@
data = null;
}
- /**constructor containing the variables name and data*/
+ /**constructor containing the variables name and data
+ * @param _name
+ * @param _data*/
public Variable(String _name, OperandToken _data)
{
super();
@@ -51,8 +54,10 @@
//}
}
- /**Assign a new value to the variable*/
- //public OperandToken assign(Token _data)
+ /**Assign a new value to the variable
+ * @param _data
+ * @return
+ */
public OperandToken assign(OperandToken _data)
{
if (_data!=null)
@@ -86,9 +91,12 @@
return equal;
}
- /**Converts the variable to a string.*/
+ /**Converts the variable to a string.
+ * @return
+ */
public String toString()
{
+ //Errors.throwMathLibException("Variable");
if(data == null)
return null;
else
@@ -107,7 +115,9 @@
return name;
}
- /**Returns the variables data*/
+ /**Returns the variables data
+ * @return
+ */
public OperandToken getData()
{
return data;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 21:03:26
|
Revision: 779
http://mathlib.svn.sourceforge.net/mathlib/?rev=779&view=rev
Author: st_mueller
Date: 2009-01-25 21:03:22 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/ContextList.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/ContextList.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/ContextList.java 2009-01-25 21:02:24 UTC (rev 778)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/ContextList.java 2009-01-25 21:03:22 UTC (rev 779)
@@ -99,7 +99,7 @@
{
// variable is local only
// return data from current context
- return localContext.getVariables().getVariable(name);
+ return var;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 21:02:25
|
Revision: 778
http://mathlib.svn.sourceforge.net/mathlib/?rev=778&view=rev
Author: st_mueller
Date: 2009-01-25 21:02:24 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java 2009-01-25 21:01:47 UTC (rev 777)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java 2009-01-25 21:02:24 UTC (rev 778)
@@ -11,6 +11,7 @@
jmathlib.core.constants.ErrorCodes,
jmathlib.core.constants.TokenConstants
{
+
/**
*
*/
@@ -18,14 +19,6 @@
{
}
- /**Convert the object into a string
- * @param
- */
- public String toString()
- {
- return "";
- }
-
/**Converts the object to a string based on the operand list
* @param operands = operands for the expression
*/
@@ -33,7 +26,6 @@
{
return "root object";
}
-
/**Duplicates the object by serialising it to a piped stream then reading it back into
* the new object
@@ -74,9 +66,9 @@
}
catch(java.io.IOException except)
{
+ except.printStackTrace();
ErrorLogger.debugLine("RootObject: IO exception");
ErrorLogger.debugLine(except.getMessage());
- //except.printStackTrace();
}
catch(java.lang.ClassNotFoundException except)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 21:01:49
|
Revision: 777
http://mathlib.svn.sourceforge.net/mathlib/?rev=777&view=rev
Author: st_mueller
Date: 2009-01-25 21:01:47 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/AssignmentOperatorToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/AssignmentOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/AssignmentOperatorToken.java 2009-01-25 21:01:09 UTC (rev 776)
+++ JMathLib/trunk/src/jmathlib/core/tokens/AssignmentOperatorToken.java 2009-01-25 21:01:47 UTC (rev 777)
@@ -99,7 +99,7 @@
// clone limits functions/values to preserve for future evalutation
ops[0] = left.getData();
ops[1] = right;
- ops[2] = ((OperandToken)limits[0].clone());
+ ops[2] = (OperandToken)limits[0].clone();
ops[2] = ops[2].evaluate(null, globals);
if (limitsLength==2)
@@ -128,7 +128,7 @@
{
ErrorLogger.debugLine("AssignmentOperatorToken: displayResult");
if ((right!=null))
- globals.getInterpreter().displayText(left.getName() +" = "+ right.toString());
+ globals.getInterpreter().displayText(left.getName() +" = "+ right.toString(globals));
else
globals.getInterpreter().displayText(left.getName() +" = []");
}
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2009-01-25 21:01:09 UTC (rev 776)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2009-01-25 21:01:47 UTC (rev 777)
@@ -682,7 +682,7 @@
else if (Double.isNaN(re))
result.append("NaN");
else
- //result.append(globals.getNumberFormat().format(re));
+ //result.append(getNumberFormat().format(re));
result.append(numFormat.format(re));
//stefan
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 21:01:14
|
Revision: 776
http://mathlib.svn.sourceforge.net/mathlib/?rev=776&view=rev
Author: st_mueller
Date: 2009-01-25 21:01:09 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/VariableToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/VariableToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/VariableToken.java 2009-01-25 21:00:19 UTC (rev 775)
+++ JMathLib/trunk/src/jmathlib/core/tokens/VariableToken.java 2009-01-25 21:01:09 UTC (rev 776)
@@ -25,8 +25,7 @@
/**Boolean indicator if limits are active */
private boolean limitSwitch = false;
- /** true if e.g. a{8}...
- * */
+ /** true if e.g. a{8}... */
private boolean cellB = false;
/**constructor containing the variables name
@@ -133,10 +132,11 @@
/**@return the value of the data held within the variable
if the variable has not been inisitalised then it returns the variable*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
ErrorLogger.debugLine("VariableToken: eval: " + name);
-
+ //ErrorLogger.debugLine("VariableToken: evalG: " + globals);
+
// Check if variable is defined (in object storage)
if(fieldName != null)
{
@@ -148,10 +148,10 @@
//else
//{
ErrorLogger.debugLine("VariableToken: " + name + "getting field " + fieldName);
- return ((MathLibObject)getVariable(name).getData()).getFieldData(fieldName);
+ return ((MathLibObject)globals.getVariable(name).getData()).getFieldData(fieldName);
//}
}
- else if( getVariable(name) == null )
+ else if( globals.getVariable(name) == null )
{
// variable is not yet defined (e.g. user typed sin(a) and "a" is unknown)
// or it is a function
@@ -172,7 +172,7 @@
// If it is not a variable maybe it's a function or script-file
FunctionToken function = new FunctionToken(name, limitTokens);
function.setOperands(new OperandToken[] {});
- OperandToken retValue = function.evaluate(null);
+ OperandToken retValue = function.evaluate(null, globals);
// if the "function" is really a script it won't return anything
if (function.isScript())
@@ -196,12 +196,12 @@
// variable is defined already/now
// get data of variable
- OperandToken variableData = getVariable(name).getData();
+ OperandToken variableData = globals.getVariable(name).getData();
// check if data is available
if(variableData != null)
{
- ErrorLogger.debugLine("Variable data = " + variableData.toString());
+ ErrorLogger.debugLine("VariableToken data = " + variableData.toString());
// clone data so that original values are not changed
variableData = ((OperandToken)variableData.clone());
@@ -219,7 +219,7 @@
//ErrorLogger.debugLine(i);
// clone limits functions/values to preserve for future evalutation
opTok[i+1] = ((OperandToken)limitTokens[i].clone());
- opTok[i+1] = opTok[i+1].evaluate(null);
+ opTok[i+1] = opTok[i+1].evaluate(null, globals);
if (opTok[i+1] != null)
ErrorLogger.debugLine("VariableToken: eval: toString("+i+") "+opTok[i+1].toString());
@@ -234,14 +234,14 @@
}
// create instance of external function SubMatix and compute submatrix
- result = subM.evaluate(opTok);
+ result = subM.evaluate(opTok, globals);
}
/* display the result of this variable in the user console*/
if (isDisplayResult())
- getInterpreter().displayText(name +" = "+ result.toString());
-
+ globals.getInterpreter().displayText(name +" = "+ result.toString(globals));
+
return result;
}
else
@@ -250,7 +250,7 @@
// display the result of this variable in the user console
if (isDisplayResult())
- getInterpreter().displayText(name +" = []");
+ globals.getInterpreter().displayText(name +" = []");
return null;
}
@@ -297,14 +297,14 @@
}
/**return the data of the variable*/
- public OperandToken getData()
+/* public OperandToken getData()
{
if(fieldName == null)
return getVariable(name).getData();
else
return ((MathLibObject)getVariable(name).getData()).getFieldData(fieldName);
}
-
+*/
public boolean equals(Object obj)
{
if(obj instanceof VariableToken)
@@ -319,7 +319,7 @@
/**Checks if this operand is a numeric value
@return true if this is a number, false if it's
an algebraic expression*/
- public boolean isNumeric()
+/* public boolean isNumeric()
{
boolean numeric = false;
OperandToken data = null;
@@ -330,6 +330,7 @@
return numeric;
}
+ */
/**
* check if variable is a struct
@@ -354,13 +355,13 @@
}
/**get the variable that this token references*/
- public Variable getVariable()
+ public Variable getVariable(GlobalValues globals)
{
if(fieldName == null)
- return getVariable(name);
+ return globals.getVariable(name);
- if(getVariable(name)!=null)
- return ((MathLibObject)getVariable(name).getData()).getFieldVariable(fieldName);
+ if(globals.getVariable(name)!=null)
+ return ((MathLibObject)globals.getVariable(name).getData()).getFieldVariable(fieldName);
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-25 21:00:26
|
Revision: 775
http://mathlib.svn.sourceforge.net/mathlib/?rev=775&view=rev
Author: st_mueller
Date: 2009-01-25 21:00:19 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/Expression.java
JMathLib/trunk/src/jmathlib/core/tokens/NumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/Token.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/Expression.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/Expression.java 2009-01-25 19:29:11 UTC (rev 774)
+++ JMathLib/trunk/src/jmathlib/core/tokens/Expression.java 2009-01-25 21:00:19 UTC (rev 775)
@@ -13,7 +13,7 @@
/**The number of operands*/
private int noChildren = 0;
- /*the operator being held within the node*/
+ /**the operator being held within the node*/
private OperatorToken data;
/**Stores the index of the child being executed*/
@@ -24,14 +24,14 @@
{
super(50);// , "EXPRESSION");
data = null;
- children = null; //new OperandToken[5];
+ children = null;
}
/**Creates an expression with no operands
@param _data = the expressions operator*/
public Expression(OperatorToken _data)
{
- super(50); //, "EXPRESSION");
+ super(50);
data = _data;
children = null;
}
@@ -41,7 +41,7 @@
@param operand = the expressions operand*/
public Expression(OperatorToken _data, OperandToken operand)
{
- super(50); //, "EXPRESSION");
+ super(50);
data = _data;
children = new OperandToken[1];
children[0] = operand;
@@ -54,7 +54,7 @@
@param right = the right hand operand*/
public Expression(OperatorToken _data, OperandToken left, OperandToken right)
{
- super(50); //, "EXPRESSION");
+ super(50);
data = _data;
children = new OperandToken[2];
children[0] = left;
@@ -86,7 +86,7 @@
@param _noChildren = the number of operands*/
public Expression(OperatorToken _data, OperandToken[] _children, int _noChildren)
{
- super(50); //, "EXPRESSION");
+ super(50);
data = _data;
children = _children;
noChildren = _noChildren;
@@ -201,7 +201,7 @@
/**evaluate the data item held within this node
@param ops = the expressions operands
@return the result of the expression as an OperandToken*/
- public OperandToken evaluate(Token[] ops)
+ public OperandToken evaluate(Token[] ops, GlobalValues globals)
{
OperandToken result = null;
ErrorLogger.debugLine("Expression: evaluate " + toString());
@@ -232,7 +232,7 @@
}
// evaluate right-hand argument (e.g. a= 2+3)
- children[1] = right.evaluate(null);
+ children[1] = right.evaluate(null, globals);
//check LEFT side for submatrices (e.g. a(1,:) = [1,2,3] )
if (left instanceof FunctionToken)
@@ -250,7 +250,7 @@
}
}
else if(data instanceof UnaryOperatorToken && (((UnaryOperatorToken)data).getValue() == '+' ||
- ((UnaryOperatorToken)data).getValue() == '-' ) )
+ ((UnaryOperatorToken)data).getValue() == '-' ) )
{
//!!! is this line really necessary !!!!???
//do nothing
@@ -269,11 +269,14 @@
{
if(children[i] != null)
{
+ ErrorLogger.debugLine("Expression: child: "+children[i].toString());
+ //ErrorLogger.debugLine("Expression: globals: "+globals);
+
// check if result should be displayed
dispB = children[i].isDisplayResult();
// evaluate children
- children[i] = children[i].evaluate(null);
+ children[i] = children[i].evaluate(null, globals);
// check if result should be displayed before
if (dispB && children[i]!=null)
@@ -292,14 +295,12 @@
data.setDisplayResult(true);
// evaluate expression
- result = data.evaluate(children);
+ result = data.evaluate(children, globals);
/* set the display state of the result, if the original expression
also has the display state set */
if (isDisplayResult() && (result != null))
- {
result.setDisplayResult(true);
- }
}
else
{
@@ -314,16 +315,16 @@
if (children[i]!=null)
{
ErrorLogger.debugLine("Expression: store ans "+children[i].toString());
- Variable answervar = createVariable("ans");
+ Variable answervar = globals.createVariable("ans");
answervar.assign(children[i]);
}
/* display the result this expression in the user console*/
- if ((children[i] != null) &&
- children[i].isDisplayResult() )
+ if ((children[i] != null) &&
+ children[i].isDisplayResult() )
{
//ErrorLogger.debugLine("Expression: !!!!!!!!! showResult");
- getInterpreter().displayText(" ans = "+ children[i].toString());
+ globals.getInterpreter().displayText(" ans = "+ children[i].toString(globals));
}
}
}
@@ -338,7 +339,7 @@
String result = "";
if (data != null)
{
- result = (data).toString(children);
+ result = data.toString(children);
}
else
{
@@ -352,40 +353,6 @@
return result;
}
-
- /**Performs a multiplication
- @param argument = the value to multiply the expression by
- @return the result as an OperandToken*/
- /*public OperandToken multiply(OperandToken argument)
- {
- return null;
- }
- */
- /**Raise this object to the power of arg
- @param = the value to raise it to the power of
- @return the result as an OperandToken*/
- /*public OperandToken powerOf(OperandToken argument)
- {
- return null;
- }*/
-
- /**add this token to another
- @param arg = the amount to add to it
- @return the result as an OperandToken*/
- /*public OperandToken add(OperandToken argument)
- {
- return null;
- }
- */
-
- /**subtract this token from another
- @param arg = the amount to subtract from it
- @return the result as an OperandToken*/
- /*public OperandToken subtract(OperandToken argument)
- {
- return null;
- }*/
-
/**Builds an expression tree
@param op = the expressions operator
@param left = the left hand operand
Modified: JMathLib/trunk/src/jmathlib/core/tokens/NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/NumberToken.java 2009-01-25 19:29:11 UTC (rev 774)
+++ JMathLib/trunk/src/jmathlib/core/tokens/NumberToken.java 2009-01-25 21:00:19 UTC (rev 775)
@@ -18,7 +18,7 @@
* 2
* 4 */
/**stores the number format for displaying the number*/
- protected static NumberFormat numFormat = NumberFormat.getInstance();
+ protected /*static*/ NumberFormat numFormat = NumberFormat.getInstance();
/**Index for real values within array*/
protected static final int REAL = 0;
@@ -38,6 +38,22 @@
}
/**
+ *
+ * @return
+ */
+ /* protected NumberFormat getNumberFormat()
+ {
+ if (globals==null)
+ ErrorLogger.debugLine("NumberToken: numberFormat: null");
+
+ if (globals!=null)
+ return globals.getNumberFormat();
+ else
+ return NumberFormat.getInstance();
+ }
+ */
+
+ /**
* Convert y,x points to element number n
* @param y
* @param x
@@ -117,6 +133,7 @@
/**Evaluate the token. This causes it to return itself*/
public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
+ ErrorLogger.debugLine("NumberToken: eval");
return this;
}
@@ -148,5 +165,15 @@
return null;
}
+ /**
+ *
+ */
+ public String toString(GlobalValues globals)
+ {
+ ErrorLogger.debugLine("NumberToken: toString(globals)");
+ numFormat = globals.getNumberFormat();
+ return toString();
+ }
+
} // end NumberToken
Modified: JMathLib/trunk/src/jmathlib/core/tokens/Token.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/Token.java 2009-01-25 19:29:11 UTC (rev 774)
+++ JMathLib/trunk/src/jmathlib/core/tokens/Token.java 2009-01-25 21:00:19 UTC (rev 775)
@@ -41,6 +41,16 @@
*/
abstract public String toString();
+ /**
+ *
+ * @param globals
+ * @return
+ */
+ public String toString(GlobalValues globals)
+ {
+ return toString();
+ }
+
/**Converts the token to its MathML representation. At the moment this is unimplemented and just
converts the token into a string*/
public String toMathMlString(OperandToken[] operands)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 19:29:12
|
Revision: 774
http://mathlib.svn.sourceforge.net/mathlib/?rev=774&view=rev
Author: st_mueller
Date: 2009-01-25 19:29:11 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/core/interpreter/testInterpreter.java
Modified: JMathLib/trunk/src/jmathlibtests/core/interpreter/testInterpreter.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/core/interpreter/testInterpreter.java 2009-01-25 19:28:55 UTC (rev 773)
+++ JMathLib/trunk/src/jmathlibtests/core/interpreter/testInterpreter.java 2009-01-25 19:29:11 UTC (rev 774)
@@ -85,7 +85,8 @@
}
public void testAccessMethods11() {
double[][] dr = {{1.0, 2.0, 1.0},{3.0, 4.0, 5.0}};
- ml.executeExpression("d=[1,2,1\n3,4,5]");
+ ml.executeExpression("setdebug(1)");
+ ml.executeExpression("d=[1,2,1\n3,4,5]");
assertTrue(Compare.ArrayEquals(dr, ml.getArrayValueRe("d")));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 19:29:04
|
Revision: 773
http://mathlib.svn.sourceforge.net/mathlib/?rev=773&view=rev
Author: st_mueller
Date: 2009-01-25 19:28:55 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
bugfix: correction of 'adf'+888 let to some error with disp('asdf'+5) -> disp(['asdf' num2str(5)])
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/core/tokens/testCharToken.java
Modified: JMathLib/trunk/src/jmathlibtests/core/tokens/testCharToken.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/core/tokens/testCharToken.java 2009-01-25 08:01:50 UTC (rev 772)
+++ JMathLib/trunk/src/jmathlibtests/core/tokens/testCharToken.java 2009-01-25 19:28:55 UTC (rev 773)
@@ -49,7 +49,7 @@
{
CharToken expectedResult = new CharToken("A String1");
Token actualResult = string1.add(number);
- assertEquals(expectedResult.toString(), actualResult.toString());
+ assertEquals(" [66 , 33 , 84 , 117 , 115 , 106 , 111 , 104]\n", actualResult.toString());
}
public void testCharToken003() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 08:01:59
|
Revision: 772
http://mathlib.svn.sourceforge.net/mathlib/?rev=772&view=rev
Author: st_mueller
Date: 2009-01-25 08:01:50 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/WhileOperatorToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/WhileOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/WhileOperatorToken.java 2009-01-25 07:59:07 UTC (rev 771)
+++ JMathLib/trunk/src/jmathlib/core/tokens/WhileOperatorToken.java 2009-01-25 08:01:50 UTC (rev 772)
@@ -7,7 +7,6 @@
/**Used to implement if-then-else operations within an expression*/
public class WhileOperatorToken extends CommandToken
{
-
/**condition */
OperandToken whileRelation;
@@ -15,19 +14,21 @@
OperandToken whileCode;
/**Constructor setting the whileRelation and whileCode
- @param _whileRelation = the test relationship
- @param _whileCode = the code to execute while the test is true*/
+ * @param _whileRelation = the test relationship
+ * @param _whileCode = the code to execute while the test is true
+ */
public WhileOperatorToken(OperandToken _whileRelation, OperandToken _whileCode)
{
whileRelation = _whileRelation;
whileCode = _whileCode;
}
-
/**evaluates the operator
- @param operands = the tokens parameters (not used)
- @return the result as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ * @param operands = the tokens parameters (not used)
+ * @param globals
+ * @return the result as an OperandToken
+ * */
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
ErrorLogger.debugLine("Parser: While: evaluate");
@@ -37,7 +38,7 @@
// Check condition of while(...)
OperandToken relationLine = ((OperandToken)whileRelation.clone());
ErrorLogger.debugLine("line = " + relationLine.toString());
- OperandToken result = relationLine.evaluate(null);
+ OperandToken result = relationLine.evaluate(null, globals);
if (result instanceof DoubleNumberToken)
{
@@ -72,7 +73,7 @@
{
OperandToken codeLine = ((OperandToken)whileCode.clone());
ErrorLogger.debugLine("Parser: while number is true");
- code = codeLine.evaluate(null);
+ code = codeLine.evaluate(null, globals);
}
}
else if (result instanceof LogicalToken)
@@ -88,7 +89,7 @@
{
OperandToken codeLine = ((OperandToken)whileCode.clone());
ErrorLogger.debugLine("Parser: while boolean is true");
- code = codeLine.evaluate(null);
+ code = codeLine.evaluate(null, globals);
}
}
@@ -100,12 +101,12 @@
return null;
}
-
- /**@return the operator as a string*/
+ /**
+ * @return the operator as a string
+ */
public String toString()
{
return "while";
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 07:59:11
|
Revision: 771
http://mathlib.svn.sourceforge.net/mathlib/?rev=771&view=rev
Author: st_mueller
Date: 2009-01-25 07:59:07 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/MatrixToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/MatrixToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/MatrixToken.java 2009-01-25 07:58:29 UTC (rev 770)
+++ JMathLib/trunk/src/jmathlib/core/tokens/MatrixToken.java 2009-01-25 07:59:07 UTC (rev 771)
@@ -10,7 +10,7 @@
/**The values of the matrix (array)*/
OperandToken value[][];
-
+ /** type of matrix */
private int typeOfMatrix; // 0 = numeric array
// 1 = cell array
@@ -45,7 +45,7 @@
/**evaluate function - just returns the object itself
@param operands = the matrices operands (not used)
@return the matrix token itself*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
ErrorLogger.debugLine("Matrix evaluate size: "+sizeY+" "+sizeX);
@@ -70,7 +70,7 @@
{
//if (value[yy][xx] != null) // maybe not necessary
//{
- value[yy][xx] = value[yy][xx].evaluate(null);
+ value[yy][xx] = value[yy][xx].evaluate(null, globals);
// Check if value[yy][xx] is array of number tokens
// e.g.: [1,2,[3,4],5]
@@ -260,7 +260,7 @@
/**multiply arg by this object for a number token
@param arg = the amount to multiply the matrix by
@return the result as an OperandToken*/
- public OperandToken multiply(OperandToken arg)
+ /* public OperandToken multiply(OperandToken arg)
{
int y = value.length;
@@ -268,7 +268,7 @@
ErrorLogger.debugLine("matrix multiply dimension "+y+" "+x);
- /* Multiply every single element of the matrix */
+ // Multiply every single element of the matrix
for (int yy=0; yy<y; yy++)
{
for (int xx=0; xx<x; xx++)
@@ -286,7 +286,7 @@
ErrorLogger.debugLine("Matrix multiply variable "+value[yy][xx].toString()+" "+argument.toString());
value[yy][xx] = new Expression(new MulDivOperatorToken('*'), value[yy][xx], argument);
ErrorLogger.debugLine("mt1");
- value[yy][xx] = value[yy][xx].evaluate(null);
+ //stefan value[yy][xx] = value[yy][xx].evaluate(null, globals);
ErrorLogger.debugLine("mt2");
//value[yy][xx] = value[yy][xx].multiply(arg);
ErrorLogger.debugLine("mt3");
@@ -305,25 +305,25 @@
MatrixToken retvalue = new MatrixToken(value);
//retvalue = retvalue.evaluate(null);
- return retvalue.evaluate(null);
+ return retvalue; //stefan retvalue.evaluate(null, globals);
}
+*/
-
/**add arg to this object for a number token
@param arg = the amount to add to the matrix
@return the result as an OperandToken*/
- public OperandToken add(OperandToken arg)
+ /* public OperandToken add(OperandToken arg)
{
ErrorLogger.debugLine("matrix add");
//if(arg instanceof VariableToken)
//return arg;
- /* left argument */
+ // left argument
int y1 = value.length;
int x1 = value[0].length;
- /* right argument */
+ // right argument
OperandToken value2[][] = ((MatrixToken)arg).getValue();
int y2 = value2.length;
int x2 = value2[0].length;
@@ -351,7 +351,7 @@
ErrorLogger.debugLine("Matrix add Expressions");
value[yy][xx] = new Expression(new AddSubOperatorToken('+'), left, right);
- value[yy][xx] = value[yy][xx].evaluate(null);
+ //stefam value[yy][xx] = value[yy][xx].evaluate(null, globals);
}
ErrorLogger.debugLine("Matrix add to String "+value[yy][xx].toString());
@@ -360,8 +360,8 @@
return new MatrixToken(value);
}
+*/
-
public OperandToken elementAt(int y, int x)
{
return value[y][x];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 07:58:33
|
Revision: 770
http://mathlib.svn.sourceforge.net/mathlib/?rev=770&view=rev
Author: st_mueller
Date: 2009-01-25 07:58:29 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/MathLibObject.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/MathLibObject.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/MathLibObject.java 2009-01-25 07:56:19 UTC (rev 769)
+++ JMathLib/trunk/src/jmathlib/core/tokens/MathLibObject.java 2009-01-25 07:58:29 UTC (rev 770)
@@ -4,8 +4,6 @@
import jmathlib.core.tokens.numbertokens.*;
import java.util.*;
-//import java.util.ArrayList;
-
/** */
public class MathLibObject extends DataToken
{
@@ -102,11 +100,15 @@
/**Evaluates the structure
@return the structure itself*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
return this;
}
+ /**
+ * @param
+ * @return
+ */
public OperandToken add(OperandToken arg)
{
MathLibObject result = new MathLibObject(this);
@@ -135,6 +137,10 @@
return result;
}
+ /**
+ * @param
+ * @return
+ */
public OperandToken subtract(OperandToken arg)
{
MathLibObject result = new MathLibObject(this);
@@ -164,6 +170,10 @@
return result;
}
+ /**
+ * @param arg
+ * @return
+ */
public OperandToken multiply(OperandToken arg)
{
MathLibObject result = new MathLibObject(this);
@@ -192,6 +202,10 @@
return result;
}
+ /**
+ * @param
+ * @return
+ */
public OperandToken divide(OperandToken arg)
{
MathLibObject result = new MathLibObject(this);
@@ -220,6 +234,9 @@
return result;
}
+ /**
+ * @param
+ */
public OperandToken power(OperandToken arg)
{
MathLibObject result = new MathLibObject(this);
@@ -230,345 +247,22 @@
while(argFields.hasNext())
{
- Variable var = ((Variable)((Map.Entry)argFields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = getFieldData(fieldName);
-
- if(data != null)
- {
- result.setField(fieldName, data.power(var.getData()));
- }
- else
- {
- result.setField(fieldName, DoubleNumberToken.zero);
- }
+ Variable var = ((Variable)((Map.Entry)argFields.next()).getValue());
+ String fieldName = var.getName();
+
+ OperandToken data = getFieldData(fieldName);
+
+ if(data != null)
+ {
+ result.setField(fieldName, data.power(var.getData()));
+ }
+ else
+ {
+ result.setField(fieldName, DoubleNumberToken.zero);
+ }
}
}
return result;
}
-
- //unary operations
- /**calculate the factorial
- @return the result as an OperandToken*/
- public OperandToken factorial()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
- result.setField(fieldName, data.factorial());
- }
- return result;
- }
-
- /**trigonometric functions - calculate the sine of this token
- @return the result as an OperandToken*/
- /* public OperandToken sin()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
- result.setField(fieldName, data.sin());
- }
- return result;
- }*/
-
- /**trigonometric functions - calculate the cosine of this token
- @return the result as an OperandToken*/
-/* public OperandToken cos()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
- result.setField(fieldName, data.cos());
- }
- return result;
- }*/
-
- /**trigonometric functions - calculate the tangent of this token
- @return the result as an OperandToken*/
- public OperandToken tan()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.tan());
- }
- return result;
- }
-
- /**trigonometric functions - calculate the arc sine of this token
- @return the result as an OperandToken*/
- public OperandToken asin()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.asin());
- }
- return result;
- }
-
- /**trigonometric functions - calculate the arc cosine of this token
- @return the result as an OperandToken*/
- public OperandToken acos()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.acos());
- }
- return result;
- }
-
- /**trigonometric functions - calculate the arc tangent of this token
- @return the result as an OperandToken*/
- public OperandToken atan()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.atan());
- }
- return result;
- }
-
-
- /**Trigonometric function - calculates the hyperbolic sine
- @return the result as an OperandToken*/
- public OperandToken sinh()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.sinh());
- }
- return result;
- }
-
- /**Trigonometric function - calculates the hyperbolic cosine
- @return the result as an OperandToken*/
- public OperandToken cosh()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.cosh());
- }
- return result;
- }
-
- /**Trigonometric function - calculates the hyperbolic tan
- @return the result as an OperandToken*/
- public OperandToken tanh()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.tanh());
- }
- return result;
- }
-
- /**Trigonometric function - calculates the inverse hyperbolic sine
- @return the result as an OperandToken*/
- /* public OperandToken asinh()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
- result.setField(fieldName, data.asinh());
- }
- return result;
- }*/
-
- /**Trigonometric function - calculates the inverse hyperbolic cosine
- @return the result as an OperandToken*/
- public OperandToken acosh()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.acosh());
- }
- return result;
- }
-
- /**Trigonometric function - calculates the inverse hyperbolic tangent
- @return the result as an OperandToken*/
- public OperandToken atanh()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.atanh());
- }
- return result;
- }
-
- /**Standard functions - calculates the absolute value
- @return the result as an OperandToken*/
- public OperandToken abs()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.abs());
- }
- return result;
- }
-
- /**Standard functions - calculates the exponent
- @return the result as an OperandToken*/
- public OperandToken exp()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.exp());
- }
- return result;
- }
-
- public OperandToken degreesToRadians()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.degreesToRadians());
- }
- return result;
-
- }
-
- public OperandToken radiansToDegrees()
- {
- MathLibObject result = new MathLibObject();
- Iterator fields = getFields();
-
- while(fields.hasNext())
- {
- Variable var = ((Variable)((Map.Entry)fields.next()).getValue());
- String fieldName = var.getName();
-
- OperandToken data = var.getData();
-
-// result.setField(fieldName, data.radiansToDegrees());
- }
- return result;
- }
-
-
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 07:56:23
|
Revision: 769
http://mathlib.svn.sourceforge.net/mathlib/?rev=769&view=rev
Author: st_mueller
Date: 2009-01-25 07:56:19 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/DotOperatorToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/DotOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/DotOperatorToken.java 2009-01-25 07:55:54 UTC (rev 768)
+++ JMathLib/trunk/src/jmathlib/core/tokens/DotOperatorToken.java 2009-01-25 07:56:19 UTC (rev 769)
@@ -12,7 +12,7 @@
}
/**evaluates the operator*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
ErrorLogger.debugLine("DotOperatorToken: evaluate");
@@ -20,7 +20,7 @@
Token left = operands[0];
Token right = operands[1];
- left = left.evaluate(null);
+ left = left.evaluate(null, globals);
// not needed. is done by variable token
// check if left is a variable (e.g. a.abc, where "a" is a structure)
@@ -50,12 +50,12 @@
try
{
//check if a function with this name exists
- if (getFunctionManager().findFunctionByName(name) != null)
+ if (globals.getFunctionManager().findFunctionByName(name) != null)
{
ErrorLogger.debugLine("parser value.function");
FunctionToken func = new FunctionToken(name, (OperandToken)left);
- return func.evaluate(null);
+ return func.evaluate(null, globals);
}
}
catch(Exception e){}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 07:55:58
|
Revision: 768
http://mathlib.svn.sourceforge.net/mathlib/?rev=768&view=rev
Author: st_mueller
Date: 2009-01-25 07:55:54 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/AssignmentOperatorToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/AssignmentOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/AssignmentOperatorToken.java 2009-01-25 07:46:58 UTC (rev 767)
+++ JMathLib/trunk/src/jmathlib/core/tokens/AssignmentOperatorToken.java 2009-01-25 07:55:54 UTC (rev 768)
@@ -1,6 +1,5 @@
package jmathlib.core.tokens;
-import jmathlib.core.interpreter.Variable;
import jmathlib.core.interpreter.*;
import jmathlib.toolbox.jmathlib.matrix.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
@@ -23,7 +22,7 @@
* @param operands = the operators operands
* @return the result as and OperandToken
*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = null;
@@ -40,7 +39,7 @@
// if leftVarTok is of type MathLibObject the next line will return
// a reference to the field values (e.g. a.b)
- Variable left = leftVarTok.getVariable();
+ Variable left = leftVarTok.getVariable(globals);
// check if variable already exists
if (left == null)
@@ -53,32 +52,32 @@
{
// e.g. a{8}=...
ErrorLogger.debugLine("AssignmentOpTok: new cell");
- left = createVariable(name);
+ left = globals.createVariable(name);
left.assign(new CellArrayToken());
}
else if (!leftVarTok.isStruct())
{
// auto create a new variable
- left = createVariable(name);
+ left = globals.createVariable(name);
}
else if (leftVarTok.isStruct() &&
- getVariable(name) == null)
+ globals.getVariable(name) == null)
{
// struct is not created yet
ErrorLogger.debugLine("AssignmentOpTok: new struct: "+name+"."+fieldName);
MathLibObject obj = new MathLibObject();
obj.setField(fieldName, DoubleNumberToken.zero);
- Variable var = createVariable(name );
+ Variable var = globals.createVariable(name );
var.assign(obj);
- left = ((MathLibObject)getVariable(name).getData()).getFieldVariable(fieldName);
+ left = ((MathLibObject)globals.getVariable(name).getData()).getFieldVariable(fieldName);
}
else
{
// struct is already created, but field is missing
// variable is a struct -> auto create new field variable
ErrorLogger.debugLine("AssignmentOpTok: struct new field: "+name+"."+fieldName);
- ((MathLibObject)getVariable(name).getData()).setField(fieldName,DoubleNumberToken.zero);
- left = leftVarTok.getVariable();
+ ((MathLibObject)globals.getVariable(name).getData()).setField(fieldName,DoubleNumberToken.zero);
+ left = leftVarTok.getVariable(globals);
}
}
@@ -101,12 +100,12 @@
ops[0] = left.getData();
ops[1] = right;
ops[2] = ((OperandToken)limits[0].clone());
- ops[2] = ops[2].evaluate(null);
+ ops[2] = ops[2].evaluate(null, globals);
if (limitsLength==2)
{
ops[3] = ((OperandToken)limits[1].clone());
- ops[3] = ops[3].evaluate(null);
+ ops[3] = ops[3].evaluate(null, globals);
}
subassign subA = new subassign();
@@ -118,7 +117,7 @@
}
// create instance of external function SubAssign and compute assignment
- right = subA.evaluate(ops);
+ right = subA.evaluate(ops, globals);
}
result = left.assign(right);
@@ -127,11 +126,11 @@
/* display the result this expression in the user console*/
if (isDisplayResult())
{
- ErrorLogger.debugLine("AssignmentOperatorToken: !!!!!!!!! displayResult");
+ ErrorLogger.debugLine("AssignmentOperatorToken: displayResult");
if ((right!=null))
- getInterpreter().displayText(left.getName() +" = "+ right.toString());
+ globals.getInterpreter().displayText(left.getName() +" = "+ right.toString());
else
- getInterpreter().displayText(left.getName() +" = []");
+ globals.getInterpreter().displayText(left.getName() +" = []");
}
return null;
@@ -139,7 +138,7 @@
else if (operands[0] instanceof Expression)
{
ErrorLogger.debugLine("AssignmentOpTok: eval: Expression *******");
- operands[0] = operands[0].evaluate(null);
+ operands[0] = operands[0].evaluate(null, globals);
//return evaluate(operands);
return null;
}
@@ -156,8 +155,8 @@
|| (left.getSizeY() != 1)
|| (right.getSizeY() != 1) )
{
- ErrorLogger.debugLine("AssignOperatorToken: unequal sizes");
- return null;
+ ErrorLogger.debugLine("AssignOperatorToken: unequal sizes");
+ return null;
}
OperandToken[][] leftOps = left.getValue();
@@ -166,29 +165,31 @@
// assign all right side elements to left side variables
for (int i=0; i<left.getSizeX(); i++)
{
- if (!(leftOps[0][i] instanceof VariableToken)) return null;
- //ErrorLogger.debugLine("AssignOpToken: inst Var..");
-
- if (!(rightOps[0][i] instanceof DoubleNumberToken )) return null;
- //ErrorLogger.debugLine("AssignOpToken: inst Num..");
-
- // get one variable element of left side
- VariableToken varToken = (VariableToken)leftOps[0][i];
- Variable leftVar = getVariable(varToken.getName());
-
- // get number-matrix of an element on the right side
- DoubleNumberToken number = (DoubleNumberToken)rightOps[0][i];
-
- if (leftVar == null)
- {
- ErrorLogger.debugLine("AssignmentOpTok: variable is null");
-
- // create variable
- leftVar = createVariable(varToken.getName() );
- }
-
- // assign right side matrix to left side variable
- result = leftVar.assign(number);
+ if (!(leftOps[0][i] instanceof VariableToken))
+ return null;
+ //ErrorLogger.debugLine("AssignOpToken: inst Var..");
+
+ if (!(rightOps[0][i] instanceof DoubleNumberToken ))
+ return null;
+ //ErrorLogger.debugLine("AssignOpToken: inst Num..");
+
+ // get one variable element of left side
+ VariableToken varToken = (VariableToken)leftOps[0][i];
+ Variable leftVar = globals.getVariable(varToken.getName());
+
+ // get number-matrix of an element on the right side
+ DoubleNumberToken number = (DoubleNumberToken)rightOps[0][i];
+
+ if (leftVar == null)
+ {
+ ErrorLogger.debugLine("AssignmentOpTok: variable is null");
+
+ // create variable
+ leftVar = globals.createVariable(varToken.getName() );
+ }
+
+ // assign right side matrix to left side variable
+ result = leftVar.assign(number);
}
//return DoubleNumberToken.one;
return null;
@@ -212,12 +213,13 @@
// assign all right side elements to left side variables
for (int i=0; i<left.getSizeX(); i++)
{
- if (!(leftOps[0][i] instanceof VariableToken)) return null;
+ if (!(leftOps[0][i] instanceof VariableToken))
+ return null;
//ErrorLogger.debugLine("AssignOpToken: inst Var..");
// get one variable element of left side
VariableToken varToken = ((VariableToken)leftOps[0][i]);
- Variable leftVar = getVariable(varToken.getName());
+ Variable leftVar = globals.getVariable(varToken.getName());
// check if variable already exists
if (leftVar == null)
@@ -225,7 +227,7 @@
ErrorLogger.debugLine("AssignmentOpTok: variable is null");
// create variable
- leftVar = createVariable(varToken.getName() );
+ leftVar = globals.createVariable(varToken.getName() );
}
// get number-matrix of an element on the right side
@@ -234,7 +236,7 @@
// assign right side matrix to left side variable
result = leftVar.assign(number);
}
- return null; //result; //DoubleNumberToken.one;
+ return null;
}
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-25 07:47:01
|
Revision: 767
http://mathlib.svn.sourceforge.net/mathlib/?rev=767&view=rev
Author: st_mueller
Date: 2009-01-25 07:46:58 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
bugfix: correction of 'adf'+888 let to some error with disp('asdf'+5) -> disp(['asdf' num2str(5)])
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/test/testFunctionWhile001.m
Modified: JMathLib/trunk/src/jmathlib/toolbox/test/testFunctionWhile001.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/test/testFunctionWhile001.m 2009-01-24 20:24:50 UTC (rev 766)
+++ JMathLib/trunk/src/jmathlib/toolbox/test/testFunctionWhile001.m 2009-01-25 07:46:58 UTC (rev 767)
@@ -5,7 +5,7 @@
{
y=y+1;
t=t+y;
- disp("y=" + y + " t= " + t);
+ disp(["y=" num2str(y) " t= " num2str(t)]);
newline();
}
end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-24 20:24:58
|
Revision: 766
http://mathlib.svn.sourceforge.net/mathlib/?rev=766&view=rev
Author: st_mueller
Date: 2009-01-24 20:24:50 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/ForOperatorToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/ForOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/ForOperatorToken.java 2009-01-24 20:22:57 UTC (rev 765)
+++ JMathLib/trunk/src/jmathlib/core/tokens/ForOperatorToken.java 2009-01-24 20:24:50 UTC (rev 766)
@@ -36,48 +36,66 @@
forCode = _forCode;
}
+ /**
+ *
+ * @return
+ */
public OperandToken getForInitialisation()
{
return forInitialisation;
}
+ /**
+ *
+ * @return
+ */
public OperandToken getForRelation()
{
return forRelation;
}
+ /**
+ *
+ * @return
+ */
public OperandToken getForIncrement()
{
return forIncrement;
}
+ /**
+ *
+ * @return
+ */
public OperandToken getForCode()
{
return forCode;
}
/**evaluates the operator
- @param operands = the tokens parameters (not used)
- @return the result as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ * @param operands = the tokens parameters (not used)
+ * @param
+ * @return the result as an OperandToken
+ */
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
ErrorLogger.debugLine("Parser: For: evaluate");
if(forRelation == null)
{
- vectorFor();
+ vectorFor(globals);
}
else
{
OperandToken intialisationLine = ((OperandToken)forInitialisation.clone());
- intialisationLine.evaluate(null);
+ intialisationLine.evaluate(null, globals);
while(true)
{
// Check condition of For(...)
OperandToken relationLine = ((OperandToken)forRelation.clone());
- OperandToken result = relationLine.evaluate(null);
+ OperandToken result = relationLine.evaluate(null, globals);
if (result instanceof DoubleNumberToken)
{
@@ -111,11 +129,11 @@
{
OperandToken codeLine = ((OperandToken)forCode.clone());
ErrorLogger.debugLine("Parser: for number is true");
- code = codeLine.evaluate(null);
+ code = codeLine.evaluate(null, globals);
//evaluate increment code
OperandToken incrementLine = ((OperandToken)forIncrement.clone());
- incrementLine.evaluate(null);
+ incrementLine.evaluate(null, globals);
}
}
else if (result instanceof LogicalToken)
@@ -131,11 +149,11 @@
{
OperandToken codeLine = ((OperandToken)forCode.clone());
ErrorLogger.debugLine("Parser: for boolean is true");
- code = codeLine.evaluate(null);
+ code = codeLine.evaluate(null, globals);
//evaluate increment code
OperandToken incrementLine = ((OperandToken)forIncrement.clone());
- incrementLine.evaluate(null);
+ incrementLine.evaluate(null, globals);
}
}
@@ -149,7 +167,9 @@
}
- /**@return the operator as a string*/
+ /**
+ * @return the operator as a string
+ */
public String toString()
{
return "For";
@@ -157,7 +177,7 @@
/**evaluate for loop defined with a vector*/
- private void vectorFor()
+ private void vectorFor(GlobalValues globals)
{
ErrorLogger.debugLine("vector for " + forInitialisation.toString());
@@ -172,7 +192,7 @@
{
ErrorLogger.debugLine("vector for evaluating 1");
VariableToken variableToken = ((VariableToken)forExpression.getChild(0));
- Variable variable = createVariable(variableToken.getName());
+ Variable variable = globals.createVariable(variableToken.getName());
DoubleNumberToken vector = null;
Token child = forExpression.getChild(1);
@@ -185,7 +205,7 @@
{
ErrorLogger.debugLine("vector for evaluating 3");
OperandToken childOp = (OperandToken)child.clone();
- childOp = childOp.evaluate(null);
+ childOp = childOp.evaluate(null, globals);
ErrorLogger.debugLine("for op "+ childOp);
//child = ((Expression)child).getChild(1);
@@ -211,7 +231,7 @@
variable.assign(value);
Expression exp = ((Expression)forCode.clone());
- exp.evaluate(null);
+ exp.evaluate(null, globals);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-24 20:23:00
|
Revision: 765
http://mathlib.svn.sourceforge.net/mathlib/?rev=765&view=rev
Author: st_mueller
Date: 2009-01-24 20:22:57 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/UnaryOperatorToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/UnaryOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/UnaryOperatorToken.java 2009-01-24 20:21:39 UTC (rev 764)
+++ JMathLib/trunk/src/jmathlib/core/tokens/UnaryOperatorToken.java 2009-01-24 20:22:57 UTC (rev 765)
@@ -8,7 +8,8 @@
public class UnaryOperatorToken extends OperatorToken
{
/**Constructor taking the operator and priority
- @param _operator = the operator being constructed */
+ * @param _operator = the operator being constructed
+ */
public UnaryOperatorToken(char _operator)
{
/**call the super constructor, type defaults to ttoperator and operands to 1*/
@@ -19,7 +20,7 @@
/**evaluate the operator
@param operands = the operator operands
@return the result as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = null;
@@ -51,7 +52,7 @@
if(operand instanceof VariableToken)
{
// first: evaluate and return original value variable
- result = operand.evaluate(null);
+ result = operand.evaluate(null, globals);
// second: decrease variable
OperandToken op = result.subtract(new DoubleNumberToken(1));
@@ -59,7 +60,7 @@
// save new variable value
String variable = ((VariableToken)operand).getName();
//getVariables().getVariable(variable).assign(op);
- getVariable(variable).assign(op);
+ globals.getVariable(variable).assign(op);
}
else if(operand instanceof NumberToken)
{
@@ -79,7 +80,7 @@
if(operand instanceof VariableToken)
{
// first: evaluate and return original value variable
- result = operand.evaluate(null);
+ result = operand.evaluate(null, globals);
// second: increase variable
OperandToken op = result.add(new DoubleNumberToken(1));
@@ -87,7 +88,7 @@
// save new variable value
String variable = ((VariableToken)operand).getName();
//getVariables().getVariable(variable).assign(op);
- getVariable(variable).assign(op);
+ globals.getVariable(variable).assign(op);
}
else if(operand instanceof NumberToken)
{
@@ -113,7 +114,9 @@
return result;
}
- /**@return the operator as a string*/
+ /**
+ * @return the operator as a string
+ */
public String toString()
{
if (value=='-')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-24 20:21:41
|
Revision: 764
http://mathlib.svn.sourceforge.net/mathlib/?rev=764&view=rev
Author: st_mueller
Date: 2009-01-24 20:21:39 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/NumberToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/NumberToken.java 2009-01-24 20:18:33 UTC (rev 763)
+++ JMathLib/trunk/src/jmathlib/core/tokens/NumberToken.java 2009-01-24 20:21:39 UTC (rev 764)
@@ -18,7 +18,7 @@
* 2
* 4 */
/**stores the number format for displaying the number*/
- private static NumberFormat numFormat = NumberFormat.getInstance();
+ protected static NumberFormat numFormat = NumberFormat.getInstance();
/**Index for real values within array*/
protected static final int REAL = 0;
@@ -115,7 +115,7 @@
}
/**Evaluate the token. This causes it to return itself*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
return this;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-24 20:18:37
|
Revision: 763
http://mathlib.svn.sourceforge.net/mathlib/?rev=763&view=rev
Author: st_mueller
Date: 2009-01-24 20:18:33 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/CharToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/CharToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/CharToken.java 2009-01-24 19:50:17 UTC (rev 762)
+++ JMathLib/trunk/src/jmathlib/core/tokens/CharToken.java 2009-01-24 20:18:33 UTC (rev 763)
@@ -1,6 +1,7 @@
package jmathlib.core.tokens;
import jmathlib.core.interpreter.*;
+import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
/**Class used to represent any strings used in an expression*/
public class CharToken extends DataToken
@@ -121,6 +122,31 @@
}
/**
+ * cast all char-values into double-array
+ * @return
+ */
+ public double[][] getValuesRe()
+ {
+ // in case char-array is empty return null
+ if ((sizeY==0) && (sizeX==0))
+ return null;
+
+ // create empty return array
+ double[][] d = new double[sizeY][sizeX];
+
+ // convert array of byte to array of double
+ for (int y=0; y<sizeY; y++)
+ {
+ for (int x=0; x<sizeX; x++)
+ {
+ d[y][x]= (double)values[y][x];
+ }
+ }
+
+ return d;
+ }
+
+ /**
* @param
* @param
*/
@@ -161,10 +187,25 @@
if (sizeY!=1)
Errors.throwMathLibException("CharToken: add not supported");
- String answer = new String(values[0]) + arg.toString();
- values[0] = answer.toCharArray();
- sizeX = values[0].length;
- return new CharToken(answer);
+ if (arg instanceof CharToken)
+ {
+ String answer = new String(values[0]) + arg.toString();
+ values[0] = answer.toCharArray();
+ sizeX = values[0].length;
+ return new CharToken(answer);
+
+ }
+ else if (arg instanceof DoubleNumberToken)
+ {
+ double[][] d = getValuesRe();
+
+ DoubleNumberToken num = new DoubleNumberToken(d);
+
+ return arg.add(num);
+ }
+
+ Errors.throwMathLibException("DoubleNumberToken: add: no number");
+ return null;
}
}
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2009-01-24 19:50:17 UTC (rev 762)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2009-01-24 20:18:33 UTC (rev 763)
@@ -6,9 +6,7 @@
import jmathlib.core.tokens.NumberToken;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.tokens.OperandToken;
-import jmathlib.toolbox.string._double;
-
public class DoubleNumberToken extends NumberToken
{
/**Complex values of the token
@@ -104,8 +102,9 @@
}
/**Constructor taking the numbers value as two double[][]
- @param _real = the numbers value as a 2D array of double
- @param _imaginary = the numbers value as a 2D array of double*/
+ * @param _real = the numbers value as a 2D array of double
+ * @param _imaginary = the numbers value as a 2D array of double
+ */
public DoubleNumberToken(double[][] _real, double[][] _imaginary)
{
super(5, "double");
@@ -142,7 +141,8 @@
}
/**Constructor taking the numbers value as a double[][][]
- @param _values = the numbers value as a 3D array of double*/
+ * @param _values = the numbers value as a 3D array of double
+ */
public DoubleNumberToken(double[][][] _values)
{
super(5, "double");
@@ -253,7 +253,9 @@
/** return a new Number Token of size y*x
- *
+ * @param x
+ * @param y
+ * @return
*/
public DataToken getElementSized(int y, int x)
{
@@ -293,14 +295,15 @@
noElem = sizeY * sizeX;
} // end setSize
- /**@return the real value of the first number*/
+ /**
+ * @return the real value of the first number
+ */
public double getValueRe()
{
return getValueRe(0);
}
/**
- *
* @param y
* @param x
* @return the real value of the number at position y, x
@@ -311,7 +314,6 @@
}
/**
- *
* @param index
* @return
*/
@@ -321,7 +323,6 @@
}
/**
- *
* @param n
* @return
*/
@@ -330,28 +331,36 @@
return values[n][REAL];
}
-
- /**@return the real value of the number at position y, x as an integer*/
+ /**
+ * @param y
+ * @param x
+ * @return the real value of the number at position y, x as an integer
+ */
public int getIntValue(int y, int x)
{
double temp = getValueRe( yx2n(y,x) );
return (new Double(temp)).intValue();
}
- /**@return the imaginary value of the first number*/
+ /**
+ * @return the imaginary value of the first number
+ */
public double getValueIm()
{
return getValueIm(0);
}
- /**@return the imaginary value of the number at position y, x*/
+ /**
+ * @param y
+ * @param x
+ * @return the imaginary value of the number at position y, x
+ */
public double getValueIm(int y, int x)
{
return getValueIm( yx2n(y,x) );
}
/**
- *
* @param index
* @return
*/
@@ -361,7 +370,6 @@
}
/**
- *
* @param n
* @return
*/
@@ -371,7 +379,11 @@
}
- /**@return the absolute value of the number at position y, x*/
+ /**
+ * @param y
+ * @param x
+ * @return the absolute value of the number at position y, x
+ * */
public double getValueAbs(int y, int x)
{
int n = yx2n(y,x);
@@ -379,15 +391,20 @@
return Math.sqrt(temp);
}
- /**@return the angle of the number at position y, x in radians*/
+ /**
+ * @param y
+ * @param x
+ * @return the angle of the number at position y, x in radians
+ */
public double getValueArg(int y, int x)
{
int n = yx2n(y,x);
return Math.atan2(values[n][IMAG], values[n][REAL]);
}
-
- /**@return the real values of the number*/
+ /**
+ * @return the real values of the number
+ */
public double[][] getValuesRe()
{
double[][] temp = new double[sizeY][sizeX];
@@ -406,13 +423,17 @@
return temp;
}
- /**@return the real values of the number*/
+ /**
+ * @return the real values of the number
+ */
public double[][] getReValues()
{
return getValuesRe();
}
- /**@return the imaginary values of the number*/
+ /**
+ * @return the imaginary values of the number
+ */
public double[][] getValuesIm()
{
double[][] temp = new double[sizeY][sizeX];
@@ -433,7 +454,6 @@
/**
- *
* @param n
* @return
*/
@@ -444,7 +464,6 @@
/**
- *
* @param n
* @param num
*/
@@ -453,11 +472,12 @@
values[n][REAL] = ((DoubleNumberToken)num).getValueRe();
values[n][IMAG] = ((DoubleNumberToken)num).getValueIm();
}
-
- /**@return an array of double representing the element at y,x
- @param y = y position in matrix
- @param x = x position in matrix*/
+ /**
+ * @param y = y position in matrix
+ * @param x = x position in matrix
+ * @return an array of double representing the element at y,x
+ */
public double[] getValueComplex(int y, int x)
{
int n = yx2n(y,x);
@@ -465,7 +485,6 @@
}
/**
- *
* @param n
* @return
*/
@@ -475,7 +494,6 @@
}
/**
- *
* @param n
* @param _value
*/
@@ -509,7 +527,6 @@
}
/**
- *
* @param n
* @param _real
* @param _imag
@@ -521,7 +538,6 @@
}
/**
- *
* @param index multidimensional index
* @param _real
* @param _imag
@@ -534,9 +550,10 @@
setValue(n, _real, _imag);
}
-
- /**return the number as a string*/
+ /**return the number as a string
+ * @return
+ */
public String toString()
{
String result = null;
@@ -569,6 +586,11 @@
return result;
}
+ /**
+ * @param dim
+ * @param i
+ * @return
+ */
private String toString(int[] dim, int i)
{
String ret="";
@@ -605,6 +627,10 @@
return ret;
}
+ /**
+ * @param nn
+ * @return
+ */
private String toString2d(int[] nn)
{
StringBuffer buffer = new StringBuffer(20);
@@ -630,7 +656,9 @@
}
/** create string representation of (complex) double values
- @param _values[]={REAL,IMAG} real and imaginary part of number*/
+ * @param _values[]={REAL,IMAG} real and imaginary part of number
+ * @return
+ */
public String toString(double _values[])
{
@@ -654,8 +682,10 @@
else if (Double.isNaN(re))
result.append("NaN");
else
- result.append(getNumberFormat().format(re));
-
+ //result.append(globals.getNumberFormat().format(re));
+ result.append(numFormat.format(re));
+//stefan
+
// imaginary part of number
if((im != 0.0) || Double.isNaN(im))
{
@@ -670,8 +700,10 @@
else if (Double.isNaN(im))
result.append("NaN");
else
- result.append(getNumberFormat().format(im));
-
+ //result.append(getNumberFormat().format(im));
+ result.append(numFormat.format(im));
+ //stefan
+
result.append("i)");
}
return result.toString();
@@ -684,7 +716,9 @@
//}
/**Check if two tokens are equal
- @param arg = the object to check against*/
+ * @param arg = the object to check against
+ * @return
+ */
public boolean equals(Object arg)
{
if(arg instanceof DoubleNumberToken)
@@ -710,7 +744,11 @@
return false;
}
- /**calculate the arg of the complex number at y, x*/
+ /**calculate the arg of the complex number at y, x
+ * @param y
+ * @param x
+ * @return
+ */
public double arg(int y, int x)
{
int n = yx2n(y,x);
@@ -721,8 +759,9 @@
////////////////////////////////////////////////////////////
/**add arg to this object for a number token
- @param = the value to add to it
- @return the result as an OperandToken*/
+ * @param = the value to add to it
+ * @return the result as an OperandToken
+ */
public OperandToken add(OperandToken arg)
{
@@ -798,11 +837,11 @@
else if(arg instanceof CharToken)
{
// 2+'a b'
- CharToken nArg = ((CharToken)arg);
- _double d = new _double();
- DoubleNumberToken numT = (DoubleNumberToken)d.evaluate(new OperandToken[]{nArg});
-
- return this.add(numT);
+ double[][] d = ((CharToken)arg).getValuesRe();
+
+ DoubleNumberToken num = new DoubleNumberToken(d);
+
+ return this.add(num);
}
Errors.throwMathLibException("DoubleNumberToken: add: no number");
@@ -811,8 +850,9 @@
} // and add
/**subtract arg from this object for a number token
- @param = the value to subtract
- @return the result as an OperandToken*/
+ * @param = the value to subtract
+ * @return the result as an OperandToken
+ */
public OperandToken subtract(OperandToken arg)
{
if(!(arg instanceof DoubleNumberToken))
@@ -876,8 +916,9 @@
}
/**Raise this object to the power of arg
- * @param = the value to raise it to the power of
- * @return the result as an OperandToken*/
+ * @param = the value to raise it to the power of
+ * @return the result as an OperandToken
+ */
public OperandToken power(OperandToken arg)
{
// works only on numbers
@@ -1067,8 +1108,9 @@
/**multiply arg by this object for a number token
- @param arg = the value to multiply it by
- @return the result as an OperandToken*/
+ * @param arg = the value to multiply it by
+ * @return the result as an OperandToken
+ */
public OperandToken multiply(OperandToken arg)
{
if(!(arg instanceof DoubleNumberToken))
@@ -1146,9 +1188,10 @@
} // end multiply
/**Multiplies two complex numbers
- @param arg1 = the first complex number as an array of double
- @param arg2 = the second complex number as an array of double
- @return the result as an array of double*/
+ * @param arg1 = the first complex number as an array of double
+ * @param arg2 = the second complex number as an array of double
+ * @return the result as an array of double
+ */
public double[] multiply(double[] arg1, double[]arg2)
{
double[] temp = new double[2];
@@ -1158,8 +1201,9 @@
}
/**divide this object by arg for a number token
- @param arg = the value to divide it by
- @return the result as an OperandToken*/
+ * @param arg = the value to divide it by
+ * @return the result as an OperandToken
+ */
public OperandToken divide(OperandToken arg)
{
if(!(arg instanceof DoubleNumberToken))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-24 19:50:23
|
Revision: 762
http://mathlib.svn.sourceforge.net/mathlib/?rev=762&view=rev
Author: st_mueller
Date: 2009-01-24 19:50:17 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/IfThenOperatorToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/IfThenOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/IfThenOperatorToken.java 2009-01-24 19:47:55 UTC (rev 761)
+++ JMathLib/trunk/src/jmathlib/core/tokens/IfThenOperatorToken.java 2009-01-24 19:50:17 UTC (rev 762)
@@ -1,6 +1,7 @@
package jmathlib.core.tokens;
import jmathlib.core.interpreter.*;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -50,23 +51,25 @@
public Expression getIfRelation()
{
- return null; //ifRelation;
+ return null; //ifRelation;
}
public Expression getIfCode()
{
- return null; //ifCode;
+ return null; //ifCode;
}
public Expression getElseCode()
{
- return null; //elseCode;
+ return null; //elseCode;
}
/**evaluates the operator
- @param operands = the operators operands
- @return the result of the test as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ * @param operands = the operators operands
+ * @param
+ * @return the result of the test as an OperandToken
+ */
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
ErrorLogger.debugLine("Parser: IfThen: evaluate "+conditions.size());
@@ -79,7 +82,7 @@
ConditionToken conditionToken = ((ConditionToken)conditions.get(pos));
ErrorLogger.debugLine("Parser: IfThen: cond: " + conditionToken.toString());
- result = conditionToken.evaluate(null);
+ result = conditionToken.evaluate(null, globals);
pos++;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-24 19:47:57
|
Revision: 761
http://mathlib.svn.sourceforge.net/mathlib/?rev=761&view=rev
Author: st_mueller
Date: 2009-01-24 19:47:55 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/FunctionToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/FunctionToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/FunctionToken.java 2009-01-24 19:45:28 UTC (rev 760)
+++ JMathLib/trunk/src/jmathlib/core/tokens/FunctionToken.java 2009-01-24 19:47:55 UTC (rev 761)
@@ -27,7 +27,8 @@
public boolean evaluationLockB = false;
/**constructor for function tokens
- @param _name = the name of the function*/
+ * @param _name = the name of the function
+ */
public FunctionToken(String _name)
{
name = _name;
@@ -64,19 +65,10 @@
noOfLeftHandArguments = _number;
}
- /**Return number of arguments (size of operands[])
- @return operands.length number or operands*/
- // public int getNumberOfArguments()
- //{
- // if (operands != null)
- // return operands.length;
- // else
- // return 0;
- //}
-
/**Return one of the operands
- @param index = index of operand
- @return operand = requested operand */
+ * @param index = index of operand
+ * @return operand = requested operand
+ */
public OperandToken getOperand(int index)
{
if (operands == null)
@@ -111,14 +103,18 @@
}
/**Executes the function referenced by this token
- @param operands = the functions operands
- @return the result of the function as an OperandToken*/
- public OperandToken evaluate(Token[] _operands)
+ * @param operands = the functions operands
+ * @param
+ * @return the result of the function as an OperandToken
+ */
+ public OperandToken evaluate(Token[] _operands, GlobalValues globals)
{
Function function = null;
OperandToken result = null;
ErrorLogger.debugLine("FunctionToken: eval "+name);
+ //setGlobals(globals);
+
// special handling for "return" function
// throw control exception
if (name.equals("return"))
@@ -129,7 +125,7 @@
// check if the function is overloaded by a variable name
//if( getVariables().getVariable(name) != null)
- if( getVariable(name) != null)
+ if( globals.getVariable(name) != null)
{
// Variable overloads function
ErrorLogger.debugLine("FunctionToken: eval: variable overloads function");
@@ -138,14 +134,14 @@
VariableToken varToken = new VariableToken(name, operands);
// evaluate variable with limits and return result
- return varToken.evaluate(null);
+ return varToken.evaluate(null, globals);
}
// Function is not overloaded by a variable
// Now try to find the function
try
{
- function = getFunctionManager().findFunction(this);
+ function = globals.getFunctionManager().findFunction(this);
}
catch(Exception exception)
{
@@ -172,7 +168,7 @@
{
for (int i=0; i<operands.length; i++)
{
- operands[i]=operands[i].evaluate(null);
+ operands[i]=operands[i].evaluate(null, globals);
}
}
@@ -180,9 +176,9 @@
// If the function if of type UserFunction it has to be cloned so that
// the original m-function or m-script stays untouched
if (function instanceof UserFunction)
- result = ((Function)function.clone()).evaluate(operands);
+ result = ((Function)function.clone()).evaluate(operands, globals);
else
- result = function.evaluate(operands);
+ result = function.evaluate(operands, globals);
// remember that this function has been evaluated
// (important for functions which are overloading variables (e.g. who ))
@@ -201,7 +197,6 @@
return result;
} // end function!=null
- ErrorLogger.debugLine("FunctionToken: function not found ");
Errors.throwMathLibException("FunctionToken: undefinded variable or function "+name);
return result;
} // end evaluate
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|