org.lsmp.djep.vectorJep.function
Class MDot

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

public class MDot
extends MMultiply
implements BinaryOperatorI

The MDot operator.

Author:
Rich Morris Created on 23-Feb-2004

Field Summary
 
Fields inherited from class org.lsmp.djep.vectorJep.function.MMultiply
add, sub
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
MDot()
           
 
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 lhs, MatrixValueI rhs)
          calculates the value.
 Scaler calcValue(Scaler res, MVector lhs, MVector rhs)
           
 java.lang.Object dot(MVector lhs, MVector rhs)
          returns lhs . rhs
 java.lang.Object dot(java.lang.Object param1, java.lang.Object param2)
          returns param1 . param2.
 void run(java.util.Stack stack)
          Run the function on the stack.
 
Methods inherited from class org.lsmp.djep.vectorJep.function.MMultiply
mul, mul
 
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
 

Constructor Detail

MDot

public MDot()
Method Detail

calcDim

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

Specified by:
calcDim in interface BinaryOperatorI
Overrides:
calcDim in class MMultiply

calcValue

public MatrixValueI calcValue(MatrixValueI res,
                              MatrixValueI lhs,
                              MatrixValueI rhs)
                       throws ParseException
calculates the value.

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

calcValue

public Scaler calcValue(Scaler res,
                        MVector lhs,
                        MVector rhs)
                 throws ParseException
Throws:
ParseException

run

public void run(java.util.Stack stack)
         throws ParseException
Description copied from interface: PostfixMathCommandI
Run the function on the stack. Pops the arguments from the stack, and pushes the result on the top of the stack.

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

dot

public java.lang.Object dot(java.lang.Object param1,
                            java.lang.Object param2)
                     throws ParseException
returns param1 . param2. Defaults to scaler mult if parameters are not vectors.

Throws:
ParseException

dot

public java.lang.Object dot(MVector lhs,
                            MVector rhs)
                     throws ParseException
returns lhs . rhs

Throws:
ParseException


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