org.lsmp.djep.vectorJep.function
Class MMultiply

java.lang.Object
  extended byorg.nfunk.jep.function.PostfixMathCommand
      extended byorg.nfunk.jep.function.Multiply
          extended byorg.lsmp.djep.vectorJep.function.MMultiply
All Implemented Interfaces:
BinaryOperatorI, PostfixMathCommandI
Direct Known Subclasses:
MDot

public class MMultiply
extends Multiply
implements BinaryOperatorI

An extension of the Multiply to with vectors and matricies. Must faster (1/3) if used with MatrixJep and calcValue routines. Note vector * vector treated as col_vec * row_vec -> matrix.

Since:
2.3.2 Improved error reporting
Author:
Rich Morris Created on 27-Jul-2003 TODO add handeling of tensors

Field Summary
protected  Add add
           
protected  Subtract sub
           
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
MMultiply()
           
 
Method Summary
 Dimensions calcDim(Dimensions l, Dimensions r)
          Find the dimensions of this operator when applied to arguments with given dimensions.
 MatrixValueI calcValue(MatrixValueI res, MatrixValueI param1, MatrixValueI param2)
          Calculates the value of this operator for given input with results stored in res.
 java.lang.Object mul(MatrixValueI param1, MatrixValueI param2)
          Multiply two objects.
 java.lang.Object mul(java.lang.Object param1, java.lang.Object param2)
          Multiply two objects.
 void run(java.util.Stack stack)
          need to redo this as the standard jep version assumes commutivity.
 
Methods inherited from class org.nfunk.jep.function.Multiply
mul, mul, mul, mul, mul
 
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, setCurNumberOfParameters
 

Field Detail

add

protected Add add

sub

protected Subtract sub
Constructor Detail

MMultiply

public MMultiply()
Method Detail

run

public void run(java.util.Stack stack)
         throws ParseException
need to redo this as the standard jep version assumes commutivity.

Specified by:
run in interface PostfixMathCommandI
Overrides:
run in class Multiply
Throws:
ParseException

mul

public java.lang.Object mul(java.lang.Object param1,
                            java.lang.Object param2)
                     throws ParseException
Multiply two objects.

Overrides:
mul in class Multiply
Throws:
ParseException

mul

public java.lang.Object mul(MatrixValueI param1,
                            MatrixValueI param2)
                     throws ParseException
Multiply two objects.

Throws:
ParseException

calcDim

public Dimensions calcDim(Dimensions l,
                          Dimensions r)
                   throws ParseException
Description copied from interface: BinaryOperatorI
Find the dimensions of this operator when applied to arguments with given dimensions.

Specified by:
calcDim in interface BinaryOperatorI
Throws:
ParseException

calcValue

public MatrixValueI calcValue(MatrixValueI res,
                              MatrixValueI param1,
                              MatrixValueI param2)
                       throws ParseException
Description copied from interface: BinaryOperatorI
Calculates the value of this operator for given input with results stored in res. res is returned. Using this method is slightly faster than the standard run method as it eliminates the construction of tempoary objects.

Specified by:
calcValue in interface BinaryOperatorI
Throws:
ParseException


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