All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lsmp.djep.vectorJep.function.MUMinus Maven / Gradle / Ivy

Go to download

JEP is a Java library for parsing and evaluating mathematical expressions.

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.UMinus;
/**
 * Unitary minus for matrices.
 * @author Rich Morris
 * Created on 27-Jul-2003
 */
public class MUMinus extends UMinus implements UnaryOperatorI {

	public Dimensions calcDim(Dimensions ldim)
	{
		return ldim;
	}

	/** calculates the value.
	 * @param res - results will be stored in this object
	 * @param lhs - the value to be negated
	 * @return res
	 */
	public MatrixValueI calcValue(MatrixValueI res,MatrixValueI lhs) throws ParseException
	{
		int len = res.getNumEles();
		for(int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy