org.lsmp.djep.vectorJep.function
Class MSubtract

java.lang.Object
  extended byorg.nfunk.jep.function.PostfixMathCommand
      extended byorg.nfunk.jep.function.Subtract
          extended byorg.lsmp.djep.vectorJep.function.MSubtract
All Implemented Interfaces:
BinaryOperatorI, PostfixMathCommandI

public class MSubtract
extends Subtract
implements BinaryOperatorI

An extension of the Add command to allow it to add MVector's and Matrix's.

Author:
Rich Morris Created on 27-Jul-2003

Field Summary
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
MSubtract()
           
 
Method Summary
 Dimensions calcDim(Dimensions ldim, Dimensions rdim)
          Find the dimensions of this operator when applied to arguments with given dimensions.
 MatrixValueI calcValue(MatrixValueI res, MatrixValueI lhs, MatrixValueI rhs)
          calculates the value.
 Matrix sub(Matrix lhs, Matrix rhs)
          Adds two matricies.
 MVector sub(MVector lhs, MVector rhs)
          Adds two vectors.
 java.lang.Object sub(java.lang.Object param1, java.lang.Object param2)
          Adds two objects.
 Tensor sub(Tensor lhs, Tensor rhs)
          Adds two matricies.
 
Methods inherited from class org.nfunk.jep.function.Subtract
run, sub, sub, sub, sub
 
Methods inherited from class org.nfunk.jep.function.PostfixMathCommand
checkStack, getNumberOfParameters, setCurNumberOfParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nfunk.jep.function.PostfixMathCommandI
getNumberOfParameters, run, setCurNumberOfParameters
 

Constructor Detail

MSubtract

public MSubtract()
Method Detail

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
calculates the value.

Specified by:
calcValue in interface BinaryOperatorI
Parameters:
res - - results will be stored in this object
lhs - - lhs value
rhs - - rhs value
Returns:
res
Throws:
ParseException

sub

public java.lang.Object sub(java.lang.Object param1,
                            java.lang.Object param2)
                     throws ParseException
Adds two objects.

Overrides:
sub in class Subtract
Throws:
ParseException

sub

public MVector sub(MVector lhs,
                   MVector rhs)
            throws ParseException
Adds two vectors.

Throws:
ParseException

sub

public Matrix sub(Matrix lhs,
                  Matrix rhs)
           throws ParseException
Adds two matricies.

Throws:
ParseException

sub

public Tensor sub(Tensor lhs,
                  Tensor rhs)
           throws ParseException
Adds two matricies.

Throws:
ParseException


http://www.singularsys.com/jep Copyright © 2004 Singular Systems