org.lsmp.djep.vectorJep.function
Class Ele

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

public class Ele
extends PostfixMathCommand
implements BinaryOperatorI

ele(x,i) returns the i-th element of x.

Author:
Rich Morris Created on 15-Nov-2003

Field Summary
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
Ele()
           
 
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 param1, MatrixValueI param2)
          Calculates the value of this operator for given input with results stored in res.
 void run(java.util.Stack stack)
          Run the function on the stack.
 
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

Ele

public Ele()
Method Detail

calcDim

public Dimensions calcDim(Dimensions ldim,
                          Dimensions rdim)
                   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

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 PostfixMathCommand
Throws:
ParseException


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