public class Ele extends PostfixMathCommand implements BinaryOperatorI
a = [1,2,3,4];
ele(a,1); // returns 1
m = [[1,2],[3,4]];
ele(m,[2,2]); // return 4
New parser feature allow a[] notation to be used.
a=[1,2,3,4];
a[3]; // returns 3
b=[[1,2],[3,4]];
b[1,2]; // returns 2
Constructor and Description |
---|
Ele() |
Modifier and Type | Method and Description |
---|---|
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(Stack stack)
Throws an exception because this method should never be called under
normal circumstances.
|
checkNumberOfParameters, getNumberOfParameters, setCurNumberOfParameters
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkNumberOfParameters, getNumberOfParameters, setCurNumberOfParameters
public Dimensions calcDim(Dimensions ldim, Dimensions rdim) throws ParseException
BinaryOperatorI
calcDim
in interface BinaryOperatorI
ParseException
public MatrixValueI calcValue(MatrixValueI res, MatrixValueI param1, MatrixValueI param2) throws ParseException
BinaryOperatorI
calcValue
in interface BinaryOperatorI
ParseException
public void run(Stack stack) throws ParseException
PostfixMathCommand
run
in interface PostfixMathCommandI
run
in class PostfixMathCommand
ParseException
Jas4pp 1.5 © Java Analysis Studio for Particle Physics