diff --git a/.gitignore b/.gitignore
index 20983dbd..f3bbeb6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,4 @@ ipch/
*.csproj.user
DTAR_*_DTAR/
/CURRENT/c-sharp/UpgradeLog.htm
+/CURRENT/c-sharp/.idea
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Argument.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Argument.cs
index e5c386dd..1372a84c 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Argument.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Argument.cs
@@ -57,145 +57,132 @@
using System;
namespace org.mariuszgromada.math.mxparser {
- /**
- * Argument class enables to declare the argument
- * (variable) which can be used in further processing
- * (in expressions, functions and dependent / recursive arguments).
- *
- *
- * For example:
- *
- * - 'x' - argument in expression 'sin(x)'
- *
- 'x' and 'y' - arguments in expression 'sin(x)+cos(y)'.
- *
- 'x=2*t' - dependent argument (dependent from 't') in expression 'cos(x)'
- *
- *
- * Using Argument class you can define two argument types:
- *
- * - free argument - when value of argument 'x' is directly given
- * by a number (for example 'x=5')
- *
- dependent argument - when value of argument 'x' is given by
- * expression (for example: 'x=2*a+b' - argument 'x' depends from
- * argument/constant 'a' and argument/constant 'b' or any other
- * possible option like function, etc...)
- *
- *
- * When creating an argument you should avoid names reserved as
- * parser keywords, in general words known in mathematical language
- * as function names, operators (for example:
- * sin, cos, +, -, etc...). Please be informed that after associating
- * the argument with the expression, function or dependent/recursive argument
- * its name will be recognized by the parser as reserved key word.
- * It means that it could not be the same as any other key word known
- * by the parser for this particular expression. Parser is case sensitive.
- *
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.3.0
- *
- * @see RecursiveArgument
- * @see Expression
- * @see Function
- * @see Constant
- */
+
+ ///
+ /// Argument class enables to declare the argument
+ /// (variable) which can be used in further processing
+ /// (in expressions, functions and dependent / recursive arguments).
+ ///
+ /// For example:
+ ///
+ /// - 'x' - argument in expression 'sin(x)'
+ /// - 'x' and 'y' - arguments in expression 'sin(x)+cos(y)'.
+ /// - 'x=2*t' - dependent argument (dependent from 't') in expression 'cos(x)'
+ ///
+ ///
+ /// Using Argument class you can define two argument types:
+ ///
+ /// - free argument - when value of argument 'x' is directly given
+ /// by a number (for example 'x=5')
+ /// - dependent argument - when value of argument 'x' is given by
+ /// expression (for example: 'x=2*a+b' - argument 'x' depends from
+ /// argument/constant 'a' and argument/constant 'b' or any other
+ /// possible option like function, etc...)
+ ///
+ ///
+ ///
+ ///
+ /// When creating an argument you should avoid names reserved as
+ /// parser keywords, in general words known in mathematical language
+ /// as function names, operators (for example:
+ /// sin, cos, +, -, etc...). Please be informed that after associating
+ /// the argument with the expression, function or dependent/recursive argument
+ /// its name will be recognized by the parser as reserved key word.
+ /// It means that it could not be the same as any other key word known
+ /// by the parser for this particular expression. Parser is case sensitive.
+ ///
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.3.0
+ ///
[CLSCompliant(true)]
public class Argument : PrimitiveElement {
- /**
- * No syntax errors in the dependent argument definition.
- */
+
+ ///No syntax errors in the dependent argument definition.
public const bool NO_SYNTAX_ERRORS = Expression.NO_SYNTAX_ERRORS;
- /**
- * Syntax error in the dependent argument definition.
- */
+
+ /// Syntax error in the dependent argument definition.
public const bool SYNTAX_ERROR_OR_STATUS_UNKNOWN = Expression.SYNTAX_ERROR_OR_STATUS_UNKNOWN;
- /**
- * Double.NaN as initial value of the argument.
- */
+
+ /// as initial value of the argument.
public const double ARGUMENT_INITIAL_VALUE = Double.NaN;
- /**
- * When argument was not not found
- */
+
+ /// When argument was not not found
public const int NOT_FOUND = Expression.NOT_FOUND;
- /**
- * Type indicator for free argument.
- */
+
+ /// Type indicator for free argument.
public const int FREE_ARGUMENT = 1;
- /**
- * Type indicator for dependent argument.
- */
+
+ /// Type indicator for dependent argument.
public const int DEPENDENT_ARGUMENT = 2;
- /**
- * Type indicator for recursive argument.
- */
+
+ /// Type indicator for recursive argument.
public const int RECURSIVE_ARGUMENT = 3;
- /**
- * Argument type id for the definition of key words
- * known by the parser.
- */
+
+ /// Argument type id for the definition of key words
+ /// known by the parser.
public const int TYPE_ID = 101;
public const String TYPE_DESC = "User defined argument";
- /**
- * Description of the argument.
- */
+ /// Description of the argument.
private String description;
- /**
- * Argument expression for dependent and recursive
- * arguments.
- */
+
+ ///
+ /// Argument expression for dependent and recursive
+ /// arguments.
+ ///
internal Expression argumentExpression;
- /**
- * Argument name (x, y, arg1, my_argument, etc...)
- */
+ /// Argument name (x, y, arg1, my_argument, etc...)
private String argumentName;
- /**
- * Argument type (free, dependent)
- */
+ /// Argument type (free, dependent)
internal int argumentType;
- /**
- * Argument value (for free arguments).
- */
+ /// Argument value (for free arguments).
internal double argumentValue;
- /**
- * Index argument.
- *
- * @see RecursiveArgument
- */
+
+ /// Index argument.
+ ///
+ ///
+
protected Argument n;
+
/*=================================================
*
* Constructors
*
*=================================================
*/
- /**
- * Default constructor - creates argument based on the argument definition string.
- *
- * @param argumentDefinitionString Argument definition string, i.e.:
- *
- * - 'x' - only argument name
- *
- 'x=5' - argument name and argument value
- *
- 'x=2*5' - argument name and argument value given as simple expression
- *
- 'x=2*y' - argument name and argument expression (dependent argument 'x' on argument 'y')
- *
- *
- * @param elements Optional parameters (comma separated) such as Arguments, Constants, Functions
- */
+
+ /// Default constructor - creates argument based on the argument definition string.
+ ///
+ ///
+ /// Argument definition string, i.e.:
+ ///
+ /// - 'x' - only argument name
+ /// - 'x=5' - argument name and argument value
+ /// - 'x=2*5' - argument name and argument value given as simple expression
+ /// - 'x=2*y' - argument name and argument expression (dependent argument 'x' on argument 'y')
+ ///
+ ///
+ ///
+ ///
+ /// Optional parameters (comma separated) such as Arguments,
+ /// Constants, Functions
+ ///
public Argument(String argumentDefinitionString, params PrimitiveElement[] elements) : base(Argument.TYPE_ID)
{
if (mXparser.regexMatch(argumentDefinitionString, ParserSymbol.nameOnlyTokenRegExp)) {
@@ -238,20 +225,24 @@ public Argument(String argumentDefinitionString, params PrimitiveElement[] eleme
setSilentMode();
description = "";
}
- /**
- * Default constructor - creates argument based on the argument definition string.
- *
- * @param argumentDefinitionString Argument definition string, i.e.:
- *
- * - 'x' - only argument name
- *
- 'x=5' - argument name and argument value
- *
- 'x=2*5' - argument name and argument value given as simple expression
- *
- 'x=2*y' - argument name and argument expression (dependent argument 'x' on argument 'y')
- *
- *
- * @param forceDependent If true parser will try to create dependent argument
- * @param elements Optional parameters (comma separated) such as Arguments, Constants, Functions
- */
+
+ /// Default constructor - creates argument based on the argument definition string.
+ ///
+ ///
+ /// Argument definition string, i.e.:
+ ///
+ /// - 'x' - only argument name
+ /// - 'x=5' - argument name and argument value
+ /// - 'x=2*5' - argument name and argument value given as simple expression
+ /// - 'x=2*y' - argument name and argument expression (dependent argument 'x' on argument 'y')
+ ///
+ ///
+ ///
+ /// If true parser will try to create dependent argument
+ ///
+ /// Optional parameters (comma separated) such as Arguments,
+ /// Constants, Functions
+ ///
public Argument(String argumentDefinitionString, bool forceDependent, params PrimitiveElement[] elements) : base(Argument.TYPE_ID) {
if ( mXparser.regexMatch(argumentDefinitionString, ParserSymbol.nameOnlyTokenRegExp) ) {
argumentName = argumentDefinitionString;
@@ -295,12 +286,11 @@ public Argument(String argumentDefinitionString, bool forceDependent, params Pri
setSilentMode();
description = "";
}
- /**
- * Constructor - creates free argument.
- *
- * @param argumentName the argument name
- * @param argumentValue the argument value
- */
+
+ /// Constructor - creates free argument.
+ ///
+ /// the argument name
+ /// the argument value
public Argument(String argumentName, double argumentValue) : base(Argument.TYPE_ID) {
argumentExpression = new Expression();
if (mXparser.regexMatch(argumentName, ParserSymbol.nameOnlyTokenRegExp)) {
@@ -315,18 +305,21 @@ public Argument(String argumentName, double argumentValue) : base(Argument.TYPE_
setSilentMode();
description = "";
}
- /**
- * Constructor - creates dependent argument(with hidden
- * argument expression).
- *
- * @param argumentName the argument name
- * @param argumentExpressionString the argument expression string
- * @param elements Optional parameters (comma separated)
- * such as Arguments, Constants, Functions
- *
- * @see Expression
- * @see PrimitiveElement
- */
+
+ ///
+ /// Constructor - creates dependent argument(with hidden
+ /// argument expression).
+ ///
+ ///
+ /// the argument name
+ /// the argument expression string
+ ///
+ /// Optional parameters (comma separated) such as Arguments,
+ /// Constants, Functions
+ ///
+ ///
+ ///
+ ///
public Argument(String argumentName, String argumentExpressionString, params PrimitiveElement[] elements) : base(Argument.TYPE_ID) {
if (mXparser.regexMatch(argumentName, ParserSymbol.nameOnlyTokenRegExp)) {
this.argumentName="" + argumentName;
@@ -343,68 +336,58 @@ public Argument(String argumentName, String argumentExpressionString, params Pri
setSilentMode();
description = "";
}
- /**
- * Sets argument description.
- *
- * @param description the argument description.
- */
+
+ /// Sets argument description.
+ ///
+ /// the argument description.
public void setDescription(String description) {
this.description = description;
}
- /**
- * Gets argument description.
- *
- * @return The argument description string.
- */
+
+ /// Gets argument description.
+ ///
+ /// The argument description string.
public String getDescription() {
return description;
}
- /**
- * Enables argument verbose mode
- */
+ /// Enables argument verbose mode
public void setVerboseMode() {
argumentExpression.setVerboseMode();
}
- /**
- * Disables argument verbose mode (sets default silent mode)
- */
+ /// Disables argument verbose mode (sets default silent mode)
public void setSilentMode() {
argumentExpression.setSilentMode();
}
- /**
- * Returns verbose mode status
- *
- * @return true if verbose mode is on,
- * otherwise returns false.
- */
+
+ /// Returns verbose mode status
+ ///
+ /// true if verbose mode is on, otherwise returns false.
public bool getVerboseMode() {
return argumentExpression.getVerboseMode();
}
- /**
- * Gets recursive mode status
- *
- * @return true if recursive mode is enabled,
- * otherwise returns false
- */
+
+ /// Gets recursive mode status
+ ///
+ /// true if recursive mode is enabled, otherwise returns false
public bool getRecursiveMode() {
return argumentExpression.getRecursiveMode();
}
- /**
- * Gets computing time
- *
- * @return Computing time in seconds.
- */
+
+ /// Gets computing time
+ ///
+ /// Computing time in seconds.
public double getComputingTime() {
return argumentExpression.getComputingTime();
}
- /**
- * Sets (modifies) argument name.
- * Each expression / function / dependent argument associated
- * with this argument will be marked as modified
- * (requires new syntax checking).
- *
- * @param argumentName the argument name
- */
+
+ ///
+ /// Sets (modifies) argument name.
+ /// Each expression / function / dependent argument associated
+ /// with this argument will be marked as modified
+ /// (requires new syntax checking).
+ ///
+ ///
+ /// the argument name
public void setArgumentName(String argumentName) {
if ((mXparser.regexMatch(argumentName, ParserSymbol.nameOnlyTokenRegExp))) {
this.argumentName = argumentName;
@@ -413,53 +396,54 @@ public void setArgumentName(String argumentName) {
else if (argumentExpression != null)
argumentExpression.setSyntaxStatus(SYNTAX_ERROR_OR_STATUS_UNKNOWN, "[" + argumentName + "] " + "Invalid argument name, pattern not match: " + ParserSymbol.nameOnlyTokenRegExp);
}
- /**
- * Sets argument expression string.
- * Each expression / function / dependent argument associated
- * with this argument will be marked as modified
- * (requires new syntax checking).
- *
- * @param argumentExpressionString the argument expression string
- *
- * @see Expression
- */
+
+ ///
+ /// Sets argument expression string.
+ /// Each expression / function / dependent argument associated
+ /// with this argument will be marked as modified
+ /// (requires new syntax checking).
+ ///
+ ///
+ /// the argument expression string
+ ///
+ ///
public void setArgumentExpressionString(String argumentExpressionString) {
argumentExpression.setExpressionString(argumentExpressionString);
if (argumentType == FREE_ARGUMENT)
argumentType = DEPENDENT_ARGUMENT;
}
- /**
- * Gets argument name
- *
- * @return the argument name as string
- */
+
+ /// Gets argument name
+ ///
+ /// the argument name as string
public String getArgumentName() {
return argumentName;
}
- /**
- * Gets argument expression string
- *
- * @return the argument expression string
- */
+
+ /// Gets argument expression string
+ ///
+ /// the argument expression string
public String getArgumentExpressionString() {
return argumentExpression.getExpressionString();
}
- /**
- * Gets argument type
- *
- * @return Argument type: Argument.FREE_ARGUMENT,
- * Argument.DEPENDENT_ARGUMENT,
- * Argument.RECURSIVE_ARGUMENT
- */
+
+ /// Gets argument type
+ ///
+ ///
+ /// Argument type: ,
+ /// ,
+ ///
+ ///
public int getArgumentType() {
return argumentType;
}
- /**
- * Sets argument value, if DEPENDENT_ARGUMENT then argument type
- * is set to FREE_ARGUMENT
- *
- * @param argumentValue the value of argument
- */
+
+ ///
+ /// Sets argument value, if then argument type
+ /// is set to
+ ///
+ ///
+ /// the value of argument
public void setArgumentValue(double argumentValue) {
if (argumentType == DEPENDENT_ARGUMENT) {
argumentType = FREE_ARGUMENT;
@@ -473,58 +457,68 @@ public void setArgumentValue(double argumentValue) {
*
*=================================================
*/
- /**
- * Checks argument syntax
- *
- * @return syntax status: Argument.NO_SYNTAX_ERRORS,
- * Argument.SYNTAX_ERROR_OR_STATUS_UNKNOWN
- */
+
+ /// Checks argument syntax
+ ///
+ ///
+ /// syntax status: ,
+ ///
+ ///
public bool checkSyntax() {
if (argumentType == FREE_ARGUMENT)
return Argument.NO_SYNTAX_ERRORS;
else
return argumentExpression.checkSyntax();
}
- /**
- * Returns error message after checking the syntax
- *
- * @return Error message as string.
- */
+
+ /// Returns error message after checking the syntax
+ ///
+ /// Error message as string.
public String getErrorMessage() {
return argumentExpression.getErrorMessage();
}
- /**
- * Gets argument value.
- *
- * @return direct argument value for free argument,
- * otherwise returns calculated argument value
- * based on the argument expression.
- */
+
+ /// Gets argument value.
+ ///
+ ///
+ /// direct argument value for free argument,
+ /// otherwise returns calculated argument value
+ /// based on the argument expression.
+ ///
public double getArgumentValue() {
if (argumentType == FREE_ARGUMENT)
return argumentValue;
else
return argumentExpression.calculate();
}
- /**
- * Adds user defined elements (such as: Arguments, Constants, Functions)
- * to the argument expressions.
- *
- * @param elements Elements list (variadic - comma separated) of types: Argument, Constant, Function
- *
- * @see PrimitiveElement
- */
+
+ ///
+ /// Adds user defined elements (such as: Arguments, Constants, Functions)
+ /// to the argument expressions.
+ ///
+ ///
+ ///
+ /// Elements list (variadic - comma separated) of types: ,
+ /// ,
+ ///
+ ///
+ ///
public void addDefinitions(params PrimitiveElement[] elements) {
argumentExpression.addDefinitions(elements);
}
- /**
- * Removes user defined elements (such as: Arguments, Constants, Functions)
- * from the argument expressions.
- *
- * @param elements Elements list (variadic - comma separated) of types: Argument, Constant, Function
- *
- * @see PrimitiveElement
- */
+
+ ///
+ /// Removes user defined elements (such as: Arguments, Constants, Functions)
+ /// from the argument expressions.
+ ///
+ ///
+ ///
+ /// Elements list (variadic - comma separated) of types:
+ /// Arguments, Constants,
+ /// Functions
+ ///
+ ///
+ ///
public void removeDefinitions(params PrimitiveElement[] elements) {
argumentExpression.removeDefinitions(elements);
}
@@ -535,131 +529,141 @@ public void removeDefinitions(params PrimitiveElement[] elements) {
*
*=================================================
*/
- /**
- * Adds arguments (variadic) to the argument expression definition.
- *
- * @param arguments the arguments list
- * (comma separated list)
- * @see Argument
- * @see RecursiveArgument
- */
+
+ ///
+ /// Adds arguments (variadic) to the argument expression definition.
+ ///
+ ///
+ /// the arguments list (comma separated list)
+ ///
+ ///
+ ///
public void addArguments(params Argument[] arguments) {
argumentExpression.addArguments(arguments);
}
- /**
- * Enables to define the arguments (associated with
- * the argument expression) based on the given arguments names.
- *
- * @param argumentsNames the arguments names (variadic)
- * comma separated list
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ ///
+ /// Enables to define the arguments (associated with
+ /// the argument expression) based on the given arguments names.
+ ///
+ ///
+ ///
+ /// the arguments names (variadic)
+ /// comma separated list
+ ///
+ ///
+ ///
+ ///
public void defineArguments(params String[] argumentsNames) {
argumentExpression.defineArguments(argumentsNames);
}
- /**
- * Enables to define the argument (associated with the argument expression)
- * based on the argument name and the argument value.
- *
- * @param argumentName the argument name
- * @param argumentValue the the argument value
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ ///
+ /// Enables to define the argument (associated with the argument expression)
+ /// based on the argument name and the argument value.
+ ///
+ ///
+ /// the argument name
+ /// the the argument value
+ ///
+ ///
+ ///
public void defineArgument(String argumentName, double argumentValue) {
argumentExpression.defineArgument(argumentName, argumentValue);
}
- /**
- * Gets argument index from the argument expression.
- *
- * @param argumentName the argument name
- *
- * @return The argument index if the argument name was found,
- * otherwise returns Argument.NOT_FOUND
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ /// Gets argument index from the argument expression.
+ ///
+ /// the argument name
+ ///
+ ///
+ /// The argument index if the argument name was found,
+ /// otherwise returns
+ ///
+ ///
+ ///
+ ///
public int getArgumentIndex(String argumentName) {
return argumentExpression.getArgumentIndex(argumentName);
}
- /**
- * Gets argument from the argument expression.
- *
- *
- * @param argumentName the argument name
- *
- * @return The argument if the argument name was found,
- * otherwise returns null.
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ /// Gets argument from the argument expression.
+ ///
+ /// the argument name
+ ///
+ ///
+ /// The argument if the argument name was found,
+ /// otherwise returns null.
+ ///
+ ///
+ ///
+ ///
public Argument getArgument(String argumentName) {
return argumentExpression.getArgument(argumentName);
}
- /**
- * Gets argument from the argument expression.
- *
- * @param argumentIndex the argument index
- *
- * @return Argument if the argument index is between 0 and
- * the last available argument index (getArgumentsNumber()-1),
- * otherwise returns null.
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ /// Gets argument from the argument expression.
+ ///
+ /// the argument index
+ ///
+ ///
+ /// Argument if the argument index is between 0 and
+ /// the last available argument index (-1),
+ /// otherwise returns null.
+ ///
+ ///
+ ///
+ ///
public Argument getArgument(int argumentIndex) {
return argumentExpression.getArgument(argumentIndex);
}
- /**
- * Gets number of arguments associated with the argument expression.
- *
- * @return The number of arguments (int >= 0)
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ /// Gets number of arguments associated with the argument expression.
+ ///
+ /// The number of arguments (int >= 0)
+ ///
+ ///
+ ///
public int getArgumentsNumber() {
return argumentExpression.getArgumentsNumber();
}
- /**
- * Removes first occurrences of the arguments
- * associated with the argument expression.
- *
- * @param argumentsNames the arguments names
- * (variadic parameters) comma separated
- * list
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ ///
+ /// Removes first occurrences of the arguments
+ /// associated with the argument expression.
+ ///
+ ///
+ ///
+ /// the arguments names
+ /// (variadic parameters) comma separated list
+ ///
+ ///
+ ///
+ ///
public void removeArguments(params String[] argumentsNames) {
argumentExpression.removeArguments(argumentsNames);
}
- /**
- * Removes first occurrences of the arguments
- * associated with the argument expression.
- *
- * @param arguments the arguments (variadic parameters)
- * comma separated list
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ ///
+ /// Removes first occurrences of the arguments
+ /// associated with the argument expression.
+ ///
+ ///
+ ///
+ /// the arguments (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
+ ///
public void removeArguments(params Argument[] arguments) {
argumentExpression.removeArguments(arguments);
}
- /**
- * Removes all arguments associated with the argument expression.
- *
- * @see Argument
- * @see RecursiveArgument
- */
+
+ /// Removes all arguments associated with the argument expression.
+ ///
+ ///
+ ///
public void removeAllArguments() {
argumentExpression.removeAllArguments();
}
@@ -670,111 +674,118 @@ public void removeAllArguments() {
*
*=================================================
*/
- /**
- * Adds constants (variadic parameters) to the argument expression definition.
- *
- * @param constants the constants
- * (comma separated list)
- *
- * @see Constant
- */
+ /// Adds constants (variadic parameters) to the argument expression definition.
+ ///
+ /// the constants (comma separated list)
+ ///
+ ///
public void addConstants(params Constant[] constants) {
argumentExpression.addConstants(constants);
}
- /**
- * Enables to define the constant (associated with
- * the argument expression) based on the constant name and
- * constant value.
- *
- * @param constantName the constant name
- * @param constantValue the constant value
- *
- * @see Constant
- */
+
+ ///
+ /// Enables to define the constant (associated with
+ /// the argument expression) based on the constant name and
+ /// constant value.
+ ///
+ ///
+ /// the constant name
+ /// the constant value
+ ///
+ ///
public void defineConstant(String constantName, double constantValue) {
argumentExpression.defineConstant(constantName, constantValue);
}
- /**
- * Gets constant index associated with the argument expression.
- *
- * @param constantName the constant name
- *
- * @return Constant index if constant name was found,
- * otherwise return Constant.NOT_FOUND.
- *
- * @see Constant
- */
+
+ /// Gets constant index associated with the argument expression.
+ ///
+ /// the constant name
+ ///
+ ///
+ /// Constant index if constant name was found,
+ /// otherwise return .
+ ///
+ ///
+ ///
public int getConstantIndex(String constantName) {
return argumentExpression.getConstantIndex(constantName);
}
- /**
- * Gets constant associated with the argument expression.
- *
- * @param constantName the constant name
- *
- * @return Constant if constant name was found,
- * otherwise return null.
- *
- * @see Constant
- */
+
+ /// Gets constant associated with the argument expression.
+ ///
+ /// the constant name
+ ///
+ ///
+ /// Constant if constant name was found,
+ /// otherwise return null.
+ ///
+ ///
+ ///
public Constant getConstant(String constantName) {
return argumentExpression.getConstant(constantName);
}
- /**
- * Gets constant associated with the argument expression.
- *
- * @param constantIndex the constant index
- *
- * @return Constant if the constantIndex is between
- * 0 and the last available constant index
- * (getConstantsNumber() - 1),
- * otherwise it returns null.
- *
- * @see Constant
- */
+
+ /// Gets constant associated with the argument expression.
+ ///
+ /// the constant index
+ ///
+ ///
+ /// Constant if the is between
+ /// 0 and the last available constant index
+ /// ( - 1),
+ /// otherwise it returns null.
+ ///
+ ///
+ ///
public Constant getConstant(int constantIndex) {
return argumentExpression.getConstant(constantIndex);
}
- /**
- * Gets number of constants associated with the argument expression.
- *
- * @return number of constants (int >= 0)
- *
- * @see Constant
- */
+
+ /// Gets number of constants associated with the argument expression.
+ ///
+ /// number of constants (int >= 0)
+ ///
+ ///
public int getConstantsNumber() {
return argumentExpression.getConstantsNumber();
}
- /**
- * Removes first occurrences of the constants
- * associated with the argument expression.
- *
- * @param constantsNames the constants names (variadic parameters)
- * comma separated list
- *
- * @see Constant
- */
+
+ ///
+ /// Removes first occurrences of the constants
+ /// associated with the argument expression.
+ ///
+ ///
+ ///
+ /// the constants names (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public void removeConstants(params String[] constantsNames) {
argumentExpression.removeConstants(constantsNames);
}
- /**
- * Removes first occurrences of the constants
- * associated with the argument expression
- *
- * @param constants the constants (variadic parameters)
- * comma separated list
- *
- * @see Constant
- */
+
+ ///
+ /// Removes first occurrences of the constants
+ /// associated with the argument expression
+ ///
+ ///
+ ///
+ /// the constants (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public void removeConstants(params Constant[] constants) {
argumentExpression.removeConstants(constants);
}
- /**
- * Removes all constants
- * associated with the argument expression
- *
- * @see Constant
- */
+
+ ///
+ /// Removes all constants
+ /// associated with the argument expression
+ ///
+ ///
+ ///
public void removeAllConstants() {
argumentExpression.removeAllConstants();
}
@@ -785,114 +796,126 @@ public void removeAllConstants() {
*
*=================================================
*/
- /**
- * Adds functions (variadic parameters) to the argument expression definition.
- *
- * @param functions the functions
- * (variadic parameters) comma separated list
- *
- * @see Function
- */
+
+ /// Adds functions (variadic parameters) to the argument expression definition.
+ ///
+ ///
+ /// the functions (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public void addFunctions(params Function[] functions) {
argumentExpression.addFunctions(functions);
}
- /**
- * Enables to define the function (associated with
- * the argument expression) based on the function name,
- * function expression string and arguments names (variadic parameters).
- *
- * @param functionName the function name
- * @param functionExpressionString the expression string
- * @param argumentsNames the function arguments names
- * (variadic parameters)
- * comma separated list
- *
- * @see Function
- */
+
+ ///
+ /// Enables to define the function (associated with
+ /// the argument expression) based on the function name,
+ /// function expression string and arguments names (variadic parameters).
+ ///
+ ///
+ /// the function name
+ /// the expression string
+ ///
+ /// the function arguments names
+ /// (variadic parameters) comma separated list
+ ///
+ ///
+ ///
public void defineFunction(String functionName, String functionExpressionString,
params String[] argumentsNames) {
argumentExpression.defineFunction(functionName, functionExpressionString, argumentsNames);
}
- /**
- * Gets index of function associated with the argument expression.
- *
- * @param functionName the function name
- *
- * @return Function index if function name was found,
- * otherwise returns Function.NOT_FOUND
- *
- * @see Function
- */
+
+ /// Gets index of function associated with the argument expression.
+ ///
+ /// the function name
+ ///
+ ///
+ /// Function index if function name was found,
+ /// otherwise returns
+ ///
+ ///
+ ///
public int getFunctionIndex(String functionName) {
return argumentExpression.getFunctionIndex(functionName);
}
- /**
- * Gets function associated with the argument expression.
- *
- * @param functionName the function name
- *
- * @return Function if function name was found,
- * otherwise returns null.
- *
- * @see Function
- */
+
+ /// Gets function associated with the argument expression.
+ ///
+ /// the function name
+ ///
+ ///
+ /// Function if function name was found,
+ /// otherwise returns null.
+ ///
+ ///
+ ///
public Function getFunction(String functionName) {
return argumentExpression.getFunction(functionName);
}
- /**
- * Gets function associated with the argument expression.
- *
- * @param functionIndex the function index
- *
- * @return Function if function index is between 0 and
- * the last available function index (getFunctionsNumber()-1),
- * otherwise returns null.
- *
- * @see Function
- */
+
+ /// Gets function associated with the argument expression.
+ ///
+ /// the function index
+ ///
+ ///
+ /// Function if function index is between 0 and
+ /// the last available function index (-1),
+ /// otherwise returns null.
+ ///
+ ///
+ ///
public Function getFunction(int functionIndex) {
return argumentExpression.getFunction(functionIndex);
}
- /**
- * Gets number of functions associated with the argument expression.
- *
- * @return number of functions (int >= 0)
- *
- * @see Function
- */
+
+ /// Gets number of functions associated with the argument expression.
+ ///
+ /// number of functions (int >= 0)
+ ///
+ ///
public int getFunctionsNumber() {
return argumentExpression.getFunctionsNumber();
}
- /**
- * Removes first occurrences of the functions
- * associated with the argument expression.
- *
- * @param functionsNames the functions names (variadic parameters)
- * comma separated list
- *
- * @see Function
- */
+
+ ///
+ /// Removes first occurrences of the functions
+ /// associated with the argument expression.
+ ///
+ ///
+ ///
+ /// the functions names (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public void removeFunctions(params String[] functionsNames) {
argumentExpression.removeFunctions(functionsNames);
}
- /**
- * Removes first occurrences of the functions
- * associated with the argument expression.
- *
- * @param functions the functions (variadic parameters)
- * comma separated list.
- *
- * @see Function
- */
+
+ ///
+ /// Removes first occurrences of the functions
+ /// associated with the argument expression.
+ ///
+ ///
+ ///
+ /// the functions (variadic parameters)
+ /// comma separated list.
+ ///
+ ///
+ ///
public void removeFunctions(params Function[] functions) {
argumentExpression.removeFunctions(functions);
}
- /**
- * Removes all functions
- * associated with the argument expression.
- *
- * @see Function
- */
+
+ ///
+ /// Removes all functions
+ /// associated with the argument expression.
+ ///
+ ///
+ ///
public void removeAllFunctions() {
argumentExpression.removeAllFunctions();
}
@@ -902,39 +925,37 @@ public void removeAllFunctions() {
*
*=================================================
*/
- /**
- * Adds related expression to the argumentExpression
- *
- * @param expression the related expression
- * @see Expression
- */
+
+ /// Adds related expression to the
+ ///
+ /// the related expression
+ ///
internal void addRelatedExpression(Expression expression) {
argumentExpression.addRelatedExpression(expression);
}
- /**
- * Adds related expression form the argumentExpression
- *
- * @param expression related expression
- *
- * @see Expression
- */
+
+ /// Adds related expression form the
+ ///
+ /// related expression
+ ///
+ ///
internal void removeRelatedExpression(Expression expression) {
argumentExpression.removeRelatedExpression(expression);
}
- /**
- * Sets expression was modified flag to all related expressions
- * to the argumentExpression.
- *
- * @see Expression
- */
+
+ ///
+ /// Sets expression was modified flag to all related expressions
+ /// to the .
+ ///
+ ///
+ ///
internal void setExpressionModifiedFlags() {
argumentExpression.setExpressionModifiedFlag();
}
- /**
- * Creates cloned object of the this argument.''
- *
- * @return clone of the argument.
- */
+
+ /// Creates cloned object of the this argument.''
+ ///
+ /// clone of the argument.
public Argument clone() {
Argument newArg = new Argument(this.argumentName);
newArg.argumentExpression = this.argumentExpression;
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Constant.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Constant.cs
index 045c6db6..081cfdb9 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Constant.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Constant.cs
@@ -58,97 +58,78 @@
using System.Collections.Generic;
namespace org.mariuszgromada.math.mxparser {
- /**
- * Constant class provides ability to declare constants.
- * Constants can be used in further processing by any expression,
- * dependent or recursive argument, function, etc...
- *
- * When creating a constant you should avoid names reserved as
- * parser keywords, in general words known in mathematical language
- * as function names, operators (for example:
- * sin, cos, +, -, pi, e, etc...). Please be informed that after associating
- * the constant with the expression, function or dependent/recursive argument
- * its name will be recognized by the parser as reserved key word.
- * It means that it could not be the same as any other key word known
- * by the parser for this particular expression.
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.3.0
- *
- * @see RecursiveArgument
- * @see Expression
- * @see Function
- * @see Argument
- *
- */
+ ///
+ /// Constant class provides ability to declare constants.
+ /// Constants can be used in further processing by any expression,
+ /// dependent or recursive argument, function, etc...
+ ///
+ ///
+ /// When creating a constant you should avoid names reserved as
+ /// parser keywords, in general words known in mathematical language
+ /// as function names, operators (for example:
+ /// sin, cos, +, -, pi, e, etc...). Please be informed that after associating
+ /// the constant with the expression, function or dependent/recursive argument
+ /// its name will be recognized by the parser as reserved key word.
+ /// It means that it could not be the same as any other key word known
+ /// by the parser for this particular expression.
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.3.0
+ ///
+ ///
+ ///
+ ///
+ ///
[CLSCompliant(true)]
public class Constant : PrimitiveElement {
- /**
- * When constant could not be found
- */
+ /// When constant could not be found
public const int NOT_FOUND = Expression.NOT_FOUND;
- /**
- * Type identifier for constants
- */
+ /// Type identifier for constants
public const int TYPE_ID = 104;
public const String TYPE_DESC = "User defined constant";
- /**
- * Status of the Expression syntax
- */
+ /// Status of the Expression syntax
public const bool NO_SYNTAX_ERRORS = Expression.NO_SYNTAX_ERRORS;
public const bool SYNTAX_ERROR_OR_STATUS_UNKNOWN = Expression.SYNTAX_ERROR_OR_STATUS_UNKNOWN;
private const String NO_SYNTAX_ERROR_MSG = "Constant - no syntax errors.";
- /**
- * Name of the constant
- */
+ /// Name of the constant
private String constantName;
- /**
- * COnstant value
- */
+ /// COnstant value
private double constantValue;
- /**
- * Constant description
- */
+ /// Constant description
private String description;
- /**
- * Dependent expression list
- */
+ /// Dependent expression list
private List relatedExpressionsList;
- /**
- * Status of the expression syntax
- *
- * Please referet to the:
- * - NO_SYNTAX_ERRORS
- * - SYNTAX_ERROR_OR_STATUS_UNKNOWN
- */
+ /// Status of the expression syntax
+ ///
+ ///
+ /// Please referet to the:
+ /// -
+ /// -
+ ///
private bool syntaxStatus;
- /**
- * Message after checking the syntax
- */
+ /// Message after checking the syntax
private String errorMessage;
- /**
- * Constructor - creates constant with a given name and given value
- *
- *
- * @param constantName the constant name
- * @param constantValue the constant value
- */
+
+ /// Constructor - creates constant with a given name and given value
+ ///
+ /// the constant name
+ /// the constant value
public Constant(String constantName, double constantValue) : base(Constant.TYPE_ID) {
relatedExpressionsList = new List();
if (mXparser.regexMatch(constantName, ParserSymbol.nameOnlyTokenOptBracketsRegExp)) {
@@ -162,14 +143,15 @@ public Constant(String constantName, double constantValue) : base(Constant.TYPE_
errorMessage = "[" + constantName + "] " + "--> invalid constant name, pattern not mathes: " + ParserSymbol.nameTokenRegExp; ;
}
}
- /**
- * Constructor - creates constant with a given name and given value.
- * Additionally description is being set.
- *
- * @param constantName the constant name
- * @param constantValue the constant value
- * @param description the constant description
- */
+
+ ///
+ /// Constructor - creates constant with a given name and given value.
+ /// Additionally description is being set.
+ ///
+ ///
+ /// the constant name
+ /// the constant value
+ /// the constant description
public Constant(String constantName, double constantValue, String description) : base(Constant.TYPE_ID) {
relatedExpressionsList = new List();
if (mXparser.regexMatch(constantName, ParserSymbol.nameOnlyTokenOptBracketsRegExp)) {
@@ -184,16 +166,22 @@ public Constant(String constantName, double constantValue, String description) :
errorMessage = "[" + constantName + "] " + "--> invalid constant name, pattern not mathes: " + ParserSymbol.nameTokenRegExp; ;
}
}
- /**
- * Constructor for function definition in natural math language,
- * for instance providing on string "f(x,y) = sin(x) + cos(x)"
- * is enough to define function "f" with parameters "x and y"
- * and function body "sin(x) + cos(x)".
- *
- * @param constantDefinitionString Constant definition in the form
- * of one String, ie "c = 2" or "c = 2*sin(pi/3)"
- * @param elements Optional parameters (comma separated) such as Arguments, Constants, Functions
- */
+
+ ///
+ /// Constructor for function definition in natural math language,
+ /// for instance providing on string "f(x,y) = sin(x) + cos(x)"
+ /// is enough to define function "f" with parameters "x and y"
+ /// and function body "sin(x) + cos(x)".
+ ///
+ ///
+ ///
+ /// Constant definition in the form
+ /// of one String, ie "c = 2" or "c = 2*sin(pi/3)"
+ ///
+ ///
+ /// Optional parameters (comma separated) such as Arguments,
+ /// Constants, Functions
+ ///
public Constant(String constantDefinitionString, params PrimitiveElement[] elements) : base(Constant.TYPE_ID) {
description = "";
syntaxStatus = SYNTAX_ERROR_OR_STATUS_UNKNOWN;
@@ -209,20 +197,20 @@ public Constant(String constantDefinitionString, params PrimitiveElement[] eleme
}
else errorMessage = "[" + constantDefinitionString + "] " + "--> pattern not mathes: " + ParserSymbol.constArgDefStrRegExp;
}
- /**
- * Gets constant name
- *
- * @return the constant name as string.
- */
+
+ /// Gets constant name
+ ///
+ /// the constant name as string.
public String getConstantName() {
return constantName;
}
- /**
- * Sets constant name. If constant is associated with any expression
- * then this operation will set modified flag to each related expression.
- *
- * @param constantName the constant name
- */
+
+ ///
+ /// Sets constant name. If constant is associated with any expression
+ /// then this operation will set modified flag to each related expression.
+ ///
+ ///
+ /// the constant name
public void setConstantName(String constantName) {
if (mXparser.regexMatch(constantName, ParserSymbol.nameOnlyTokenOptBracketsRegExp)) {
this.constantName = constantName;
@@ -233,77 +221,71 @@ public void setConstantName(String constantName) {
errorMessage = "[" + constantName + "] " + "--> invalid constant name, pattern not mathes: " + ParserSymbol.nameTokenRegExp; ;
}
}
- /**
- * Sets constant value
- * @param value constant value
- */
+
+ /// Sets constant value
+ ///
+ /// constant value
public void setConstantValue(double constantValue) {
this.constantValue = constantValue;
}
- /**
- * Gets constant value.
- *
- * @return constant value as double
- */
+
+ /// Gets constant value.
+ ///
+ /// constant value as double
public double getConstantValue() {
return constantValue;
}
- /**
- * Gets constant description.
- *
- * @return constant description as string.
- */
+
+ /// Gets constant description.
+ ///
+ /// constant description as string.
public String getDescription() {
return description;
}
- /**
- * Sets constant description.
- *
- * @param description the constant description
- */
+
+ /// Sets constant description.
+ ///
+ /// the constant description
public void setDescription(String description) {
this.description = description;
}
- /**
- * Method return error message after
- *
- * @return Error message as string.
- */
+
+ /// Method return error message after
+ ///
+ /// Error message as string.
public String getErrorMessage() {
return errorMessage;
}
- /**
- * Gets syntax status of the expression.
- *
- * @return Constant.NO_SYNTAX_ERRORS if there are no syntax errors,
- * ConstantValue.SYNTAX_ERROR_OR_STATUS_UNKNOWN when syntax error was found or
- * syntax status is unknown
- */
+
+ /// Gets syntax status of the expression.
+ ///
+ ///
+ /// if there are no syntax errors,
+ /// when syntax error was found or
+ /// syntax status is unknown
+ ///
public bool getSyntaxStatus() {
return this.syntaxStatus;
}
- /**
- * Adds related expression.
- *
- * @param expression the related expression.
- */
+
+ /// Adds related expression.
+ ///
+ /// the related expression.
internal void addRelatedExpression(Expression expression) {
if (expression != null)
if ( !relatedExpressionsList.Contains(expression) )
relatedExpressionsList.Add(expression);
}
- /**
- * Removes related expression.
- *
- * @param expression the related expression.
- */
+
+ /// Removes related expression.
+ ///
+ /// the related expression.
internal void removeRelatedExpression(Expression expression) {
if (expression != null)
relatedExpressionsList.Remove(expression);
}
- /**
- * Sets expression modified flag to each related expression.
- */
+
+ /// Sets expression modified flag to each related expression.
void setExpressionModifiedFlags() {
foreach (Expression e in relatedExpressionsList)
e.setExpressionModifiedFlag();
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Expression.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Expression.cs
index bb95b8ae..15a37a9f 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Expression.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Expression.cs
@@ -64,241 +64,233 @@
using org.mariuszgromada.math.mxparser.parsertokens;
namespace org.mariuszgromada.math.mxparser {
- /**
- * Expression - base class for real expressions definition.
- *
- * Examples:
- *
- * - '1+2'
- *
- 'sin(x)+1'
- *
- 'asin(3*x)^10-log(4,8)'
- *
- in general 'f(x1,x2,...,xn)' where x1,...,xn are real
- * arguments
- *
- *
- * Class provides easy way to define multivariate arithmetic expression.
- *
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.3.3
- *
- * @see Argument
- * @see RecursiveArgument
- * @see Constant
- * @see Function
- */
+ ///
+ /// Expression - base class for real expressions definition.
+ ///
+ /// Examples:
+ ///
+ /// - '1+2'
+ /// - 'sin(x)+1'
+ /// - 'asin(3*x)^10-log(4,8)'
+ /// -
+ /// in general 'f(x1,x2,...,xn)' where x1,...,xn are real
+ /// arguments
+ ///
+ ///
+ ///
+ ///
+ /// Class provides easy way to define multivariate arithmetic expression.
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.3.3
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
[CLSCompliant(true)]
public class Expression {
- /**
- * FOUND / NOT_FOUND
- * used for matching purposes
- */
+ ///
+ /// FOUND / NOT_FOUND
+ /// used for matching purposes
+ ///
internal const int NOT_FOUND = mXparser.NOT_FOUND;
internal const int FOUND = mXparser.FOUND;
- /**
- * Marker for internal processing
- */
+
+ /// Marker for internal processing
+
internal const bool INTERNAL = true;
- /**
- * For verbose mode purposes
- */
+ /// For verbose mode purposes
private const bool WITH_EXP_STR = true;
private const bool NO_EXP_STR = false;
- /**
- * Status of the Expression syntax
- */
+ /// Status of the Expression syntax
public const bool NO_SYNTAX_ERRORS = true;
public const bool SYNTAX_ERROR_OR_STATUS_UNKNOWN = false;
- /**
- * Expression string (for example: "sin(x)+cos(y)")
- */
+ /// Expression string (for example: "sin(x)+cos(y)")
internal String expressionString;
private String description;
- /**
- * List of arguments
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ /// List of arguments
+ ///
+ ///
+ ///
internal List argumentsList;
- /**
- * List of user defined functions
- *
- * @see Function
- */
+ /// List of user defined functions
+ ///
+ ///
internal List functionsList;
- /**
- * List of user defined constants
- *
- * @see Constant
- */
+ /// List of user defined constants
+ ///
+ ///
internal List constantsList;
- /**
- * List of key words known by the parser
- */
+ /// List of key words known by the parser
private List keyWordsList;
- /**
- * List of expression tokens (words).
- * Token class defines all needed
- * attributes for recognizing the structure of
- * arithmetic expression. This is the key result when
- * initial parsing is finished (tokenizeExpressionString() - method).
- * Token keeps information about:
- * - token type (for example: function, operator, argument, number, etc...)
- * - token identifier within given type (sin, cos, operaotr, etc...)
- * - token value (if token is a number)
- * - token level - key information regarding sequence (order) of further parsing
- */
+ ///
+ /// List of expression tokens (words).
+ /// Token class defines all needed
+ /// attributes for recognizing the structure of
+ /// arithmetic expression. This is the key result when
+ /// initial parsing is finished ( - method).
+ ///
+ ///
+ /// Token keeps information about:
+ ///
+ /// - token type (for example: function, operator, argument, number, etc...)
+ /// - token identifier within given type (sin, cos, operaotr, etc...)
+ /// - token value (if token is a number)
+ /// - token level - key information regarding sequence (order) of further parsing
+ ///
+ ///
private List initialTokens;
- /**
- * the initialTokens list keeps unchanged information about
- * found tokens.
- *
- * While parsing the tokensList is used. The tokensList is the same
- * as initialTokens list at the beginning of the calculation process.
- * Each math operation changes tokens list - it means that
- * tokens are parameters when performing math operation
- * and the result is also presented as token (usually as a number token)
- * At the end of the calculation the tokensList should contain only one
- * element - the result of all calculations.
- */
+ ///
+ /// the initialTokens list keeps unchanged information about
+ /// found tokens.
+ ///
+ ///
+ /// While parsing the tokensList is used. The tokensList is the same
+ /// as list at the beginning of the calculation process.
+ /// Each math operation changes tokens list - it means that
+ /// tokens are parameters when performing math operation
+ /// and the result is also presented as token (usually as a number token)
+ /// At the end of the calculation the tokensList should contain only one
+ /// element - the result of all calculations.
+ ///
private List tokensList;
- /**
- * List of related expressions, for example when
- * user defined function is used in the expression
- * or dependent argument was defined. Modification of
- * function expression calls the method expression modified
- * flag method to all related expressions.
- *
- * Related expression usually are used for
- * - dependent arguments
- * - recursive arguments
- * - user functions
- */
+ ///
+ /// List of related expressions, for example when
+ /// user defined function is used in the expression
+ /// or dependent argument was defined. Modification of
+ /// function expression calls the method expression modified
+ /// flag method to all related expressions.
+ ///
+ ///
+ /// Related expression usually are used for
+ ///
+ /// - dependent arguments
+ /// - recursive arguments
+ /// - user functions
+ ///
+ ///
internal List relatedExpressionsList;
- /**
- * Keeps computing time
- */
+ /// Keeps computing time
private double computingTime;
- /**
- * if true then new tokenizing is required
- * (the initialTokens list needs to be updated)
- */
+ ///
+ /// if true then new tokenizing is required
+ /// (the list needs to be updated)
+ ///
private bool expressionWasModified;
- /**
- * If recursive mode is on the recursive calls are permitted.
- * It mean there will be no null pointer exceptions
- * due to expression, and functions cloning.
- */
+ ///
+ /// If recursive mode is on the recursive calls are permitted.
+ /// It mean there will be no null pointer exceptions
+ /// due to expression, and functions cloning.
+ ///
internal bool recursiveMode;
- /**
- * Verbose mode prints processing info
- * calls System.out.print* methods
- */
+ ///
+ /// Verbose mode prints processing info
+ /// calls Console.Write* methods
+ ///
private bool verboseMode;
- /**
- * Internal parameter for calculus expressions
- * to avoid decrease in accuracy.
- */
+ ///
+ /// Internal parameter for calculus expressions
+ /// to avoid decrease in accuracy.
+ ///
internal bool disableUlpRounding;
internal const bool DISABLE_ULP_ROUNDING = true;
internal const bool KEEP_ULP_ROUNDING_SETTINGS = false;
- /**
- * Status of the expression syntax
- *
- * Please referet to the:
- * - NO_SYNTAX_ERRORS
- * - SYNTAX_ERROR_OR_STATUS_UNKNOWN
- */
+ /// Status of the expression syntax
+ ///
+ /// Please referet to the:
+ ///
+ ///
+ ///
+ ///
+ ///
private bool syntaxStatus;
- /**
- * Message after checking the syntax
- */
+ /// Message after checking the syntax
private String errorMessage;
- /**
- * Flag used internally to mark started recursion
- * call on the current object, necessary to
- * avoid infinite loops while recursive syntax
- * checking (i.e. f -> g and g -> f)
- * or marking modified flags on the expressions
- * related to this expression.
- *
- * @see setExpressionModifiedFlag()
- * @see checkSyntax()
- */
+ ///
+ /// Flag used internally to mark started recursion
+ /// call on the current object, necessary to
+ /// avoid infinite loops while recursive syntax
+ /// checking (i.e. f -> g and g -> f)
+ /// or marking modified flags on the expressions
+ /// related to this expression.
+ ///
+ ///
+ ///
+ ///
private bool recursionCallPending;
- /**
- * Internal counter to avoid infinite loops while calculating
- * expression defined in the way shown by below examples
- *
- * Argument x = new Argument("x = 2*y");
- * Argument y = new Argument("y = 2*x");
- * x.addDefinitions(y);
- * y.addDefinitions(x);
- *
- * Function f = new Function("f(x) = 2*g(x)");
- * Function g = new Function("g(x) = 2*f(x)");
- * f.addDefinitions(g);
- * g.addDefinitions(f);
- */
+ ///
+ /// Internal counter to avoid infinite loops while calculating
+ /// expression defined in the way shown by below examples
+ ///
+ /// Argument x = new Argument("x = 2*y");
+ /// Argument y = new Argument("y = 2*x");
+ /// x.addDefinitions(y);
+ /// y.addDefinitions(x);
+ ///
+ /// Function f = new Function("f(x) = 2*g(x)");
+ /// Function g = new Function("g(x) = 2*f(x)");
+ /// f.addDefinitions(g);
+ /// g.addDefinitions(f);
+ ///
+ ///
private int recursionCallsCounter;
- /**
- * Internal indicator for tokenization process
- * if true, then keywords such as constants
- * functions etc.. will not be recognized
- * during tokenization
- */
+ ///
+ /// Internal indicator for tokenization process
+ /// if true, then keywords such as constants
+ /// functions etc.. will not be recognized
+ /// during tokenization
+ ///
private bool parserKeyWordsOnly;
- /**
- * Indicator whether expression was
- * automatically built for user defined
- * functions purpose
- *
- * @see Function
- */
+ ///
+ /// Indicator whether expression was
+ /// automatically built for user defined
+ /// functions purpose
+ ///
+ ///
+ ///
internal bool UDFExpression = false;
- /**
- * List of parameters provided by the user at run-time
- *
- * @see Function
- */
+ /// List of parameters provided by the user at run-time
+ ///
+ ///
internal List UDFVariadicParamsAtRunTime;
- /**
- * Internal indicator for calculation process
- * Expression.Calculate() method
- * It show whether to build again tokens list
- * if clone - build again
- * if not clone - build only at the beginning
- *
- * Indicator helps to solve the problem with
- * above definitions
- *
- * Function f = new Function("f(x) = 2*g(x)");
- * Function g = new Function("g(x) = 2*f(x)");
- * f.addDefinitions(g);
- * g.addDefinitions(f);
- */
+ ///
+ /// Internal indicator for calculation process
+ /// method
+ ///
+ /// It show whether to build again tokens list
+ /// if clone - build again
+ /// if not clone - build only at the beginning
+ ///
+ /// Indicator helps to solve the problem with
+ /// above definitions
+ ///
+ /// Function f = new Function("f(x) = 2*g(x)");
+ /// Function g = new Function("g(x) = 2*f(x)");
+ /// f.addDefinitions(g);
+ /// g.addDefinitions(f);
+ ///
+ ///
private bool internalClone;
- /**
- * mXparser options changeset
- * used in checkSyntax() method
- */
+ /// mXparser options changeset
+ /// used in checkSyntax() method
private int optionsChangesetNumber = -1;
/*=================================================
*
@@ -306,75 +298,71 @@ public class Expression {
*
*=================================================
*/
- /**
- * Adds related expression
- * The same expression could be added more than once
- * For example when
- *
- * @param expression the expression
- */
+ ///
+ /// Adds related expression
+ /// The same expression could be added more than once
+ /// For example when
+ ///
+ ///
+ /// the expression
internal void addRelatedExpression(Expression expression) {
if ((expression != null) && (expression != this))
if ( !relatedExpressionsList.Contains(expression))
relatedExpressionsList.Add(expression);
}
- /**
- * Removes related expression
- *
- * @param expression the expression
- */
+ /// Removes related expression
+ ///
+ /// the expression
internal void removeRelatedExpression(Expression expression) {
relatedExpressionsList.Remove(expression);
}
- /**
- * Prints related expression list
- */
+ /// Prints related expression list
internal void showRelatedExpressions() {
mXparser.consolePrintln();
mXparser.consolePrintln(this.description + " = " + this.expressionString + ":");
foreach (Expression e in relatedExpressionsList)
mXparser.consolePrintln("-> " + e.description + " = " + e.expressionString);
}
- /**
- * Method return error message after
- * calling checkSyntax() method or
- * calculate().
- *
- * @return Error message as string.
- */
+ ///
+ /// Method return error message after
+ /// calling method or
+ /// .
+ ///
+ ///
+ /// Error message as string.
public String getErrorMessage() {
return errorMessage;
}
- /**
- * Gets syntax status of the expression.
- *
- * @return true if there are no syntax errors,
- * false when syntax error was found or
- * syntax status is unknown
- */
+ /// Gets syntax status of the expression.
+ ///
+ ///
+ /// true if there are no syntax errors,
+ /// false when syntax error was found or
+ /// syntax status is unknown
+ ///
public bool getSyntaxStatus() {
return this.syntaxStatus;
}
- /**
- * Package level method for passing
- * information about errors identified
- * on the constructors level
- *
- * @param syntaxStatus Syntax status
- * @param errorMessage Error message
- *
- * @see Function
- */
+ ///
+ /// Package level method for passing
+ /// information about errors identified
+ /// on the constructors level
+ ///
+ ///
+ /// Syntax status
+ /// Error message
+ ///
+ ///
internal void setSyntaxStatus(bool syntaxStatus, String errorMessage) {
this.syntaxStatus = syntaxStatus;
this.errorMessage = errorMessage;
this.expressionWasModified = false;
}
- /**
- * Sets expression status to modified
- * Calls setExpressionModifiedFlag() method
- * to all related expressions.
- */
+ ///
+ /// Sets expression status to modified
+ /// Calls setExpressionModifiedFlag() method
+ /// to all related expressions.
+ ///
internal void setExpressionModifiedFlag() {
if (recursionCallPending == false) {
recursionCallPending = true;
@@ -388,9 +376,7 @@ internal void setExpressionModifiedFlag() {
recursionCallPending = false;
}
}
- /**
- * Common variables while expression initializing
- */
+ /// Common variables while expression initializing
private void expressionInternalVarsInit() {
description = "";
errorMessage = "";
@@ -401,9 +387,7 @@ private void expressionInternalVarsInit() {
parserKeyWordsOnly = false;
disableUlpRounding = KEEP_ULP_ROUNDING_SETTINGS;
}
- /**
- * Common elements while expression initializing
- */
+ /// Common elements while expression initializing
private void expressionInit() {
/*
* New lists
@@ -427,58 +411,64 @@ private void expressionInit() {
*
*=================================================
*/
- /**
- * Default constructor - empty expression
- *
- * @param elements Optional elements list (variadic - comma separated) of types: Argument, Constant, Function
- *
- * @see PrimitiveElement
- */
+ /// Default constructor - empty expression
+ ///
+ ///
+ /// Optional elements list (variadic - comma separated)
+ /// of types: , ,
+ ///
+ ///
+ ///
+ ///
public Expression(params PrimitiveElement[] elements) {
expressionString = "";
expressionInit();
setExpressionModifiedFlag();
addDefinitions(elements);
}
- /**
- * Constructor - creates new expression from expression string.
- *
- * @param expressionString definition of the expression
- * @param elements Optional elements list (variadic - comma separated) of types: Argument, Constant, Function
- *
- * @see PrimitiveElement
- *
- */
+ /// Constructor - creates new expression from expression string.
+ ///
+ /// definition of the expression
+ ///
+ /// Optional elements list (variadic - comma separated)
+ /// of types: , ,
+ ///
+ ///
+ ///
+ ///
+ ///
public Expression(String expressionString, params PrimitiveElement[] elements) {
expressionInit();
this.expressionString = "" + expressionString;
setExpressionModifiedFlag();
addDefinitions(elements);
}
- /**
- * Constructor - creates new expression from expression string.
- * @param expressionString definition of the expression
- * @param parserKeyWordsOnly if true then all keywords such as functions,
- * constants, arguments will not be recognized.
- */
+ /// Constructor - creates new expression from expression string.
+ /// definition of the expression
+ ///
+ /// if true then all keywords such as functions,
+ /// constants, arguments will not be recognized.
+ ///
internal Expression(String expressionString, bool parserKeyWordsOnly) {
expressionInit();
this.expressionString = "" + expressionString;
setExpressionModifiedFlag();
this.parserKeyWordsOnly = parserKeyWordsOnly;
}
- /**
- * Package level constructor - creates new expression from subexpression
- * (sublist of the tokens list), arguments list, functions list and
- * constants list (used by the internal calculus operations, etc...).
- *
- * @param expressionString the expression string
- * @param initialTokens the tokens list (starting point - no tokenizing,
- * no syntax checking)
- * @param argumentsList the arguments list
- * @param functionsList the functions list
- * @param constantsList the constants list
- */
+ ///
+ /// Package level constructor - creates new expression from subexpression
+ /// (sublist of the tokens list), arguments list, functions list and
+ /// constants list (used by the internal calculus operations, etc...).
+ ///
+ ///
+ /// the expression string
+ ///
+ /// the tokens list (starting point - no tokenizing,
+ /// no syntax checking)
+ ///
+ /// the arguments list
+ /// the functions list
+ /// the constants list
internal Expression(String expressionString, List initialTokens, List argumentsList,
List functionsList, List constantsList, bool disableUlpRounding,
bool UDFExpression, List UDFVariadicParamsAtRunTime) {
@@ -503,24 +493,24 @@ internal Expression(String expressionString, List initialTokens, List
+ /// Package level constructor - creates new expression from expression string,
+ /// arguments list, functions list and constants list (used by the
+ /// RecursiveArgument class).
+ ///
+ ///
+ /// No related expressions at the beginning.
+ ///
+ /// the expression string
+ /// the arguments list
+ /// the functions list
+ /// the constants list
+ /// the marker for internal processing
+ ///
+ ///
+ ///
+ ///
+ ///
internal Expression(String expressionString, List argumentsList,
List functionsList, List constantsList
,bool i, bool UDFExpression, List UDFVariadicParamsAtRunTime) {
@@ -536,11 +526,9 @@ List functionsList, List constantsList
relatedExpressionsList = new List();
setExpressionModifiedFlag();
}
- /**
- * Private constructor - expression cloning.
- *
- * @param expression the base expression
- */
+ /// Private constructor - expression cloning.
+ ///
+ /// the base expression
private Expression(Expression expression) {
expressionString = "" + expression.expressionString;
description = "" + expression.description;
@@ -562,109 +550,93 @@ private Expression(Expression expression) {
UDFVariadicParamsAtRunTime = expression.UDFVariadicParamsAtRunTime;
internalClone = true;
}
- /**
- * Sets (modifies expression) expression string.
- *
- * @param expressionString the expression string
- */
+ /// Sets (modifies expression) expression string.
+ ///
+ /// the expression string
public void setExpressionString(String expressionString) {
this.expressionString = expressionString;
setExpressionModifiedFlag();
- }
- /**
- * Returns expression string
- */
- public String getExpressionString() {
- return expressionString;
- }
- /**
- * Clears expression string
- */
- public void clearExpressionString() {
- this.expressionString = "";
- setExpressionModifiedFlag();
- }
- /**
- * Sets expression description.
- *
- * @param description the description string
- */
- public void setDescription(String description) {
- this.description = description;
- }
- /**
- * Gets expression description.
- *
- * @return String description.
- */
- public String getDescription() {
- return description;
- }
- /**
- * Clears expression description
- */
- public void clearDescription() {
- this.description = "";
- }
- /**
- * Enables verbose mode.
- */
- public void setVerboseMode() {
- verboseMode = true;
- }
- /**
- * Disables verbose mode (default silent mode).
- */
- public void setSilentMode() {
- verboseMode = false;
- }
- /**
- * Returns verbose mode status.
- *
- * @return true if verbose mode is on,
- * otherwise returns false.
- */
- public bool getVerboseMode() {
- return verboseMode;
- }
- /**
- * Sets recursive mode
- */
- internal void setRecursiveMode() {
- recursiveMode = true;
- }
- /**
- * Disables recursive mode
- */
- internal void disableRecursiveMode() {
- recursiveMode = false;
- }
- /**
- * Gets recursive mode status
- *
- * @return true if recursive mode is enabled,
- * otherwise returns false.
- */
- public bool getRecursiveMode() {
- return recursiveMode;
- }
- /**
- * Gets computing time.
- *
- * @return computing time in seconds.
- */
- public double getComputingTime() {
- return computingTime;
- }
- /**
- * Adds user defined elements (such as: Arguments, Constants, Functions)
- * to the expressions.
- *
- * @param elements Elements list (variadic), where Argument, Constant, Function
- * extend the same class PrimitiveElement
- *
- * @see PrimitiveElement
- */
+ }
+ /// Returns expression string
+ public String getExpressionString() {
+ return expressionString;
+ }
+ /// Clears expression string
+ public void clearExpressionString() {
+ this.expressionString = "";
+ setExpressionModifiedFlag();
+ }
+ /// Sets expression description.
+ ///
+ /// the description string
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ /// Gets expression description.
+ ///
+ /// String description.
+ public String getDescription() {
+ return description;
+ }
+ /// Clears expression description
+ public void clearDescription() {
+ this.description = "";
+ }
+ /// Enables verbose mode.
+ public void setVerboseMode() {
+ verboseMode = true;
+ }
+ /// Disables verbose mode (default silent mode).
+ public void setSilentMode() {
+ verboseMode = false;
+ }
+ /// Returns verbose mode status.
+ ///
+ ///
+ /// true if verbose mode is on,
+ /// otherwise returns false.
+ ///
+ public bool getVerboseMode() {
+ return verboseMode;
+ }
+ /// Sets recursive mode
+ internal void setRecursiveMode() {
+ recursiveMode = true;
+ }
+ /// Disables recursive mode
+ internal void disableRecursiveMode() {
+ recursiveMode = false;
+ }
+ /// Gets recursive mode status
+ ///
+ ///
+ /// true if recursive mode is enabled,
+ /// otherwise returns false.
+ ///
+ public bool getRecursiveMode() {
+ return recursiveMode;
+ }
+ /// Gets computing time.
+ ///
+ /// computing time in seconds.
+ public double getComputingTime() {
+ return computingTime;
+ }
+ ///
+ /// Adds user defined elements (such as:
+ /// Arguments,
+ /// Constants,
+ /// Functions)
+ /// to the expressions.
+ ///
+ ///
+ ///
+ /// Elements list (variadic), where ,
+ /// ,
+ /// extend the same class
+ ///
+ ///
+ ///
public void addDefinitions(params PrimitiveElement[] elements) {
foreach (PrimitiveElement e in elements) {
int elementTypeId = e.getMyTypeId();
@@ -676,15 +648,21 @@ public void addDefinitions(params PrimitiveElement[] elements) {
}
}
}
- /**
- * Removes user defined elements (such as: Arguments, Constants, Functions)
- * to the expressions.
- *
- * @param elements Elements list (variadic), where Argument, Constant, Function
- * extend the same class PrimitiveElement
- *
- * @see PrimitiveElement
- */
+ ///
+ /// Removes user defined elements (such as:
+ /// Arguments,
+ /// Constants,
+ /// Functions)
+ /// to the expressions.
+ ///
+ ///
+ ///
+ /// Elements list (variadic), where ,
+ /// ,
+ /// extend the same class
+ ///
+ ///
+ ///
public void removeDefinitions(params PrimitiveElement[] elements) {
foreach (PrimitiveElement e in elements) {
int elementTypeId = e.getMyTypeId();
@@ -702,559 +680,568 @@ public void removeDefinitions(params PrimitiveElement[] elements) {
*
*=================================================
*/
- /**
- * Adds arguments (variadic) to the expression definition.
- *
- * @param arguments the arguments list
- * (comma separated list)
- * @see Argument
- * @see RecursiveArgument
- */
+ /// Adds arguments (variadic) to the expression definition.
+ ///
+ ///
+ /// the arguments list
+ /// (comma separated list)
+ ///
+ ///
+ ///
public void addArguments(params Argument[] arguments) {
- foreach (Argument arg in arguments) {
- if (arg != null) {
- argumentsList.Add(arg);
- arg.addRelatedExpression(this);
- }
- }
- setExpressionModifiedFlag();
- }
- /**
- * Enables to define the arguments (associated with
- * the expression) based on the given arguments names.
- *
- * @param argumentsNames the arguments names (variadic)
- * comma separated list
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public void defineArguments(params String[] argumentsNames) {
- foreach (String argName in argumentsNames) {
- Argument arg = new Argument(argName);
- arg.addRelatedExpression(this);
+ foreach (Argument arg in arguments) {
+ if (arg != null) {
argumentsList.Add(arg);
+ arg.addRelatedExpression(this);
}
- setExpressionModifiedFlag();
}
- /**
- * Enables to define the argument (associated with the expression)
- * based on the argument name and the argument value.
- *
- * @param argumentName the argument name
- * @param argumentValue the the argument value
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public void defineArgument(String argumentName, double argumentValue) {
- Argument arg = new Argument(argumentName, argumentValue);
+ setExpressionModifiedFlag();
+ }
+ ///
+ /// Enables to define the arguments (associated with
+ /// the expression) based on the given arguments names.
+ ///
+ ///
+ ///
+ /// the arguments names (variadic)
+ /// comma separated list
+ ///
+ ///
+ ///
+ ///
+ public void defineArguments(params String[] argumentsNames) {
+ foreach (String argName in argumentsNames) {
+ Argument arg = new Argument(argName);
arg.addRelatedExpression(this);
argumentsList.Add(arg);
- setExpressionModifiedFlag();
}
- /**
- * Gets argument index from the expression.
- *
- * @param argumentName the argument name
- *
- * @return The argument index if the argument name was found,
- * otherwise returns Argument.NOT_FOUND
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public int getArgumentIndex(String argumentName) {
- int argumentsNumber = argumentsList.Count;
- if (argumentsNumber > 0) {
- int argumentIndex = 0;
- int searchResult = NOT_FOUND;
- while ((argumentIndex < argumentsNumber)&&(searchResult == NOT_FOUND)) {
- if (argumentsList[argumentIndex].getArgumentName().Equals(argumentName))
- searchResult = FOUND;
- else
- argumentIndex++;
- }
- if (searchResult == FOUND)
- return argumentIndex;
+ setExpressionModifiedFlag();
+ }
+ ///
+ /// Enables to define the argument (associated with the expression)
+ /// based on the argument name and the argument value.
+ ///
+ ///
+ /// the argument name
+ /// the the argument value
+ ///
+ ///
+ ///
+ public void defineArgument(String argumentName, double argumentValue) {
+ Argument arg = new Argument(argumentName, argumentValue);
+ arg.addRelatedExpression(this);
+ argumentsList.Add(arg);
+ setExpressionModifiedFlag();
+ }
+ /// Gets argument index from the expression.
+ ///
+ /// the argument name
+ ///
+ ///
+ /// The argument index if the argument name was found,
+ /// otherwise returns
+ ///
+ ///
+ ///
+ ///
+ public int getArgumentIndex(String argumentName) {
+ int argumentsNumber = argumentsList.Count;
+ if (argumentsNumber > 0) {
+ int argumentIndex = 0;
+ int searchResult = NOT_FOUND;
+ while ((argumentIndex < argumentsNumber)&&(searchResult == NOT_FOUND)) {
+ if (argumentsList[argumentIndex].getArgumentName().Equals(argumentName))
+ searchResult = FOUND;
else
- return NOT_FOUND;
- } else
- return NOT_FOUND;
- }
- /**
- * Gets argument from the expression.
- *
- *
- * @param argumentName the argument name
- *
- * @return The argument if the argument name was found,
- * otherwise returns null.
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public Argument getArgument(String argumentName) {
- int argumentIndex = getArgumentIndex(argumentName);
- if (argumentIndex == NOT_FOUND)
- return null;
- else
- return argumentsList[argumentIndex];
- }
- /**
- * Gets argument from the expression.
- *
- * @param argumentIndex the argument index
- *
- * @return Argument if the argument index is between 0 and
- * the last available argument index (getArgumentsNumber()-1),
- * otherwise returns null.
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public Argument getArgument(int argumentIndex) {
- if ( (argumentIndex < 0) || (argumentIndex >= argumentsList.Count) )
- return null;
+ argumentIndex++;
+ }
+ if (searchResult == FOUND)
+ return argumentIndex;
else
- return argumentsList[argumentIndex];
- }
- /**
- * Gets number of arguments associated with the expression.
- *
- * @return The number of arguments (int >= 0)
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public int getArgumentsNumber() {
- return argumentsList.Count;
- }
- /**
- * Sets argument value.
- *
- * @param argumentName the argument name
- * @param argumentValue the argument value
- */
- public void setArgumentValue(String argumentName, double argumentValue) {
- int argumentIndex = getArgumentIndex(argumentName);
- if (argumentIndex != NOT_FOUND)
- argumentsList[argumentIndex].setArgumentValue(argumentValue);
- }
- /**
- * Gets argument vale.
- *
- * @param argumentName the argument name
- *
- * @return Argument value if argument name was found,
- * otherwise return Double.NaN.
- */
- public double getArgumentValue(String argumentName) {
+ return NOT_FOUND;
+ } else
+ return NOT_FOUND;
+ }
+ /// Gets argument from the expression.
+ ///
+ /// the argument name
+ ///
+ ///
+ /// The argument if the argument name was found,
+ /// otherwise returns null.
+ ///
+ ///
+ ///
+ ///
+ public Argument getArgument(String argumentName) {
+ int argumentIndex = getArgumentIndex(argumentName);
+ if (argumentIndex == NOT_FOUND)
+ return null;
+ else
+ return argumentsList[argumentIndex];
+ }
+ /// Gets argument from the expression.
+ ///
+ /// the argument index
+ ///
+ ///
+ /// Argument if the argument index is between 0 and
+ /// the last available argument index (-1),
+ /// otherwise returns null.
+ ///
+ ///
+ ///
+ ///
+ public Argument getArgument(int argumentIndex) {
+ if ( (argumentIndex < 0) || (argumentIndex >= argumentsList.Count) )
+ return null;
+ else
+ return argumentsList[argumentIndex];
+ }
+ /// Gets number of arguments associated with the expression.
+ ///
+ /// The number of arguments (int >= 0)
+ ///
+ ///
+ ///
+ public int getArgumentsNumber() {
+ return argumentsList.Count;
+ }
+ /// Sets argument value.
+ ///
+ /// the argument name
+ /// the argument value
+ public void setArgumentValue(String argumentName, double argumentValue) {
+ int argumentIndex = getArgumentIndex(argumentName);
+ if (argumentIndex != NOT_FOUND)
+ argumentsList[argumentIndex].setArgumentValue(argumentValue);
+ }
+ /// Gets argument vale.
+ ///
+ /// the argument name
+ ///
+ ///
+ /// Argument value if argument name was found,
+ /// otherwise return .
+ ///
+ public double getArgumentValue(String argumentName) {
+ int argumentIndex = getArgumentIndex(argumentName);
+ if (argumentIndex != NOT_FOUND)
+ return argumentsList[argumentIndex].getArgumentValue();
+ else
+ return Double.NaN;
+ }
+ ///
+ /// Removes first occurrences of the arguments
+ /// associated with the expression.
+ ///
+ ///
+ ///
+ /// the arguments names
+ /// (variadic parameters) comma separated
+ /// list
+ ///
+ ///
+ ///
+ ///
+ public void removeArguments(params String[] argumentsNames) {
+ foreach (String argumentName in argumentsNames) {
int argumentIndex = getArgumentIndex(argumentName);
- if (argumentIndex != NOT_FOUND)
- return argumentsList[argumentIndex].getArgumentValue();
- else
- return Double.NaN;
- }
- /**
- * Removes first occurrences of the arguments
- * associated with the expression.
- *
- * @param argumentsNames the arguments names
- * (variadic parameters) comma separated
- * list
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public void removeArguments(params String[] argumentsNames) {
- foreach (String argumentName in argumentsNames) {
- int argumentIndex = getArgumentIndex(argumentName);
- if (argumentIndex != NOT_FOUND) {
- Argument arg = argumentsList[argumentIndex];
- arg.removeRelatedExpression(this);
- argumentsList.RemoveAt(argumentIndex);
- }
+ if (argumentIndex != NOT_FOUND) {
+ Argument arg = argumentsList[argumentIndex];
+ arg.removeRelatedExpression(this);
+ argumentsList.RemoveAt(argumentIndex);
}
- setExpressionModifiedFlag();
}
- /**
- * Removes first occurrences of the arguments
- * associated with the expression.
- *
- * @param arguments the arguments (variadic parameters)
- * comma separated list
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public void removeArguments(params Argument[] arguments) {
- foreach (Argument argument in arguments) {
- if (argument != null) {
- argumentsList.Remove(argument);
- argument.removeRelatedExpression(this);
- }
+ setExpressionModifiedFlag();
+ }
+ ///
+ /// Removes first occurrences of the arguments
+ /// associated with the expression.
+ ///
+ ///
+ ///
+ /// the arguments (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
+ ///
+ public void removeArguments(params Argument[] arguments) {
+ foreach (Argument argument in arguments) {
+ if (argument != null) {
+ argumentsList.Remove(argument);
+ argument.removeRelatedExpression(this);
}
- setExpressionModifiedFlag();
}
- /**
- * Removes all arguments associated with the expression.
- *
- * @see Argument
- * @see RecursiveArgument
- */
- public void removeAllArguments() {
- foreach (Argument arg in argumentsList)
- arg.removeRelatedExpression(this);
- argumentsList.Clear();
- setExpressionModifiedFlag();
- }
- /*=================================================
- *
- * Constants handling API
- *
- *=================================================
- */
- /**
- * Adds constants (variadic parameters) to the expression definition.
- *
- * @param constants the constants
- * (comma separated list)
- *
- * @see Constant
- */
- public void addConstants(params Constant[] constants) {
- foreach (Constant constant in constants) {
- if (constant != null) {
- constantsList.Add(constant);
- constant.addRelatedExpression(this);
- }
+ setExpressionModifiedFlag();
+ }
+ /// emoves all arguments associated with the expression.
+ ///
+ ///
+ ///
+ public void removeAllArguments() {
+ foreach (Argument arg in argumentsList)
+ arg.removeRelatedExpression(this);
+ argumentsList.Clear();
+ setExpressionModifiedFlag();
+ }
+ /*=================================================
+ *
+ * Constants handling API
+ *
+ *=================================================
+ */
+ /// Adds constants (variadic parameters) to the expression definition.
+ ///
+ ///
+ /// the constants
+ /// (comma separated list)
+ ///
+ ///
+ ///
+ public void addConstants(params Constant[] constants) {
+ foreach (Constant constant in constants) {
+ if (constant != null) {
+ constantsList.Add(constant);
+ constant.addRelatedExpression(this);
}
- setExpressionModifiedFlag();
}
- /**
- * Enables to define the constant (associated with
- * the expression) based on the constant name and
- * constant value.
- *
- * @param constantName the constant name
- * @param constantValue the constant value
- *
- * @see Constant
- */
- public void defineConstant(String constantName, double constantValue) {
- Constant c = new Constant(constantName, constantValue);
- c.addRelatedExpression(this);
- constantsList.Add(c);
- setExpressionModifiedFlag();
- }
- /**
- * Gets constant index associated with the expression.
- *
- * @param constantName the constant name
- *
- * @return Constant index if constant name was found,
- * otherwise return Constant.NOT_FOUND.
- *
- * @see Constant
- */
- public int getConstantIndex(String constantName) {
- int constantsNumber = constantsList.Count;
- if (constantsNumber > 0) {
- int constantIndex = 0;
- int searchResult = NOT_FOUND;
- while ((constantIndex < constantsNumber)&&(searchResult == NOT_FOUND)) {
- if (constantsList[constantIndex].getConstantName().Equals(constantName))
- searchResult = FOUND;
- else
- constantIndex++;
- }
- if (searchResult == FOUND)
- return constantIndex;
+ setExpressionModifiedFlag();
+ }
+ ///
+ /// Enables to define the constant (associated with
+ /// the expression) based on the constant name and
+ /// constant value.
+ ///
+ ///
+ /// the constant name
+ /// the constant value
+ ///
+ ///
+ public void defineConstant(String constantName, double constantValue) {
+ Constant c = new Constant(constantName, constantValue);
+ c.addRelatedExpression(this);
+ constantsList.Add(c);
+ setExpressionModifiedFlag();
+ }
+ /// Gets constant index associated with the expression.
+ ///
+ /// the constant name
+ ///
+ ///
+ /// Constant index if constant name was found,
+ /// otherwise return .
+ ///
+ ///
+ ///
+ public int getConstantIndex(String constantName) {
+ int constantsNumber = constantsList.Count;
+ if (constantsNumber > 0) {
+ int constantIndex = 0;
+ int searchResult = NOT_FOUND;
+ while ((constantIndex < constantsNumber)&&(searchResult == NOT_FOUND)) {
+ if (constantsList[constantIndex].getConstantName().Equals(constantName))
+ searchResult = FOUND;
else
- return NOT_FOUND;
- } else
+ constantIndex++;
+ }
+ if (searchResult == FOUND)
+ return constantIndex;
+ else
return NOT_FOUND;
- }
- /**
- * Gets constant associated with the expression.
- *
- * @param constantName the constant name
- *
- * @return Constant if constant name was found,
- * otherwise return null.
- *
- * @see Constant
- */
- public Constant getConstant(String constantName) {
+ } else
+ return NOT_FOUND;
+ }
+ /// Gets constant associated with the expression.
+ ///
+ /// the constant name
+ ///
+ ///
+ /// Constant if constant name was found,
+ /// otherwise return null.
+ ///
+ ///
+ ///
+ public Constant getConstant(String constantName) {
+ int constantIndex = getConstantIndex(constantName);
+ if (constantIndex == NOT_FOUND)
+ return null;
+ else
+ return constantsList[constantIndex];
+ }
+ /// Gets constant associated with the expression.
+ ///
+ /// the constant index
+ ///
+ ///
+ /// Constant if the is between
+ /// 0 and the last available constant index
+ /// ( - 1),
+ /// otherwise it returns null.
+ ///
+ ///
+ ///
+ public Constant getConstant(int constantIndex) {
+ if ( (constantIndex < 0) || (constantIndex >= constantsList.Count) )
+ return null;
+ else
+ return constantsList[constantIndex];
+ }
+ /// Gets number of constants associated with the expression.
+ ///
+ /// number of constants (int >= 0)
+ ///
+ ///
+ public int getConstantsNumber() {
+ return constantsList.Count;
+ }
+ ///
+ /// Removes first occurrences of the constants
+ /// associated with the expression.
+ ///
+ ///
+ ///
+ /// the constants names (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
+ public void removeConstants(params String[] constantsNames) {
+ foreach (String constantName in constantsNames) {
int constantIndex = getConstantIndex(constantName);
- if (constantIndex == NOT_FOUND)
- return null;
- else
- return constantsList[constantIndex];
- }
- /**
- * Gets constant associated with the expression.
- *
- * @param constantIndex the constant index
- *
- * @return Constant if the constantIndex is between
- * 0 and the last available constant index
- * (getConstantsNumber() - 1),
- * otherwise it returns null.
- *
- * @see Constant
- */
- public Constant getConstant(int constantIndex) {
- if ( (constantIndex < 0) || (constantIndex >= constantsList.Count) )
- return null;
- else
- return constantsList[constantIndex];
- }
- /**
- * Gets number of constants associated with the expression.
- *
- * @return number of constants (int >= 0)
- *
- * @see Constant
- */
- public int getConstantsNumber() {
- return constantsList.Count;
- }
- /**
- * Removes first occurrences of the constants
- * associated with the expression.
- *
- * @param constantsNames the constants names (variadic parameters)
- * comma separated list
- *
- * @see Constant
- */
- public void removeConstants(params String[] constantsNames) {
- foreach (String constantName in constantsNames) {
- int constantIndex = getConstantIndex(constantName);
- if (constantIndex != NOT_FOUND) {
- Constant c = constantsList[constantIndex];
- c.removeRelatedExpression(this);
- constantsList.RemoveAt( constantIndex );
- }
+ if (constantIndex != NOT_FOUND) {
+ Constant c = constantsList[constantIndex];
+ c.removeRelatedExpression(this);
+ constantsList.RemoveAt( constantIndex );
}
- setExpressionModifiedFlag();
}
- /**
- * Removes first occurrences of the constants
- * associated with the expression
- *
- * @param constants the constants (variadic parameters)
- * comma separated list
- *
- * @see Constant
- */
- public void removeConstants(params Constant[] constants) {
- foreach (Constant constant in constants) {
- if (constant != null) {
- constantsList.Remove(constant);
- constant.removeRelatedExpression(this);
- setExpressionModifiedFlag();
- }
+ setExpressionModifiedFlag();
+ }
+ ///
+ /// Removes first occurrences of the constants
+ /// associated with the expression
+ ///
+ ///
+ ///
+ /// the constants (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
+ public void removeConstants(params Constant[] constants) {
+ foreach (Constant constant in constants) {
+ if (constant != null) {
+ constantsList.Remove(constant);
+ constant.removeRelatedExpression(this);
+ setExpressionModifiedFlag();
}
}
- /**
- * Removes all constants
- * associated with the expression
- *
- * @see Constant
- */
- public void removeAllConstants() {
- foreach (Constant c in constantsList)
- c.removeRelatedExpression(this);
- constantsList.Clear();
- setExpressionModifiedFlag();
- }
- /*=================================================
- *
- * Functions handling API
- *
- *=================================================
- */
- /**
- * Adds functions (variadic parameters) to the expression definition.
- *
- * @param functions the functions
- * (variadic parameters) comma separated list
- *
- * @see Function
- */
- public void addFunctions(params Function[] functions) {
- foreach (Function f in functions) {
- if (f != null) {
- functionsList.Add(f);
- if (f.getFunctionBodyType() == Function.BODY_RUNTIME)
- f.addRelatedExpression(this);
- }
+ }
+ ///
+ /// Removes all constants
+ /// associated with the expression
+ ///
+ ///
+ ///
+ public void removeAllConstants() {
+ foreach (Constant c in constantsList)
+ c.removeRelatedExpression(this);
+ constantsList.Clear();
+ setExpressionModifiedFlag();
+ }
+ /*=================================================
+ *
+ * Functions handling API
+ *
+ *=================================================
+ */
+ /// Adds functions (variadic parameters) to the expression definition.
+ ///
+ ///
+ /// the functions
+ /// (variadic parameters) comma separated list
+ ///
+ ///
+ ///
+ public void addFunctions(params Function[] functions) {
+ foreach (Function f in functions) {
+ if (f != null) {
+ functionsList.Add(f);
+ if (f.getFunctionBodyType() == Function.BODY_RUNTIME)
+ f.addRelatedExpression(this);
}
- setExpressionModifiedFlag();
}
- /**
- * Enables to define the function (associated with
- * the expression) based on the function name,
- * function expression string and arguments names (variadic parameters).
- *
- * @param functionName the function name
- * @param functionExpressionString the expression string
- * @param argumentsNames the function arguments names
- * (variadic parameters)
- * comma separated list
- *
- * @see Function
- */
- public void defineFunction(String functionName, String functionExpressionString,
- params String[] argumentsNames) {
- Function f = new Function(functionName, functionExpressionString, argumentsNames);
- functionsList.Add(f);
- f.addRelatedExpression(this);
- setExpressionModifiedFlag();
- }
- /**
- * Gets index of function associated with the expression.
- *
- * @param functionName the function name
- *
- * @return Function index if function name was found,
- * otherwise returns Function.NOT_FOUND
- *
- * @see Function
- */
- public int getFunctionIndex(String functionName) {
- int functionsNumber = functionsList.Count;
- if (functionsNumber > 0) {
- int functionIndex = 0;
- int searchResult = NOT_FOUND;
- while ((functionIndex < functionsNumber)
- && (searchResult == NOT_FOUND)) {
- if (functionsList[functionIndex].getFunctionName().
- Equals(functionName))
- searchResult = FOUND;
- else
- functionIndex++;
- }
- if (searchResult == FOUND)
- return functionIndex;
+ setExpressionModifiedFlag();
+ }
+ ///
+ /// Enables to define the function (associated with
+ /// the expression) based on the function name,
+ /// function expression string and arguments names (variadic parameters).
+ ///
+ ///
+ /// the function name
+ /// the expression string
+ ///
+ /// the function arguments names
+ /// (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
+ public void defineFunction(String functionName, String functionExpressionString,
+ params String[] argumentsNames) {
+ Function f = new Function(functionName, functionExpressionString, argumentsNames);
+ functionsList.Add(f);
+ f.addRelatedExpression(this);
+ setExpressionModifiedFlag();
+ }
+ /// Gets index of function associated with the expression.
+ ///
+ /// the function name
+ ///
+ ///
+ /// Function index if function name was found,
+ /// otherwise returns
+ ///
+ ///
+ ///
+ public int getFunctionIndex(String functionName) {
+ int functionsNumber = functionsList.Count;
+ if (functionsNumber > 0) {
+ int functionIndex = 0;
+ int searchResult = NOT_FOUND;
+ while ((functionIndex < functionsNumber)
+ && (searchResult == NOT_FOUND)) {
+ if (functionsList[functionIndex].getFunctionName().
+ Equals(functionName))
+ searchResult = FOUND;
else
- return NOT_FOUND;
- } else
+ functionIndex++;
+ }
+ if (searchResult == FOUND)
+ return functionIndex;
+ else
return NOT_FOUND;
- }
- /**
- * Gets function associated with the expression.
- *
- * @param functionName the function name
- *
- * @return Function if function name was found,
- * otherwise returns null.
- *
- * @see Function
- */
- public Function getFunction(String functionName) {
+ } else
+ return NOT_FOUND;
+ }
+ /// Gets function associated with the expression.
+ ///
+ /// the function name
+ ///
+ ///
+ /// Function if function name was found,
+ /// otherwise returns null.
+ ///
+ ///
+ ///
+ public Function getFunction(String functionName) {
+ int functionIndex = getFunctionIndex(functionName);
+ if (functionIndex == NOT_FOUND)
+ return null;
+ else
+ return functionsList[functionIndex];
+ }
+ /// Gets function associated with the expression.
+ ///
+ /// functionIndex the function index
+ ///
+ ///
+ /// Function if function index is between 0 and
+ /// the last available function index (-1),
+ /// otherwise returns null.
+ ///
+ ///
+ ///
+ public Function getFunction(int functionIndex) {
+ if ( (functionIndex < 0) || (functionIndex >= functionsList.Count) )
+ return null;
+ else
+ return functionsList[functionIndex];
+ }
+ /// Gets number of functions associated with the expression.
+ ///
+ /// number of functions (int >= 0)
+ ///
+ ///
+ public int getFunctionsNumber() {
+ return functionsList.Count;
+ }
+ ///
+ /// Removes first occurrences of the functions
+ /// associated with the expression.
+ ///
+ ///
+ ///
+ /// the functions names (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
+ public void removeFunctions(params String[] functionsNames) {
+ foreach (String functionName in functionsNames) {
int functionIndex = getFunctionIndex(functionName);
- if (functionIndex == NOT_FOUND)
- return null;
- else
- return functionsList[functionIndex];
- }
- /**
- * Gets function associated with the expression.
- *
- * @param functionIndex the function index
- *
- * @return Function if function index is between 0 and
- * the last available function index (getFunctionsNumber()-1),
- * otherwise returns null.
- *
- * @see Function
- */
- public Function getFunction(int functionIndex) {
- if ( (functionIndex < 0) || (functionIndex >= functionsList.Count) )
- return null;
- else
- return functionsList[functionIndex];
- }
- /**
- * Gets number of functions associated with the expression.
- *
- * @return number of functions (int >= 0)
- *
- * @see Function
- */
- public int getFunctionsNumber() {
- return functionsList.Count;
- }
- /**
- * Removes first occurrences of the functions
- * associated with the expression.
- *
- * @param functionsNames the functions names (variadic parameters)
- * comma separated list
- *
- * @see Function
- */
- public void removeFunctions(params String[] functionsNames) {
- foreach (String functionName in functionsNames) {
- int functionIndex = getFunctionIndex(functionName);
- if (functionIndex != NOT_FOUND) {
- Function f = functionsList[functionIndex];
- f.removeRelatedExpression(this);
- functionsList.Remove(f);
- }
+ if (functionIndex != NOT_FOUND) {
+ Function f = functionsList[functionIndex];
+ f.removeRelatedExpression(this);
+ functionsList.Remove(f);
}
- setExpressionModifiedFlag();
}
- /**
- * Removes first occurrences of the functions
- * associated with the expression.
- *
- * @param functions the functions (variadic parameters)
- * comma separated list.
- *
- * @see Function
- */
- public void removeFunctions(params Function[] functions) {
- foreach (Function function in functions) {
- if (function != null) {
- function.removeRelatedExpression(this);
- functionsList.Remove(function);
- }
+ setExpressionModifiedFlag();
+ }
+ ///
+ /// Removes first occurrences of the functions
+ /// associated with the expression.
+ ///
+ ///
+ ///
+ /// the functions (variadic parameters)
+ /// comma separated list.
+ ///
+ ///
+ ///
+ public void removeFunctions(params Function[] functions) {
+ foreach (Function function in functions) {
+ if (function != null) {
+ function.removeRelatedExpression(this);
+ functionsList.Remove(function);
}
- setExpressionModifiedFlag();
- }
- /**
- * Removes all functions
- * associated with the expression.
- *
- * @see Function
- */
- public void removeAllFunctions() {
- foreach (Function f in functionsList)
- f.removeRelatedExpression(this);
- functionsList.Clear();
- setExpressionModifiedFlag();
}
+ setExpressionModifiedFlag();
+ }
+ ///
+ /// Removes all functions
+ /// associated with the expression.
+ ///
+ ///
+ ///
+ public void removeAllFunctions() {
+ foreach (Function f in functionsList)
+ f.removeRelatedExpression(this);
+ functionsList.Clear();
+ setExpressionModifiedFlag();
+ }
/*=================================================
*
* Common methods (supporting calculations)
*
*=================================================
*/
- /**
- * Sets given token to the number type / value.
- * Method should be called only by the SetDecreaseRemove like methods
- *
- * @param pos the position on which token
- * should be updated to the given number
- * @param number the number
- * @param ulpRound If true, then if {@link mXparser#ulpRounding} = true
- * intelligent ULP rounding is applied.
- */
+ ///
+ /// Sets given token to the number type / value.
+ /// Method should be called only by the SetDecreaseRemove like methods
+ ///
+ ///
+ ///
+ /// the position on which token
+ /// should be updated to the given number
+ ///
+ /// the number
+ ///
+ /// If true, then if = true
+ /// intelligent ULP rounding is applied.
+ ///
private void setToNumber(int pos, double number, bool ulpRound) {
Token token = tokensList[pos];
if ((mXparser.ulpRounding) && (disableUlpRounding == false)) {
@@ -1281,59 +1268,77 @@ private void setToNumber(int pos, double number, bool ulpRound) {
private void setToNumber(int pos, double number) {
setToNumber(pos, number, false);
}
- /**
- * SetDecreaseRemove for 1 arg functions
- *
- * SetDecreaseRemove like methods are called by the methods
- * calculating values of the unary operation, binary relations
- * and functions.
- *
- * 3 things are done by this type of methods
- * 1) Set token type to number type / value
- * 2) Decrease level of the token
- * 3) Remove no longer needed tokens
- *
- * For example:
- *
- * Expression string: 1+cos(0)
- * will be tokened as follows:
- *
- * idx : 0 1 2 3 4 5
- * token : 1 + cos ( 0 )
- * level : 0 0 1 2 2 2
- *
- * Partitions with the highest level will be handled first.
- * In the case presented above, it means, that the parenthesis will be removed
- *
- * idx : 0 1 2 3
- * token : 1 + cos 0
- * level : 0 0 1 2
- *
- * Next step is to calculate cos(0) = 1
- *
- * SetDecreaseRemove like methods
- *
- * 1) Set cos token to 1 (pos=2, result=1):
- * idx : 0 1 2 3
- * token : 1 + 1 0
- * level : 0 0 1 2
- *
- * 2) Decrease level (pos=2):
- * idx : 0 1 2 3
- * token : 1 + 1 0
- * level : 0 0 0 2
- *
- * 3) Remove no longer needed tokens (pos+1=3):
- * idx : 0 1 2
- * token : 1 + 1
- * level : 0 0 0
- *
- * @param pos the position on which token
- * should be updated to the given number
- * @param result the number
- * @param ulpRound If true, then if {@link mXparser#ulpRounding} = true
- * intelligent ULP rounding is applied.
- */
+ ///
+ /// SetDecreaseRemove for 1 arg functions
+ ///
+ ///
+ /// SetDecreaseRemove like methods are called by the methods
+ /// calculating values of the unary operation, binary relations
+ /// and functions.
+ ///
+ /// 3 things are done by this type of methods
+ ///
+ /// - Set token type to number type / value
+ /// - Decrease level of the token
+ /// - Remove no longer needed tokens
+ ///
+ /// For example:
+ ///
+ /// Expression string: 1+cos(0)
+ /// will be tokened as follows:
+ ///
+ /// idx : 0 1 2 3 4 5
+ /// token : 1 + cos ( 0 )
+ /// level : 0 0 1 2 2 2
+ ///
+ /// Partitions with the highest level will be handled first.
+ /// In the case presented above, it means, that the parenthesis will be removed
+ ///
+ /// idx : 0 1 2 3
+ /// token : 1 + cos 0
+ /// level : 0 0 1 2
+ ///
+ /// Next step is to calculate cos(0) = 1
+ ///
+ /// SetDecreaseRemove like methods
+ ///
+ /// -
+ /// Set cos token to 1 (pos=2, result=1):
+ ///
+ /// idx : 0 1 2 3
+ /// token : 1 + 1 0
+ /// level : 0 0 1 2
+ ///
+ ///
+ ///
+ /// -
+ /// Decrease level (pos=2):
+ ///
+ /// idx : 0 1 2 3
+ /// token : 1 + 1 0
+ /// level : 0 0 0 2
+ ///
+ ///
+ ///
+ /// -
+ /// Remove no longer needed tokens (pos+1=3):
+ ///
+ /// idx : 0 1 2
+ /// token : 1 + 1
+ /// level : 0 0 0
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// the position on which token
+ /// should be updated to the given number
+ ///
+ /// the number
+ ///
+ /// If true, then if = true
+ /// intelligent ULP rounding is applied.
+ ///
private void f1SetDecreaseRemove(int pos, double result, bool ulpRound) {
setToNumber(pos, result, ulpRound);
tokensList[pos].tokenLevel--;
@@ -1342,18 +1347,22 @@ private void f1SetDecreaseRemove(int pos, double result, bool ulpRound) {
private void f1SetDecreaseRemove(int pos, double result) {
f1SetDecreaseRemove(pos, result, false);
}
- /**
- * SetDecreaseRemove for 2-args functions
- *
- * For detailed specification refer to the
- * f1SetDecreaseRemove()
- *
- * @param pos the position on which token
- * should be updated to the given number
- * @param result the number
- * @param ulpRound If true, then if {@link mXparser#ulpRounding} = true
- * intelligent ULP rounding is applied.
- */
+ /// SetDecreaseRemove for 2-args functions
+ ///
+ /// For detailed specification refer to the
+ ///
+ ///
+ ///
+ /// the position on which token
+ /// should be updated to the given number
+ ///
+ /// the number
+ ///
+ /// If true, then if = true
+ /// intelligent ULP rounding is applied.
+ ///
+ ///
+ ///
private void f2SetDecreaseRemove(int pos, double result, bool ulpRound) {
setToNumber(pos, result, ulpRound);
tokensList[pos].tokenLevel--;
@@ -1363,18 +1372,22 @@ private void f2SetDecreaseRemove(int pos, double result, bool ulpRound) {
private void f2SetDecreaseRemove(int pos, double result) {
f2SetDecreaseRemove(pos, result, false);
}
- /**
- * SetDecreaseRemove for 3-args functions
- *
- * For detailed specification refer to the
- * f1SetDecreaseRemove()
- *
- * @param pos the position on which token
- * should be updated to the given number
- * @param result the number
- * @param ulpRound If true, then if {@link mXparser#ulpRounding} = true
- * intelligent ULP rounding is applied.
- */
+ /// SetDecreaseRemove for 3-args functions
+ ///
+ /// For detailed specification refer to the
+ ///
+ ///
+ ///
+ /// the position on which token
+ /// should be updated to the given number
+ ///
+ /// the number
+ ///
+ /// If true, then if = true
+ /// intelligent ULP rounding is applied.
+ ///
+ ///
+ ///
private void f3SetDecreaseRemove(int pos, double result, bool ulpRound) {
setToNumber(pos, result, ulpRound);
tokensList[pos].tokenLevel--;
@@ -1385,18 +1398,22 @@ private void f3SetDecreaseRemove(int pos, double result, bool ulpRound) {
private void f3SetDecreaseRemove(int pos, double result) {
f3SetDecreaseRemove(pos, result, false);
}
- /**
- * SetDecreaseRemove for operators
- *
- * For detailed specification refer to the
- * f1SetDecreaseRemove()
- *
- * @param pos the position on which token
- * should be updated to the given number
- * @param result the number
- * @param ulpRound If true, then if {@link mXparser#ulpRounding} = true
- * intelligent ULP rounding is applied.
- */
+ /// SetDecreaseRemove for operators
+ ///
+ /// For detailed specification refer to the
+ ///
+ ///
+ ///
+ /// the position on which token
+ /// should be updated to the given number
+ ///
+ /// the number
+ ///
+ /// If true, then if = true
+ /// intelligent ULP rounding is applied.
+ ///
+ ///
+ ///
private void opSetDecreaseRemove(int pos, double result, bool ulpRound) {
setToNumber(pos, result, ulpRound);
tokensList.RemoveAt(pos+1);
@@ -1405,18 +1422,22 @@ private void opSetDecreaseRemove(int pos, double result, bool ulpRound) {
private void opSetDecreaseRemove(int pos, double result) {
opSetDecreaseRemove(pos, result, false);
}
- /**
- * SetDecreaseRemove for calculus operators.
- *
- * For detailed specification refer to the
- * f1SetDecreaseRemove()
- *
- * @param pos the position on which token
- * should be updated to the given number
- * @param result the number
- * @param ulpRound If true, then if {@link mXparser#ulpRounding} = true
- * intelligent ULP rounding is applied.
- */
+ /// SetDecreaseRemove for calculus operators
+ ///
+ /// For detailed specification refer to the
+ ///
+ ///
+ ///
+ /// the position on which token
+ /// should be updated to the given number
+ ///
+ /// the number
+ ///
+ /// If true, then if = true
+ /// intelligent ULP rounding is applied.
+ ///
+ ///
+ ///
private void calcSetDecreaseRemove(int pos, double result, bool ulpRound) {
setToNumber(pos, result, ulpRound);
tokensList[pos].tokenLevel--;
@@ -1438,19 +1459,23 @@ private void calcSetDecreaseRemove(int pos, double result, bool ulpRound) {
private void calcSetDecreaseRemove(int pos, double result) {
calcSetDecreaseRemove(pos, result, false);
}
- /**
- * SetDecreaseRemove for special functions.
- *
- * For detailed specification refer to the
- * f1SetDecreaseRemove()
- *
- * @param pos the position on which token
- * should be updated to the given number
- * @param result the number
- * @param length the special function range
- * @param ulpRound If true, then if {@link mXparser#ulpRounding} = true
- * intelligent ULP rounding is applied.
- */
+ /// SetDecreaseRemove for special functions
+ ///
+ /// For detailed specification refer to the
+ ///
+ ///
+ ///
+ /// the position on which token
+ /// should be updated to the given number
+ ///
+ /// the number
+ /// the special function range
+ ///
+ /// If true, then if = true
+ /// intelligent ULP rounding is applied.
+ ///
+ ///
+ ///
private void variadicSetDecreaseRemove(int pos, double value, int length, bool ulpRound) {
setToNumber(pos, value, ulpRound);
tokensList[pos].tokenLevel--;
@@ -1460,14 +1485,17 @@ private void variadicSetDecreaseRemove(int pos, double value, int length, bool u
private void variadicSetDecreaseRemove(int pos, double value, int length) {
variadicSetDecreaseRemove(pos, value, length, false);
}
- /**
- * If set remove method for the if function.
- *
- * @param pos the position
- * @param ifCondition the result of if condition
- * @param ulpRound If true, then if {@link mXparser#ulpRounding} = true
- * intelligent ULP rounding is applied.
- */
+ /// If set remove method for the if function.
+ ///
+ ///
+ /// the position on which token
+ /// should be updated to the given number
+ ///
+ /// the number
+ ///
+ /// If true, then if = true
+ /// intelligent ULP rounding is applied.
+ ///
private void ifSetRemove(int pos, double ifCondition, bool ulpRound) {
/*
* left parethesis position
@@ -1531,14 +1559,12 @@ private void removeTokens(int from, int to) {
private void ifSetRemove(int pos, double ifCondition) {
ifSetRemove(pos, ifCondition, false);
}
- /**
- * Creates string tokens list from the subexpression.
- *
- * @param startPos start position (index)
- * @param endPos end position (index)
- *
- * @return tokens list representing requested subexpression.
- */
+ /// Creates string tokens list from the subexpression.
+ ///
+ /// start position (index)
+ /// end position (index)
+ ///
+ /// tokens list representing requested subexpression.
private List createInitialTokens(int startPos,
int endPos,
List tokensList) {
@@ -1550,11 +1576,9 @@ private List createInitialTokens(int startPos,
}
return tokens;
}
- /**
- * Return number of functions parameters.
- *
- * @param pos the function position
- */
+ /// Return number of functions parameters.
+ ///
+ /// the function position
private int getParametersNumber(int pos) {
int lPpos = pos+1;
if (lPpos == initialTokens.Count)
@@ -1586,16 +1610,14 @@ private int getParametersNumber(int pos) {
return -1;
}
}
- /**
- * Returns list of the functions parameters.
- *
- * @param pos the function position
- * @param tokensList the tokens checkSYnt
- *
- * @return the list of function parameters
- *
- * @see FunctionParameter
- */
+ /// Returns list of the functions parameters.
+ ///
+ /// the function position
+ /// the tokens checkSYnt
+ ///
+ /// the list of function parameters
+ ///
+ ///
private List getFunctionParameters(int pos, List tokensList) {
List functionParameters = new List();
int cPos = pos+2;
@@ -1636,20 +1658,19 @@ private List getFunctionParameters(int pos, List token
} while (!end);
return functionParameters;
}
- /**
- * Gets / returns argument representing given argument name. If
- * argument name exists on the list of known arguments
- * the the initial status of the found argument is remembered, otherwise new
- * argument will be created.
- *
- * @param argumentName the argument name
- *
- * @return Argument parameter representing given argument name:
- *
- *
- * @see ArgumentParameter
- * @see Argument
- */
+ ///
+ /// Gets / returns argument representing given argument name. If
+ /// argument name exists on the list of known arguments
+ /// the the initial status of the found argument is remembered, otherwise new
+ /// argument will be created.
+ ///
+ ///
+ /// the argument name
+ ///
+ /// Argument parameter representing given argument name
+ ///
+ ///
+ ///
private ArgumentParameter getParamArgument(String argumentName) {
ArgumentParameter argParam = new ArgumentParameter();
argParam.index = getArgumentIndex(argumentName);
@@ -1668,11 +1689,9 @@ private ArgumentParameter getParamArgument(String argumentName) {
}
return argParam;
}
- /**
- * Clears argument parameter.
- *
- * @param argParam the argument parameter.
- */
+ /// Clears argument parameter.
+ ///
+ /// the argument parameter.
private void clearParamArgument(ArgumentParameter argParam) {
if (argParam.presence == NOT_FOUND)
argumentsList.RemoveAt(argParam.index);
@@ -1687,11 +1706,9 @@ private void clearParamArgument(ArgumentParameter argParam) {
*
*=================================================
*/
- /**
- * Free Arguments handling.
- *
- * @param pos the token position
- */
+ /// Free Arguments handling.
+ ///
+ /// the token position
private void FREE_ARGUMENT(int pos) {
Argument argument = argumentsList[ tokensList[pos].tokenId ];
bool argumentVerboseMode = argument.getVerboseMode();
@@ -1701,11 +1718,9 @@ private void FREE_ARGUMENT(int pos) {
if (argumentVerboseMode == false)
argument.setSilentMode();
}
- /**
- * Dependent Arguments handling.
- *
- * @param pos the token position
- */
+ /// Dependent Arguments handling.
+ ///
+ /// the token position
private void DEPENDENT_ARGUMENT(int pos) {
Argument argument = argumentsList[ tokensList[pos].tokenId ];
bool argumentVerboseMode = argument.getVerboseMode();
@@ -1734,11 +1749,9 @@ private void DEPENDENT_ARGUMENT(int pos) {
if (argumentVerboseMode == false)
argument.setSilentMode();
}
- /**
- * User functions handling.
- *
- * @param pos the token position
- */
+ /// User functions handling.
+ ///
+ /// the token position
private void USER_FUNCTION(int pos) {
Function function;
Function fun = functionsList[ tokensList[pos].tokenId ];
@@ -1792,20 +1805,16 @@ private void USER_FUNCTION(int pos) {
if (functionVerboseMode == false)
function.setSilentMode();
}
- /**
- * User constants handling.
- *
- * @param pos the token position
- */
+ /// User constants handling.
+ ///
+ /// the token position
private void USER_CONSTANT(int pos) {
Constant constant = constantsList[ tokensList[pos].tokenId ];
setToNumber(pos, constant.getConstantValue());
}
- /**
- * Recursive arguments handling.
- *
- * @param pos the token position
- */
+ /// Recursive arguments handling.
+ ///
+ /// the token position
private void RECURSIVE_ARGUMENT(int pos) {
double index = tokensList[pos+1].tokenValue;
RecursiveArgument argument = (RecursiveArgument)argumentsList[ tokensList[pos].tokenId ];
@@ -1817,11 +1826,9 @@ private void RECURSIVE_ARGUMENT(int pos) {
if (argumentVerboseMode == false)
argument.setSilentMode();
}
- /**
- * Constants handling.
- *
- * @param pos the token position
- */
+ /// Constants handling.
+ ///
+ /// the token position
private void CONSTANT(int pos) {
double constValue = Double.NaN;
switch (tokensList[pos].tokenId) {
@@ -2098,11 +2105,9 @@ private void CONSTANT(int pos) {
}
setToNumber(pos, constValue);
}
- /**
- * Constants handling.
- *
- * @param pos the token position
- */
+ /// Constants handling.
+ ///
+ /// the token position
private void UNIT(int pos) {
double unitValue = Double.NaN;
switch (tokensList[pos].tokenId) {
@@ -2406,11 +2411,9 @@ private void UNIT(int pos) {
}
setToNumber(pos, unitValue);
}
- /**
- * Random Variables handling.
- *
- * @param pos the token position
- */
+ /// Random Variables handling.
+ ///
+ /// the token position
private void RANDOM_VARIABLE(int pos) {
double rndVar = Double.NaN;
switch (tokensList[pos].tokenId) {
@@ -2513,70 +2516,57 @@ private void RANDOM_VARIABLE(int pos) {
}
setToNumber(pos, rndVar);
}
- /**
- * Gets token value
- * @param tokenIndex the token index
- *
- * @return the token value
- */
+ /// Gets token value
+ ///
+ /// the token index
+ ///
+ /// the token value
private double getTokenValue(int tokenIndex) {
return tokensList[tokenIndex].tokenValue;
}
- /**
- * Tetration handling.
- *
- * @param pos the token position
- */
+ /// Tetration handling.
+ ///
+ /// the token position
private void TETRATION(int pos) {
double a = getTokenValue(pos - 1);
double n = getTokenValue(pos + 1);
opSetDecreaseRemove(pos, MathFunctions.tetration(a, n), true);
}
- /**
- * Power handling.
- *
- * @param pos the token position
- */
+ /// Power handling.
+ ///
+ /// the token position
private void POWER(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, MathFunctions.power(a, b), true);
}
- /**
- * Modulo handling.
- *
- * @param pos the token position
- */
+ /// Modulo handling.
+ ///
+ /// the token position
private void MODULO(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, MathFunctions.mod(a, b) );
}
- /**
- * Division handling.
- *
- * @param pos the token position
- */
+ /// Division handling.
+ ///
+ /// the token position
private void DIVIDE(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, MathFunctions.div(a, b), true);
}
- /**
- * Multiplication handling.
- *
- * @param pos the token position
- */
+ /// Multiplication handling.
+ ///
+ /// the token position
private void MULTIPLY(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, a * b, true);
}
- /**
- * Addition handling.
- *
- * @param pos the token position
- */
+ /// Addition handling.
+ ///
+ /// the token position
private void PLUS(int pos) {
Token b = tokensList[pos+1];
if (pos>0) {
@@ -2594,11 +2584,9 @@ private void PLUS(int pos) {
tokensList.RemoveAt(pos+1);
}
}
- /**
- * Subtraction handling
- *
- * @param pos the token position
- */
+ /// Subtraction handling
+ ///
+ /// the token position
private void MINUS(int pos) {
Token b = tokensList[pos+1];
if (pos>0) {
@@ -2616,750 +2604,596 @@ private void MINUS(int pos) {
tokensList.RemoveAt(pos+1);
}
}
- /**
- * Logical AND
- *
- * @param pos the token position
- */
+ /// Logical AND
+ ///
+ /// the token position
private void AND(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.and(a, b) );
}
- /**
- * Logical OR
- *
- * @param pos the token position
- */
+ /// Logical OR
+ ///
+ /// the token position
private void OR(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.or(a, b) );
}
- /**
- * Logical NAND
- *
- * @param pos the token position
- */
+ /// Logical NAND
+ ///
+ /// the token position
private void NAND(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.nand(a, b) );
}
- /**
- * Logical NOR
- *
- * @param pos the token position
- */
+ /// Logical NOR
+ ///
+ /// the token position
private void NOR(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.nor(a, b) );
}
- /**
- * Logical XOR
- *
- *
- * @param pos the token position
- */
+ /// Logical XOR
+ ///
+ /// the token position
private void XOR(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.xor(a, b) );
}
- /**
- * Logical IMP
- *
- *
- * @param pos the token position
- */
+ /// Logical IMP
+ ///
+ /// the token position
private void IMP(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.imp(a, b) );
}
- /**
- * Logical CIMP
- *
- * @param pos the token position
- */
+ /// Logical CIMP
+ ///
+ /// the token position
private void CIMP(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.cimp(a, b) );
}
- /**
- * Logical NIMP
- *
- * @param pos the token position
- */
+ /// Logical NIMP
+ ///
+ /// the token position
private void NIMP(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.nimp(a, b) );
}
- /**
- * Logical CNIMP
- *
- * @param pos the token position
- */
+ /// Logical CNIMP
+ ///
+ /// the token position
private void CNIMP(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.cnimp(a, b) );
}
- /**
- * Logical EQV
- *
- * @param pos the token position
- */
+ /// Logical EQV
+ ///
+ /// the token position
private void EQV(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BooleanAlgebra.eqv(a, b) );
}
- /**
- * Logical negation
- *
- * @param pos the token position
- */
+ /// Logical negation
+ ///
+ /// the token position
private void NEG(int pos) {
double a = getTokenValue(pos+1);
setToNumber(pos, BooleanAlgebra.not(a) );
tokensList.RemoveAt(pos+1);
}
- /**
- * Equality relation.
- *
- * @param pos the token position
- */
+ /// Equality relation.
+ ///
+ /// the token position
private void EQ(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BinaryRelations.eq(a, b) );
}
- /**
- * Not equals.
- *
- * @param pos the token position
- */
+ /// Not equals.
+ ///
+ /// the token position
private void NEQ(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BinaryRelations.neq(a, b) );
}
- /**
- * Lower than.
- *
- * @param pos the token position
- */
+ /// Lower than.
+ ///
+ /// the token position
private void LT(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BinaryRelations.lt(a, b) );
}
- /**
- * Greater than.
- *
- * @param pos the token position
- */
+ /// Greater than.
+ ///
+ /// the token position
private void GT(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BinaryRelations.gt(a, b) );
}
- /**
- * Lower or equal.
- *
- * @param pos the token position
- */
+ /// Lower or equal.
+ ///
+ /// the token position
private void LEQ(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BinaryRelations.leq(a, b) );
}
- /**
- * Greater or equal
- *
- * @param pos the token position
- */
+ /// Greater or equal
+ ///
+ /// the token position
private void GEQ(int pos) {
double a = getTokenValue(pos-1);
double b = getTokenValue(pos+1);
opSetDecreaseRemove(pos, BinaryRelations.geq(a, b) );
}
- /**
- * Bitwise COMPL
- *
- * @param pos the token position
- */
+ /// Bitwise COMPL
+ ///
+ /// the token position
private void BITWISE_COMPL(int pos) {
long a = (long)getTokenValue(pos + 1);
setToNumber(pos, ~a);
tokensList.RemoveAt(pos + 1);
}
- /**
- * Bitwise AND
- *
- * @param pos the token position
- */
+ /// Bitwise AND
+ ///
+ /// the token position
private void BITWISE_AND(int pos) {
long a = (long)getTokenValue(pos - 1);
long b = (long)getTokenValue(pos + 1);
opSetDecreaseRemove(pos, a & b);
}
- /**
- * Bitwise OR
- *
- * @param pos the token position
- */
+ /// Bitwise OR
+ ///
+ /// the token position
private void BITWISE_OR(int pos) {
long a = (long)getTokenValue(pos - 1);
long b = (long)getTokenValue(pos + 1);
opSetDecreaseRemove(pos, a | b);
}
- /**
- * Bitwise XOR
- *
- * @param pos the token position
- */
+ /// Bitwise XOR
+ ///
+ /// the token position
private void BITWISE_XOR(int pos) {
long a = (long)getTokenValue(pos - 1);
long b = (long)getTokenValue(pos + 1);
opSetDecreaseRemove(pos, a ^ b);
}
- /**
- * Bitwise LEFT SHIFT
- *
- * @param pos the token position
- */
+ /// Bitwise LEFT SHIFT
+ ///
+ /// the token position
private void BITWISE_LEFT_SHIFT(int pos) {
long a = (long)getTokenValue(pos - 1);
int b = (int)getTokenValue(pos + 1);
opSetDecreaseRemove(pos, a << b);
}
- /**
- * Bitwise RIGHT SHIFT
- *
- * @param pos the token position
- */
+ /// Bitwise RIGHT SHIFT
+ ///
+ /// the token position
private void BITWISE_RIGHT_SHIFT(int pos) {
long a = (long)getTokenValue(pos - 1);
int b = (int)getTokenValue(pos + 1);
opSetDecreaseRemove(pos, a >> b);
}
- /**
- * Sine function
- *
- * @param pos the token position
- */
+ /// Sine function
+ ///
+ /// the token position
private void SIN(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.sin(a) );
}
- /**
- * Cosine / Trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Cosine / Trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void COS(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.cos(a) );
}
- /**
- * Tangent / Trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Tangent / Trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void TAN(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.tan(a) );
}
- /**
- * Cotangent / Trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Cotangent / Trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void CTAN(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.ctan(a) );
}
- /**
- * Secant / Trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Secant / Trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void SEC(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.sec(a) );
}
- /**
- * Cosecant / Trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Cosecant / Trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void COSEC(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.cosec(a) );
}
- /**
- * Arcus sine / Inverse trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus sine / Inverse trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ASIN(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.asin(a) );
}
- /**
- * Arcus cosine / Inverse trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus cosine / Inverse trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ACOS(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.acos(a) );
}
- /**
- * Arcus tangent / Inverse trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus tangent / Inverse trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ATAN(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.atan(a) );
}
- /**
- * Arcus cotangent / Inverse trigonometric functions
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus cotangent / Inverse trigonometric functions
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ACTAN(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.actan(a) );
}
- /**
- * Natural logarithm (base e)
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Natural logarithm (base e)
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void LN(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.ln(a) );
}
- /**
- * Logarithm - base 2
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Logarithm - base 2
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void LOG2(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.log2(a) );
}
- /**
- * Logarithm - base 10
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Logarithm - base 10
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void LOG10(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.log10(a) );
}
- /**
- * Converts degrees to radius
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Converts degrees to radius
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void RAD(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.rad(a) );
}
- /**
- * Exponential function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Exponential function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void EXP(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.exp(a) );
}
- /**
- * Square root
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Square root
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void SQRT(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.sqrt(a) );
}
- /**
- * Hyperbolic sine
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Hyperbolic sine
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void SINH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.sinh(a) );
}
- /**
- * Hyperbolic cosine
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Hyperbolic cosine
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void COSH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.cosh(a) );
}
- /**
- * Hyperbolic tangent
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Hyperbolic tangent
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void TANH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.tanh(a) );
}
- /**
- * Hyperbolic cotangent
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Hyperbolic cotangent
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void COTH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.coth(a) );
}
- /**
- * Hyperbolic secant
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Hyperbolic secant
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void SECH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.sech(a) );
}
- /**
- * Hyperbolic cosecant
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Hyperbolic cosecant
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void CSCH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.csch(a) );
}
- /**
- * Converts radians to degrees
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Converts radians to degrees
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void DEG(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.deg(a) );
}
- /**
- * Absolut value
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Absolut value
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ABS(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.abs(a) );
}
- /**
- * Signum function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Signum function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void SGN(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.sgn(a) );
}
- /**
- * Floor function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Floor function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void FLOOR(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.floor(a) );
}
- /**
- * Ceil function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Ceil function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void CEIL(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.ceil(a) );
}
- /**
- * Arcus hyperbolic sine
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus hyperbolic sine
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ARSINH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.arsinh(a) );
}
- /**
- * Arcus hyperbolic cosine
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus hyperbolic cosine
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ARCOSH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.arcosh(a) );
}
- /**
- * Arcus hyperbolic tangent
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus hyperbolic tangent
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ARTANH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.artanh(a) );
}
- /**
- * Arcus hyperbolic cotangent
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus hyperbolic cotangent
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ARCOTH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.arcoth(a) );
}
- /**
- * Arcus hyperbolic secant
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus hyperbolic secant
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ARSECH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.arsech(a) );
}
- /**
- * Arcus hyperbolic cosecant
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcus hyperbolic cosecant
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ARCSCH(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.arcsch(a) );
}
- /**
- * SA / sinc normalized
- *
- * @param pos the token position
- */
+ /// SA / sinc normalized
+ ///
+ /// the token position
private void SA(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.sa(a) );
}
- /**
- * Sinc unnormalized
- *
- * @param pos the token position
- */
+ /// Sinc unnormalized
+ ///
+ /// the token position
private void SINC(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.sinc(a) );
}
- /**
- * Bell numbers
- *
- * @param pos the token position
- */
+ /// Bell numbers
+ ///
+ /// the token position
private void BELL_NUMBER(int pos) {
double n = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.bellNumber(n) );
}
- /**
- * Lucas numbers
- *
- * @param pos the token position
- */
+ /// Lucas numbers
+ ///
+ /// the token position
private void LUCAS_NUMBER(int pos) {
double n = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.lucasNumber(n) );
}
- /**
- * Fibonacci numbers
- *
- * @param pos the token position
- */
+ /// Fibonacci numbers
+ ///
+ /// the token position
private void FIBONACCI_NUMBER(int pos) {
double n = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.fibonacciNumber(n) );
}
- /**
- * Harmonic numbers
- *
- * @param pos the token position
- */
+ /// Harmonic numbers
+ ///
+ /// the token position
private void HARMONIC_NUMBER(int pos) {
double n = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, MathFunctions.harmonicNumber(n) );
}
- /**
- * Prime test
- *
- * @param pos the token position
- */
+ /// Prime test
+ ///
+ /// the token position
private void IS_PRIME(int pos) {
double n = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, NumberTheory.primeTest(n));
}
- /**
- * Prime counting
- *
- * @param pos the token position
- */
+ /// Prime counting
+ ///
+ /// the token position
private void PRIME_COUNT(int pos) {
double n = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, NumberTheory.primeCount(n));
}
- /**
- * Exponential integral function
- *
- * @param pos the token position
- */
+ /// Exponential integral function
+ ///
+ /// the token position
private void EXP_INT(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.exponentialIntegralEi(x));
}
- /**
- * Logarithmic exponential integral function
- *
- * @param pos the token position
- */
+ /// Logarithmic exponential integral function
+ ///
+ /// the token position
private void LOG_INT(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.logarithmicIntegralLi(x));
}
- /**
- * Offset logarithmic exponential integral function
- *
- * @param pos the token position
- */
+ /// Offset logarithmic exponential integral function
+ ///
+ /// the token position
private void OFF_LOG_INT(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.offsetLogarithmicIntegralLi(x));
}
- /**
- * Factorilal function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Factorilal function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void FACT(int pos) {
double a = getTokenValue(pos-1);
setToNumber(pos, MathFunctions.factorial(a));
tokensList.RemoveAt(pos-1);
}
- /**
- * Percentage
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Percentage
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void PERC(int pos) {
double a = getTokenValue(pos - 1);
setToNumber(pos, a * Units.PERC);
tokensList.RemoveAt(pos - 1);
}
- /**
- * Negation
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Negation
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void NOT(int pos) {
double a = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, BooleanAlgebra.not(a) );
}
- /**
- * Gauss error function
- *
- * @param pos the token position
- */
+ /// Gauss error function
+ ///
+ /// the token position
private void GAUSS_ERF(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.erf(x));
}
- /**
- * Gauss complementary error function
- *
- * @param pos the token position
- */
+ /// Gauss complementary error function
+ ///
+ /// the token position
private void GAUSS_ERFC(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.erfc(x));
}
- /**
- * Inverse of Gauss error function
- *
- * @param pos the token position
- */
+ /// Inverse of Gauss error function
+ ///
+ /// the token position
private void GAUSS_ERF_INV(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.erfInv(x));
}
- /**
- * Inverse of Gauss complementary error function
- *
- * @param pos the token position
- */
+ /// Inverse of Gauss complementary error function
+ ///
+ /// the token position
private void GAUSS_ERFC_INV(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.erfcInv(x));
}
- /**
- * Unit in The Last Place
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Unit in The Last Place
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ULP(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, MathFunctions.ulp(x));
}
- /**
- * Is Not-a-Number
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Is Not-a-Number
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ISNAN(int pos) {
double x = getTokenValue(pos + 1);
if (Double.IsNaN(x))
@@ -3367,112 +3201,90 @@ private void ISNAN(int pos) {
else
f1SetDecreaseRemove(pos, BooleanAlgebra.FALSE);
}
- /**
- * Number of digits in base 10
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Number of digits in base 10
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void NDIG10(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, NumberTheory.numberOfDigits(x));
}
- /**
- * Number of prime factors - distinct
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Number of prime factors - distinct
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void NFACT(int pos) {
double n = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, NumberTheory.numberOfPrimeFactors(n));
}
- /**
- * Arcuus secant
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcuus secant
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ARCSEC(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, MathFunctions.asec(x));
}
- /**
- * Arcuus cosecant
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Arcuus cosecant
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void ARCCSC(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, MathFunctions.acosec(x));
}
- /**
- * Gamma special function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Gamma special function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void GAMMA(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.gamma(x));
}
- /**
- * Lambert-W special function, principal branch 0
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Lambert-W special function, principal branch 0
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void LAMBERT_W0(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.lambertW(x, 0));
}
- /**
- * Lambert-W special function, branch = -1
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Lambert-W special function, branch = -1
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void LAMBERT_W1(int pos) {
double x = getTokenValue(pos + 1);
f1SetDecreaseRemove(pos, SpecialFunctions.lambertW(x, -1));
- }
- /**
- * Signum of Gamma special function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ }
+ /// Signum of Gamma special function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void SGN_GAMMA(int pos) {
double x = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, SpecialFunctions.sgnGamma(x) );
}
- /**
- * Log Gamma special function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Log Gamma special function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void LOG_GAMMA(int pos) {
double x = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, SpecialFunctions.logGamma(x) );
}
- /**
- * Digamma special function
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Digamma special function
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void DI_GAMMA(int pos) {
double x = getTokenValue(pos+1);
f1SetDecreaseRemove(pos, SpecialFunctions.diGamma(x) );
}
- /**
- * User Defined Variadic function param value
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// User Defined Variadic function param value
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void UDF_PARAM(int pos) {
double value = Double.NaN;
double x = getTokenValue(pos+1);
@@ -3491,24 +3303,20 @@ private void UDF_PARAM(int pos) {
}
f1SetDecreaseRemove(pos, value );
}
- /**
- * Logarithm
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Logarithm
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void LOG(int pos) {
double b = getTokenValue(pos+1);
double a = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.log(a, b) );
}
- /**
- * Creates ArraList containing function parameters
- *
- * @param pos the function position
- *
- * @return List of function parameters.
- */
+ /// Creates containing function parameters
+ ///
+ /// the token position
+ ///
+ /// List of function parameters.
private List getNumbers(int pos) {
List numbers = new List();
int pn = pos;
@@ -3528,270 +3336,218 @@ private List getNumbers(int pos) {
} while ( end == false );
return numbers;
}
- /**
- * Modulo
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Modulo
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void MOD(int pos) {
double a = getTokenValue(pos+1);
double b = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.mod(a, b) );
}
- /**
- * Binomial Coefficient
- *
- * @param pos the token position
- */
+ /// Binomial Coefficient
+ ///
+ /// the token position
private void BINOM_COEFF(int pos) {
double n = getTokenValue(pos+1);
double k = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.binomCoeff(n,k) );
}
- /**
- * Number of permutations
- *
- * @param pos the token position
- */
+ /// Number of permutations
+ ///
+ /// the token position
private void PERMUTATIONS(int pos) {
double n = getTokenValue(pos+1);
double k = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.numberOfPermutations(n, k) );
}
- /**
- * Beta special function
- * @param pos the token position
- */
+ /// Beta special function
+ ///
+ /// the token position
private void BETA(int pos) {
double x = getTokenValue(pos+1);
double y = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, SpecialFunctions.beta(x, y) );
}
- /**
- * Log beta special function
- * @param pos the token position
- */
+ /// Log beta special function
+ ///
+ /// the token position
private void LOG_BETA(int pos) {
double x = getTokenValue(pos+1);
double y = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, SpecialFunctions.logBeta(x, y) );
}
- /**
- * Bernoulli Number
- *
- * @param pos the token position
- */
+ /// Bernoulli Number
+ ///
+ /// the token position
private void BERNOULLI_NUMBER(int pos) {
double m = getTokenValue(pos+1);
double n = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.bernoulliNumber(m, n) );
}
- /**
- * Stirling number of the first kind
- *
- * @param pos the token position
- */
+ /// Stirling number of the first kind
+ ///
+ /// the token position
private void STIRLING1_NUMBER(int pos) {
double n = getTokenValue(pos+1);
double k = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.Stirling1Number(n, k) );
}
- /**
- * Stirling number of the second kind.
- *
- * @param pos the token position
- */
+ /// Stirling number of the second kind.
+ ///
+ /// the token position
private void STIRLING2_NUMBER(int pos) {
double n = getTokenValue(pos+1);
double k = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.Stirling2Number(n, k) );
}
- /**
- * Worpitzky number.
- *
- * @param pos the token position
- */
+ /// Worpitzky number.
+ ///
+ /// the token position
private void WORPITZKY_NUMBER(int pos) {
double n = getTokenValue(pos+1);
double k = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.worpitzkyNumber(n, k) );
}
- /**
- * Euler number
- *
- * @param pos the token position
- */
+ /// Euler number
+ ///
+ /// the token position
private void EULER_NUMBER(int pos) {
double n = getTokenValue(pos+1);
double k = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.eulerNumber(n, k) );
}
- /**
- * Kronecker delta
- *
- * @param pos the token position
- */
+ /// Kronecker delta
+ ///
+ /// the token position
private void KRONECKER_DELTA(int pos) {
double i = getTokenValue(pos+1);
double j = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.kroneckerDelta(i, j) );
}
- /**
- * Euler polynomial
- *
- * @param pos the token position
- */
+ /// Euler polynomial
+ ///
+ /// the token position
private void EULER_POLYNOMIAL(int pos) {
double m = getTokenValue(pos+1);
double x = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.eulerPolynomial(m, x) );
}
- /**
- * Harmonic numbers
- *
- * @param pos the token position
- */
+ /// Harmonic numbers
+ ///
+ /// the token position
private void HARMONIC2_NUMBER(int pos) {
double x = getTokenValue(pos+1);
double n = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, MathFunctions.harmonicNumber(x, n) );
}
- /**
- * Decimal rounding
- *
- * @param pos the token position
- */
+ /// Decimal rounding
+ ///
+ /// the token position
private void ROUND(int pos) {
double value = getTokenValue(pos + 1);
int places = (int)getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, MathFunctions.round(value, places));
}
- /**
- * Random number - Uniform Continuous distribution
- *
- * @param pos the token position
- */
+ /// Random number - Uniform Continuous distribution
+ ///
+ /// the token position
private void RND_VAR_UNIFORM_CONT(int pos) {
double a = getTokenValue(pos + 1);
double b = getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, ProbabilityDistributions.rndUniformContinuous(a, b, ProbabilityDistributions.randomGenerator));
}
- /**
- * Random number - Uniform Discrete distribution
- *
- * @param pos the token position
- */
+ /// Random number - Uniform Discrete distribution
+ ///
+ /// the token position
private void RND_VAR_UNIFORM_DISCR(int pos) {
int a = (int)getTokenValue(pos + 1);
int b = (int)getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, ProbabilityDistributions.rndInteger(a, b, ProbabilityDistributions.randomGenerator));
}
- /**
- * Random number - Normal distribution
- *
- * @param pos the token position
- */
+ /// Random number - Normal distribution
+ ///
+ /// the token position
private void RND_NORMAL(int pos) {
double mean = getTokenValue(pos + 1);
double stddev = getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, ProbabilityDistributions.rndNormal(mean, stddev, ProbabilityDistributions.randomGenerator));
}
- /**
- * Number of digits in given numeral system
- *
- * @param pos the token position
- */
+ /// Number of digits in given numeral system
+ ///
+ /// the token position
private void NDIG(int pos) {
double number = getTokenValue(pos + 1);
double numeralSystemBase = getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, NumberTheory.numberOfDigits(number, numeralSystemBase));
}
- /**
- * Digit at position - base 10 numeral system
- *
- * @param pos the token position
- */
+ /// Digit at position - base 10 numeral system
+ ///
+ /// the token position
private void DIGIT10(int pos) {
double number = getTokenValue(pos + 1);
double position = getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, NumberTheory.digitAtPosition(number, position));
}
- /**
- * Prime factor value
- *
- * @param pos the token position
- */
+ /// Prime factor value
+ ///
+ /// the token position
private void FACTVAL(int pos) {
double number = getTokenValue(pos + 1);
double id = getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, NumberTheory.primeFactorValue(number, id));
}
- /**
- * Prime factor value exponent
- *
- * @param pos the token position
- */
+ /// Prime factor value exponent
+ ///
+ /// the token position
private void FACTEXP(int pos) {
double number = getTokenValue(pos + 1);
double id = getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, NumberTheory.primeFactorExponent(number, id));
}
- /**
- * Nth order root
- *
- * @param pos the token position
- */
+ /// Nth order root
+ ///
+ /// the token position
private void ROOT(int pos) {
double n = getTokenValue(pos + 1);
double x = getTokenValue(pos + 2);
f2SetDecreaseRemove(pos, MathFunctions.root(n, x));
}
- /**
- * Lower incomplete special Gamma function
- *
- * @param pos the token position
- */
+ /// Lower incomplete special Gamma function
+ ///
+ /// the token position
private void INC_GAMMA_LOWER(int pos) {
double s = getTokenValue(pos+1);
double x = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, SpecialFunctions.incompleteGammaLower(s, x) );
}
- /**
- * Upper incomplete special Gamma function
- *
- * @param pos the token position
- */
+ /// Upper incomplete special Gamma function
+ ///
+ /// the token position
private void INC_GAMMA_UPPER(int pos) {
double s = getTokenValue(pos+1);
double x = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, SpecialFunctions.incompleteGammaUpper(s, x) );
}
- /**
- * Lower regularized special Gamma function
- *
- * @param pos the token position
- */
+ /// Lower regularized special Gamma function
+ ///
+ /// the token position
private void REG_GAMMA_LOWER(int pos) {
double s = getTokenValue(pos+1);
double x = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, SpecialFunctions.regularizedGammaLowerP(s, x) );
}
- /**
- * Lower regularized special Gamma function
- *
- * @param pos the token position
- */
+ /// Lower regularized special Gamma function
+ ///
+ /// the token position
private void REG_GAMMA_UPPER(int pos) {
double s = getTokenValue(pos+1);
double x = getTokenValue(pos+2);
f2SetDecreaseRemove(pos, SpecialFunctions.regularizedGammaUpperQ(s, x) );
}
- /**
- * IF function
- *
- * @param pos the token position
- */
+ /// IF function
+ ///
+ /// the token position
private void IF_CONDITION(int pos) {
/*
* Get condition string
@@ -3808,11 +3564,9 @@ private void IF_CONDITION(int pos) {
ifExp.setVerboseMode();
ifSetRemove(pos, ifExp.calculate());
}
- /**
- * IFF function
- *
- * @param pos the token position
- */
+ /// IFF function
+ ///
+ /// the token position
private void IFF(int pos) {
/*
* Get condition string
@@ -3873,12 +3627,10 @@ private void IFF(int pos) {
tokensList[pos].tokenLevel--;
}
}
- /**
- * IF
- * Sets tokens to number token
- *
- * @param pos token index (position)
- */
+ /// IF
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void IF(int pos) {
double ifCondition = tokensList[pos+1].tokenValue;
double ifTrue = tokensList[pos+2].tokenValue;
@@ -3890,157 +3642,132 @@ private void IF(int pos) {
result = Double.NaN;
f3SetDecreaseRemove(pos, result );
}
- /**
- * Characteristic function (a,b)
- *
- * @param pos the token position
- */
+ /// Characteristic function (a,b)
+ ///
+ /// the token position
private void CHI(int pos) {
double x = getTokenValue(pos+1);
double a = getTokenValue(pos+2);
double b = getTokenValue(pos+3);
f3SetDecreaseRemove(pos, MathFunctions.chi(x, a, b) );
}
- /**
- * Characteristic function [a,b]
- *
- * @param pos the token position
- */
+ /// Characteristic function [a,b]
+ ///
+ /// the token position
private void CHI_LR(int pos) {
double x = getTokenValue(pos+1);
double a = getTokenValue(pos+2);
double b = getTokenValue(pos+3);
f3SetDecreaseRemove(pos, MathFunctions.chi_LR(x, a, b) );
}
- /**
- * Characteristic function [a,b)
- *
- * @param pos the token position
- */
+ /// Characteristic function [a,b)
+ ///
+ /// the token position
private void CHI_L(int pos) {
double x = getTokenValue(pos+1);
double a = getTokenValue(pos+2);
double b = getTokenValue(pos+3);
f3SetDecreaseRemove(pos, MathFunctions.chi_L(x, a, b) );
}
- /**
- * Characteristic function (a,b]
- *
- * @param pos the token position
- */
+ /// Characteristic function (a,b]
+ ///
+ /// the token position
private void CHI_R(int pos) {
double x = getTokenValue(pos + 1);
double a = getTokenValue(pos + 2);
double b = getTokenValue(pos + 3);
f3SetDecreaseRemove(pos, MathFunctions.chi_R(x, a, b));
}
- /**
- * Probability Distribution Function - Uniform Continuous distribution
- *
- * @param pos the token position
- */
+ /// Probability Distribution Function - Uniform Continuous distribution
+ ///
+ /// the token position
private void PDF_UNIFORM_CONT(int pos) {
double x = getTokenValue(pos + 1);
double a = getTokenValue(pos + 2);
double b = getTokenValue(pos + 3);
f3SetDecreaseRemove(pos, ProbabilityDistributions.pdfUniformContinuous(x, a, b));
}
- /**
- * Cumulative Distribution Function - Uniform Continuous distribution
- *
- * @param pos the token position
- */
+ /// Cumulative Distribution Function - Uniform Continuous distribution
+ ///
+ /// the token position
private void CDF_UNIFORM_CONT(int pos) {
double x = getTokenValue(pos + 1);
double a = getTokenValue(pos + 2);
double b = getTokenValue(pos + 3);
f3SetDecreaseRemove(pos, ProbabilityDistributions.cdfUniformContinuous(x, a, b));
}
- /**
- * Quantile Function - Uniform Continuous distribution
- *
- * @param pos the token position
- */
+ /// Quantile Function - Uniform Continuous distribution
+ ///
+ /// the token position
private void QNT_UNIFORM_CONT(int pos) {
double q = getTokenValue(pos + 1);
double a = getTokenValue(pos + 2);
double b = getTokenValue(pos + 3);
f3SetDecreaseRemove(pos, ProbabilityDistributions.qntUniformContinuous(q, a, b));
}
- /**
- * Probability Distribution Function - Normal distribution
- *
- * @param pos the token position
- */
+ /// Probability Distribution Function - Normal distribution
+ ///
+ /// the token position
private void PDF_NORMAL(int pos) {
double x = getTokenValue(pos + 1);
double mean = getTokenValue(pos + 2);
double stddev = getTokenValue(pos + 3);
f3SetDecreaseRemove(pos, ProbabilityDistributions.pdfNormal(x, mean, stddev));
}
- /**
- * Cumulative Distribution Function - Normal distribution
- *
- * @param pos the token position
- */
+ /// Cumulative Distribution Function - Normal distribution
+ ///
+ /// the token position
private void CDF_NORMAL(int pos) {
double x = getTokenValue(pos + 1);
double mean = getTokenValue(pos + 2);
double stddev = getTokenValue(pos + 3);
f3SetDecreaseRemove(pos, ProbabilityDistributions.cdfNormal(x, mean, stddev));
}
- /**
- * Quantile Function - Normal distribution
- *
- * @param pos the token position
- */
+ /// Quantile Function - Normal distribution
+ ///
+ /// the token position
private void QNT_NORMAL(int pos) {
double q = getTokenValue(pos + 1);
double mean = getTokenValue(pos + 2);
double stddev = getTokenValue(pos + 3);
f3SetDecreaseRemove(pos, ProbabilityDistributions.qntNormal(q, mean, stddev));
}
- /**
- * Digit at position - numeral system with given base
- *
- * @param pos the token position
- */
+ /// Digit at position - numeral system with given base
+ ///
+ /// the token position
private void DIGIT(int pos) {
double number = getTokenValue(pos + 1);
double position = getTokenValue(pos + 2);
double numeralSystemBase = getTokenValue(pos + 3);
f3SetDecreaseRemove(pos, NumberTheory.digitAtPosition(number, position, numeralSystemBase));
}
- /**
- * Incomplete beta special function
- * @param pos the token position
- */
+ /// Incomplete beta special function
+ ///
+ /// the token position
private void INC_BETA(int pos) {
double x = getTokenValue(pos+1);
double a = getTokenValue(pos+2);
double b = getTokenValue(pos+3);
f3SetDecreaseRemove(pos, SpecialFunctions.incompleteBeta(a, b, x) );
}
- /**
- * Regularized incomplete beta special function
- * @param pos the token position
- */
+ /// Regularized incomplete beta special function
+ ///
+ /// the token position
private void REG_BETA(int pos) {
double x = getTokenValue(pos+1);
double a = getTokenValue(pos+2);
double b = getTokenValue(pos+3);
f3SetDecreaseRemove(pos, SpecialFunctions.regularizedBeta(a, b, x) );
}
- /**
- * Updating missing tokens (i.e. indexes i sum operator). Used when creating
- * internal expressions based on the sublist of tokens.
- *
- *
- * @param tokens the tokens list
- * @param keyWord missing key word
- * @param tokenId missing token id
- * @param tokenTypeId missing token type id
- */
+ ///
+ /// Updating missing tokens (i.e. indexes i sum operator). Used when creating
+ /// internal expressions based on the sublist of tokens.
+ ///
+ ///
+ /// the tokens list
+ /// missing key word
+ /// missing token id
+ /// missing token type id
private void updateMissingTokens(List tokens, String keyWord, int tokenId, int tokenTypeId) {
foreach (Token t in tokens)
if ( (t.tokenTypeId == ConstantValue.NaN) && (t.tokenStr.Equals(keyWord))) {
@@ -4049,13 +3776,13 @@ private void updateMissingTokens(List tokens, String keyWord, int tokenId
t.tokenTypeId = tokenTypeId;
}
}
- /**
- * Update missing tokens in expression related
- * to iterative operators.
- *
- * @param index Index parameter of the iterative operator
- * @param iterParams Parameters list of the iterative operator
- */
+ ///
+ /// Update missing tokens in expression related
+ /// to iterative operators.
+ ///
+ ///
+ /// Index parameter of the iterative operator
+ /// Parameters list of the iterative operator
private void updateMissingTokens(ArgumentParameter index, IterativeOperatorParameters iterParams) {
if (index.presence == Argument.NOT_FOUND) {
updateMissingTokens(iterParams.indexParam.tokens, iterParams.indexParam.paramStr, index.index, Argument.TYPE_ID);
@@ -4064,12 +3791,10 @@ private void updateMissingTokens(ArgumentParameter index, IterativeOperatorParam
updateMissingTokens(iterParams.funParam.tokens, iterParams.indexParam.paramStr, index.index, Argument.TYPE_ID);
}
}
- /**
- * Evaluates ranges 'from', 'to', 'delta' for the iterative operator
- *
- * @param index Index parameter of the iterative operator
- * @param iterParams Parameters list of the iterative operator
- */
+ /// Evaluates ranges 'from', 'to', 'delta' for the iterative operator
+ ///
+ /// Index parameter of the iterative operator
+ /// Parameters list of the iterative operator
private void evalFromToDeltaParameters(ArgumentParameter index, IterativeOperatorParameters iterParams) {
/*
* Create from, to, fun expression
@@ -4103,16 +3828,16 @@ private void evalFromToDeltaParameters(ArgumentParameter index, IterativeOperato
iterParams.delta = iterParams.deltaExp.calculate();
}
}
- /**
- * Summation operator (SIGMA by)
- * sum(i,m,n,f(i),b) --> sum f(i) from i=m to i=n by delta
- * i - index (argument)
- * m, n - numbers or expressions
- * f(i) - function string
- * by delta
- *
- * @param pos the token position
- */
+ ///
+ /// Summation operator (SIGMA by)
+ /// sum(i,m,n,f(i),b) --> sum f(i) from i=m to i=n by delta
+ /// i - index (argument)
+ /// m, n - numbers or expressions
+ /// f(i) - function string
+ /// by delta
+ ///
+ ///
+ /// the token position
private void SUM(int pos) {
IterativeOperatorParameters iterParams = new IterativeOperatorParameters(getFunctionParameters(pos, tokensList));
ArgumentParameter index = getParamArgument(iterParams.indexParam.paramStr);
@@ -4122,16 +3847,16 @@ private void SUM(int pos) {
clearParamArgument(index);
calcSetDecreaseRemove(pos, sigma, true);
}
- /**
- * Product operator (SIGMA by)
- * pord(i,m,n,f(i),b) --> prod f(i) from i=m to i=n by delta
- * i - index (argument)
- * m, n - numbers or expressions
- * f(i) - function string
- * by delta
- *
- * @param pos the token position
- */
+ ///
+ /// Product operator (SIGMA by)
+ /// pord(i,m,n,f(i),b) --> prod f(i) from i=m to i=n by delta
+ /// i - index (argument)
+ /// m, n - numbers or expressions
+ /// f(i) - function string
+ /// by delta
+ ///
+ ///
+ /// the token position
private void PROD(int pos) {
IterativeOperatorParameters iterParams = new IterativeOperatorParameters(getFunctionParameters(pos, tokensList));
ArgumentParameter index = getParamArgument(iterParams.indexParam.paramStr);
@@ -4141,16 +3866,16 @@ private void PROD(int pos) {
clearParamArgument(index);
calcSetDecreaseRemove(pos, product, true);
}
- /**
- * Minimum value - iterative operator
- * mini(i,m,n,f(i),b) --> min f(i) from i=m to i=n by delta
- * i - index (argument)
- * m, n - numbers or expressions
- * f(i) - function string
- * by delta
- *
- * @param pos the token position
- */
+ ///
+ /// Minimum value - iterative operator
+ /// mini(i,m,n,f(i),b) --> min f(i) from i=m to i=n by delta
+ /// i - index (argument)
+ /// m, n - numbers or expressions
+ /// f(i) - function string
+ /// by delta
+ ///
+ ///
+ /// the token position
private void MIN(int pos) {
IterativeOperatorParameters iterParams = new IterativeOperatorParameters(getFunctionParameters(pos, tokensList));
ArgumentParameter index = getParamArgument(iterParams.indexParam.paramStr);
@@ -4160,16 +3885,16 @@ private void MIN(int pos) {
clearParamArgument(index);
calcSetDecreaseRemove(pos, min);
}
- /**
- * Maximum value - iterative operator
- * maxi(i,m,n,f(i),b) --> max f(i) from i=m to i=n by delta
- * i - index (argument)
- * m, n - numbers or expressions
- * f(i) - function string
- * by delta
- *
- * @param pos the token position
- */
+ ///
+ /// Maximum value - iterative operator
+ /// maxi(i,m,n,f(i),b) --> max f(i) from i=m to i=n by delta
+ /// i - index (argument)
+ /// m, n - numbers or expressions
+ /// f(i) - function string
+ /// by delta
+ ///
+ ///
+ /// the token position
private void MAX(int pos) {
IterativeOperatorParameters iterParams = new IterativeOperatorParameters(getFunctionParameters(pos, tokensList));
ArgumentParameter index = getParamArgument(iterParams.indexParam.paramStr);
@@ -4179,16 +3904,16 @@ private void MAX(int pos) {
clearParamArgument(index);
calcSetDecreaseRemove(pos, max);
}
- /**
- * Average function value - iterative operator
- * avg(i,m,n,f(i),b) --> avg f(i) from i=m to i=n by delta
- * i - index (argument)
- * m, n - numbers or expressions
- * f(i) - function string
- * by delta
- *
- * @param pos the token position
- */
+ ///
+ /// Average function value - iterative operator
+ /// avg(i,m,n,f(i),b) --> avg f(i) from i=m to i=n by delta
+ /// i - index (argument)
+ /// m, n - numbers or expressions
+ /// f(i) - function string
+ /// by delta
+ ///
+ ///
+ /// the token position
private void AVG(int pos) {
IterativeOperatorParameters iterParams = new IterativeOperatorParameters(getFunctionParameters(pos, tokensList));
ArgumentParameter index = getParamArgument(iterParams.indexParam.paramStr);
@@ -4198,16 +3923,16 @@ private void AVG(int pos) {
clearParamArgument(index);
calcSetDecreaseRemove(pos, avg, true);
}
- /**
- * Variance from sample function values - iterative operator
- * vari(i,m,n,f(i),b) --> var f(i) from i=m to i=n by delta
- * i - index (argument)
- * m, n - numbers or expressions
- * f(i) - function string
- * by delta
- *
- * @param pos the token position
- */
+ ///
+ /// Variance from sample function values - iterative operator
+ /// vari(i,m,n,f(i),b) --> var f(i) from i=m to i=n by delta
+ /// i - index (argument)
+ /// m, n - numbers or expressions
+ /// f(i) - function string
+ /// by delta
+ ///
+ ///
+ /// the token position
private void VAR(int pos) {
IterativeOperatorParameters iterParams = new IterativeOperatorParameters(getFunctionParameters(pos, tokensList));
ArgumentParameter index = getParamArgument(iterParams.indexParam.paramStr);
@@ -4217,16 +3942,16 @@ private void VAR(int pos) {
clearParamArgument(index);
calcSetDecreaseRemove(pos, var, true);
}
- /**
- * Standard deviation from sample function values - iterative operator
- * stdi(i,m,n,f(i),b) --> std f(i) from i=m to i=n by delta
- * i - index (argument)
- * m, n - numbers or expressions
- * f(i) - function string
- * by delta
- *
- * @param pos the token position
- */
+ ///
+ /// Standard deviation from sample function values - iterative operator
+ /// stdi(i,m,n,f(i),b) --> std f(i) from i=m to i=n by delta
+ /// i - index (argument)
+ /// m, n - numbers or expressions
+ /// f(i) - function string
+ /// by delta
+ ///
+ ///
+ /// the token position
private void STD(int pos) {
IterativeOperatorParameters iterParams = new IterativeOperatorParameters(getFunctionParameters(pos, tokensList));
ArgumentParameter index = getParamArgument(iterParams.indexParam.paramStr);
@@ -4236,12 +3961,11 @@ private void STD(int pos) {
clearParamArgument(index);
calcSetDecreaseRemove(pos, std, true);
}
- /*
- * Function derivative
- *
- * @param pos the token position
- * @param derivativeType the type of derivative (LEFT, RIGHT, ...)
- */
+
+ /// Function derivative
+ ///
+ /// the token position
+ /// the type of derivative (LEFT, RIGHT, ...)
private void DERIVATIVE(int pos, int derivativeType) {
/*
* 2 params - der( f(x), x )
@@ -4332,12 +4056,10 @@ private void DERIVATIVE(int pos, int derivativeType) {
}
clearParamArgument(x);
}
- /**
- * Function derivative
- *
- * @param pos the token position
- * @param derivativeType the type of derivative (left, right, etc...)
- */
+ /// Function derivative
+ ///
+ /// the token position
+ /// the type of derivative (left, right, etc...)
private void DERIVATIVE_NTH(int pos, int derivativeType) {
const double DEF_EPS = 1E-6;
/*
@@ -4397,15 +4119,11 @@ private void DERIVATIVE_NTH(int pos, int derivativeType) {
}
clearParamArgument(x);
}
- /**
- * Function integral
- *
- * @param pos the token position
- */
+ /// Function integral
+ ///
+ /// the token position
private void INTEGRAL(int pos) {
- /**
- * Default epsilon
- */
+ // Default epsilon
const double DEF_EPS = 1E-6
;
/*
@@ -4444,15 +4162,11 @@ private void INTEGRAL(int pos) {
calcSetDecreaseRemove(pos, Calculus.integralTrapezoid(funExp, x.argument, aExp.calculate(), bExp.calculate(), eps, maxSteps) );
clearParamArgument(x);
}
- /**
- * Function SOLVE
- *
- * @param pos the token position
- */
+ /// Function SOLVE
+ ///
+ /// the token position
private void SOLVE(int pos) {
- /**
- * Default epsilon
- */
+ /// Default epsilon
const double DEF_EPS = 1E-9;
/*
* Default max number of steps
@@ -4490,11 +4204,9 @@ private void SOLVE(int pos) {
calcSetDecreaseRemove(pos, Calculus.solveBrent(funExp, x.argument, aExp.calculate(), bExp.calculate(), eps, maxSteps));
clearParamArgument(x);
}
- /**
- * Forward difference operator
- *
- * @param pos the token position
- */
+ /// Forward difference operator
+ ///
+ /// the token position
private void FORWARD_DIFFERENCE(int pos) {
List parameters = getFunctionParameters(pos, tokensList);
FunctionParameter funParam = parameters[0];
@@ -4514,11 +4226,9 @@ private void FORWARD_DIFFERENCE(int pos) {
calcSetDecreaseRemove(pos, Calculus.forwardDifference(funExp, h, x.argument) );
clearParamArgument(x);
}
- /**
- * Backward diffrence operator
- *
- * @param pos the token position
- */
+ /// Backward diffrence operator
+ ///
+ /// the token position
private void BACKWARD_DIFFERENCE(int pos) {
List parameters = getFunctionParameters(pos, tokensList);
FunctionParameter funParam = parameters[0];
@@ -4538,229 +4248,181 @@ private void BACKWARD_DIFFERENCE(int pos) {
calcSetDecreaseRemove(pos, Calculus.backwardDifference(funExp, h, x.argument) );
clearParamArgument(x);
}
- /**
- * Minimum variadic
- * Sets tokens to number token
- *
- * @param pos the token position
- */
+ /// Minimum variadic
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void MIN_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.min( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * Maximum variadic
- * Sets tokens to number token
- *
- * @param pos token index (position)
- */
+ /// Maximum variadic
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void MAX_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.max( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * Sum variadic
- * Sets tokens to number token
- *
- * @param pos token index (position)
- */
+ /// Sum variadic
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void SUM_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.sum(mXparser.arrayList2double(numbers)), numbers.Count, true);
}
- /**
- * Sum variadic
- * Sets tokens to number token
- *
- * @param pos token index (position)
- */
+ /// Sum variadic
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void PROD_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.prod(mXparser.arrayList2double(numbers)), numbers.Count, true);
}
- /**
- * Average variadic
- * Sets tokens to number token
- *
- * @param pos token index (position)
- */
+ /// Average variadic
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void AVG_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, Statistics.avg(mXparser.arrayList2double(numbers)), numbers.Count, true);
}
- /**
- * Variance variadic
- * Sets tokens to number token
- *
- * @param pos token index (position)
- */
+ /// Variance variadic
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void VAR_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, Statistics.var(mXparser.arrayList2double(numbers)), numbers.Count, true);
}
- /**
- * Standard deviation variadic
- * Sets tokens to number token
- *
- * @param pos token index (position)
- */
+ /// Standard deviation variadic
+ /// Sets tokens to number token
+ ///
+ /// the token position
private void STD_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, Statistics.std(mXparser.arrayList2double(numbers)), numbers.Count, true);
}
- /**
- * Continued fraction
- *
- * @param pos the token position
- */
+ /// Continued fraction
+ ///
+ /// the token position
private void CONTINUED_FRACTION(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, MathFunctions.continuedFraction( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * Continued polynomial
- *
- * @param pos the token position
- */
+ /// Continued polynomial
+ ///
+ /// the token position
private void CONTINUED_POLYNOMIAL(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, MathFunctions.continuedPolynomial( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * Greates Common Divisor
- *
- * @param pos the token position
- */
+ /// Greates Common Divisor
+ ///
+ /// the token position
private void GCD(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.gcd( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * Lowest Common Multiply
- *
- * @param pos the token position
- */
+ /// Lowest Common Multiply
+ ///
+ /// the token position
private void LCM(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.lcm( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * Random number from list
- *
- * @param pos the token position
- */
+ /// Random number from list
+ ///
+ /// the token position
private void RND_LIST(int pos) {
List numbers = getNumbers(pos);
int n = numbers.Count;
int i = ProbabilityDistributions.rndIndex(n, ProbabilityDistributions.randomGenerator);
variadicSetDecreaseRemove(pos, numbers[i], numbers.Count);
}
- /**
- * Coalesce
- *
- * @param pos the token position
- */
+ /// Coalesce
+ ///
+ /// the token position
private void COALESCE(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, MathFunctions.coalesce(mXparser.arrayList2double(numbers)), numbers.Count);
}
- /**
- * OR_VARIADIC
- *
- * @param pos the token position
- */
+ /// OR_VARIADIC
+ ///
+ /// the token position
private void OR_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, BooleanAlgebra.orVariadic( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * AND_VARIADIC
- *
- * @param pos the token position
- */
+ /// AND_VARIADIC
+ ///
+ /// the token position
private void AND_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, BooleanAlgebra.andVariadic( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * XOR_VARIADIC
- *
- * @param pos the token position
- */
+ /// XOR_VARIADIC
+ ///
+ /// the token position
private void XOR_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, BooleanAlgebra.xorVariadic( mXparser.arrayList2double(numbers) ), numbers.Count );
}
- /**
- * ARGMIN_VARIADIC
- *
- * @param pos the token position
- */
+ /// ARGMIN_VARIADIC
+ ///
+ /// the token position
private void ARGMIN_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.argmin(mXparser.arrayList2double(numbers)), numbers.Count );
}
- /**
- * ARGMAX_VARIADIC
- *
- * @param pos the token position
- */
+ /// ARGMAX_VARIADIC
+ ///
+ /// the token position
private void ARGMAX_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.argmax(mXparser.arrayList2double(numbers)), numbers.Count );
}
- /**
- * MEDIAN_VARIADIC
- *
- * @param pos the token position
- */
+ /// MEDIAN_VARIADIC
+ ///
+ /// the token position
private void MEDIAN_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, Statistics.median(mXparser.arrayList2double(numbers)), numbers.Count );
}
- /**
- * MODE_VARIADIC
- *
- * @param pos the token position
- */
+ /// MODE_VARIADIC
+ ///
+ /// the token position
private void MODE_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, Statistics.mode(mXparser.arrayList2double(numbers)), numbers.Count );
}
- /**
- * BASE_VARIADIC
- *
- * @param pos the token position
- */
+ /// BASE_VARIADIC
+ ///
+ /// the token position
private void BASE_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.convOthBase2Decimal(mXparser.arrayList2double(numbers)), numbers.Count );
}
- /**
- * NDIST_VARIADIC
- *
- * @param pos the token position
- */
+ /// NDIST_VARIADIC
+ ///
+ /// the token position
private void NDIST_VARIADIC(int pos) {
List numbers = getNumbers(pos);
variadicSetDecreaseRemove(pos, NumberTheory.numberOfDistValues(mXparser.arrayList2double(numbers)), numbers.Count );
}
- /**
- * Parser symbols
- * Removes comma
- *
- * @param pos token index (position)
- */
+ /// Parser symbols
+ /// Removes comma
+ ///
+ /// the token position)
private void COMMA(int pos) {
tokensList.RemoveAt(pos);
}
- /**
- * Parser symbols
- * Removes parenthesis
- *
- * @param lPos left token index (position)
- * @param rPos roght token index (position)
- */
+ /// Parser symbols
+ /// Removes parenthesis
+ ///
+ /// left token index (position)
+ /// roght token index (position)
private void PARENTHESES(int lPos, int rPos) {
for (int p = lPos; p <= rPos; p++)
tokensList[p].tokenLevel--;
@@ -4773,16 +4435,14 @@ private void PARENTHESES(int lPos, int rPos) {
*
*=================================================
*/
- /**
- * Checks syntax of the expression string.
- *
- * @return true if syntax is ok
- */
+ /// Checks syntax of the expression string.
+ ///
+ /// true if syntax is ok
public bool checkLexSyntax() {
bool syntax = NO_SYNTAX_ERRORS;
recursionCallsCounter = 0;
if (expressionString.Length == 0) {
- syntax = SYNTAX_ERROR_OR_STATUS_UNKNOWN;
+ syntax = SYNTAX_ERROR_OR_STATUS_UNKNOWN;
errorMessage = "Empty expression string\n";
return syntax;
}
@@ -4799,20 +4459,16 @@ public bool checkLexSyntax() {
}
return syntax;
}
- /**
- * Checks syntax of the expression string.
- *
- * @return true if syntax is ok
- */
+ /// Checks syntax of the expression string.
+ ///
+ /// true if syntax is ok
public bool checkSyntax() {
bool syntax = checkSyntax("[" + expressionString + "] ", false);
return syntax;
}
- /**
- * Checks syntax of the calculus parameter
- *
- * @return true if syntax is ok
- */
+ /// Checks syntax of the calculus parameter
+ ///
+ /// true if syntax is ok
private int checkCalculusParameter(String param) {
int errors = 0;
foreach (KeyWord kw in keyWordsList)
@@ -4821,15 +4477,17 @@ private int checkCalculusParameter(String param) {
errors++;
return errors;
}
- /**
- * Checks if argument given in the function parameter is known
- * in the expression.
- *
- * @param param the function parameter
- *
- * @return true if argument is known,
- * otherwise returns false.
- */
+ ///
+ /// Checks if argument given in the function parameter is known
+ /// in the expression.
+ ///
+ ///
+ /// the function parameter
+ ///
+ ///
+ /// true if argument is known,
+ /// otherwise returns false.
+ ///
private bool checkIfKnownArgument(FunctionParameter param) {
if (param.tokens.Count > 1)
return false;
@@ -4838,14 +4496,14 @@ private bool checkIfKnownArgument(FunctionParameter param) {
return false;
return true;
}
- /**
- * Checks if token is uknown
- *
- * @param param the function parameter
- *
- * @return true if there is only 1 token with unknown type,
- * otherwise returns false.
- */
+ /// Checks if token is uknown
+ ///
+ /// the function parameter
+ ///
+ ///
+ /// true if there is only 1 token with unknown type,
+ /// otherwise returns false.
+ ///
private bool checkIfUnknownToken(FunctionParameter param) {
if (param.tokens.Count > 1)
return false;
@@ -4854,13 +4512,14 @@ private bool checkIfUnknownToken(FunctionParameter param) {
return false;
return true;
}
- /**
- * Checking the syntax (recursively).
- *
- * @param level string representing the recurssion level.
- * @return true if syntax was correct,
- * otherwise returns false.
- */
+ /// Checking the syntax (recursively).
+ ///
+ /// string representing the recurssion level.
+ ///
+ ///
+ /// true if syntax was correct,
+ /// otherwise returns false.
+ ///
private bool checkSyntax(String level, bool functionWithBodyExt) {
if ( (expressionWasModified == false) && (syntaxStatus == NO_SYNTAX_ERRORS) && (optionsChangesetNumber == mXparser.optionsChangesetNumber) ) {
errorMessage = level + "already checked - no errors!\n";
@@ -4879,7 +4538,7 @@ private bool checkSyntax(String level, bool functionWithBodyExt) {
errorMessage = level +"checking ...\n";
bool syntax = NO_SYNTAX_ERRORS;
if (expressionString.Length == 0) {
- syntax = SYNTAX_ERROR_OR_STATUS_UNKNOWN;
+ syntax = SYNTAX_ERROR_OR_STATUS_UNKNOWN;
errorMessage = errorMessage + level + "Empty expression string\n";
syntaxStatus = syntax;
recursionCallPending = false;
@@ -5178,12 +4837,12 @@ private bool checkSyntax(String level, bool functionWithBodyExt) {
recursionCallPending = false;
return syntax;
}
- /**
- * Calculates the expression value
- *
- * @return The expression value if syntax was ok,
- * otherwise returns Double.NaN.
- */
+ /// Calculates the expression value
+ ///
+ ///
+ /// The expression value if syntax was ok,
+ /// otherwise returns .
+ ///
public double calculate() {
computingTime = 0;
long startTime = mXparser.currentTimeMillis();
@@ -5727,10 +5386,9 @@ public double calculate() {
}
return result;
}
- /**
- * Calculates unary function
- * @param pos token position
- */
+ /// Calculates unary function
+ ///
+ /// token position
private void f1ArgCalc(int pos) {
switch (tokensList[pos].tokenId) {
case Function1Arg.SIN_ID: SIN(pos); break;
@@ -5797,10 +5455,9 @@ private void f1ArgCalc(int pos) {
case Function1Arg.PARAM_ID: UDF_PARAM(pos); break;
}
}
- /**
- * Calculates binary function
- * @param pos Token position
- */
+ /// Calculates binary function
+ ///
+ /// Token position
private void f2ArgCalc(int pos) {
switch (tokensList[pos].tokenId) {
case Function2Arg.LOG_ID: LOG(pos); break;
@@ -5832,10 +5489,9 @@ private void f2ArgCalc(int pos) {
case Function2Arg.LOG_BETA_ID: LOG_BETA(pos); break;
}
}
- /**
- * Calculates function with 3 arguments
- * @param pos Token position
- */
+ /// Calculates function with 3 arguments
+ ///
+ /// Token position
private void f3ArgCalc(int pos) {
switch (tokensList[pos].tokenId) {
case Function3Arg.IF_ID: IF(pos); break;
@@ -5854,10 +5510,9 @@ private void f3ArgCalc(int pos) {
case Function3Arg.REG_BETA_ID: REG_BETA(pos); break;
}
}
- /**
- * Calculates Variadic function
- * @param pos Token position
- */
+ /// Calculates Variadic function
+ ///
+ /// Token position
private void variadicFunCalc(int pos) {
switch (tokensList[pos].tokenId) {
case FunctionVariadic.IFF_ID: IFF(pos); break;
@@ -5885,10 +5540,9 @@ private void variadicFunCalc(int pos) {
case FunctionVariadic.NDIST_ID: NDIST_VARIADIC(pos); break;
}
}
- /**
- * Calculates calculus operators
- * @param pos
- */
+ /// Calculates calculus operators
+ ///
+ /// the token position
private void calculusCalc(int pos) {
switch (tokensList[pos].tokenId) {
case CalculusOperator.SUM_ID: SUM(pos); break;
@@ -5908,10 +5562,9 @@ private void calculusCalc(int pos) {
case CalculusOperator.BACKW_DIFF_ID: BACKWARD_DIFFERENCE(pos); break;
}
}
- /**
- * Calculates boolean operators
- * @param pos
- */
+ /// Calculates boolean operators
+ ///
+ /// the token position
private void bolCalc(int pos) {
switch (tokensList[pos].tokenId) {
case BooleanOperator.AND_ID: AND(pos); break;
@@ -5926,10 +5579,9 @@ private void bolCalc(int pos) {
case BooleanOperator.XOR_ID: XOR(pos); break;
}
}
- /**
- * Calculates Bitwise operators
- * @param pos
- */
+ /// Calculates Bitwise operators
+ ///
+ /// the token position
private void bitwiseCalc(int pos) {
switch (tokensList[pos].tokenId) {
case BitwiseOperator.AND_ID: BITWISE_AND(pos); break;
@@ -5945,18 +5597,16 @@ private void bitwiseCalc(int pos) {
*
*=================================================
*/
- /**
- * Class level method for adding specific automatic
- * parser keywords relates to User Defined Functions
- * i.e.: par(i), [npar]
- */
+ ///
+ /// Class level method for adding specific automatic
+ /// parser keywords relates to User Defined Functions
+ /// i.e.: par(i), [npar]
+ ///
private void addUDFSpecificParserKeyWords() {
addKeyWord(Function1Arg.PARAM_STR, Function1Arg.PARAM_DESC, Function1Arg.PARAM_ID, Function1Arg.PARAM_SYN, Function1Arg.PARAM_SINCE, Function1Arg.TYPE_ID);
addKeyWord(ConstantValue.NPAR_STR, ConstantValue.NPAR_DESC, ConstantValue.NPAR_ID, ConstantValue.NPAR_SYN, ConstantValue.NPAR_SINCE, ConstantValue.TYPE_ID);
}
- /**
- * Creates parser key words list
- */
+ /// Creates parser key words list
private void addParserKeyWords() {
/*
* Operators key words
@@ -6477,9 +6127,7 @@ private void addParserKeyWords() {
addKeyWord(ParserSymbol.DECIMAL_REG_EXP, ParserSymbol.NUMBER_REG_DESC, ParserSymbol.NUMBER_ID, ParserSymbol.NUMBER_SYN, ParserSymbol.NUMBER_SINCE, ParserSymbol.NUMBER_TYPE_ID);
addKeyWord(ParserSymbol.BLANK_STR, ParserSymbol.BLANK_DESC, ParserSymbol.BLANK_ID, ParserSymbol.BLANK_SYN, ParserSymbol.BLANK_SINCE, ParserSymbol.TYPE_ID);
}
- /**
- * Adds arguments key words to the keywords list
- */
+ /// Adds arguments key words to the keywords list
private void addArgumentsKeyWords() {
int argumentsNumber = argumentsList.Count;
for (int argumentIndex = 0; argumentIndexAdds functions key words to the keywords list
private void addFunctionsKeyWords() {
int functionsNumber = functionsList.Count;
for (int functionIndex = 0; functionIndexAdds constants key words to the keywords list
private void addConstantsKeyWords() {
int constantsNumber = constantsList.Count;
for (int constantIndex = 0; constantIndex < constantsNumber; constantIndex++) {
@@ -6518,9 +6162,7 @@ private void addConstantsKeyWords() {
addKeyWord(c.getConstantName(), c.getDescription(), constantIndex, c.getConstantName(), "", Constant.TYPE_ID);
}
}
- /**
- * Final validation of key words
- */
+ /// Final validation of key words
private void validateParserKeyWords() {
if (mXparser.overrideBuiltinTokens) {
/*
@@ -6555,14 +6197,14 @@ private void validateParserKeyWords() {
keyWordsList.Remove(kw);
}
}
- /**
- * Adds key word to the keyWords list
- *
- * @param wordString
- * @param wordDescription
- * @param wordId
- * @param wordTypeId
- */
+ /// Adds key word to the keyWords list
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
private void addKeyWord(String wordString, String wordDescription, int wordId, String wordSyntax, String wordSince, int wordTypeId) {
if ((mXparser.tokensToRemove.Count > 0) || (mXparser.tokensToModify.Count > 0))
if ((wordTypeId == Function1Arg.TYPE_ID) ||
@@ -6581,19 +6223,19 @@ private void addKeyWord(String wordString, String wordDescription, int wordId, S
wordString = tm.newToken;
if (tm.newTokenDescription != null)
wordDescription = tm.newTokenDescription;
- wordSyntax = wordSyntax.Replace(tm.currentToken, tm.newToken);
- }
- }
+ wordSyntax = wordSyntax.Replace(tm.currentToken, tm.newToken);
+ }
+ }
}
keyWordsList.Add(new KeyWord(wordString, wordDescription, wordId, wordSyntax, wordSince, wordTypeId));
}
- /**
- * Checks whether unknown token represents number literal
- * provided in different numeral base system, where
- * base is between 1 and 36.
- *
- * @param token The token not know to the parser
- */
+ ///
+ /// Checks whether unknown token represents number literal
+ /// provided in different numeral base system, where
+ /// base is between 1 and 36.
+ ///
+ ///
+ /// The token not know to the parser
private void checkOtherNumberBases(Token token) {
int dotPos = 0;
int tokenStrLength = token.tokenStr.Length;
@@ -6663,12 +6305,12 @@ private void checkOtherNumberBases(Token token) {
token.tokenValue = NumberTheory.convOthBase2Decimal(numberLiteral, numeralSystemBase);
}
}
- /**
- * Checks whether unknown token represents fraction
- * provided as fraction or mixed fraction
- *
- * @param token The token not know to the parser
- */
+ ///
+ /// Checks whether unknown token represents fraction
+ /// provided as fraction or mixed fraction
+ ///
+ ///
+ /// The token not know to the parser
private void checkFraction(Token token) {
int tokenStrLength = token.tokenStr.Length;
if (tokenStrLength < 3) return;
@@ -6707,14 +6349,14 @@ private void checkFraction(Token token) {
token.tokenId = ParserSymbol.NUMBER_ID;
token.tokenValue = fractionValue;
}
- /**
- * Adds expression token
- * Method is called by the tokenExpressionString()
- * while parsing string expression
- *
- * @param tokenStr the token string
- * @param keyWord the key word
- */
+ ///
+ /// Adds expression token
+ /// Method is called by the tokenExpressionString()
+ /// while parsing string expression
+ ///
+ ///
+ /// the token string
+ /// the key word
private void addToken(String tokenStr, KeyWord keyWord) {
Token token = new Token();
initialTokens.Add(token);
@@ -6733,9 +6375,7 @@ private void addToken(String tokenStr, KeyWord keyWord) {
checkFraction(token);
}
}
- /**
- * Tokenizing expressiong string
- */
+ /// Tokenizing expressiong string
private void tokenizeExpressionString() {
/*
* Add parser and argument key words
@@ -7158,9 +6798,7 @@ private void tokenizeExpressionString() {
*/
evaluateTokensLevels();
}
- /**
- * Evaluates tokens levels
- */
+ /// Evaluates tokens levels
private void evaluateTokensLevels() {
int tokenLevel = 0;
Stack tokenStack = new Stack();
@@ -7202,9 +6840,7 @@ private void evaluateTokensLevels() {
}
}
}
- /**
- * copy initial tokens lito to tokens list
- */
+ /// copy initial tokens lito to tokens list
private void copyInitialTokens() {
tokensList = new List();
foreach (Token token in initialTokens) {
@@ -7215,15 +6851,15 @@ private void copyInitialTokens() {
private const String ARGUMENT = "argument";
private const String UNITCONST = "unit/const";
private const String ERROR = "error";
- /**
- * Tokenizes expression string and returns tokens list,
- * including: string, type, level.
- *
- * @return Copy of initial tokens.
- *
- * @see Token
- * @see mXparser#consolePrintTokens(ArrayList)
- */
+ ///
+ /// Tokenizes expression string and returns tokens list,
+ /// including: string, type, level.
+ ///
+ ///
+ /// Copy of initial tokens.
+ ///
+ ///
+ ///
public List getCopyOfInitialTokens() {
List tokensListCopy = new List();
if (expressionString.Length == 0) return tokensListCopy;
@@ -7250,14 +6886,16 @@ public List getCopyOfInitialTokens() {
}
return tokensListCopy;
}
- /**
- * Returns missing user defined arguments names, i.e.
- * sin(x) + cos(y) where x and y are not defined
- * function will return x and y.
- *
- * @return Array of missing user defined arguments names
- * - distinct strings.
- */
+ ///
+ /// Returns missing user defined arguments names, i.e.
+ /// sin(x) + cos(y) where x and y are not defined
+ /// function will return x and y.
+ ///
+ ///
+ ///
+ /// Array of missing user defined arguments names
+ /// - distinct strings.
+ ///
public String[] getMissingUserDefinedArguments() {
List tokens = getCopyOfInitialTokens();
List missingArguments = new List();
@@ -7271,14 +6909,16 @@ public String[] getMissingUserDefinedArguments() {
missArgs[i] = missingArguments[i];
return missArgs;
}
- /**
- * Returns missing user defined units names, i.e.
- * 2*[w] + [q] where [w] and [q] are not defined
- * function will return [w] and [q].
- *
- * @return Array of missing user defined units names
- * - distinct strings.
- */
+ ///
+ /// Returns missing user defined units names, i.e.
+ /// 2*[w] + [q] where [w] and [q] are not defined
+ /// function will return [w] and [q].
+ ///
+ ///
+ ///
+ /// Array of missing user defined units names
+ /// - distinct strings.
+ ///
public String[] getMissingUserDefinedUnits() {
List tokens = getCopyOfInitialTokens();
List missingUnits = new List();
@@ -7292,14 +6932,16 @@ public String[] getMissingUserDefinedUnits() {
missUnits[i] = missingUnits[i];
return missUnits;
}
- /**
- * Returns missing user defined functions names, i.e.
- * sin(x) + fun(x,y) where fun is not defined
- * function will return fun.
- *
- * @return Array of missing user defined functions names
- * - distinct strings.
- */
+ ///
+ /// Returns missing user defined functions names, i.e.
+ /// sin(x) + fun(x,y) where fun is not defined
+ /// function will return fun.
+ ///
+ ///
+ ///
+ /// Array of missing user defined functions names
+ /// - distinct strings.
+ ///
public String[] getMissingUserDefinedFunctions() {
List tokens = getCopyOfInitialTokens();
List missingFunctions = new List();
@@ -7313,36 +6955,27 @@ public String[] getMissingUserDefinedFunctions() {
missFun[i] = missingFunctions[i];
return missFun;
}
- /**
- * Gets initial tokens and returns copied list
- *
- * @see Function
- */
+ /// Gets initial tokens and returns copied list
+ ///
+ ///
internal List getInitialTokens() {
return initialTokens;
}
- /*
- * Text adjusting.
- */
+ /// Text adjusting.
private static String getLeftSpaces(String maxStr, String str) {
String spc = "";
for (int i=0; iText adjusting.
private static String getRightSpaces(String maxStr, String str) {
String spc = "";
for (int i=0; iShows parsing (verbose mode purposes).
private void showParsing(int lPos, int rPos) {
mXparser.consolePrint(" ---> ");
for (int i=lPos; i<=rPos; i++) {
@@ -7354,9 +6987,7 @@ private void showParsing(int lPos, int rPos) {
}
mXparser.consolePrint(" ... ");
}
- /**
- * shows known keywords
- */
+ /// shows known keywords
void showKeyWords() {
int keyWordsNumber = keyWordsList.Count;
String maxStr = "KEY_WORD";
@@ -7374,21 +7005,17 @@ void showKeyWords() {
}
mXparser.consolePrintln(" -------------------------------------------");
}
- /**
- * Gets help content.
- *
- * @return The help content.
- */
+ /// Gets help content.
+ ///
+ /// The help content.
public String getHelp() {
return getHelp("");
}
- /**
- * Searching help content.
- *
- * @param word searching key word
- *
- * @return The help content.
- */
+ /// Searching help content.
+ ///
+ /// searching key word
+ ///
+ /// The help content.
public String getHelp(String word) {
keyWordsList = new List();
String helpStr = "Help content: \n\n";
@@ -7443,32 +7070,30 @@ public String getHelp(String word) {
}
return helpStr;
}
- /**
- * Returns list of key words known to the parser
- *
- * @return List of keywords known to the parser.
- *
- * @see KeyWord
- * @see KeyWord#wordTypeId
- * @see Expression#getHelp()
- */
+ /// Returns list of key words known to the parser
+ ///
+ /// List of keywords known to the parser.
+ ///
+ ///
+ ///
+ ///
public List getKeyWords() {
return getKeyWords("");
}
- /**
- * Returns list of key words known to the parser
- *
- * @param query Give any string to filter list of key words against this string.
- * User more precise syntax: str=tokenString, desc=tokenDescription,
- * syn=TokenSyntax, sin=tokenSince, wid=wordId, tid=wordTypeId
- * to narrow the result.
- *
- * @return List of keywords known to the parser filter against query string.
- *
- * @see KeyWord
- * @see KeyWord#wordTypeId
- * @see Expression#getHelp(String)
- */
+ /// Returns list of key words known to the parser
+ ///
+ ///
+ /// Give any string to filter list of key words against this string.
+ /// User more precise syntax: str=tokenString, desc=tokenDescription,
+ /// syn=TokenSyntax, sin=tokenSince, wid=wordId, tid=wordTypeId
+ /// to narrow the result.
+ ///
+ ///
+ /// List of keywords known to the parser filter against query string.
+ ///
+ ///
+ ///
+ ///
public List getKeyWords(String query) {
keyWordsList = new List();
List kwyWordsToReturn = new List();
@@ -7494,15 +7119,11 @@ public List getKeyWords(String query) {
}
return kwyWordsToReturn;
}
- /*
- * shows tokens
- */
+ /// shows tokens
void showTokens() {
showTokens(tokensList);
}
- /*
- * show tokens
- */
+ /// show tokens
internal static void showTokens(List tokensList) {
String maxStr = "TokenTypeId";
mXparser.consolePrintln(" --------------------");
@@ -7535,15 +7156,11 @@ internal static void showTokens(List tokensList) {
}
mXparser.consolePrintln(" ---------------------------------------------------------------------------------------------------------------");
}
- /**
- * shows initial tokens
- */
+ /// shows initial tokens
void showInitialTokens() {
showTokens(initialTokens);
}
- /*
- * show arguments
- */
+ /// show arguments
private void showArguments() {
foreach (Argument a in argumentsList) {
bool vMode = a.getVerboseMode();
@@ -7553,20 +7170,16 @@ private void showArguments() {
a.setVerboseMode();
}
}
- /**
- *
- * @param info
- * @param withExpressionString
- */
+ ///
+ ///
+ ///
private void printSystemInfo(String info, bool withExpressionString) {
if (withExpressionString)
mXparser.consolePrint( /*"[" + this + "]" + */ "[" + description + "]" + "[" + expressionString + "] " + info);
else
mXparser.consolePrint(/*"[" + this + "]" + */ info);
}
- /**
- * Expression cloning.
- */
+ /// Expression cloning.
internal Expression clone() {
Expression newExp = new Expression(this);
if ( (initialTokens != null) && (initialTokens.Count > 0) )
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Function.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Function.cs
index b65aa665..0f849794 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Function.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Function.cs
@@ -58,129 +58,101 @@
using System.Collections.Generic;
namespace org.mariuszgromada.math.mxparser {
- /**
- * Function class provides possibility to define user functions.
- * Functions can be used in further processing by any expression,
- * dependent or recursive argument, function, etc... For expamle:
- *
- *
- * - 'f(x) = sin(x)'
- *
- 'g(x,y) = sin(x)+cos(y)'
- *
- 'h(x,y = f(x)+g(y,x)'
- *
- in general 'f(x1,x2,...,xn)' where x1,...,xn are arguments
- *
- *
- *
- * When creating a function you should avoid names reserved as
- * parser keywords, in general words known in mathematical language
- * as function names, operators (for example:
- * sin, cos, +, -, pi, e, etc...). Please be informed that after associating
- * the constant with the expression, function or dependent/recursive argument
- * its name will be recognized by the parser as reserved key word.
- * It means that it could not be the same as any other key word known
- * by the parser for this particular expression.
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.3.0
- *
- * @see RecursiveArgument
- * @see Expression
- * @see Argument
- * @see Constant
- * @see FunctionExtension
- *
- */
+ ///
+ /// Function class provides possibility to define user functions.
+ /// Functions can be used in further processing by any expression,
+ /// dependent or recursive argument, function, etc... For expamle:
+ ///
+ ///
+ /// - 'f(x) = sin(x)'
+ /// - 'g(x,y) = sin(x)+cos(y)'
+ /// - 'h(x,y = f(x)+g(y,x)'
+ /// - in general 'f(x1,x2,...,xn)' where x1,...,xn are arguments
+ ///
+ ///
+ ///
+ ///
+ /// When creating a function you should avoid names reserved as
+ /// parser keywords, in general words known in mathematical language
+ /// as function names, operators (for example:
+ /// sin, cos, +, -, pi, e, etc...). Please be informed that after associating
+ /// the constant with the expression, function or dependent/recursive argument
+ /// its name will be recognized by the parser as reserved key word.
+ /// It means that it could not be the same as any other key word known
+ /// by the parser for this particular expression.
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.3.0
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
[CLSCompliant(true)]
public class Function : PrimitiveElement {
- /**
- * No syntax errors in the function.
- */
+ /// No syntax errors in the function.
public const bool NO_SYNTAX_ERRORS = Expression.NO_SYNTAX_ERRORS;
- /**
- * Syntax error in the function or syntax status unknown.
- */
+ /// Syntax error in the function or syntax status unknown.
public const bool SYNTAX_ERROR_OR_STATUS_UNKNOWN = Expression.SYNTAX_ERROR_OR_STATUS_UNKNOWN;
- /**
- * When function was not found
- */
+ /// When function was not found
public const int NOT_FOUND = Expression.NOT_FOUND;
- /**
- * Function type id identifier
- */
+ /// Function type id identifier
public const int TYPE_ID = 103;
public const String TYPE_DESC = "User defined function";
- /**
- * Function with body based on the expression string.
- *
- * @see Function#getFunctionBodyType()
- */
+ /// Function with body based on the expression string.
+ ///
+ ///
public const int BODY_RUNTIME = 1;
- /**
- * Function with body based on the extended code.
- *
- * @see FunctionExtension
- * @see Function#getFunctionBodyType()
- */
+ /// Function with body based on the extended code.
+ ///
+ ///
+ ///
public const int BODY_EXTENDED = 2;
- /**
- * Function body type.
- *
- * @see Function#BODY_RUNTIME
- * @see Function#BODY_EXTENDED
- * @see Function#getFunctionBodyType()
- */
+ /// Function body type.
+ ///
+ ///
+ ///
+ ///
private int functionBodyType;
- /**
- * function expression
- */
+ /// function expression
internal Expression functionExpression;
- /**
- * function name
- */
+ /// function name
private String functionName;
- /**
- * function description
- */
+ /// function description
private String description;
- /**
- * Indicates whether UDF is variadic
- */
+ /// Indicates whether UDF is variadic
internal bool isVariadic;
- /**
- * The number of function parameters
- */
+ /// The number of function parameters
private int parametersNumber;
- /**
- * Function extension (body based in code)
- *
- * @see FunctionExtension
- * @see FunctionExtensionVariadic
- * @see Function#Function(String, FunctionExtension)
- */
+ /// Function extension (body based in code)
+ ///
+ ///
+ ///
+ ///
private FunctionExtension functionExtension;
- /**
- * Function extension variadic (body based in code)
- *
- * @see FunctionExtension
- * @see FunctionExtensionVariadic
- * @see Function#Function(String, FunctionExtension)
- */
+ /// Function extension variadic (body based in code)
+ ///
+ ///
+ ///
+ ///
private FunctionExtensionVariadic functionExtensionVariadic;
/*=================================================
*
@@ -188,17 +160,21 @@ public class Function : PrimitiveElement {
*
*=================================================
*/
- /**
- * Constructor - creates function from function name
- * and function expression string.
- *
- * @param functionName the function name
- * @param functionExpressionString the function expression string
- * @param elements Optional elements list (variadic - comma separated) of types: Argument, Constant, Function
- *
- * @see PrimitiveElement
- * @see Expression
- */
+ ///
+ /// Constructor - creates function from function name
+ /// and function expression string.
+ ///
+ ///
+ /// the function name
+ /// the function expression string
+ ///
+ /// Optional elements list (variadic - comma separated)
+ /// of types: , ,
+ ///
+ ///
+ ///
+ ///
+ ///
public Function(String functionName
,String functionExpressionString, params PrimitiveElement[] elements) : base(Function.TYPE_ID) {
if (mXparser.regexMatch(functionName, ParserSymbol.nameOnlyTokenRegExp)) {
@@ -219,17 +195,19 @@ public Function(String functionName
functionExpression.setSyntaxStatus(SYNTAX_ERROR_OR_STATUS_UNKNOWN, "[" + functionName + "]" + "Invalid function name, pattern not matches: " + ParserSymbol.nameTokenRegExp);
}
}
- /**
- * Constructor - creates function from function name,
- * function expression string and argument names.
- *
- * @param functionName the function name
- * @param functionExpressionString the function expression string
- * @param argumentsNames the arguments names (variadic parameters)
- * comma separated list
- *
- * @see Expression
- */
+ ///
+ /// Constructor - creates function from function name,
+ /// function expression string and argument names.
+ ///
+ ///
+ /// the function name
+ /// the function expression string
+ ///
+ /// the arguments names (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public Function(String functionName
,String functionExpressionString
,params String[] argumentsNames ) : base(Function.TYPE_ID) {
@@ -253,20 +231,23 @@ public Function(String functionName
functionExpression.setSyntaxStatus(SYNTAX_ERROR_OR_STATUS_UNKNOWN, "[" + functionName + "]" + "Invalid function name, pattern not matches: " + ParserSymbol.nameTokenRegExp);
}
}
- /**
- * Constructor for function definition in natural math language,
- * for instance providing on string "f(x,y) = sin(x) + cos(x)"
- * is enough to define function "f" with parameters "x and y"
- * and function body "sin(x) + cos(x)".
- *
- * @param functionDefinitionString Function definition in the form
- * of one String, ie "f(x,y) = sin(x) + cos(x)"
- * @param elements Optional elements list (variadic - comma separated)
- * of types: Argument, Constant, Function
- *
- * @see PrimitiveElement
- *
- */
+ ///
+ /// Constructor for function definition in natural math language,
+ /// for instance providing on string "f(x,y) = sin(x) + cos(x)"
+ /// is enough to define function "f" with parameters "x and y"
+ /// and function body "sin(x) + cos(x)".
+ ///
+ ///
+ /// Function definition in the form
+ /// of one String, ie "f(x,y) = sin(x) + cos(x)"
+ ///
+ ///
+ /// Optional elements list (variadic - comma separated)
+ /// of types: , ,
+ ///
+ ///
+ ///
+ ///
public Function(String functionDefinitionString, params PrimitiveElement[] elements) : base(Function.TYPE_ID) {
parametersNumber = 0;
if (mXparser.regexMatch(functionDefinitionString, ParserSymbol.functionDefStrRegExp)) {
@@ -306,14 +287,14 @@ public Function(String functionDefinitionString, params PrimitiveElement[] eleme
functionExpression.setSyntaxStatus(Expression.SYNTAX_ERROR_OR_STATUS_UNKNOWN, errorMessage);
}
}
- /**
- * Constructor for function definition based on
- * your own source code - this is via implementation
- * of FunctionExtension interface.
- *
- * @param functionName Function name
- * @param functionExtension Your own source code
- */
+ ///
+ /// Constructor for function definition based on
+ /// your own source code - this is via implementation
+ /// of interface.
+ ///
+ ///
+ /// Function name
+ /// Your own source code
public Function(String functionName, FunctionExtension functionExtension) : base(Function.TYPE_ID) {
if (mXparser.regexMatch(functionName, ParserSymbol.nameOnlyTokenRegExp)) {
this.functionName = functionName;
@@ -330,14 +311,14 @@ public Function(String functionName, FunctionExtension functionExtension) : base
functionExpression.setSyntaxStatus(SYNTAX_ERROR_OR_STATUS_UNKNOWN, "[" + functionName + "]" + "Invalid function name, pattern not matches: " + ParserSymbol.nameTokenRegExp);
}
}
- /**
- * Constructor for function definition based on
- * your own source code - this is via implementation
- * of FunctionExtensionVariadic interface.
- *
- * @param functionName Function name
- * @param functionExtensionVariadic Your own source code
- */
+ ///
+ /// Constructor for function definition based on
+ /// your own source code - this is via implementation
+ /// of interface.
+ ///
+ ///
+ /// Function name
+ /// Your own source code
public Function(String functionName, FunctionExtensionVariadic functionExtensionVariadic) : base(Function.TYPE_ID) {
if ( mXparser.regexMatch(functionName, ParserSymbol.nameOnlyTokenRegExp) ) {
this.functionName = functionName;
@@ -354,12 +335,12 @@ public Function(String functionName, FunctionExtensionVariadic functionExtension
functionExpression.setSyntaxStatus(SYNTAX_ERROR_OR_STATUS_UNKNOWN, "[" + functionName + "]" + "Invalid function name, pattern not matches: " + ParserSymbol.nameTokenRegExp);
}
}
- /**
- * Private constructor used for function cloning.
- *
- * @param function the function, which is going
- * to be cloned.
- */
+ /// Private constructor used for function cloning.
+ ///
+ ///
+ /// the function, which is going
+ /// to be cloned.
+ ///
private Function(Function function) : base(Function.TYPE_ID) {
functionName = function.functionName;
description = function.description;
@@ -372,20 +353,25 @@ private Function(Function function) : base(Function.TYPE_ID) {
if (function.functionExtensionVariadic != null) functionExtensionVariadic = function.functionExtensionVariadic.clone();
}
}
- /**
- * Constructor for function definition in natural math language,
- * for instance providing on string "f(x,y) = sin(x) + cos(x)"
- * is enough to define function "f" with parameters "x and y"
- * and function body "sin(x) + cos(x)".
- *
- * @param functionDefinitionString Function definition in the form
- * of one String, ie "f(x,y) = sin(x) + cos(x)"
- * @param elements Optional elements list (variadic - comma separated)
- * of types: Argument, Constant, Function
- *
- * @see PrimitiveElement
- *
- */
+ ///
+ /// Constructor for function definition in natural math language,
+ /// for instance providing on string "f(x,y) = sin(x) + cos(x)"
+ /// is enough to define function "f" with parameters "x and y"
+ /// and function body "sin(x) + cos(x)".
+ ///
+ ///
+ ///
+ /// Function definition in the form
+ /// of one String, ie "f(x,y) = sin(x) + cos(x)"
+ ///
+ ///
+ /// Optional elements list (variadic - comma separated)
+ /// of types: , ,
+ ///
+ ///
+ ///
+ ///
+ ///
public void setFunction(String functionDefinitionString, params PrimitiveElement[] elements) {
parametersNumber = 0;
if ( mXparser.regexMatch(functionDefinitionString, ParserSymbol.functionDefStrRegExp) ) {
@@ -425,43 +411,33 @@ public void setFunction(String functionDefinitionString, params PrimitiveElement
functionExpression.setSyntaxStatus(Expression.SYNTAX_ERROR_OR_STATUS_UNKNOWN, errorMessage);
}
}
- /**
- * Sets function description.
- *
- * @param description the function description
- */
+ /// Sets function description.
+ ///
+ /// the function description
public void setDescription(String description) {
this.description = description;
}
- /**
- * Gets function description
- *
- * @return Function description as string
- */
+ /// Gets function description
+ ///
+ /// Function description as string
public String getDescription() {
return description;
}
- /**
- * Gets function name.
- *
- * @return Function name as string.
- */
+ /// Gets function name.
+ ///
+ /// Function name as string.
public String getFunctionName() {
return functionName;
}
- /**
- * Gets function expression string
- *
- * @return Function expression as string.
- */
+ /// Gets function expression string
+ ///
+ /// Function expression as string.
public String getFunctionExpressionString() {
return functionExpression.getExpressionString();
}
- /**
- * Sets function name.
- *
- * @param functionName the function name
- */
+ /// Sets function name.
+ ///
+ /// the function name
public void setFunctionName(String functionName) {
if (mXparser.regexMatch(functionName, ParserSymbol.nameOnlyTokenRegExp)) {
this.functionName = functionName;
@@ -469,13 +445,13 @@ public void setFunctionName(String functionName) {
}
else functionExpression.setSyntaxStatus(SYNTAX_ERROR_OR_STATUS_UNKNOWN, "[" + functionName + "]" + "Invalid function name, pattern not matches: " + ParserSymbol.nameTokenRegExp);
}
- /**
- * Sets value of function argument (function parameter).
- *
- * @param argumentIndex the argument index (in accordance to
- * arguments declaration sequence)
- * @param argumentValue the argument value
- */
+ /// Sets value of function argument (function parameter).
+ ///
+ ///
+ /// the argument index (in accordance to
+ /// arguments declaration sequence)
+ ///
+ /// the argument value
public void setArgumentValue(int argumentIndex, double argumentValue) {
if (isVariadic == false)
if (functionBodyType == BODY_RUNTIME)
@@ -483,20 +459,18 @@ public void setArgumentValue(int argumentIndex, double argumentValue) {
else if (isVariadic == false)
functionExtension.setParameterValue(argumentIndex, argumentValue);
}
- /**
- * Returns function body type: {@link Function#BODY_RUNTIME} {@link Function#BODY_EXTENDED}
- * @return Returns function body type: {@link Function#BODY_RUNTIME} {@link Function#BODY_EXTENDED}
- */
+ /// Returns function body type:
+ ///
+ /// Returns function body type:
public int getFunctionBodyType() {
return functionBodyType;
}
- /**
- * Checks function syntax
- *
- * @return syntax status: Function.NO_SYNTAX_ERRORS,
- * Function.SYNTAX_ERROR_OR_STATUS_UNKNOWN
- *
- */
+ /// Checks function syntax
+ ///
+ ///
+ /// syntax status: ,
+ ///
+ ///
public bool checkSyntax() {
bool syntaxStatus = Function.NO_SYNTAX_ERRORS;
if (functionBodyType != BODY_EXTENDED)
@@ -504,26 +478,20 @@ public bool checkSyntax() {
checkRecursiveMode();
return syntaxStatus;
}
- /**
- * Returns error message after checking the syntax.
- *
- * @return Error message as string.
- */
+ /// Returns error message after checking the syntax.
+ ///
+ /// Error message as string.
public String getErrorMessage() {
return functionExpression.getErrorMessage();
}
- /**
- * clone method
- */
+ /// clone method
internal Function clone() {
Function newFunction = new Function(this);
return newFunction;
}
- /**
- * Calculates function value
- *
- * @return Function value as double.
- */
+ /// Calculates function value
+ ///
+ /// Function value as double.
public double calculate() {
if (functionBodyType == BODY_RUNTIME)
return functionExpression.calculate();
@@ -541,13 +509,11 @@ public double calculate() {
} else return Double.NaN;
}
}
- /**
- * Calculates function value
- *
- * @param params the function parameters values (as doubles)
- *
- * @return function value as double.
- */
+ /// Calculates function value
+ ///
+ /// the function parameters values (as doubles)
+ ///
+ /// function value as double.
public double calculate(params double[] parameters) {
if (parameters.Length > 0) {
functionExpression.UDFVariadicParamsAtRunTime = new List();
@@ -575,13 +541,14 @@ public double calculate(params double[] parameters) {
return Double.NaN;
}
}
- /**
- * Calculates function value
- *
- * @param arguments function parameters (as Arguments)
- *
- * @return function value as double
- */
+ /// Calculates function value
+ ///
+ ///
+ /// ]function parameters (as
+ /// Arguments)
+ ///
+ ///
+ /// function value as double
public double calculate(params Argument[] arguments) {
double[] parameters;
if (arguments.Length > 0) {
@@ -615,28 +582,36 @@ public double calculate(params Argument[] arguments) {
return Double.NaN;
}
}
- /**
- * Adds user defined elements (such as: Arguments, Constants, Functions)
- * to the function expressions.
- *
- * @param elements Elements list (variadic), where Argument, Constant, Function
- * extend the same class PrimitiveElement
- *
- * @see PrimitiveElement
- */
+ ///
+ /// Adds user defined elements (such as: Arguments,
+ /// Constants, Functions)
+ /// to the function expressions.
+ ///
+ ///
+ ///
+ /// Elements list (variadic), where ,
+ /// ,
+ /// extend the same class
+ ///
+ ///
+ ///
public void addDefinitions(params PrimitiveElement[] elements) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.addDefinitions(elements);
}
- /**
- * Removes user defined elements (such as: Arguments, Constants, Functions)
- * from the function expressions.
- *
- * @param elements Elements list (variadic), where Argument, Constant, Function
- * extend the same class PrimitiveElement
- *
- * @see PrimitiveElement
- */
+ ///
+ /// Removes user defined elements (such as: Arguments,
+ /// Constants, Functions)
+ /// from the function expressions.
+ ///
+ ///
+ ///
+ /// Elements list (variadic), where ,
+ /// ,
+ /// extend the same class
+ ///
+ ///
+ ///
public void removeDefinitions(params PrimitiveElement[] elements) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.removeDefinitions(elements);
@@ -655,113 +630,113 @@ private int countRecursiveArguments() {
if (argument.getArgumentType() == Argument.RECURSIVE_ARGUMENT) numOfRecursiveArguments++;
return numOfRecursiveArguments;
}
- /**
- * Adds arguments (variadic) to the function expression definition.
- *
- * @param arguments the arguments list
- * (comma separated list)
- * @see Argument
- * @see RecursiveArgument
- */
+ /// Adds arguments (variadic) to the function expression definition.
+ ///
+ ///
+ /// the arguments list
+ /// (comma separated list)
+ ///
+ ///
+ ///
+ ///
public void addArguments(params Argument[] arguments) {
if (functionBodyType == Function.BODY_RUNTIME) {
functionExpression.addArguments(arguments);
parametersNumber = functionExpression.getArgumentsNumber() - countRecursiveArguments();
}
}
- /**
- * Enables to define the arguments (associated with
- * the function expression) based on the given arguments names.
- *
- * @param argumentsNames the arguments names (variadic)
- * comma separated list
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ ///
+ /// Enables to define the arguments (associated with
+ /// the function expression) based on the given arguments names.
+ ///
+ ///
+ ///
+ /// the arguments names (variadic)
+ /// comma separated list
+ ///
+ ///
+ ///
+ ///
public void defineArguments(params String[] argumentsNames) {
if (functionBodyType == Function.BODY_RUNTIME) {
functionExpression.defineArguments(argumentsNames);
parametersNumber = functionExpression.getArgumentsNumber() - countRecursiveArguments();
}
}
- /**
- * Enables to define the argument (associated with the function expression)
- * based on the argument name and the argument value.
- *
- * @param argumentName the argument name
- * @param argumentValue the the argument value
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ ///
+ /// Enables to define the argument (associated with the function expression)
+ /// based on the argument name and the argument value.
+ ///
+ ///
+ /// the argument name
+ /// the the argument value
+ ///
+ ///
+ ///
public void defineArgument(String argumentName, double argumentValue) {
if (functionBodyType == Function.BODY_RUNTIME) {
functionExpression.defineArgument(argumentName, argumentValue);
parametersNumber = functionExpression.getArgumentsNumber() - countRecursiveArguments();
}
}
- /**
- * Gets argument index from the function expression.
- *
- * @param argumentName the argument name
- *
- * @return The argument index if the argument name was found,
- * otherwise returns Argument.NOT_FOUND
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ /// Gets argument index from the function expression.
+ ///
+ /// the argument name
+ ///
+ ///
+ /// The argument index if the argument name was found,
+ /// otherwise returns
+ ///
+ ///
+ ///
+ ///
public int getArgumentIndex(String argumentName) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getArgumentIndex(argumentName);
else
return -1;
}
- /**
- * Gets argument from the function expression.
- *
- *
- * @param argumentName the argument name
- *
- * @return The argument if the argument name was found,
- * otherwise returns null.
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ /// Gets argument from the function expression
+ ///
+ /// the argument name
+ ///
+ ///
+ /// The argument if the argument name was found,
+ /// otherwise returns null.
+ ///
+ ///
+ ///
+ ///
public Argument getArgument(String argumentName) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getArgument(argumentName);
else
return null;
}
- /**
- * Gets argument from the function expression.
- *
- * @param argumentIndex the argument index
- *
- * @return Argument if the argument index is between 0 and
- * the last available argument index (getArgumentsNumber()-1),
- * otherwise returns null.
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ /// Gets argument from the function expression.
+ ///
+ /// the argument index
+ ///
+ ///
+ /// Argument if the argument index is between 0 and
+ /// the last available argument index (-1),
+ /// otherwise returns null.
+ ///
+ ///
+ ///
+ ///
public Argument getArgument(int argumentIndex) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getArgument(argumentIndex);
else
return null;
}
- /**
- * Gets number of parameters associated with the function expression.
- *
- * @return The number of function parameters (int >= 0)
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ /// Gets number of parameters associated with the function expression.
+ ///
+ /// The number of function parameters (int >= 0)
+ ///
+ ///
+ ///
public int getParametersNumber() {
if (isVariadic == false)
return parametersNumber;
@@ -772,24 +747,23 @@ public int getParametersNumber() {
return -1;
}
}
- /**
- * Set parameters number.
- *
- * @param parametersNumber the number of function parameters (default = number of arguments
- * (less number might be specified).
- */
+ /// Set parameters number.
+ ///
+ ///
+ /// the number of function parameters (default = number of arguments
+ /// (less number might be specified).
+ ///
public void setParametersNumber(int parametersNumber) {
if (functionBodyType == Function.BODY_RUNTIME) {
this.parametersNumber = parametersNumber;
functionExpression.setExpressionModifiedFlag();
}
}
- /**
- * Gets user defined function parameter name
- *
- * @param parameterIndex Parameter index between 0 and n-1
- * @return If parameter exists returns parameters name, otherwise empty string is returned.
- */
+ /// Gets user defined function parameter name
+ ///
+ /// Parameter index between 0 and n-1
+ ///
+ /// If parameter exists returns parameters name, otherwise empty string is returned.
public String getParameterName(int parameterIndex) {
if (parameterIndex < 0) return "";
if (parameterIndex >= parametersNumber) return "";
@@ -797,59 +771,58 @@ public String getParameterName(int parameterIndex) {
if (functionBodyType == BODY_EXTENDED) return this.functionExtension.getParameterName(parameterIndex);
return "";
}
- /**
- * Gets number of arguments associated with the function expression.
- *
- * @return The number of arguments (int >= 0)
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ /// Gets number of arguments associated with the function expression.
+ ///
+ /// The number of arguments (int >= 0)
+ ///
+ ///
+ ///
public int getArgumentsNumber() {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getArgumentsNumber();
else
return 0;
}
- /**
- * Removes first occurrences of the arguments
- * associated with the function expression.
- *
- * @param argumentsNames the arguments names
- * (variadic parameters) comma separated
- * list
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ ///
+ /// Removes first occurrences of the arguments
+ /// associated with the function expression.
+ ///
+ ///
+ ///
+ /// the arguments names
+ /// (variadic parameters) comma separated list
+ ///
+ ///
+ ///
+ ///
public void removeArguments(params String[] argumentsNames) {
if (functionBodyType == Function.BODY_RUNTIME) {
functionExpression.removeArguments(argumentsNames);
parametersNumber = functionExpression.getArgumentsNumber() - countRecursiveArguments();
}
}
- /**
- * Removes first occurrences of the arguments
- * associated with the function expression.
- *
- * @param arguments the arguments (variadic parameters)
- * comma separated list
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ ///
+ /// Removes first occurrences of the arguments
+ /// associated with the function expression.
+ ///
+ ///
+ ///
+ /// the arguments (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
+ ///
public void removeArguments(params Argument[] arguments) {
if (functionBodyType == Function.BODY_RUNTIME) {
functionExpression.removeArguments(arguments);
parametersNumber = functionExpression.getArgumentsNumber() - countRecursiveArguments();
}
}
- /**
- * Removes all arguments associated with the function expression.
- *
- * @see Argument
- * @see RecursiveArgument
- */
+ /// Removes all arguments associated with the function expression.
+ ///
+ ///
+ ///
public void removeAllArguments() {
if (functionBodyType == Function.BODY_RUNTIME) {
functionExpression.removeAllArguments();
@@ -863,127 +836,129 @@ public void removeAllArguments() {
*
*=================================================
*/
- /**
- * Adds constants (variadic parameters) to the function expression definition.
- *
- * @param constants the constants
- * (comma separated list)
- *
- * @see Constant
- */
+ /// Adds constants (variadic parameters) to the function expression definition.
+ ///
+ ///
+ /// the constants
+ /// (comma separated list)
+ ///
+ ///
+ ///
public void addConstants(params Constant[] constants) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.addConstants(constants);
}
- /**
- * Enables to define the constant (associated with
- * the function expression) based on the constant name and
- * constant value.
- *
- * @param constantName the constant name
- * @param constantValue the constant value
- *
- * @see Constant
- */
+ ///
+ /// Enables to define the constant (associated with
+ /// the function expression) based on the constant name and
+ /// constant value.
+ ///
+ ///
+ /// the constant name
+ /// the constant value
+ ///
+ ///
public void defineConstant(String constantName, double constantValue) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.defineConstant(constantName, constantValue);
}
- /**
- * Gets constant index associated with the function expression.
- *
- * @param constantName the constant name
- *
- * @return Constant index if constant name was found,
- * otherwise return Constant.NOT_FOUND.
- *
- * @see Constant
- */
+ /// Gets constant index associated with the function expression.
+ ///
+ /// the constant name
+ ///
+ ///
+ /// Constant index if constant name was found,
+ /// otherwise return .
+ ///
+ ///
+ ///
public int getConstantIndex(String constantName) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getConstantIndex(constantName);
else
return -1;
}
- /**
- * Gets constant associated with the function expression.
- *
- * @param constantName the constant name
- *
- * @return Constant if constant name was found,
- * otherwise return null.
- *
- * @see Constant
- */
+ /// Gets constant associated with the function expression.
+ ///
+ /// the constant name
+ ///
+ ///
+ /// Constant if constant name was found,
+ /// otherwise return null.
+ ///
+ ///
+ ///
public Constant getConstant(String constantName) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getConstant(constantName);
else
return null;
}
- /**
- * Gets constant associated with the function expression.
- *
- * @param constantIndex the constant index
- *
- * @return Constant if the constantIndex is between
- * 0 and the last available constant index
- * (getConstantsNumber() - 1),
- * otherwise it returns null.
- *
- * @see Constant
- */
+ /// Gets constant associated with the function expression.
+ ///
+ /// the constant index
+ ///
+ ///
+ /// Constant if the constantIndex is between
+ /// 0 and the last available constant index
+ /// ( - 1),
+ /// otherwise it returns null.
+ ///
+ ///
+ ///
public Constant getConstant(int constantIndex) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getConstant(constantIndex);
else
return null;
}
- /**
- * Gets number of constants associated with the function expression.
- *
- * @return number of constants (int >= 0)
- *
- * @see Constant
- */
+ /// Gets number of constants associated with the function expression.
+ ///
+ /// number of constants (int >= 0)
+ ///
+ ///
public int getConstantsNumber() {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getConstantsNumber();
else
return 0;
}
- /**
- * Removes first occurrences of the constants
- * associated with the function expression.
- *
- * @param constantsNames the constants names (variadic parameters)
- * comma separated list
- *
- * @see Constant
- */
+ ///
+ /// Removes first occurrences of the constants
+ /// associated with the function expression.
+ ///
+ ///
+ ///
+ /// the constants names (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public void removeConstants(params String[] constantsNames) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.removeConstants(constantsNames);
}
- /**
- * Removes first occurrences of the constants
- * associated with the function expression
- *
- * @param constants the constants (variadic parameters)
- * comma separated list
- *
- * @see Constant
- */
+ ///
+ /// Removes first occurrences of the constants
+ /// associated with the function expression
+ ///
+ ///
+ ///
+ /// the constants (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public void removeConstants(params Constant[] constants) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.removeConstants(constants);
}
- /**
- * Removes all constants
- * associated with the function expression
- *
- * @see Constant
- */
+ ///
+ /// Removes all constants
+ /// associated with the function expression
+ ///
+ ///
+ ///
public void removeAllConstants() {
functionExpression.removeAllConstants();
}
@@ -994,130 +969,134 @@ public void removeAllConstants() {
*
*=================================================
*/
- /**
- * Adds functions (variadic parameters) to the function expression definition.
- *
- * @param functions the functions
- * (variadic parameters) comma separated list
- *
- * @see Function
- */
+ /// Adds functions (variadic parameters) to the function expression definition.
+ ///
+ ///
+ /// the functions
+ /// (variadic parameters) comma separated list
+ ///
+ ///
+ ///
public void addFunctions(params Function[] functions) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.addFunctions(functions);
}
- /**
- * Enables to define the function (associated with
- * the function expression) based on the function name,
- * function expression string and arguments names (variadic parameters).
- *
- * @param functionName the function name
- * @param functionExpressionString the expression string
- * @param argumentsNames the function arguments names
- * (variadic parameters)
- * comma separated list
- *
- * @see Function
- */
+ ///
+ /// Enables to define the function (associated with
+ /// the function expression) based on the function name,
+ /// function expression string and arguments names (variadic parameters).
+ ///
+ ///
+ /// the function name
+ /// the expression string
+ ///
+ /// the function arguments names
+ /// (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public void defineFunction(String functionName, String functionExpressionString,
params String[] argumentsNames) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.defineFunction(functionName, functionExpressionString, argumentsNames);
}
- /**
- * Gets index of function associated with the function expression.
- *
- * @param functionName the function name
- *
- * @return Function index if function name was found,
- * otherwise returns Function.NOT_FOUND
- *
- * @see Function
- */
+ /// Gets index of function associated with the function expression.
+ ///
+ /// the function name
+ ///
+ ///
+ /// Function index if function name was found,
+ /// otherwise returns
+ ///
+ ///
+ ///
public int getFunctionIndex(String functionName) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getFunctionIndex(functionName);
else
return -1;
}
- /**
- * Gets function associated with the function expression.
- *
- * @param functionName the function name
- *
- * @return Function if function name was found,
- * otherwise returns null.
- *
- * @see Function
- */
+ /// Gets function associated with the function expression.
+ ///
+ /// the function name
+ ///
+ ///
+ /// Function if function name was found,
+ /// otherwise returns null.
+ ///
+ ///
+ ///
public Function getFunction(String functionName) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getFunction(functionName);
else
return null;
}
- /**
- * Gets function associated with the function expression.
- *
- * @param functionIndex the function index
- *
- * @return Function if function index is between 0 and
- * the last available function index (getFunctionsNumber()-1),
- * otherwise returns null.
- *
- * @see Function
- */
+ /// Gets function associated with the function expression.
+ ///
+ /// the function index
+ ///
+ ///
+ /// Function if function index is between 0 and
+ /// the last available function index (-1),
+ /// otherwise returns null.
+ ///
+ ///
+ ///
public Function getFunction(int functionIndex) {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getFunction(functionIndex);
else
return null;
}
- /**
- * Gets number of functions associated with the function expression.
- *
- * @return number of functions (int >= 0)
- *
- * @see Function
- */
+ /// Gets number of functions associated with the function expression.
+ ///
+ /// number of functions (int >= 0)
+ ///
+ ///
public int getFunctionsNumber() {
if (functionBodyType == Function.BODY_RUNTIME)
return functionExpression.getFunctionsNumber();
else
return 0;
}
- /**
- * Removes first occurrences of the functions
- * associated with the function expression.
- *
- * @param functionsNames the functions names (variadic parameters)
- * comma separated list
- *
- * @see Function
- */
+ ///
+ /// Removes first occurrences of the functions
+ /// associated with the function expression.
+ ///
+ ///
+ ///
+ /// the functions names (variadic parameters)
+ /// comma separated list
+ ///
+ ///
+ ///
public void removeFunctions(params String[] functionsNames) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.removeFunctions(functionsNames);
}
- /**
- * Removes first occurrences of the functions
- * associated with the function expression.
- *
- * @param functions the functions (variadic parameters)
- * comma separated list.
- *
- * @see Function
- */
+ ///
+ /// Removes first occurrences of the functions
+ /// associated with the function expression.
+ ///
+ ///
+ ///
+ /// the functions (variadic parameters)
+ /// comma separated list.
+ ///
+ ///
+ ///
public void removeFunctions(params Function[] functions) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.removeFunctions(functions);
}
- /**
- * Removes all functions
- * associated with the function expression.
- *
- * @see Function
- */
+ ///
+ /// Removes all functions
+ /// associated with the function expression.
+ ///
+ ///
+ ///
public void removeAllFunctions() {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.removeAllFunctions();
@@ -1125,31 +1104,27 @@ public void removeAllFunctions() {
/*
* ---------------------------------------------
*/
- /**
- * Enables verbose function mode
- */
+ /// Enables verbose function mode
public void setVerboseMode() {
functionExpression.setVerboseMode();
}
- /**
- * Disables function verbose mode (sets default silent mode)
- */
+ /// Disables function verbose mode (sets default silent mode)
public void setSilentMode() {
functionExpression.setSilentMode();
}
- /**
- * Returns verbose mode status
- *
- * @return true if verbose mode is on,
- * otherwise returns false
- */
+ /// Returns verbose mode status
+ ///
+ ///
+ /// true if verbose mode is on,
+ /// otherwise returns false
+ ///
public bool getVerboseMode() {
return functionExpression.getVerboseMode();
}
- /**
- * Checks whether function name appears in function body
- * if yes the recursive mode is being set
- */
+ ///
+ /// Checks whether function name appears in function body
+ /// if yes the recursive mode is being set
+ ///
internal void checkRecursiveMode() {
if (functionBodyType == Function.BODY_RUNTIME) {
List functionExpressionTokens = functionExpression.getInitialTokens();
@@ -1162,45 +1137,37 @@ internal void checkRecursiveMode() {
}
}
}
- /**
- * Gets recursive mode status
- *
- * @return true if recursive mode is enabled,
- * otherwise returns false
- *
- */
+ /// Gets recursive mode status
+ ///
+ ///
+ /// true if recursive mode is enabled,
+ /// otherwise returns false
+ ///
+ ///
public bool getRecursiveMode() {
return functionExpression.getRecursiveMode();
}
- /**
- * Gets computing time
- *
- * @return computing time in seconds.
- */
+ /// Gets computing time
+ ///
+ /// computing time in seconds.
public double getComputingTime() {
return functionExpression.getComputingTime();
}
- /**
- * Adds related expression.
- *
- * @param expression the related expression
- */
+ /// Adds related expression.
+ ///
+ /// the related expression
internal void addRelatedExpression(Expression expression) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.addRelatedExpression(expression);
}
- /**
- * Removes related expression.
- *
- * @param expression the related expression
- */
+ /// Removes related expression.
+ ///
+ /// the related expression
internal void removeRelatedExpression(Expression expression) {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.removeRelatedExpression(expression);
}
- /**
- * Set expression modified flags in the related expressions.
- */
+ /// Set expression modified flags in the related expressions.
internal void setExpressionModifiedFlags() {
if (functionBodyType == Function.BODY_RUNTIME)
functionExpression.setExpressionModifiedFlag();
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/FunctionExtension.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/FunctionExtension.cs
index ee693136..b8324c21 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/FunctionExtension.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/FunctionExtension.cs
@@ -56,76 +56,69 @@
using System;
namespace org.mariuszgromada.math.mxparser {
- /**
- * FunctionExtension provides interface for function algorithm definition.
- * In this case algorithm definition is based on source code using
- * JAVA (for JAVA / Android) or .NET. If implemented Function Extension
- * object can be further used while Function object
- * construction, which means it can extend mXparser math collection.
- * mXparser extension with your own implementation can be achieved
- * by implementing FunctionExtension interface, creating an FunctionExtension
- * object, creating Function object based on FunctionExtension, adding Function
- * object to Expression / mXparser definition.
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.1.0
- *
- * @see Function
- *
- */
+ ///
+ /// FunctionExtension provides interface for function algorithm definition.
+ /// In this case algorithm definition is based on source code using
+ /// JAVA (for JAVA / Android) or .NET. If implemented Function Extension
+ /// object can be further used while object
+ /// construction, which means it can extend math collection.
+ /// mXparser extension with your own implementation can be achieved
+ /// by implementing FunctionExtension interface, creating an FunctionExtension
+ /// object, creating object based on FunctionExtension, adding
+ /// object to / definition.
+ ///
+ ///
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.1.0
+ ///
+ ///
+ ///
[CLSCompliant(true)]
public interface FunctionExtension {
- /**
- * Gets parameters number.
- *
- * @return Returns parameters number.
- */
+ /// Gets parameters number.
+ ///
+ /// Returns parameters number.
int getParametersNumber();
- /**
- * Sets value of function parameter
- *
- * @param parameterIndex - parameter index (from 0 to n-1)
- * @param parameterValue - parameter value
- */
+ /// Sets value of function parameter
+ ///
+ /// parameter index (from 0 to n-1)
+ /// parameter value
void setParameterValue(int parameterIndex, double parameterValue);
- /**
- * Gets parameter name
- *
- * @param parameterIndex - parameter index (from 0 to n-1)
- * @return Returns parameter name
- */
+ /// Gets parameter name
+ ///
+ /// parameter index (from 0 to n-1)
+ ///
+ /// Returns parameter name
String getParameterName(int parameterIndex);
- /**
- * Actual algorithm implementation.
- *
- * @param params Function parameters.
- * @return Function Extension value.
- */
+ /// Actual algorithm implementation
+ ///
+ /// Function Extension value.
double calculate();
- /**
- * Cloning in case of usage in Expression
- * with recursive statements.
- *
- * @return Returns FunctionExtension object that was cloned.
- *
- * @see Expression#getRecursiveMode()
- */
+ ///
+ /// Cloning in case of usage in Expression
+ /// with recursive statements.
+ ///
+ ///
+ /// Returns FunctionExtension object that was cloned.
+ ///
+ ///
FunctionExtension clone();
}
}
\ No newline at end of file
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/FunctionExtensionVariadic.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/FunctionExtensionVariadic.cs
index 6ae8f3b7..29458e83 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/FunctionExtensionVariadic.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/FunctionExtensionVariadic.cs
@@ -56,62 +56,62 @@
using System;
namespace org.mariuszgromada.math.mxparser {
- /**
- * FunctionExtensionVariadic similarly to FunctionExtension
- * provides interface for function algorithm definition.
- * FunctionExtension is used for user defined functions with
- * fixed number of parameters, where FunctionExtensionVariadic
- * is used for user defined function with variadic number of
- * parameters. Algorithm definition is based on source code using
- * JAVA (for JAVA / Android) or .NET. If implemented Function Extension
- * object can be further used while Function object
- * construction, which means it can extend mXparser math collection.
- * mXparser extension with your own implementation can be achieved
- * by implementing FunctionExtensionVariadic interface,
- * creating FunctionExtensionVariadic object, creating Function object
- * based on FunctionExtensionVariadic, adding Function
- * object to Expression / mXparser definition.
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.2.0
- *
- * @see FunctionExtension
- * @see Function
- *
- */
+ ///
+ /// FunctionExtensionVariadic similarly to
+ /// provides interface for function algorithm definition.
+ /// is used for user defined functions with
+ /// fixed number of parameters, where FunctionExtensionVariadic
+ /// is used for user defined function with variadic number of
+ /// parameters. Algorithm definition is based on source code using
+ /// JAVA (for JAVA / Android) or .NET. If implemented Function Extension
+ /// object can be further used while object
+ /// construction, which means it can extend math collection.
+ /// extension with your own implementation can be achieved
+ /// by implementing FunctionExtensionVariadic interface,
+ /// creating FunctionExtensionVariadic object, creating object
+ /// based on FunctionExtensionVariadic, adding
+ /// object to / definition.
+ ///
+ ///
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.2.0
+ ///
+ ///
+ ///
+ ///
[CLSCompliant(true)]
public interface FunctionExtensionVariadic {
- /**
- * Actual algorithm implementation.
- * @param parameters Variadic list of parameters
- *
- * @return Function Extension value.
- */
+ /// Actual algorithm implementation.
+ ///
+ /// Variadic list of parameters
+ ///
+ /// Function Extension value.
double calculate(params double[] parameters);
- /**
- * Cloning in case of usage in Expression
- * with recursive statements.
- *
- * @return Returns FunctionExtension object that was cloned.
- *
- * @see Expression#getRecursiveMode()
- */
+ ///
+ /// Cloning in case of usage in Expression
+ /// with recursive statements.
+ ///
+ ///
+ /// Returns FunctionExtension object that was cloned.
+ ///
+ ///
FunctionExtensionVariadic clone();
}
}
\ No newline at end of file
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Miscellaneous.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Miscellaneous.cs
index 77ded3bc..95a09df8 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Miscellaneous.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/Miscellaneous.cs
@@ -64,9 +64,7 @@ namespace org.mariuszgromada.math.mxparser {
*
*=================================================
*/
- /**
- * Package level class for handling function parameters.
- */
+ /// Package level class for handling function parameters.
internal class FunctionParameter {
internal List tokens;
internal String paramStr;
@@ -83,9 +81,7 @@ internal FunctionParameter(List tokens,
}
}
- /**
- * Package level class for generating iterative operator parameters
- */
+ /// Package level class for generating iterative operator parameters
internal class IterativeOperatorParameters {
internal FunctionParameter indexParam;
internal FunctionParameter fromParam;
@@ -134,9 +130,7 @@ internal IterativeOperatorParameters(List functionParameters)
}
}
}
- /**
- * Handling argument parameters
- */
+ /// Handling argument parameters
internal class ArgumentParameter {
internal Argument argument;
internal double initialValue;
@@ -150,11 +144,11 @@ internal ArgumentParameter() {
presence = Expression.NOT_FOUND;
}
}
- /**
- * Internal token class
- * which is used with stack while
- * evaluation of tokens levels
- */
+ ///
+ /// Internal token class
+ /// which is used with stack while
+ /// evaluation of tokens levels
+ ///
internal class TokenStackElement {
internal int tokenIndex;
internal int tokenId;
@@ -175,47 +169,40 @@ internal SyntaxStackElement(String tokenStr, int tokenLevel) {
* Comparators for sorting
* ---------------------------------------------------------
*/
- /**
- * Comparator for key word list sorting by key word string.
- * This king of sorting is used while checking the syntax
- * (duplicated key word error)
- */
+ ///
+ /// Comparator for key word list sorting by key word string.
+ /// This king of sorting is used while checking the syntax
+ /// (duplicated key word error)
+ ///
class KwStrComparator : IComparer {
- /**
- *
- */
+ ///
public int Compare(KeyWord kw1, KeyWord kw2) {
String s1 = kw1.wordString;
String s2 = kw2.wordString;
return s1.CompareTo(s2);
}
}
- /**
- * Comparator for key word list sorting by
- * descending key word length
- * .
- * This king of sorting is used while tokenizing
- * (best match)
- */
+ ///
+ /// Comparator for key word list sorting by
+ /// descending key word length
+ ///
+ /// This king of sorting is used while tokenizing
+ /// (best match)
+ ///
class DescKwLenComparator : IComparer {
- /**
- *
- */
+ ///
public int Compare(KeyWord kw1, KeyWord kw2) {
int l1 = kw1.wordString.Length;
int l2 = kw2.wordString.Length;
return l2 - l1;
}
}
- /**
- * Comparator for key word list sorting by
- * type of the key word
- *
- */
+ ///
+ /// Comparator for key word list sorting by
+ /// type of the key word
+ ///
class KwTypeComparator : IComparer {
- /**
- *
- */
+ ///
public int Compare(KeyWord kw1, KeyWord kw2) {
int t1 = kw1.wordTypeId * 1000000 + kw1.wordId * 1000 + kw1.wordString.Length;
int t2 = kw2.wordTypeId * 1000000 + kw2.wordId * 1000 + kw2.wordString.Length;
@@ -227,13 +214,13 @@ public int Compare(KeyWord kw1, KeyWord kw2) {
* Grouping constants by interfaces
* ---------------------------------------------------------
*/
- /*
- * Package level class to be used
- * while function, argument, constant definition
- * using only one string, ie:
- * Function "f(x,y) = sin(x) + cos(y)"
- * Constant "a = 5/20"
- */
+ ///
+ /// Package level class to be used
+ /// while function, argument, constant definition
+ /// using only one string, ie:
+ /// Function "f(x,y) = sin(x) + cos(y)"
+ /// Constant "a = 5/20"
+ ///
internal class HeadEqBody {
private const bool ONLY_PARSER_KEYWORDS = true;
internal String headStr;
@@ -265,9 +252,7 @@ internal HeadEqBody(String definitionString) {
}
}
}
- /**
- * Data structure used internally for token to be modified list
- */
+ /// Data structure used internally for token to be modified list
internal class TokenModification {
internal String currentToken;
internal String newToken;
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/PrimitiveElement.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/PrimitiveElement.cs
index 64c671c6..59493c5c 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/PrimitiveElement.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/PrimitiveElement.cs
@@ -56,69 +56,66 @@
using System;
namespace org.mariuszgromada.math.mxparser {
- /**
- * Class used for connecting all basic elements such as: Argument, Constant,
- * Function. Class not used by the end user.
- *
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 3.0.0
- *
- * @see Argument
- * @see Constant
- * @see Function
- * @see RecursiveArgument
- * @see Expression#addDefinitions(PrimitiveElement...)
- * @see Expression#removeDefinitions(PrimitiveElement...)
- */
+ ///
+ /// Class used for connecting all basic elements such as: , ,
+ /// . Class not used by the end user.
+ ///
+ ///
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 3.0.0
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
[CLSCompliant(true)]
public class PrimitiveElement {
- /**
- * Element type id
- *
- * @see Argument.TYPE_ID
- * @see Constant.TYPE_ID
- * @see Function.TYPE_ID
- */
+ /// Element type id
+ ///
+ ///
+ ///
+ ///
private int myTypeId;
- /**
- * Default constructor setting element type id
- *
- * @param typeId Element type id
- *
- * @see Argument.TYPE_ID
- * @see Constant.TYPE_ID
- * @see Function.TYPE_ID
- */
+ /// Default constructor setting element type id
+ ///
+ /// Element type id
+ ///
+ ///
+ ///
+ ///
public PrimitiveElement(int typeId) {
myTypeId = typeId;
}
- /**
- * Returns element type id
- *
- * @return Element type id as int Function.TYPE_ID, Argument.TYPE_ID, Function.TYPE_ID
- *
- * @see Argument.TYPE_ID
- * @see Constant.TYPE_ID
- * @see Function.TYPE_ID
- *
- */
+ /// Returns element type id
+ ///
+ ///
+ /// Element type id as int ,
+ /// ,
+ ///
+ ///
+ ///
+ ///
+ ///
public int getMyTypeId() {
return myTypeId;
}
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/RecursiveArgument.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/RecursiveArgument.cs
index e6bf1059..fcfaaeff 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/RecursiveArgument.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/RecursiveArgument.cs
@@ -58,83 +58,81 @@
using System.Collections.Generic;
namespace org.mariuszgromada.math.mxparser {
- /**
- * RecursiveArgument class enables to declare the argument
- * (variable) which is defined in a recursive way. Such an argument
- * can be used in further processing in expressions, functions and dependent
- * or recursive arguments.
- *
- * For example:
- *
- * - 'fib(n) = fin(n-1)+fib(n-2), fib(0) = 0, fib(1) = 1'
- *
- 'factorial(n) = n*factorial(n-1), factorial(0) = 1'
- *
- *
- * When creating an argument you should avoid:
- *
- * - names reserved as parser keywords, in general words known in mathematical language
- * as function names, operators (for example:
- * sin, cos, +, -, etc...). Please be informed that after associating
- * the argument with the expression, function or dependent/recursive argument
- * its name will be recognized by the parser as reserved key word.
- * It means that it could not be the same as any other key word known
- * by the parser for this particular expression.
- *
- defining statements with increasing index: 'a(n) = a(n+1) + ... ', otherwise
- * you will get Double.NaN
- *
- if recursion is not properly defined you will get Double.NaN in the result.
- * This is due to the recursion counter inside of the recursive argument. Calculating
- * n-th element requires no more than n recursion steps (usually less than n).
- *
- For negative 'n' you will get Double.NaN.
- *
- *
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.2.0
- *
- * @see Argument
- * @see Expression
- * @see Function
- * @see Constant
- */
+ ///
+ /// RecursiveArgument class enables to declare the argument
+ /// (variable) which is defined in a recursive way. Such an argument
+ /// can be used in further processing in expressions, functions and dependent
+ /// or recursive arguments.
+ ///
+ /// For example:
+ ///
+ /// - 'fib(n) = fin(n-1)+fib(n-2), fib(0) = 0, fib(1) = 1'
+ /// - 'factorial(n) = n*factorial(n-1), factorial(0) = 1'
+ ///
+ ///
+ ///
+ /// When creating an argument you should avoid:
+ ///
+ /// -
+ /// names reserved as parser keywords, in general words known in mathematical language
+ /// as function names, operators (for example:
+ /// sin, cos, +, -, etc...). Please be informed that after associating
+ /// the argument with the expression, function or dependent/recursive argument
+ /// its name will be recognized by the parser as reserved key word.
+ /// It means that it could not be the same as any other key word known
+ /// by the parser for this particular expression.
+ ///
+ /// -
+ /// defining statements with increasing index: 'a(n) = a(n+1) + ... ', otherwise
+ /// you will get
+ ///
+ /// -
+ /// if recursion is not properly defined you will get in the result.
+ /// This is due to the recursion counter inside of the recursive argument. Calculating
+ /// n-th element requires no more than n recursion steps (usually less than n).
+ ///
+ /// - For negative 'n' you will get .
+ ///
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.2.0
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
[CLSCompliant(true)]
public class RecursiveArgument : Argument {
- /**
- * Type identifier for recursive arguments.
- */
+ /// Type identifier for recursive arguments.
public const int TYPE_ID_RECURSIVE = 102;
public const String TYPE_DESC_RECURSIVE = "User defined recursive argument";
- /**
- * Base values
- */
+ /// Base values
private List baseValues;
- /**
- * To avoid never ending loops
- */
+ /// To avoid never ending loops
private int recursiveCounter;
private int startingIndex;
- /**
- * Constructor - creates recursive argument.
- *
- * @param argumentName the argument name
- * @param recursiveExpressionString the recursive expression string
- * @param indexName index argument name
- */
+ /// Constructor - creates recursive argument.
+ ///
+ /// the argument name
+ /// the recursive expression string
+ /// index argument name
public RecursiveArgument(String argumentName, String recursiveExpressionString, String indexName)
: base(argumentName, recursiveExpressionString)
{
@@ -148,18 +146,19 @@ public RecursiveArgument(String argumentName, String recursiveExpressionString,
recursiveCounter = -1;
}
}
- /**
- * Constructor - creates recursive argument.
- *
- * @param argumentName the argument name
- * @param recursiveExpressionString the recursive expression string
- * @param n the index argument
- * @param elements Optional elements list (variadic - comma
- * separated) of types: Argument, Constant, Function
- *
- * @see PrimitiveElement
- * @see Argument
- */
+ /// Constructor - creates recursive argument.
+ ///
+ /// the argument name
+ /// the recursive expression string
+ /// the index argument
+ ///
+ /// Optional elements list (variadic - comma
+ /// separated) of types: ,
+ /// ,
+ ///
+ ///
+ ///
+ ///
public RecursiveArgument(String argumentName, String recursiveExpressionString, Argument n, params PrimitiveElement[] elements)
: base(argumentName, recursiveExpressionString)
{
@@ -174,25 +173,27 @@ public RecursiveArgument(String argumentName, String recursiveExpressionString,
recursiveCounter = -1;
}
}
- /**
- * Constructor - creates argument based on the argument definition string.
- *
- * @param argumentDefinitionString Argument definition string, i.e.:
- *
- * - 'x' - only argument name
- *
- 'x=5' - argument name and argument value
- *
- 'x=2*5' - argument name and argument value given as simple expression
- *
- 'x=2*y' - argument name and argument expression (dependent argument 'x' on argument 'y')
- *
- 'x(n)=x(n-1)+x(n-2)' - for recursive arguments)
- *
- *
- * @param elements Optional elements list
- * (variadic - comma separated) of types: Argument,
- * Constant, Function
- *
- * @see PrimitiveElement
- * @see Argument
- */
+ /// Constructor - creates argument based on the argument definition string.
+ ///
+ ///
+ /// Argument definition string, i.e.:
+ ///
+ /// - 'x' - only argument name
+ /// - 'x=5' - argument name and argument value
+ /// - 'x=2*5' - argument name and argument value given as simple expression
+ /// - 'x=2*y' - argument name and argument expression (dependent argument 'x' on argument 'y')
+ /// - 'x(n)=x(n-1)+x(n-2)' - for recursive arguments)
+ ///
+ ///
+ ///
+ ///
+ /// Optional elements list
+ /// (variadic - comma separated) of types: ,
+ /// ,
+ ///
+ ///
+ ///
+ ///
public RecursiveArgument(String argumentDefinitionString, params PrimitiveElement[] elements) : base(argumentDefinitionString)
{
if (mXparser.regexMatch(argumentDefinitionString, ParserSymbol.function1ArgDefStrRegExp)) {
@@ -209,12 +210,10 @@ public RecursiveArgument(String argumentDefinitionString, params PrimitiveElemen
base.argumentExpression.setSyntaxStatus(SYNTAX_ERROR_OR_STATUS_UNKNOWN, "[" + argumentDefinitionString + "] " + "Invalid argument definition (patterns: f(n) = f(n-1) ... ).");
}
}
- /**
- * Adds base case
- *
- * @param index the base case index
- * @param value the base case value
- */
+ /// Adds base case
+ ///
+ /// the base case index
+ /// the base case value
public void addBaseCase(int index, double value) {
int recSize = baseValues.Count;
if (index > recSize-1) {
@@ -227,21 +226,17 @@ public void addBaseCase(int index, double value) {
} else
baseValues[index] = value;
}
- /**
- * Clears all based cases and stored calculated values
- */
+ /// Clears all based cases and stored calculated values
public void resetAllCases()
{
baseValues.Clear();
recursiveCounter = -1;
}
- /**
- * Gets recursive argument value
- *
- * @param index the index
- *
- * @return value as double
- */
+ /// Gets recursive argument value
+ ///
+ /// the index
+ ///
+ /// value as double
public double getArgumentValue(double index) {
/*
* Remember starting index
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mXparser.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mXparser.cs
index 0eda7914..15e1a23f 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mXparser.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mXparser.cs
@@ -63,180 +63,171 @@
[assembly: CLSCompliant(true)]
namespace org.mariuszgromada.math.mxparser {
- /**
- * mXparser class provides usefull methods when parsing, calculating or
- * parameters transforming.
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.3.0
- *
- * @see RecursiveArgument
- * @see Expression
- * @see Function
- * @see Constant
- */
+ ///
+ /// mXparser class provides usefull methods when parsing, calculating or
+ /// parameters transforming.
+ ///
+ ///
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.3.0
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
[CLSCompliant(true)]
public sealed class mXparser {
- /**
- * mXparser version
- */
+ /// mXparser version
public const String VERSION = "4.3.0";
public const String VERSION_CODE_NAME = "Caprica";
public const String VERSION_NAME = VERSION + " " + VERSION_CODE_NAME;
- /**
- * FOUND / NOT_FOUND
- * used for matching purposes
- */
+ ///
+ /// /
+ /// used for matching purposes
+ ///
internal const int NOT_FOUND = -1;
internal const int FOUND = 0;
- /**
- * Console output string for below methods
- *
- * @see mXparser.#consolePrintln(Object)
- * @see mXparser.#consolePrint(Object)
- */
+ /// Console output string for below methods
+ ///
+ ///
+ ///
private static volatile String CONSOLE_OUTPUT = "";
private static volatile String CONSOLE_PREFIX = "[mXparser-v." + VERSION + "] ";
private static volatile String CONSOLE_OUTPUT_PREFIX = CONSOLE_PREFIX;
private static volatile int CONSOLE_ROW_NUMBER = 1;
- /**
- * Prime numbers cache
- */
+ /// Prime numbers cache
public static PrimesCache primesCache;
public const int PRIMES_CACHE_NOT_INITIALIZED = -1;
- /**
- * Threads number settings
- */
+ /// Threads number settings
private static int THREADS_NUMBER = Environment.ProcessorCount;
- /**
- * Empty expression for general help purposes.
- */
+ /// Empty expression for general help purposes.
internal static volatile Expression mXparserExp = new Expression();
- /**
- * Double floating-point precision arithmetic causes
- * rounding problems, i.e. 0.1 + 0.1 + 0.1 is different than 0.3
- *
- * mXparser provides intelligent ULP rounding to avoid this
- * type of errors.
- */
+ ///
+ /// Double floating-point precision arithmetic causes
+ /// rounding problems, i.e. 0.1 + 0.1 + 0.1 is different than 0.3
+ ///
+ /// mXparser provides intelligent ULP rounding to avoid this
+ /// type of errors.
+ ///
internal volatile static bool ulpRounding = true;
- /**
- * Indicator marking whether to round final result
- * to precise integer when result is very close
- * to integer, solves problems like
- * sin(pi) = 0
- */
+ ///
+ /// Indicator marking whether to round final result
+ /// to precise integer when result is very close
+ /// to integer, solves problems like
+ /// sin(pi) = 0
+ ///
internal volatile static bool almostIntRounding = true;
internal const int DEFAULT_MAX_RECURSION_CALLS = 200;
- /**
- * Internal limit for counter to avoid infinite loops while calculating
- * expression defined in the way shown by below examples
- *
- * Argument x = new Argument("x = 2*y");
- * Argument y = new Argument("y = 2*x");
- * x.addDefinitions(y);
- * y.addDefinitions(x);
- *
- * Function f = new Function("f(x) = 2*g(x)");
- * Function g = new Function("g(x) = 2*f(x)");
- * f.addDefinitions(g);
- * g.addDefinitions(f);
- */
+ ///
+ /// Internal limit for counter to avoid infinite loops while calculating
+ /// expression defined in the way shown by below examples
+ ///
+ /// Argument x = new Argument("x = 2*y");
+ /// Argument y = new Argument("y = 2*x");
+ /// x.addDefinitions(y);
+ /// y.addDefinitions(x);
+ ///
+ ///
+ /// Function f = new Function("f(x) = 2*g(x)");
+ /// Function g = new Function("g(x) = 2*f(x)");
+ /// f.addDefinitions(g);
+ /// g.addDefinitions(f);
+ ///
+ ///
internal volatile static int MAX_RECURSION_CALLS = DEFAULT_MAX_RECURSION_CALLS;
- /**
- * List of built-in tokens to remove.
- */
+ /// List of built-in tokens to remove.
internal volatile static List tokensToRemove = new List();
- /**
- * List of built-in tokens to modify
- */
+ /// List of built-in tokens to modify
internal volatile static List tokensToModify = new List();
- /**
- * Indicator whether mXparser operates in radians / degrees mode
- * true - degrees mode
- * false - radians mode
- *
- * Default false (radians mode)
- */
+ ///
+ /// Indicator whether mXparser operates in radians / degrees mode
+ ///
+ /// - truedegrees mode
+ /// - falseradians mode
+ ///
+ ///
+ ///
+ /// Default false (radians mode)
+ ///
internal volatile static bool degreesMode = false;
- /**
- * Indicator whether user defined tokens should override
- * built-in tokens.
- */
+ ///
+ /// Indicator whether user defined tokens should override
+ /// built-in tokens.
+ ///
internal volatile static bool overrideBuiltinTokens = false;
- /**
- * Options changeset
- */
+ /// Options changeset
internal volatile static int optionsChangesetNumber = 0;
- /**
- * Indicator whether to call cancel current calculation
- */
+ /// Indicator whether to call cancel current calculation
private static volatile bool cancelCurrentCalculationFlag = false;
- /**
- * Initialization of prime numbers cache.
- * Cache size according to {@link PrimesCache#DEFAULT_MAX_NUM_IN_CACHE}
- * @see PrimesCache
- */
+ ///
+ /// Initialization of prime numbers cache.
+ /// Cache size according to
+ ///
+ ///
public static void initPrimesCache() {
primesCache = new PrimesCache();
}
- /**
- * Returns true in case when primes cache initialization was successful,
- * otherwise returns false.
- *
- * @return Returns true in case when primes cache initialization was successful,
- * otherwise returns false.
- */
+ ///
+ /// Returns true in case when primes cache initialization was successful,
+ /// otherwise returns false.
+ ///
+ ///
+ /// Returns true in case when primes cache initialization was successful,
+ /// otherwise returns false.
+ ///
public static bool isInitPrimesCacheSuccessful() {
if (primesCache == null) return false;
lock (primesCache) {
return primesCache.isInitSuccessful();
}
}
- /**
- * Initialization of prime numbers cache.
- * @param mximumNumberInCache The maximum integer number that
- * will be stored in cache.
- * @see PrimesCache
- */
+ /// Initialization of prime numbers cache.
+ ///
+ ///
+ /// The maximum integer number that
+ /// will be stored in cache.
+ ///
+ ///
+ ///
public static void initPrimesCache(int mximumNumberInCache) {
primesCache = new PrimesCache(mximumNumberInCache);
}
- /**
- * Initialization of prime numbers cache.
- * @param primesCache The primes cache object
- * @see PrimesCache
- */
+ /// Initialization of prime numbers cache.
+ ///
+ /// The primes cache object
+ ///
+ ///
public static void initPrimesCache(PrimesCache primesCache) {
mXparser.primesCache = primesCache;
}
- /**
- * Sets {@link mXparser#primesCache} to null
- */
+ /// Sets to null
public static void setNoPrimesCache() {
primesCache = null;
}
- /**
- * Returns maximum integer number in primes cache
- * @return If primes cache was initialized then maximum number in
- * primes cache, otherwise {@link mXparser#PRIMES_CACHE_NOT_INITIALIZED}
- */
+ /// Returns maximum integer number in primes cache
+ ///
+ ///
+ /// If primes cache was initialized then maximum number in
+ /// primes cache, otherwise
+ ///
public static int getMaxNumInPrimesCache() {
if (primesCache != null) {
lock (primesCache) {
@@ -245,23 +236,17 @@ public static int getMaxNumInPrimesCache() {
} else
return PRIMES_CACHE_NOT_INITIALIZED;
}
- /**
- * Gets maximum threads number
- * @return Threads number.
- */
+ /// Gets maximum threads number
+ ///
+ /// Threads number.
public static int getThreadsNumber() {
return THREADS_NUMBER;
}
- /**
- * Sets default threads number
- * @param threadsNumber Thread number.
- */
+ /// Sets default threads number
public static void setDefaultThreadsNumber() {
THREADS_NUMBER = Environment.ProcessorCount;
}
- /**
- * Sets threads number
- */
+ /// Sets threads number
public static void setThreadsNumber(int threadsNumber) {
if (threadsNumber > 0) THREADS_NUMBER = threadsNumber;
}
@@ -271,29 +256,24 @@ public static void setThreadsNumber(int threadsNumber) {
public static long currentTimeMillis() {
return (long)(DateTime.UtcNow - Jan1st1970).TotalMilliseconds;
}
- /**
- * Calculates function f(x0) (given as expression) assigning Argument x = x0;
- *
- *
- * @param f the expression
- * @param x the argument
- * @param x0 the argument value
- *
- * @return f.calculate()
- *
- * @see Expression
- */
+ /// Calculates function f(x0) (given as expression) assigning Argument x = x0;
+ ///
+ /// the expression
+ /// the argument
+ /// the argument value
+ ///
+ /// f.calculate()
+ ///
+ ///
public static double getFunctionValue(Expression f, Argument x, double x0) {
x.setArgumentValue(x0);
return f.calculate();
}
- /**
- * Converts List of double to double[]
- *
- * @param numbers the numbers list
- *
- * @return numbers array
- */
+ /// Converts List of double to double[]
+ ///
+ /// the numbers list
+ ///
+ /// numbers array
public static double[] arrayList2double(List numbers) {
if (numbers == null)
return null;
@@ -303,17 +283,18 @@ public static double[] arrayList2double(List numbers) {
newNumbers[i] = numbers[i];
return newNumbers;
}
- /**
- * Returns array of double values of the function f(i)
- * calculated on the range: i = from to i = to by step = delta
- *
- * @param f Function expression
- * @param index Index argument
- * @param from 'from' value
- * @param to 'to' value
- * @param delta 'delta' step definition
- * @return Array of function values
- */
+ ///
+ /// Returns array of double values of the function f(i)
+ /// calculated on the range: i = from to i = to by step = delta
+ ///
+ ///
+ /// Function expression
+ /// Index argument
+ /// 'from' value
+ /// 'to' value
+ /// 'delta' step definition
+ ///
+ /// Array of function values
public static double[] getFunctionValues(Expression f, Argument index, double from, double to, double delta) {
if ((Double.IsNaN(delta)) || (Double.IsNaN(from)) || (Double.IsNaN(to)) || (delta == 0))
return null;
@@ -348,262 +329,265 @@ public static double[] getFunctionValues(Expression f, Argument index, double fr
} else values = null;
return values;
}
- /**
- * Modifies random generator used by the ProbabilityDistributions class.
- *
- * @param randomGenerator Random generator.
- * @see ProbabilityDistributions
- * @see ProbabilityDistributions#randomGenerator
- */
+ /// Modifies random generator used by the ProbabilityDistributions class.
+ ///
+ /// Random generator.
+ ///
+ ///
+ ///
public static void setRandomGenerator(Random randomGenerator) {
if (randomGenerator != null) ProbabilityDistributions.randomGenerator = randomGenerator;
}
- /**
- * Sets comparison mode to EXACT.
- * @see BinaryRelations
- */
+ /// Sets comparison mode to EXACT.
+ ///
+ ///
public static void setExactComparison() {
BinaryRelations.setExactComparison();
}
- /**
- * Sets comparison mode to EPSILON.
- * @see BinaryRelations
- */
+ /// Sets comparison mode to EPSILON.
+ ///
+ ///
public static void setEpsilonComparison() {
BinaryRelations.setEpsilonComparison();
}
- /**
- * Sets epsilon value.
- * @param epsilon Epsilon value (grater than 0).
- *
- * @see #setEpsilonComparison()
- * @see BinaryRelations
- */
+ /// Sets epsilon value.
+ ///
+ /// Epsilon value (grater than 0).
+ ///
+ ///
+ ///
public static void setEpsilon(double epsilon) {
BinaryRelations.setEpsilon(epsilon);
}
- /**
- * Sets default epsilon value.
- *
- * @see #setEpsilonComparison()
- * @see BinaryRelations#DEFAULT_COMPARISON_EPSILON
- * @see BinaryRelations
- */
+ /// Sets default epsilon value.
+ ///
+ ///
+ ///
+ ///
public static void setDefaultEpsilon() {
BinaryRelations.setDefaultEpsilon();
}
- /**
- * Returns current epsilon value.
- * @return Returns current epsilon value.
- *
- * @see #setEpsilonComparison()
- * @see BinaryRelations
- */
+ /// Returns current epsilon value.
+ ///
+ /// Returns current epsilon value.
+ ///
+ ///
+ ///
public static double getEpsilon() {
return BinaryRelations.getEpsilon();
}
- /**
- * Checks if epsilon comparison mode is active;
- * @return True if epsilon mode is active, otherwise returns false.
- * @see #setEpsilonComparison()
- * @see #setExactComparison()
- * @see BinaryRelations
- */
+ /// Checks if epsilon comparison mode is active;
+ ///
+ /// True if epsilon mode is active, otherwise returns false.
+ ///
+ ///
+ ///
+ ///
public static bool checkIfEpsilonMode() {
return BinaryRelations.checkIfEpsilonMode();
}
- /**
- * Checks if exact comparison mode is active;
- * @return True if exact mode is active, otherwise returns false.
- * @see #setEpsilonComparison()
- * @see #setExactComparison()
- * @see BinaryRelations
- */
+ /// Checks if exact comparison mode is active;
+ ///
+ /// True if exact mode is active, otherwise returns false.
+ ///
+ ///
+ ///
+ ///
public static bool checkIfExactMode() {
return BinaryRelations.checkIfExactMode();
}
- /**
- * Double floating-point precision arithmetic causes
- * rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
- * additionally doubles are having a lot of advantages
- * providing flexible number representation regardless of
- * number size. mXparser is fully based on double numbers
- * and that is why is providing intelligent ULP rounding
- * to minimize misleading results. By default this option is
- * enabled resulting in automatic rounding only in some cases.
- * Using this mode 0.1 + 0.1 + 0.1 = 0.3
- */
+ ///
+ /// Double floating-point precision arithmetic causes
+ /// rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
+ /// additionally doubles are having a lot of advantages
+ /// providing flexible number representation regardless of
+ /// number size. mXparser is fully based on double numbers
+ /// and that is why is providing intelligent ULP rounding
+ /// to minimize misleading results. By default this option is
+ /// enabled resulting in automatic rounding only in some cases.
+ /// Using this mode 0.1 + 0.1 + 0.1 = 0.3
+ ///
public static void enableUlpRounding() {
ulpRounding = true;
}
- /**
- * Double floating-point precision arithmetic causes
- * rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
- * additionally doubles are having a lot of advantages
- * providing flexible number representation regardless of
- * number size. mXparser is fully based on double numbers
- * and that is why is providing intelligent ULP rounding
- * to minimize misleading results. By default this option is
- * enabled resulting in automatic rounding only in some cases.
- * Disabling this mode 0.1 + 0.1 + 0.1 will be slightly different than 0.3.
- */
+ ///
+ /// Double floating-point precision arithmetic causes
+ /// rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
+ /// additionally doubles are having a lot of advantages
+ /// providing flexible number representation regardless of
+ /// number size. mXparser is fully based on double numbers
+ /// and that is why is providing intelligent ULP rounding
+ /// to minimize misleading results. By default this option is
+ /// enabled resulting in automatic rounding only in some cases.
+ /// Disabling this mode 0.1 + 0.1 + 0.1 will be slightly different than 0.3.
+ ///
public static void disableUlpRounding() {
ulpRounding = false;
}
- /**
- * Double floating-point precision arithmetic causes
- * rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
- * additionally doubles are having a lot of advantages
- * providing flexible number representation regardless of
- * number size. mXparser is fully based on double numbers
- * and that is why is providing intelligent ULP rounding
- * to minimize misleading results. By default this option is
- * enabled resulting in automatic rounding only in some cases.
- * Using this mode 0.1 + 0.1 + 0.1 = 0.3
- *
- * @return True if ULP rounding is enabled, otherwise false.
- */
+ ///
+ /// Double floating-point precision arithmetic causes
+ /// rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
+ /// additionally doubles are having a lot of advantages
+ /// providing flexible number representation regardless of
+ /// number size. mXparser is fully based on double numbers
+ /// and that is why is providing intelligent ULP rounding
+ /// to minimize misleading results. By default this option is
+ /// enabled resulting in automatic rounding only in some cases.
+ /// Using this mode 0.1 + 0.1 + 0.1 = 0.3
+ ///
+ ///
+ /// True if ULP rounding is enabled, otherwise false.
public static bool checkIfUlpRounding() {
return ulpRounding;
}
- /**
- * Enables almost integer rounding option causing
- * rounding final calculation result to precise integer
- * if and only if result is very close to integer.
- * Very close condition depends on epsilon.
- *
- * @see mXparser#setEpsilon(double)
- * @see mXparser#getEpsilon()
- * @see Expression#calculate()
- */
+ ///
+ /// Enables almost integer rounding option causing
+ /// rounding final calculation result to precise integer
+ /// if and only if result is very close to integer.
+ /// Very close condition depends on epsilon.
+ ///
+ ///
+ ///
+ ///
+ ///
public static void enableAlmostIntRounding() {
almostIntRounding = true;
}
- /**
- * Disables almost integer rounding option causing
- * rounding final calculation result to precise integer
- * if and only if result is very close to integer.
- * Very close condition depends on epsilon.
- *
- * @see mXparser#setEpsilon(double)
- * @see mXparser#getEpsilon()
- * @see Expression#calculate()
- */
+ ///
+ /// Disables almost integer rounding option causing
+ /// rounding final calculation result to precise integer
+ /// if and only if result is very close to integer.
+ /// Very close condition depends on epsilon.
+ ///
+ ///
+ ///
+ ///
+ ///
public static void disableAlmostIntRounding() {
almostIntRounding = false;
}
- /**
- * Returns state of almost integer rounding option causing
- * rounding final calculation result to precise integer
- * if and only if result is very close to integer.
- * Very close condition depends on epsilon.
- *
- * @return true if option enabled, false otherwise
- *
- * @see mXparser#setEpsilon(double)
- * @see mXparser#getEpsilon()
- * @see Expression#calculate()
- */
+ ///
+ /// Returns state of almost integer rounding option causing
+ /// rounding final calculation result to precise integer
+ /// if and only if result is very close to integer.
+ /// Very close condition depends on epsilon.
+ ///
+ ///
+ /// true if option enabled, false otherwise
+ ///
+ ///
+ ///
+ ///
public static bool checkIfAlmostIntRounding() {
return almostIntRounding;
}
- /**
- * Internal limit to avoid infinite loops while calculating
- * expression defined in the way shown by below examples.
- *
- * Argument x = new Argument("x = 2*y");
- * Argument y = new Argument("y = 2*x");
- * x.addDefinitions(y);
- * y.addDefinitions(x);
- *
- * Function f = new Function("f(x) = 2*g(x)");
- * Function g = new Function("g(x) = 2*f(x)");
- * f.addDefinitions(g);
- * g.addDefinitions(f);
- *
- * Currently does not affect properly defined recursive mode.
- *
- * @param maxAllowedRecursionDepth
- */
+ ///
+ /// Internal limit to avoid infinite loops while calculating
+ /// expression defined in the way shown by below examples.
+ ///
+ /// Argument x = new Argument("x = 2*y");
+ /// Argument y = new Argument("y = 2*x");
+ /// x.addDefinitions(y);
+ /// y.addDefinitions(x);
+ ///
+ ///
+ /// Function f = new Function("f(x) = 2*g(x)");
+ /// Function g = new Function("g(x) = 2*f(x)");
+ /// f.addDefinitions(g);
+ /// g.addDefinitions(f);
+ ///
+ /// Currently does not affect properly defined recursive mode.
+ ///
+ ///
+ ///
public static void setMaxAllowedRecursionDepth(int maxAllowedRecursionDepth) {
MAX_RECURSION_CALLS = maxAllowedRecursionDepth;
}
- /**
- * Internal limit to avoid infinite loops while calculating
- * expression defined in the way shown by below examples.
- *
- * Argument x = new Argument("x = 2*y");
- * Argument y = new Argument("y = 2*x");
- * x.addDefinitions(y);
- * y.addDefinitions(x);
- *
- * Function f = new Function("f(x) = 2*g(x)");
- * Function g = new Function("g(x) = 2*f(x)");
- * f.addDefinitions(g);
- * g.addDefinitions(f);
- *
- * Currently does not affect properly defined recursive mode.
- */
+ ///
+ /// Internal limit to avoid infinite loops while calculating
+ /// expression defined in the way shown by below examples.
+ ///
+ /// Argument x = new Argument("x = 2*y");
+ /// Argument y = new Argument("y = 2*x");
+ /// x.addDefinitions(y);
+ /// y.addDefinitions(x);
+ ///
+ ///
+ /// Function f = new Function("f(x) = 2*g(x)");
+ /// Function g = new Function("g(x) = 2*f(x)");
+ /// f.addDefinitions(g);
+ /// g.addDefinitions(f);
+ ///
+ /// Currently does not affect properly defined recursive mode.
+ ///
public static int getMaxAllowedRecursionDepth() {
return MAX_RECURSION_CALLS;
}
- /**
- * Set mXparser to operate in radians mode for
- * trigonometric functions
- */
+ ///
+ /// Set mXparser to operate in radians mode for
+ /// trigonometric functions
+ ///
public static void setRadiansMode() {
degreesMode = false;
}
- /**
- * Set mXparser to operate in degrees mode for
- * trigonometric functions
- */
+ ///
+ /// Set mXparser to operate in degrees mode for
+ /// trigonometric functions
+ ///
public static void setDegreesMode() {
degreesMode = true;
}
- /**
- * Checks whether mXparser operates in radians mode for
- * trigonometric functions.
- *
- * @return true - if radians mode, false - otherwise
- */
+ ///
+ /// Checks whether mXparser operates in radians mode for
+ /// trigonometric functions.
+ ///
+ ///
+ ///
+ ///
+ /// - trueif radians mode
+ /// - falseotherwise
+ ///
+ ///
public static bool checkIfRadiansMode() {
return !degreesMode;
}
- /**
- * Checks whether mXparser operates in degrees mode for
- * trigonometric functions.
- *
- * @return true - if degrees mode, false - otherwise
- */
+ ///
+ /// Checks whether mXparser operates in degrees mode for
+ /// trigonometric functions.
+ ///
+ ///
+ ///
+ ///
+ /// - trueif degrees mode
+ /// - falseotherwise
+ ///
+ ///
public static bool checkIfDegreesMode() {
return degreesMode;
}
- /**
- * Sets initial search size for the toFraction method
- *
- * @param n initial search size, has to be non-zero positive.
- * @see NumberTheory#toFraction(double)
- */
+ /// Sets initial search size for the toFraction method
+ ///
+ /// initial search size, has to be non-zero positive.
+ ///
+ ///
public static void setToFractionInitSearchSize(long n) {
NumberTheory.setToFractionInitSearchSize(n);
}
- /**
- * Gets initial search size used by the toFraction method
- *
- * @return initial search size used by the toFraction method
- * @see NumberTheory#toFraction(double)
- */
+ /// Gets initial search size used by the toFraction method
+ ///
+ /// initial search size used by the toFraction method
+ ///
+ ///
public static long getToFractionInitSearchSize() {
return NumberTheory.getToFractionInitSearchSize();
}
- /**
- * Removes built-in tokens form the list of tokens recognized by the parsers.
- * Procedure affects only tokens classified to built-in functions, built-in
- * constants, built-in units, built-in random variables.
- *
- * @param tokens List of tokens to remove.
- */
+ ///
+ /// Removes built-in tokens form the list of tokens recognized by the parsers.
+ /// Procedure affects only tokens classified to built-in functions, built-in
+ /// constants, built-in units, built-in random variables.
+ ///
+ ///
+ /// List of tokens to remove.
public static void removeBuiltinTokens(params String[] tokens) {
if (tokens == null) return;
lock (tokensToRemove) {
@@ -615,10 +599,9 @@ public static void removeBuiltinTokens(params String[] tokens) {
optionsChangesetNumber++;
}
}
- /**
- * Un-marks tokens previously marked to be removed.
- * @param tokens List of tokens to un-mark.
- */
+ /// Un-marks tokens previously marked to be removed.
+ ///
+ /// List of tokens to un-mark.
public static void unremoveBuiltinTokens(params String[] tokens) {
if (tokens == null) return;
if (tokens.Length == 0) return;
@@ -630,19 +613,16 @@ public static void unremoveBuiltinTokens(params String[] tokens) {
optionsChangesetNumber++;
}
}
- /**
- * Un-marks all tokens previously marked to be removed.
- */
+ /// Un-marks all tokens previously marked to be removed.
public static void unremoveAllBuiltinTokens() {
lock (tokensToRemove) {
tokensToRemove.Clear();
optionsChangesetNumber++;
}
}
- /**
- * Returns current list of tokens marked to be removed.
- * @return Current list of tokens marked to be removed
- */
+ /// Returns current list of tokens marked to be removed.
+ ///
+ /// Current list of tokens marked to be removed
public static String[] getBuiltinTokensToRemove() {
lock (tokensToRemove) {
int tokensNum = tokensToRemove.Count;
@@ -652,15 +632,16 @@ public static String[] getBuiltinTokensToRemove() {
return tokensToRemoveArray;
}
}
- /**
- * Method to change definition of built-in token - more precisely
- * using this method allows to modify token string recognized by the parser
- * (i.e. sin(x) -> sinus(x)).
- * Procedure affects only tokens classified to built-in functions, built-in
- * constants, built-in units, built-in random variables.
- * @param currentToken Current token name
- * @param newToken New token name
- */
+ ///
+ /// Method to change definition of built-in token - more precisely
+ /// using this method allows to modify token string recognized by the parser
+ /// (i.e. sin(x) -> sinus(x)).
+ /// Procedure affects only tokens classified to built-in functions, built-in
+ /// constants, built-in units, built-in random variables.
+ ///
+ ///
+ /// Current token name
+ /// New token name
public static void modifyBuiltinToken(String currentToken, String newToken) {
if (currentToken == null) return;
if (currentToken.Length == 0) return;
@@ -677,16 +658,17 @@ public static void modifyBuiltinToken(String currentToken, String newToken) {
optionsChangesetNumber++;
}
}
- /**
- * Method to change definition of built-in token - more precisely
- * using this method allows to modify token string recognized by the parser
- * (i.e. sin(x) -> sinus(x)).
- * Procedure affects only tokens classified to built-in functions, built-in
- * constants, built-in units, built-in random variables.
- * @param currentToken Current token name
- * @param newToken New token name
- * @param newTokenDescription New token description (if null the previous one will be used)
- */
+ ///
+ /// Method to change definition of built-in token - more precisely
+ /// using this method allows to modify token string recognized by the parser
+ /// (i.e. sin(x) -> sinus(x)).
+ /// Procedure affects only tokens classified to built-in functions, built-in
+ /// constants, built-in units, built-in random variables.
+ ///
+ ///
+ /// Current token name
+ /// New token name
+ /// New token description (if null the previous one will be used
public static void modifyBuiltinToken(String currentToken, String newToken, String newTokenDescription) {
if (currentToken == null) return;
if (currentToken.Length == 0) return;
@@ -703,10 +685,9 @@ public static void modifyBuiltinToken(String currentToken, String newToken, Stri
optionsChangesetNumber++;
}
}
- /**
- * Un-marks tokens previously marked to be modified.
- * @param currentOrNewTokens List of tokens to be un-marked (current or modified).
- */
+ /// Un-marks tokens previously marked to be modified.
+ ///
+ /// List of tokens to be un-marked (current or modified).
public static void unmodifyBuiltinTokens(params String[] currentOrNewTokens) {
if (currentOrNewTokens == null) return;
if (currentOrNewTokens.Length == 0) return;
@@ -724,20 +705,19 @@ public static void unmodifyBuiltinTokens(params String[] currentOrNewTokens) {
optionsChangesetNumber++;
}
}
- /**
- * Un-marks all tokens previously marked to be modified.
- */
+ /// Un-marks all tokens previously marked to be modified.
public static void unmodifyAllBuiltinTokens() {
lock (tokensToModify) {
tokensToModify.Clear();
optionsChangesetNumber++;
}
}
- /**
- * Return details on tokens marked to be modified.
- * @return String[i][0] - current token, String[i][1] - new token,
- * String[i][2] - new token description.
- */
+ /// Return details on tokens marked to be modified.
+ ///
+ ///
+ /// String[i][0] - current token, String[i][1] - new token,
+ /// String[i][2] - new token description.
+ ///
public static String[,] getBuiltinTokensToModify() {
lock (tokensToModify) {
int tokensNum = tokensToModify.Count;
@@ -751,35 +731,32 @@ public static void unmodifyAllBuiltinTokens() {
return tokensToModifyArray;
}
}
- /**
- * Sets mXparser to override built-in tokens
- * by user defined tokens.
- */
+ ///
+ /// Sets mXparser to override built-in tokens
+ /// by user defined tokens.
+ ///
public static void setToOverrideBuiltinTokens() {
overrideBuiltinTokens = true;
optionsChangesetNumber++;
}
- /**
- * Sets mXparser not to override built-in tokens
- * by user defined tokens.
- */
+ ///
+ /// Sets mXparser not to override built-in tokens
+ /// by user defined tokens.
+ ///
public static void setNotToOverrideBuiltinTokens() {
overrideBuiltinTokens = false;
optionsChangesetNumber++;
}
- /**
- * Checks whether mXparser is set to override built-in tokens.
- *
- * @return True if mXparser is set to override built-in tokens by
- * user defined tokens, otherwise false.
- */
+ /// Checks whether mXparser is set to override built-in tokens.
+ ///
+ ///
+ /// True if mXparser is set to override built-in tokens by
+ /// user defined tokens, otherwise false.
+ ///
public static bool checkIfsetToOverrideBuiltinTokens() {
return overrideBuiltinTokens;
}
- /**
- * Sets default mXparser options
- *
- */
+ /// Sets default mXparser options
public static void setDefaultOptions() {
enableUlpRounding();
enableAlmostIntRounding();
@@ -793,12 +770,11 @@ public static void setDefaultOptions() {
setToFractionInitSearchSize(NumberTheory.DEFAULT_TO_FRACTION_INIT_SEARCH_SIZE);
optionsChangesetNumber++;
}
- /**
- * Returns token type description.
- *
- * @param tokenTypeId Token type id
- * @return String representing token type description.
- */
+ /// Returns token type description.
+ ///
+ /// Token type id
+ ///
+ /// String representing token type description.
public static String getTokenTypeDescription(int tokenTypeId) {
String type = "";
switch (tokenTypeId) {
@@ -823,40 +799,38 @@ public static String getTokenTypeDescription(int tokenTypeId) {
}
return type;
}
- /**
- * Converts integer number to hex string (plain text)
- *
- * @param number Integer number
- * @return Hex string (i.e. FF23)
- */
+ /// Converts integer number to hex string (plain text)
+ ///
+ /// Integer number
+ ///
+ /// Hex string (i.e. FF23)
public static String numberToHexString(int number) {
return number.ToString("X");
}
- /**
- * Converts long number to hex string (plain text)
- *
- * @param number Long number
- * @return Hex string (i.e. FF23)
- */
+ /// Converts long number to hex string (plain text)
+ ///
+ /// Long number
+ ///
+ /// Hex string (i.e. FF23)
public static String numberToHexString(long number) {
return number.ToString("X");
}
- /**
- * Converts (long)double number to hex string (plain text)
- *
- * @param number Double number
- * @return Hex string (i.e. FF23)
- */
+ /// Converts (long)double number to hex string (plain text)
+ ///
+ /// Double number
+ ///
+ /// Hex string (i.e. FF23)
public static String numberToHexString(double number) {
return numberToHexString((long)number);
}
- /**
- * Converts hex string into ASCII string, where each letter is
- * represented by two hex digits (byte) from the hex string.
- *
- * @param hexString Hex string (i.e. 48656C6C6F)
- * @return ASCII string (i.e. '48656C6C6F' = 'Hello')
- */
+ ///
+ /// Converts hex string into ASCII string, where each letter is
+ /// represented by two hex digits (byte) from the hex string.
+ ///
+ ///
+ /// Hex string (i.e. 48656C6C6F)
+ ///
+ /// ASCII string (i.e. '48656C6C6F' = 'Hello')
public static String hexString2AsciiString(String hexString) {
String hexByteStr;
int hexByteInt;
@@ -868,204 +842,219 @@ public static String hexString2AsciiString(String hexString) {
}
return asciiString;
}
- /**
- * Converts number into ASCII string, where each letter is
- * represented by two hex digits (byte) from the hex representation
- * of the original number
- *
- * @param number Integer number (i.e. 310939249775 = '48656C6C6F')
- * @return ASCII string (i.e. '48656C6C6F' = 'Hello')
- */
+ ///
+ /// Converts number into ASCII string, where each letter is
+ /// represented by two hex digits (byte) from the hex representation
+ /// of the original number
+ ///
+ ///
+ /// Integer number (i.e. 310939249775 = '48656C6C6F')
+ ///
+ /// ASCII string (i.e. '48656C6C6F' = 'Hello')
public static String numberToAsciiString(int number) {
return hexString2AsciiString(numberToHexString(number));
}
- /**
- * Converts number into ASCII string, where each letter is
- * represented by two hex digits (byte) from the hex representation
- * of the original number
- *
- * @param number Long number (i.e. 310939249775 = '48656C6C6F')
- * @return ASCII string (i.e. '48656C6C6F' = 'Hello')
- */
+ ///
+ /// Converts number into ASCII string, where each letter is
+ /// represented by two hex digits (byte) from the hex representation
+ /// of the original number
+ ///
+ ///
+ /// Long number (i.e. 310939249775 = '48656C6C6F')
+ ///
+ /// ASCII string (i.e. '48656C6C6F' = 'Hello')
public static String numberToAsciiString(long number) {
return hexString2AsciiString(numberToHexString(number));
}
- /**
- * Converts (long)double number into ASCII string, where each letter is
- * represented by two hex digits (byte) from the hex representation
- * of the original number casted to long type.
- *
- * @param number Double number (i.e. 310939249775 = '48656C6C6F')
- * @return ASCII string (i.e. '48656C6C6F' = 'Hello')
- */
+ ///
+ /// Converts (long)double number into ASCII string, where each letter is
+ /// represented by two hex digits (byte) from the hex representation
+ /// of the original number casted to long type.
+ ///
+ ///
+ /// Double number (i.e. 310939249775 = '48656C6C6F')
+ ///
+ /// ASCII string (i.e. '48656C6C6F' = 'Hello')
public static String numberToAsciiString(double number) {
return hexString2AsciiString(numberToHexString(number));
}
- /**
- * Other base (base between 1 and 36) number literal conversion to decimal number.
- *
- * @param numberLiteral Number literal in given numeral system with base between
- * 1 and 36. Digits: 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7,
- * 8:8, 9:9, 10:A, 11:B, 12:C, 13:D, 14:E, 15:F, 16:G, 17:H,
- * 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O, 25:P, 26:Q, 27:R,
- * 28:S, 29:T, 30:U, 31:V, 32:W, 33:X, 34:Y, 35:Z
- * @param numeralSystemBase Numeral system base, between 1 and 36
- * @return Decimal number after conversion. If conversion was not
- * possible the Double.NaN is returned.
- */
+ /// Other base (base between 1 and 36) number literal conversion to decimal number.
+ ///
+ ///
+ /// Number literal in given numeral system with base between
+ /// 1 and 36. Digits: 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7,
+ /// 8:8, 9:9, 10:A, 11:B, 12:C, 13:D, 14:E, 15:F, 16:G, 17:H,
+ /// 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O, 25:P, 26:Q, 27:R,
+ /// 28:S, 29:T, 30:U, 31:V, 32:W, 33:X, 34:Y, 35:Z
+ ///
+ /// Numeral system base, between 1 and 36
+ ///
+ ///
+ /// Decimal number after conversion. If conversion was not
+ /// possible the is returned.
+ ///
public static double convOthBase2Decimal(String numberLiteral, int numeralSystemBase) {
return NumberTheory.convOthBase2Decimal(numberLiteral, numeralSystemBase);
}
- /**
- * Other base (base between 1 and 36) number literal conversion to decimal number.
- * Base specification included in number literal.
- *
- * Examples: 2 for b2.1001 or b.1001, 1 for b1.111, 23 for b23.123afg
- * 16 for b16.123acdf or h.123acdf.
- *
- * @param numberLiteral Number literal string.
- *
- * Base format: b1. b2. b. b3. b4. b5. b6. b7. b8. o. b9. b10. b11. b12.
- * b13. b14. b15. b16. h. b17. b18. b19. b20. b21. b22. b23. b24. b25. b26.
- * b27. b28. b29. b30. b31. b32. b33. b34. b35. b36.
- *
- * Digits: 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:A, 11:B, 12:C,
- * 13:D, 14:E, 15:F, 16:G, 17:H, 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O, 25:P,
- * 26:Q, 27:R, 28:S, 29:T, 30:U, 31:V, 32:W, 33:X, 34:Y, 35:Z
- *
- * @return Decimal number after conversion. If conversion was not
- * possible the Double.NaN is returned.
- */
+ ///
+ /// Other base (base between 1 and 36) number literal conversion to decimal number.
+ /// Base specification included in number literal.
+ ///
+ ///
+ /// Examples: 2 for b2.1001 or b.1001, 1 for b1.111, 23 for b23.123afg
+ /// 16 for b16.123acdf or h.123acdf.
+ ///
+ ///
+ ///
+ /// Number literal string.
+ ///
+ /// Base format: b1. b2. b. b3. b4. b5. b6. b7. b8. o. b9. b10. b11. b12.
+ /// b13. b14. b15. b16. h. b17. b18. b19. b20. b21. b22. b23. b24. b25. b26.
+ /// b27. b28. b29. b30. b31. b32. b33. b34. b35. b36.
+ ///
+ /// Digits: 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:A, 11:B, 12:C,
+ /// 13:D, 14:E, 15:F, 16:G, 17:H, 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O, 25:P,
+ /// 26:Q, 27:R, 28:S, 29:T, 30:U, 31:V, 32:W, 33:X, 34:Y, 35:Z
+ ///
+ ///
+ ///
+ /// Decimal number after conversion. If conversion was not
+ /// possible the is returned.
+ ///
public static double convOthBase2Decimal(String numberLiteral) {
return NumberTheory.convOthBase2Decimal(numberLiteral);
}
- /**
- * Other base to decimal conversion.
- *
- * @param numeralSystemBase Numeral system base has to be above 0.
- * @param digits List of digits
- * @return Number after conversion. If conversion is not possible then
- * Double.NaN is returned.
- */
+ /// Other base to decimal conversion.
+ ///
+ /// Numeral system base has to be above 0.
+ /// List of digits
+ ///
+ ///
+ /// Number after conversion. If conversion is not possible then
+ /// is returned.
+ ///
public static double convOthBase2Decimal(int numeralSystemBase, params int[] digits) {
return NumberTheory.convOthBase2Decimal(numeralSystemBase, digits);
}
- /**
- * Other base to decimal conversion.
- *
- * @param numeralSystemBase Numeral system base has to be above 0.
- * @param digits List of digits
- * @return Number after conversion. If conversion is not possible then
- * Double.NaN is returned.
- */
+ /// Other base to decimal conversion.
+ ///
+ /// Numeral system base has to be above 0.
+ /// List of digits
+ ///
+ ///
+ /// Number after conversion. If conversion is not possible then
+ /// is returned.
+ ///
public static double convOthBase2Decimal(double numeralSystemBase, params double[] digits) {
return NumberTheory.convOthBase2Decimal(numeralSystemBase, digits);
}
- /**
- * Decimal number to other numeral system conversion with base
- * between 1 and 36.
- *
- * @param decimalNumber Decimal number
- * @param numeralSystemBase Numeral system base between 1 and 36
- * @return Number literal representing decimal number in
- * given numeral numeral system. Digits
- * 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8,
- * 9:9, 10:A, 11:B, 12:C, 13:D, 14:E, 15:F, 16:G,
- * 17:H, 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O,
- * 25:P, 26:Q, 27:R, 28:S, 29:T, 30:U, 31:V, 32:W,
- * 33:X, 34:Y, 35:Z. If conversion was not possible
- * the "NaN" string is returned.
- */
+ ///
+ /// Decimal number to other numeral system conversion with base
+ /// between 1 and 36.
+ ///
+ ///
+ /// Decimal number
+ /// Numeral system base between 1 and 36
+ ///
+ ///
+ /// Number literal representing decimal number in
+ /// given numeral numeral system. Digits
+ /// 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8,
+ /// 9:9, 10:A, 11:B, 12:C, 13:D, 14:E, 15:F, 16:G,
+ /// 17:H, 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O,
+ /// 25:P, 26:Q, 27:R, 28:S, 29:T, 30:U, 31:V, 32:W,
+ /// 33:X, 34:Y, 35:Z. If conversion was not possible
+ /// the "NaN" string is returned.
+ ///
public static String convDecimal2OthBase(double decimalNumber, int numeralSystemBase) {
return NumberTheory.convDecimal2OthBase(decimalNumber, numeralSystemBase);
}
- /**
- * Decimal number to other numeral system conversion with base
- * between 1 and 36.
- *
- * @param decimalNumber Decimal number
- * @param numeralSystemBase Numeral system base between 1 and 36
- * @param format If 1 then always bxx. is used, i.e. b1. or b16.
- * If 2 then for binary b. is used, for octal o. is used,
- * for hexadecimal h. is used, otherwise bxx. is used
- * where xx is the numeral system base specification.
- *
- * @return Number literal representing decimal number in
- * given numeral numeral system.
- *
- * Base format: b1. b2. b. b3. b4. b5. b6. b7. b8. o. b9. b10. b11. b12.
- * b13. b14. b15. b16. h. b17. b18. b19. b20. b21. b22. b23. b24. b25. b26.
- * b27. b28. b29. b30. b31. b32. b33. b34. b35. b36.
- *
- * Digits: 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:A, 11:B, 12:C,
- * 13:D, 14:E, 15:F, 16:G, 17:H, 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O, 25:P,
- * 26:Q, 27:R, 28:S, 29:T, 30:U, 31:V, 32:W, 33:X, 34:Y, 35:Z
- *
- * If conversion was not possible the "NaN" string is returned.
- */
+ ///
+ /// Decimal number to other numeral system conversion with base
+ /// between 1 and 36.
+ ///
+ ///
+ /// Decimal number
+ /// Numeral system base between 1 and 36
+ ///
+ /// If 1 then always bxx. is used, i.e. b1. or b16.
+ /// If 2 then for binary b. is used, for octal o. is used,
+ /// for hexadecimal h. is used, otherwise bxx. is used
+ /// where xx is the numeral system base specification.
+ ///
+ ///
+ ///
+ /// Number literal representing decimal number in
+ /// given numeral numeral system.
+ ///
+ /// Base format: b1. b2. b. b3. b4. b5. b6. b7. b8. o. b9. b10. b11. b12.
+ /// b13. b14. b15. b16. h. b17. b18. b19. b20. b21. b22. b23. b24. b25. b26.
+ /// b27. b28. b29. b30. b31. b32. b33. b34. b35. b36.
+ ///
+ /// Digits: 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:A, 11:B, 12:C,
+ /// 13:D, 14:E, 15:F, 16:G, 17:H, 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O, 25:P,
+ /// 26:Q, 27:R, 28:S, 29:T, 30:U, 31:V, 32:W, 33:X, 34:Y, 35:Z
+ ///
+ /// If conversion was not possible the "NaN" string is returned.
+ ///
public static String convDecimal2OthBase(double decimalNumber, int numeralSystemBase, int format) {
return NumberTheory.convDecimal2OthBase(decimalNumber, numeralSystemBase, format);
}
- /**
- * Converts double value to its fraction representation.
- *
- * @param value Value to be converted
- *
- * @return Array representing fraction. Sign at index 0,
- * numerator at index 1, denominator at index 2.
- * If conversion is not possible then Double.NaN is
- * assigned to all the fields.
- */
+ /// Converts double value to its fraction representation.
+ ///
+ /// @param value Value to be converted
+ ///
+ /// @return Array representing fraction. Sign at index 0,
+ /// numerator at index 1, denominator at index 2.
+ /// If conversion is not possible then Double.NaN is
+ /// assigned to all the fields.
public static double[] toFraction(double value) {
return NumberTheory.toFraction(value);
}
- /**
- * Converts double value to its mixed fraction representation.
- *
- * @param value Value to be converted
- *
- * @return Array representing fraction.
- * Sign at index 0, whole number at index 1,
- * numerator at index 2, denominator at index 3.
- * If conversion is not possible then Double.NaN is
- * assigned to both numerator and denominator.
- */
+ /// Converts double value to its mixed fraction representation.
+ ///
+ /// Value to be converted
+ ///
+ ///
+ /// Array representing fraction.
+ /// Sign at index 0, whole number at index 1,
+ /// numerator at index 2, denominator at index 3.
+ /// If conversion is not possible then is
+ /// assigned to both numerator and denominator.
+ ///
public static double[] toMixedFraction(double value) {
return NumberTheory.toMixedFraction(value);
}
- /**
- * Converts array representing fraction to fraction string representation.
- *
- * @param fraction Array representing fraction (including mix fractions)
- * @return String representation of fraction.
- *
- * @see NumberTheory#toFraction(double)
- * @see NumberTheory#toMixedFraction(double)
- */
+ /// Converts array representing fraction to fraction string representation.
+ ///
+ /// Array representing fraction (including mix fractions)
+ ///
+ /// String representation of fraction.
+ ///
+ ///
+ ///
public static String fractionToString(double[] fraction) {
return NumberTheory.fractionToString(fraction);
}
- /**
- * Converts number to its fraction string representation.
- *
- * @param value Given number
- * @return String representation of fraction.
- *
- * @see NumberTheory#toFraction(double)
- * @see NumberTheory#fractionToString(double[])
- */
+ /// Converts number to its fraction string representation.
+ ///
+ /// Given number
+ ///
+ /// String representation of fraction.
+ ///
+ ///
+ ///
public static String toFractionString(double value) {
return NumberTheory.toFractionString(value);
}
- /**
- * Converts number to its mixed fraction string representation.
- *
- * @param value Given number
- * @return String representation of fraction.
- *
- * @see NumberTheory#toMixedFraction(double)
- * @see NumberTheory#fractionToString(double[])
- */
+ /// Converts number to its mixed fraction string representation.
+ ///
+ /// Given number
+ ///
+ /// String representation of fraction.
+ ///
+ ///
+ ///
public static String toMixedFractionString(double value) {
return NumberTheory.toMixedFractionString(value);
}
@@ -1092,11 +1081,9 @@ private static void consoleWrite(Object o) {
Console.Write(o);
#endif
}
- /**
- * Prints object.toString to the Console + new line
- *
- * @param o Object to print
- */
+ /// Prints to the Console + new line
+ ///
+ /// Object to print
public static void consolePrintln(Object o) {
lock (CONSOLE_OUTPUT) {
if ((CONSOLE_ROW_NUMBER == 1) && (CONSOLE_OUTPUT.Equals(""))) {
@@ -1109,11 +1096,9 @@ public static void consolePrintln(Object o) {
CONSOLE_OUTPUT = CONSOLE_OUTPUT + o + "\n" + CONSOLE_OUTPUT_PREFIX;
}
}
- /**
- * Prints array of strings
- *
- * @param stringArray array of strinfs
- */
+ /// Prints array of strings
+ ///
+ /// array of strinfs
public static void consolePrintln(String[] stringArray) {
if (stringArray == null) {
consolePrintln("null");
@@ -1122,10 +1107,7 @@ public static void consolePrintln(String[] stringArray) {
foreach (String s in stringArray)
consolePrintln(s);
}
- /**
- * Prints new line to the Console, no new line
- *
- */
+ /// Prints new line to the Console, no new line
public static void consolePrintln() {
lock (CONSOLE_OUTPUT) {
if ((CONSOLE_ROW_NUMBER == 1) && (CONSOLE_OUTPUT.Equals(""))) {
@@ -1138,11 +1120,9 @@ public static void consolePrintln() {
CONSOLE_OUTPUT = CONSOLE_OUTPUT + "\n" + CONSOLE_OUTPUT_PREFIX;
}
}
- /**
- * Prints object.toString to the Console, no new line
- *
- * @param o Object to print
- */
+ /// Prints to the Console, no new line
+ ///
+ /// Object to print
public static void consolePrint(Object o) {
lock (CONSOLE_OUTPUT) {
if ((CONSOLE_ROW_NUMBER == 1) && (CONSOLE_OUTPUT.Equals(""))) {
@@ -1153,161 +1133,147 @@ public static void consolePrint(Object o) {
CONSOLE_OUTPUT = CONSOLE_OUTPUT + o;
}
}
- /**
- * Resets console output string, console output
- * string is being built by consolePrintln(), consolePrint().
- *
- * @see mXparser#consolePrint(Object)
- * @see mXparser#consolePrintln(Object)
- * @see mXparser#consolePrintln()
- * @see mXparser#resetConsoleOutput()
- */
+ ///
+ /// Resets console output string, console output
+ /// string is being built by consolePrintln(), consolePrint().
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
public static void resetConsoleOutput() {
lock (CONSOLE_OUTPUT) {
CONSOLE_OUTPUT = "";
CONSOLE_ROW_NUMBER = 1;
}
}
- /**
- * Sets default console prefix.
- */
+ /// Sets default console prefix.
public static void setDefaultConsolePrefix() {
lock (CONSOLE_PREFIX) {
CONSOLE_PREFIX = "[mXparser-v." + VERSION + "] ";
}
}
- /**
- * Sets default console output string prefix.
- */
+ /// Sets default console output string prefix.
public static void setDefaultConsoleOutputPrefix() {
lock (CONSOLE_OUTPUT_PREFIX) {
CONSOLE_OUTPUT_PREFIX = "[mXparser-v." + VERSION + "] ";
}
}
- /**
- * Sets console prefix.
- * @param consolePrefix String containing console prefix definition.
- */
+ /// Sets console prefix.
+ ///
+ /// String containing console prefix definition.
public static void setConsolePrefix(String consolePrefix) {
lock (CONSOLE_PREFIX) {
CONSOLE_PREFIX = consolePrefix;
}
}
- /**
- * Sets console output string prefix.
- * @param consoleOutputPrefix String containing console output prefix definition.
- */
+ /// Sets console output string prefix.
+ ///
+ /// String containing console output prefix definition.
public static void setConsoleOutputPrefix(String consoleOutputPrefix) {
lock (CONSOLE_OUTPUT_PREFIX) {
CONSOLE_OUTPUT_PREFIX = consoleOutputPrefix;
}
}
- /**
- * Returns console output string, console output string
- * is being built by consolePrintln(), consolePrint().
- *
- * @return Console output string
- *
- * @see mXparser#consolePrint(Object)
- * @see mXparser#consolePrintln(Object)
- * @see mXparser#consolePrintln();
- * @see mXparser#resetConsoleOutput();
- */
+ ///
+ /// Returns console output string, console output string
+ /// is being built by , .
+ ///
+ ///
+ /// Console output string
+ ///
+ ///
+ ///
+ ///
+ ///
public static String getConsoleOutput() {
return CONSOLE_OUTPUT;
}
- /**
- * General mXparser expression help
- *
- * @return String with all general help content
- */
+ /// General mXparser expression help
+ ///
+ /// String with all general help content
public static String getHelp() {
lock (mXparserExp) {
return mXparserExp.getHelp();
}
}
- /**
- * General mXparser expression help - in-line key word searching
- * @param word Key word to be searched
- * @return String with all help content
- * lines containing given keyword
- */
+ /// General mXparser expression help - in-line key word searching
+ ///
+ /// Key word to be searched
+ ///
+ ///
+ /// String with all help content
+ /// lines containing given keyword
+ ///
public static String getHelp(String word) {
lock (mXparserExp) {
return mXparserExp.getHelp(word);
}
}
- /**
- * Prints all help content.
- */
+ /// Prints all help content.
public static void consolePrintHelp() {
consoleWriteLine(getHelp());
}
- /**
- * Prints filtered help content.
- * @param word Key word.
- */
+ /// Prints filtered help content.
+ ///
+ /// Key word.
public static void consolePrintHelp(String word) {
consoleWriteLine(getHelp(word));
}
- /**
- * Returns list of key words known to the parser
- *
- * @return List of keywords known to the parser.
- *
- * @see KeyWord
- * @see KeyWord#wordTypeId
- * @see mXparser#getHelp()
- */
+ /// Returns list of key words known to the parser
+ ///
+ /// List of keywords known to the parser.
+ ///
+ ///
+ ///
+ ///
public static List getKeyWords() {
lock (mXparserExp) {
return mXparserExp.getKeyWords();
}
}
- /**
- * Returns list of key words known to the parser
- *
- * @param query Give any string to filter list of key words against this string.
- * User more precise syntax: str=tokenString, desc=tokenDescription,
- * syn=TokenSyntax, sin=tokenSince, wid=wordId, tid=wordTypeId
- * to narrow the result.
- *
- * @return List of keywords known to the parser filter against query string.
- *
- * @see KeyWord
- * @see KeyWord#wordTypeId
- * @see mXparser#getHelp(String)
- */
+ /// Returns list of key words known to the parser
+ ///
+ ///
+ /// Give any string to filter list of key words against this string.
+ /// User more precise syntax: str=tokenString, desc=tokenDescription,
+ /// syn=TokenSyntax, sin=tokenSince, wid=wordId, tid=wordTypeId
+ /// to narrow the result.
+ ///
+ ///
+ /// List of keywords known to the parser filter against query string.
+ ///
+ ///
+ ///
+ ///
public static List getKeyWords(String query) {
lock (mXparserExp) {
return mXparserExp.getKeyWords(query);
}
}
- /**
- * Function used to introduce some compatibility
- * between JAVA and C# while regexp matching.
- *
- * @param str String
- * @param pattern Pattern (regexp)
- *
- * @return True if pattern matches entirely, False otherwise
- */
+ ///
+ /// Function used to introduce some compatibility
+ /// between JAVA and C# while regexp matching.
+ ///
+ ///
+ /// String
+ /// Pattern (regexp)
+ ///
+ /// True if pattern matches entirely, False otherwise
public static bool regexMatch(String str, String pattern){
return Regex.IsMatch(str, "^(" + pattern + ")$");
}
- /**
- * Prints tokens to the console.
- * @param tokens Tokens list.
- *
- * @see Expression#getCopyOfInitialTokens()
- * @see Token
- */
+ /// Prints tokens to the console.
+ ///
+ /// Tokens list.
+ ///
+ ///
+ ///
public static void consolePrintTokens(List tokens) {
Expression.showTokens(tokens);
}
- /**
- * License info.
- */
+ /// License info.
public const String LICENSE =
" mXparser - version " + VERSION + "\n" +
" A flexible mathematical eXpressions parser for C#.\n" +
@@ -1354,19 +1320,15 @@ public static void consolePrintTokens(List tokens) {
" http://mxparser.codeplex.com/\n" +
" http://janetsudoku.mariuszgromada.org/\n"
;
- /**
- * Gets license info
- *
- * @return license info as string.
- */
+ /// Gets license info
+ ///
+ /// license info as string.
public static String getLicense() {
return mXparser.LICENSE;
}
- /**
- * Waits given number of milliseconds
- *
- * @param n Number of milliseconds
- */
+ /// Waits given number of milliseconds
+ ///
+ /// Number of milliseconds
public static void wait(int n) {
long t0, t1;
t0 = DateTime.Now.Millisecond;
@@ -1374,28 +1336,24 @@ public static void wait(int n) {
t1 = DateTime.Now.Millisecond;
} while (t1 - t0 < n);
}
- /**
- * Method give a signal to other methods to cancel current calculation. This is a flag,
- * remember to reset this flag after process is cancelled and you are going to start
- * new calculation process.
- */
+ ///
+ /// Method give a signal to other methods to cancel current calculation. This is a flag,
+ /// remember to reset this flag after process is cancelled and you are going to start
+ /// new calculation process.
+ ///
public static void cancelCurrentCalculation() {
cancelCurrentCalculationFlag = true;
}
- /**
- * Resets a flag giving signal to the engine to cancel current calculation.
- *
- * @see {@link #cancelCurrentCalculation()}
- */
+ /// Resets a flag giving signal to the engine to cancel current calculation.
+ ///
+ ///
public static void resetCancelCurrentCalculationFlag() {
cancelCurrentCalculationFlag = false;
}
- /**
- * Check whether a flag to cancel current calculation process is set.
- *
- * @see {@link #cancelCurrentCalculation()}
- * @see {@link #resetCancelCurrentCalculationFlag()}
- */
+ /// Check whether a flag to cancel current calculation process is set.
+ ///
+ ///
+ ///
public static bool isCurrentCalculationCancelled() {
return cancelCurrentCalculationFlag;
}
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mathcollection/AstronomicalConstants.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mathcollection/AstronomicalConstants.cs
index a7bcf0f8..9c9555d8 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mathcollection/AstronomicalConstants.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mathcollection/AstronomicalConstants.cs
@@ -56,169 +56,99 @@
using System;
namespace org.mariuszgromada.math.mxparser.mathcollection {
- /**
- * AstronomicalConstants - class representing the most important astronomical constants.
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.0.0
- */
+ /// AstronomicalConstants - class representing the most important astronomical constants.
+ ///
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.0.0
+ ///
[CLSCompliant(true)]
public sealed class AstronomicalConstants {
- /**
- * Light year
- */
+ /// Light year
public const double LIGHT_YEAR = PhysicalConstants.LIGHT_SPEED * Units.JULIAN_YEAR;
- /**
- * Astronomical unit
- */
+ /// Astronomical unit
public const double ASTRONOMICAL_UNIT = 149597870700.0 * Units.METRE;
- /**
- * Parsec
- */
+ /// Parsec
public const double PARSEC = 206264.806247096 * ASTRONOMICAL_UNIT;
- /**
- * Kiloparsec
- */
+ /// Kiloparsec
public const double KILOPARSEC = Units.KILO * PARSEC;
- /**
- * Earth equatorial radius
- */
+ /// Earth equatorial radius
public const double EARTH_RADIUS_EQUATORIAL = 6378.1370 * Units.KILOMETRE;
- /**
- * Earth polar radius
- */
+ /// Earth polar radius
public const double EARTH_RADIUS_POLAR = 6356.7523 * Units.KILOMETRE;
- /**
- * Earth mean radius
- */
+ /// Earth mean radius
public const double EARTH_RADIUS_MEAN = 6371.0088 * Units.KILOMETRE;
- /**
- * Earth mass
- */
+ /// Earth mass
public const double EARTH_MASS = 5.9722 * Units.YOTTA * Units.KILOGRAM;
- /**
- * Earth semi-major axis
- */
+ /// Earth semi-major axis
public const double EARTH_SEMI_MAJOR_AXIS = 1.000001018 * ASTRONOMICAL_UNIT;
- /**
- * Moon mean radius
- */
+ /// Moon mean radius
public const double MOON_RADIUS_MEAN = 1737.1 * Units.KILOMETRE;
- /**
- * Moon mass
- */
+ /// Moon mass
public const double MOON_MASS = 0.012300037 * EARTH_MASS;
- /**
- * Moon semi-major axis
- */
+ /// Moon semi-major axis
public const double MONN_SEMI_MAJOR_AXIS = 384399 * Units.KILOMETRE;
- /**
- * Solar radius
- */
+ /// Solar radius
public const double SOLAR_RADIUS = 695700 * Units.KILOMETRE;
- /**
- * Solar mass
- */
+ /// Solar mass
public const double SOLAR_MASS = 332946.0487 * EARTH_MASS;
- /**
- * Mercury radius
- */
+ /// Mercury radius
public const double MERCURY_RADIUS_MEAN = 2439.7 * Units.KILOMETRE;
- /**
- * Mercury mass
- */
+ /// Mercury mass
public const double MERCURY_MASS = 0.0553 * EARTH_MASS;
- /**
- * Mercury semi-major axis
- */
+ /// Mercury semi-major axis
public const double MERCURY_SEMI_MAJOR_AXIS = 0.387098 * ASTRONOMICAL_UNIT;
- /**
- * Venus radius
- */
+ /// Venus radius
public const double VENUS_RADIUS_MEAN = 6051.8 * Units.KILOMETRE;
- /**
- * Venus mass
- */
+ /// Venus mass
public const double VENUS_MASS = 0.815 * EARTH_MASS;
- /**
- * Venus semi-major axis
- */
+ /// Venus semi-major axis
public const double VENUS_SEMI_MAJOR_AXIS = 0.723332 * ASTRONOMICAL_UNIT;
- /**
- * Mars radius
- */
+ /// Mars radius
public const double MARS_RADIUS_MEAN = 3389.5 * Units.KILOMETRE;
- /**
- * Mars mass
- */
+ /// Mars mass
public const double MARS_MASS = 0.107 * EARTH_MASS;
- /**
- * Mars semi-major axis
- */
+ /// Mars semi-major axis
public const double MARS_SEMI_MAJOR_AXIS = 1.523679 * ASTRONOMICAL_UNIT;
- /**
- * Jupiter radius
- */
+ /// Jupiter radius
public const double JUPITER_RADIUS_MEAN = 69911 * Units.KILOMETRE;
- /**
- * Jupiter mass
- */
+ /// Jupiter mass
public const double JUPITER_MASS = 317.8 * EARTH_MASS;
- /**
- * Jupiter semi-major axis
- */
+ /// Jupiter semi-major axis
public const double JUPITER_SEMI_MAJOR_AXIS = 5.20260 * ASTRONOMICAL_UNIT;
- /**
- * Saturn radius
- */
+ /// Saturn radius
public const double SATURN_RADIUS_MEAN = 58232 * Units.KILOMETRE;
- /**
- * Saturn mass
- */
+ /// Saturn mass
public const double SATURN_MASS = 95.159 * EARTH_MASS;
- /**
- * Saturn semi-major axis
- */
+ /// Saturn semi-major axis
public const double SATURN_SEMI_MAJOR_AXIS = 9.5549 * ASTRONOMICAL_UNIT;
- /**
- * Uranus radius
- */
+ /// Uranus radius
public const double URANUS_RADIUS_MEAN = 25362 * Units.KILOMETRE;
- /**
- * Uranus mass
- */
+ /// Uranus mass
public const double URANUS_MASS = 14.536 * EARTH_MASS;
- /**
- * Uranus semi-major axis
- */
+ /// Uranus semi-major axis
public const double URANUS_SEMI_MAJOR_AXIS = 19.2184 * ASTRONOMICAL_UNIT;
- /**
- * Neptune radius
- */
+ /// Neptune radius
public const double NEPTUNE_RADIUS_MEAN = 24622 * Units.KILOMETRE;
- /**
- * Neptune mass
- */
+ /// Neptune mass
public const double NEPTUNE_MASS = 17.147 * EARTH_MASS;
- /**
- * Neptune semi-major axis
- */
+ /// Neptune semi-major axis
public const double NEPTUNE_SEMI_MAJOR_AXIS = 30.110387 * ASTRONOMICAL_UNIT;
}
}
\ No newline at end of file
diff --git a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mathcollection/BinaryRelations.cs b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mathcollection/BinaryRelations.cs
index c93efc0f..d056daec 100644
--- a/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mathcollection/BinaryRelations.cs
+++ b/CURRENT/c-sharp/src/org/mariuszgromada/math/mxparser/mathcollection/BinaryRelations.cs
@@ -56,109 +56,94 @@
using System;
namespace org.mariuszgromada.math.mxparser.mathcollection {
- /**
- * BinaryRelations - class for dealing with binary relations on integers or doubles.
- *
- * @author Mariusz Gromada
- * mariuszgromada.org@gmail.com
- * MathSpace.pl
- * MathParser.org - mXparser project page
- * mXparser on GitHub
- * mXparser on SourceForge
- * mXparser on Bitbucket
- * mXparser on CodePlex
- * Janet Sudoku - project web page
- * Janet Sudoku on GitHub
- * Janet Sudoku on CodePlex
- * Janet Sudoku on SourceForge
- * Janet Sudoku on BitBucket
- * Scalar Free
- * Scalar Pro
- * ScalarMath.org
- *
- * @version 4.1.0
- */
+ /// BinaryRelations - class for dealing with binary relations on integers or doubles.
+ ///
+ ///
+ /// Author: Mariusz Gromada
+ /// mariuszgromada.org@gmail.com
+ /// MathSpace.pl
+ /// MathParser.org - mXparser project page
+ /// mXparser on GitHub
+ /// mXparser on SourceForge
+ /// mXparser on Bitbucket
+ /// mXparser on CodePlex
+ /// Janet Sudoku - project web page
+ /// Janet Sudoku on GitHub
+ /// Janet Sudoku on CodePlex
+ /// Janet Sudoku on SourceForge
+ /// Janet Sudoku on BitBucket
+ /// Scalar Free
+ /// Scalar Pro
+ /// ScalarMath.org
+ ///
+ /// Version: 4.1.0
+ ///
[CLSCompliant(true)]
public sealed class BinaryRelations {
- /**
- * Default epsilon for comparison
- */
+ /// Default epsilon for comparison
public static readonly double DEFAULT_COMPARISON_EPSILON = 0.00000000000001;
- /**
- * Epsilon for comparison
- */
+ /// Epsilon for comparison
internal static double epsilon = DEFAULT_COMPARISON_EPSILON;
- /**
- * COmparison mode indicator
- */
+ /// COmparison mode indicator
internal static bool epsilonComparison = true;
- /**
- * Sets comparison mode to EXACT.
- */
+ /// Sets comparison mode to EXACT.
public static void setExactComparison() {
epsilonComparison = false;
}
- /**
- * Sets comparison mode to EPSILON.
- */
+ /// Sets comparison mode to EPSILON.
public static void setEpsilonComparison() {
epsilonComparison = true;
}
- /**
- * Sets epsilon value.
- * @param epsilon Epsilon value (grater than 0).
- *
- * @see #setEpsilonComparison()
- */
+ /// Sets epsilon value.
+ ///
+ /// Epsilon value (grater than 0).
+ ///
+ ///
public static void setEpsilon(double epsilon) {
if (epsilon > 0) BinaryRelations.epsilon = epsilon;
}
- /**
- * Sets default epsilon value.
- *
- * @see #setEpsilonComparison()
- * @see #DEFAULT_COMPARISON_EPSILON
- */
+ /// Sets default epsilon value.
+ ///
+ ///
+ ///
public static void setDefaultEpsilon() {
BinaryRelations.epsilon = DEFAULT_COMPARISON_EPSILON;
}
- /**
- * Returns current epsilon value.
- * @return Returns current epsilon value.
- *
- * @see #setEpsilonComparison()
- */
+ /// Returns current epsilon value.
+ ///
+ /// Returns current epsilon value.
+ ///
+ ///
public static double getEpsilon() {
return epsilon;
}
- /**
- * Checks if epsilon comparison mode is active;
- * @return True if epsilon mode is active, otherwise returns false.
- * @see #setEpsilonComparison()
- * @see #setExactComparison()
- */
+ /// Checks if epsilon comparison mode is active;
+ ///
+ /// True if epsilon mode is active, otherwise returns false.
+ ///
+ ///
+ ///
public static bool checkIfEpsilonMode() {
return epsilonComparison;
}
- /**
- * Checks if exact comparison mode is active;
- * @return True if exact mode is active, otherwise returns false.
- * @see #setEpsilonComparison()
- * @see #setExactComparison()
- */
+ /// Checks if exact comparison mode is active;
+ /// @return True if exact mode is active, otherwise returns false.
+ ///
+ ///
public static bool checkIfExactMode() {
return !epsilonComparison;
}
- /**
- * Equality relation.
- *
- * @param a the a number (a = b)
- * @param b the b number (a = b)
- *
- * @return if a = Double.NaN or b = Double.NaN return Double.NaN,
- * else if a = b return 1,
- * otherwise return 0.
- */
+ /// Equality relation.
+ ///
+ /// the a number (a = b)
+ /// the b number (a = b)
+ ///
+ ///
+ /// if a = or b =
+ /// return ,
+ /// else if a = b return 1,
+ /// otherwise return 0.
+ ///
public static double eq(double a, double b) {
if ((Double.IsNaN(a)) || (Double.IsNaN(b))) return Double.NaN;
double eps = NumberTheory.max(epsilon, MathFunctions.ulp(b));
@@ -169,16 +154,17 @@ public static double eq(double a, double b) {
} else if (a == b) result = BooleanAlgebra.TRUE;
return result;
}
- /**
- * Inequality relation.
- *
- * @param a the a number (a <> b)
- * @param b the b number (a <> b)
- *
- * @return if a = Double.NaN or b = Double.NaN return Double.NaN,
- * else if a <> b return 1,
- * otherwise return 0.
- */
+ /// Inequality relation.
+ ///
+ /// the a number (a <> b)
+ /// the b number (a <> b)
+ ///
+ ///
+ /// if a = or b =
+ /// return ,
+ /// else if a <> b return 1,
+ /// otherwise return 0.
+ ///
public static double neq(double a, double b) {
if ((Double.IsNaN(a)) || (Double.IsNaN(b))) return Double.NaN;
double eps = NumberTheory.max(epsilon, MathFunctions.ulp(b));
@@ -189,16 +175,17 @@ public static double neq(double a, double b) {
} else if (a != b) result = BooleanAlgebra.TRUE;
return result;
}
- /**
- * Lower than relation.
- *
- * @param a the a number (a < b)
- * @param b the b number (a < b)
- *
- * @return if a = Double.NaN or b = Double.NaN return Double.NaN,
- * else if a < b return 1,
- * otherwise return 0.
- */
+ /// Lower than relation.
+ ///
+ /// the a number (a < b)
+ /// the b number (a < b)
+ ///
+ ///
+ /// if a = or b =
+ /// return ,
+ /// else if a < b return 1,
+ /// otherwise return 0.
+ ///
public static double lt(double a, double b) {
if ((Double.IsNaN(a)) || (Double.IsNaN(b))) return Double.NaN;
double eps = NumberTheory.max(epsilon, MathFunctions.ulp(b));
@@ -209,16 +196,17 @@ public static double lt(double a, double b) {
} else if (a < b) result = BooleanAlgebra.TRUE;
return result;
}
- /**
- * Greater than relation.
- *
- * @param a the a number (a > b)
- * @param b the b number (a > b)
- *
- * @return if a = Double.NaN or b = Double.NaN return Double.NaN,
- * else if a > b return 1,
- * otherwise return 0.
- */
+ /// Greater than relation.
+ ///
+ /// the a number (a > b)
+ /// the b number (a > b)
+ ///
+ ///
+ /// if a = or b =
+ /// return ,
+ /// else if a > b return 1,
+ /// otherwise return 0.
+ ///
public static double gt(double a, double b) {
if ((Double.IsNaN(a)) || (Double.IsNaN(b))) return Double.NaN;
double eps = NumberTheory.max(epsilon, MathFunctions.ulp(b));
@@ -229,16 +217,17 @@ public static double gt(double a, double b) {
} else if (a > b) result = BooleanAlgebra.TRUE;
return result;
}
- /**
- * Lower or equal relation.
- *
- * @param a the a number (a <= b)
- * @param b the b number (a <= b)
- *
- * @return if a = Double.NaN or b = Double.NaN return Double.NaN,
- * else if a <= b return 1,
- * otherwise return 0.
- */
+ /// Lower or equal relation.
+ ///
+ /// the a number (a <= b)
+ /// the b number (a <= b)
+ ///
+ ///
+ /// if a = or b =
+ /// return ,
+ /// else if a <= b return 1,
+ /// otherwise return 0.
+ ///
public static double leq(double a, double b) {
if ((Double.IsNaN(a)) || (Double.IsNaN(b))) return Double.NaN;
double eps = NumberTheory.max(epsilon, MathFunctions.ulp(b));
@@ -249,16 +238,17 @@ public static double leq(double a, double b) {
} else if (a <= b) result = BooleanAlgebra.TRUE;
return result;
}
- /**
- * Greater or equal relation.
- *
- * @param a the a number (a >= b)
- * @param b the b number (a >= b)
- *
- * @return if a = Double.NaN or b = Double.NaN return Double.NaN,
- * else if a >= b return 1,
- * otherwise return 0.
- */
+ /// Greater or equal relation.
+ ///
+ /// the a number (a >= b)
+ /// the b number (a >= b)
+ ///
+ ///
+ /// if a = or b =
+ /// return ,
+ /// else if a >= b return 1,
+ /// otherwise return 0.
+ ///
public static double geq(double a, double b) {
if ((Double.IsNaN(a)) || (Double.IsNaN(b))) return Double.NaN;
double eps = NumberTheory.max(epsilon, MathFunctions.ulp(b));