org.lsmp.djep.vectorJep.function
Class ElementComparative
java.lang.Object
org.nfunk.jep.function.PostfixMathCommand
org.nfunk.jep.function.Comparative
org.lsmp.djep.vectorJep.function.ElementComparative
- All Implemented Interfaces:
- BinaryOperatorI, PostfixMathCommandI
public class ElementComparative
- extends Comparative
- implements BinaryOperatorI
Multiplies any number of Vectors or Matrices element by element.
TODO could be much more efficient when called through run.
- Author:
- Rich Morris
Created on 10-Dec-2004
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ElementComparative
public ElementComparative(int index)
calcDim
public Dimensions calcDim(Dimensions ldim,
Dimensions rdim)
- Description copied from interface:
BinaryOperatorI
- Find the dimensions of this operator when applied to arguments with given dimensions.
- Specified by:
calcDim
in interface BinaryOperatorI
calcValue
public MatrixValueI calcValue(MatrixValueI res,
MatrixValueI lhs,
MatrixValueI rhs)
throws ParseException
- Multiply the inputs element by element putting the results in res.
- Specified by:
calcValue
in interface BinaryOperatorI
- Throws:
ParseException
run
public void run(java.util.Stack inStack)
throws ParseException
- Description copied from class:
PostfixMathCommand
- Throws an exception because this method should never be called under
normal circumstances. Each function should use it's own run() method
for evaluating the function. This includes popping off the parameters
from the stack, and pushing the result back on the stack.
- Specified by:
run
in interface PostfixMathCommandI
- Overrides:
run
in class Comparative
- Throws:
ParseException
http://www.singularsys.com/jep Copyright © 2007 Singular Systems