java.lang.Object
com.singularsys.extensions.fastmatrix.MrpRes
All Implemented Interfaces:
Serializable

public abstract class MrpRes extends Object implements Serializable
The values returned by the evaluator and the base type for internal types.
See Also:
  • Constructor Details

    • MrpRes

      public MrpRes()
  • Method Details

    • getDimensions

      public abstract Dimensions getDimensions()
      The Dimension of the object. Use getDimensions().order() to tell if this object represents a scalar (0), vector (1) or matrix (2).
      Returns:
      an object representing the dimensions
    • doubleValue

      public double doubleValue()
      If the result is a scalar return the value
      Returns:
      result of a scalar computation.
    • toArrayMat

      public abstract double[][] toArrayMat()
      If the result is a matrix return a two-dimensional array of doubles. Returns null for vectors and scalars.
      Returns:
      a new matrix
    • toDoubleMat

      public abstract Double[][] toDoubleMat() throws EvaluationException
      Throws:
      EvaluationException
    • toArrayVec

      public abstract double[] toArrayVec()
      If the result is a vector return a one dimensional array of doubles. Returns null for matrices and a single element vector for scalars.
      Returns:
      a new vector
    • toDoubleVec

      public abstract Double[] toDoubleVec() throws EvaluationException
      Throws:
      EvaluationException
    • copyToMat

      public abstract MatrixI copyToMat(MatrixI res) throws EvaluationException
      Copy result to an existing matrix
      Parameters:
      res - the matrix to copy into
      Throws:
      EvaluationException - if the dimensions do not match or result is the wrong type
    • copyToVec

      public abstract VectorI copyToVec(VectorI res) throws EvaluationException
      Copy result to an existing vector
      Parameters:
      res - the vector to copy into
      Throws:
      EvaluationException - if the dimensions do not match or result is the wrong type
    • toFlattenedArray

      public abstract double[] toFlattenedArray()
      Create a one dimensional array. Scalar values will give an array with a single element, vector arguments give an array of the same length, matrix arguments return elements in row major order.
      Returns:
      a new one dimensional array
      Since:
      Jep 4.0/Extensions 2.1