Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lsmp > djep > vectorJep > function > VList

 `1 /*****************************************************************************2 3 JEP - Java Math Expression Parser 2.3.04       October 3 20045       (c) Copyright 2004, Nathan Funk and Richard Morris6       See LICENSE.txt for license information.7 8 *****************************************************************************/9 10 package org.lsmp.djep.vectorJep.function;11 12 import java.util.*;13 import org.nfunk.jep.*;14 import org.lsmp.djep.vectorJep.Dimensions;15 import org.lsmp.djep.vectorJep.values.*;16 17 /**18  * A enhanced version of List, allows matricies and tensors.19  * 20  * @author Rich Morris21  * Created on 27-Nov-200322  */23 public class VList extends org.nfunk.jep.function.List 24     implements NaryOperatorI25 {26     public VList()27     {28         numberOfParameters = -1;29     }30 31     /** Calculates the dimension of this node with given dimesions of children. */32     public Dimensions calcDim(Dimensions dims[]) throws ParseException33     {34         return Dimensions.valueOf(dims.length,dims[0]);35     }36     37     /** Calculates the value of this node.38      * 39      */40     public MatrixValueI calcValue(MatrixValueI res,41         MatrixValueI inputs[]) throws ParseException42     {43         int eleSize = inputs[0].getNumEles();44         for(int i=0;i=0;--i)70             {71                 Vector vec = (Vector) inStack.pop();72                 for(int j=0;j=0;--i)87             {88                 MatrixValueI mat = (MatrixValueI) inStack.pop();89                 for(int j=0;j=0;--i)100             {101                 Object param = inStack.pop();102                 res.setEle(i,param);103             }104             inStack.push(res);105             return;106         }107     }108 }109 ` Popular Tags