Class MatrixEle
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryFunction
com.singularsys.jep.functions.Ele
com.singularsys.extensions.matrix.functions.MatrixEle
- All Implemented Interfaces:
MatrixFunctionI,SymbolicLValueI,LValueI,PostfixMathCommandI,Serializable
Gets and sets the elements of a matrix or vector using a MatrixFactory.
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.functions.Ele
indexShiftFields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
ConstructorsConstructorDescriptionMatrixEle(MatrixFactoryI mfact, IntegerConvertor conv) MatrixEle(MatrixFactoryI mfact, IntegerConvertor conv, boolean javaIndex) Element access, either java convention (first element has an index 0) or mathematical convention (first element has an index 1) can be specified. -
Method Summary
Modifier and TypeMethodDescriptioncalcDims(Dimensions... inDims) Attempts to calculate the dimensions of a result of a PostfixMathCommand.Find the element of a vectorFind element of a multi-dimensional arrayFind the element of a matrixvoidSets an element of an vector valued variable.voidSets the equation of an LValueMethods inherited from class com.singularsys.jep.functions.Ele
checkNumberOfParameters, ele, eval, findIndex, getVariableMethods inherited from class com.singularsys.jep.functions.NaryFunction
runMethods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Constructor Details
-
MatrixEle
-
MatrixEle
Element access, either java convention (first element has an index 0) or mathematical convention (first element has an index 1) can be specified.- Parameters:
javaIndex- whether to use the java convention, if true index start at 0.
-
-
Method Details
-
ele
Description copied from class:EleFind the element of a vector- Overrides:
elein classEle- Parameters:
vec- the vectorrhs- the index either as a vector with a single value or as a single value.- Returns:
- element of vec referred to by the index.
- Throws:
EvaluationException- if the calculation cannot be performed
-
ele
Description copied from class:EleFind the element of a matrix- Overrides:
elein classEle- Parameters:
mat- the matrix represented a Vector<Vector<Object>>row- the indexcol- the index- Returns:
- element of matrix referred to by row/col
- Throws:
EvaluationException- if the calculation cannot be performed
-
ele
Description copied from class:EleFind element of a multi-dimensional array- Overrides:
elein classEle- Parameters:
mat- the arrayargs- array of indices- Returns:
- element in mat referred to by indices
- Throws:
EvaluationException- if the calculation cannot be performed
-
set
Description copied from class:EleSets an element of an vector valued variable. For the expressionu[2] = 5the left hand node is ASTOpNode for the Ele pfmc the method will be called likeset(pv,lhs,5);The value of the variable will be replaced by a newVector<Object>with the appropriate element replaced.- Specified by:
setin interfaceLValueI- Overrides:
setin classEle- Parameters:
pv- a pointer to the evaluator. The pv.eval() method can be used to evaluate the children of the node.node- The top node for the LValue, root should be the ASTOpNode for the Ele pfmc.value- the value obtained by evaluating the right-hand side.- Throws:
EvaluationException- if the calculation cannot be performed
-
calcDims
Description copied from interface:MatrixFunctionIAttempts to calculate the dimensions of a result of a PostfixMathCommand.- Specified by:
calcDimsin interfaceMatrixFunctionI- Parameters:
inDims- the dimensions of each argument- Returns:
- the dimension of the result, or null, if it cannot be calculated
- Throws:
ParseException- if there is a parse error
-
setEqn
Description copied from interface:SymbolicLValueISets the equation of an LValue- Specified by:
setEqnin interfaceSymbolicLValueI- Parameters:
xjep- Jep instancenode- an LValue whose equation can be seteqn- the expression the set in to- Throws:
ParseException
-