[Mathlib-commitlog] SF.net SVN: mathlib:[618] JMathLib/trunk/src/jmathlib/core/functions/ UserFunct
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-05 15:05:06
|
Revision: 618
http://mathlib.svn.sourceforge.net/mathlib/?rev=618&view=rev
Author: st_mueller
Date: 2009-01-05 15:05:03 +0000 (Mon, 05 Jan 2009)
Log Message:
-----------
changed handling of global variables
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/UserFunction.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/UserFunction.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/UserFunction.java 2009-01-05 15:02:49 UTC (rev 617)
+++ JMathLib/trunk/src/jmathlib/core/functions/UserFunction.java 2009-01-05 15:05:03 UTC (rev 618)
@@ -13,7 +13,7 @@
/** The code of the current m-function */
private OperandToken code;
- /**The names of the paramater values*/
+ /**The names of the parameter values*/
private ArrayList parameterVariables;
/**The names of the return values*/
@@ -25,9 +25,6 @@
/**Creates a user function */
public UserFunction()
{
- //VariableList localVariables = new VariableList();
- //functionContext = getContextList().createContext(localVariables);
-
parameterVariables = new ArrayList();
returnVariables = new ArrayList();
}
@@ -97,10 +94,10 @@
Errors.throwMathLibException("UserFunction: "+name+" number of parameters to large");
// set the variable NARGIN to the number of parameters of the calling function
- getVariables().createVariable("nargin").assign(new DoubleNumberToken(opLength));
+ createVariable("nargin").assign(new DoubleNumberToken(opLength));
// set the variable NARGOUT to the number of return values
- getVariables().createVariable("nargout").assign(new DoubleNumberToken(returnVariables.size()));
+ createVariable("nargout").assign(new DoubleNumberToken(returnVariables.size()));
//set the input parameters for the function
@@ -113,7 +110,7 @@
{
String parameterName = (String)parameterVariables.get(paramNo);
//System.out.println("UserFunction: "+parameterName);
- getVariables().createVariable(parameterName).assign((OperandToken)operands[paramNo]);
+ createVariable(parameterName).assign((OperandToken)operands[paramNo]);
}
}
else
@@ -127,7 +124,7 @@
{
String parameterName = (String)parameterVariables.get(paramNo);
ErrorLogger.debugLine("UserF: params: "+parameterName);
- getVariables().createVariable(parameterName).assign((OperandToken)operands[paramNo]);
+ createVariable(parameterName).assign((OperandToken)operands[paramNo]);
}
ErrorLogger.debugLine("UserF: remainingOps: "+ remainingOps);
@@ -144,13 +141,13 @@
values[i][0] = (OperandToken)operands[parameterVariables.size()-1+i];
}
CellArrayToken cell = new CellArrayToken(values);
- getVariables().createVariable("varargin").assign(cell);
+ createVariable("varargin").assign(cell);
}
else
{
// varargin is empty
CellArrayToken cell = new CellArrayToken();
- getVariables().createVariable("varargin").assign(cell);
+ createVariable("varargin").assign(cell);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|