Class MatrixEle

    • Constructor Detail

      • MatrixEle

        public MatrixEle​(MatrixFactoryI mfact,
                         IntegerConvertor conv,
                         boolean javaIndex)
        Element access, either java convention (first element has index 0) or mathematical convention (first element has index 1) can be specified.
        Parameters:
        javaIndex - whether to use the java convention, if true index start at 0.
    • Method Detail

      • ele

        public java.lang.Object ele​(java.lang.Object vec,
                                    java.lang.Object rhs)
                             throws EvaluationException
        Description copied from class: Ele
        Find the element of a vector
        Overrides:
        ele in class Ele
        Parameters:
        vec - the vector
        rhs - the index either as a vector with a single value or as a single value.
        Returns:
        element of vec referred to by the index.
        Throws:
        EvaluationException - if the calculation cannot be performed
      • ele

        public java.lang.Object ele​(java.lang.Object mat,
                                    java.lang.Object row,
                                    java.lang.Object col)
                             throws EvaluationException
        Description copied from class: Ele
        Find the element of a matrix
        Overrides:
        ele in class Ele
        Parameters:
        mat - the matrix represented a a Vector<Vector<Object>>
        row - the index
        col - the index
        Returns:
        element of matrix referred to by row/col
        Throws:
        EvaluationException - if the calculation cannot be performed
      • ele

        public java.lang.Object ele​(java.lang.Object mat,
                                    java.lang.Object[] args)
                             throws EvaluationException
        Description copied from class: Ele
        Find element of a multi-dimensional array
        Overrides:
        ele in class Ele
        Parameters:
        mat - the array
        args - array of indices
        Returns:
        element in mat referred to by indices
        Throws:
        EvaluationException - if the calculation cannot be performed
      • set

        public void set​(Evaluator pv,
                        Node node,
                        java.lang.Object value)
                 throws EvaluationException
        Description copied from interface: LValueI
        Performs appropriate action to set an LValue.
        Specified by:
        set in interface LValueI
        Overrides:
        set in class Ele
        Parameters:
        pv - a pointer to the evaluator. The pv.eval() method can be used to evaluate the children of the node.
        node - The top node for the LValue
        value - the value obtained by evaluating the right hand side.
        Throws:
        EvaluationException - if the calculation cannot be performed
      • calcDims

        public Dimensions calcDims​(Dimensions... inDims)
                            throws ParseException
        Description copied from interface: MatrixFunctionI
        Attempts to calculate the dimensions of a result of a PostfixMathCommand.
        Specified by:
        calcDims in interface MatrixFunctionI
        Parameters:
        inDims - the dimensions of each argument
        Returns:
        the dimension of the result or null if can be calculated
        Throws:
        ParseException - if there is a parse error