Class MrpRes
java.lang.Object
com.singularsys.extensions.fastmatrix.MrpRes
- All Implemented Interfaces:
Serializable
The values returned by the evaluator and the base type for internal types.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract MatrixICopy result to an existing matrixabstract VectorICopy result to an existing vectordoubleIf the result is a scalar return the valueabstract DimensionsThe Dimension of the object.abstract double[][]If the result is a matrix return a two-dimensional array of doubles.abstract double[]If the result is a vector return a one dimensional array of doubles.abstract Double[][]abstract Double[]abstract double[]Create a one dimensional array.
-
Constructor Details
-
MrpRes
public MrpRes()
-
-
Method Details
-
getDimensions
The Dimension of the object. UsegetDimensions().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
- 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
- Throws:
EvaluationException
-
copyToMat
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
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
-