1 8 package org.lsmp.djep.matrixJep; 9 import org.lsmp.djep.matrixJep.function.*; 10 import org.lsmp.djep.vectorJep.function.*; 11 import org.nfunk.jep.*; 12 import org.lsmp.djep.xjep.*; 13 19 public class MatrixOperatorSet extends XOperatorSet { 20 protected Operator TENSOR = new XOperator("TENSOR",new MList(),XOperator.NARY); 21 public Operator getMList() { return TENSOR; } 22 23 public MatrixOperatorSet() { 24 super(); 25 OP_ADD.setPFMC(new MAdd()); 26 OP_SUBTRACT.setPFMC(new MSubtract()); 27 OP_MULTIPLY.setPFMC(new MMultiply()); 29 OP_POWER.setPFMC(new MPower()); 30 OP_UMINUS.setPFMC(new MUMinus()); 31 OP_DOT.setPFMC(new MDot()); 32 OP_CROSS= new XOperator("^^","^",new ExteriorProduct(),XOperator.BINARY+XOperator.RIGHT,((XOperator) OP_CROSS).getPrecedence()); 34 OP_ASSIGN.setPFMC(new MAssign()); 36 } 37 38 public Operator[] getOperators() 39 { 40 Operator ops1[] = super.getOperators(); 41 Operator ops2[] = new Operator[ops1.length+1]; 42 System.arraycopy(ops1,0,ops2,0,ops1.length); 43 ops2[ops1.length]= TENSOR; 44 return ops2; 45 } 46 } 47 | Popular Tags |