org.lsmp.djep.vectorJep.function.MSubtract Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jep Show documentation
Show all versions of jep Show documentation
JEP is a Java library for parsing and evaluating mathematical expressions. Use groupId org.fudaa to deploy it in maven central
The newest version!
/* @author rich
* Created on 27-Jul-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.Subtract;
/**
* An extension of the Add command to allow it to add MVector's and Matrix's.
* @author Rich Morris
* Created on 27-Jul-2003
*/
public class MSubtract extends Subtract implements BinaryOperatorI {
public Dimensions calcDim(Dimensions ldim,Dimensions rdim)
{
if(ldim.equals(rdim)) return ldim;
return null;
}
/** calculates the value.
* @param res - results will be stored in this object
* @param lhs - lhs value
* @param rhs - rhs value
* @return res
*/
public MatrixValueI calcValue(MatrixValueI res,MatrixValueI lhs,MatrixValueI rhs) throws ParseException
{
int len = res.getNumEles();
for(int i=0;i