Class MrpRes
- java.lang.Object
-
- com.singularsys.extensions.fastmatrix.MrpRes
-
- All Implemented Interfaces:
java.io.Serializable
public abstract class MrpRes extends java.lang.Object implements java.io.Serializable
The values returned by the evaluator and the base type for internal types.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MrpRes()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract MatrixI
copyToMat(MatrixI res)
Copy result to an existing matrixabstract VectorI
copyToVec(VectorI res)
Copy result to an existing vectordouble
doubleValue()
If the result is a scaler return the valueabstract Dimensions
getDimensions()
The Dimension of the object.abstract double[][]
toArrayMat()
If the result is a matrix return a two dimensional array of doubles.abstract double[]
toArrayVec()
If the result is a vector return a one dimensional array of doubles.abstract java.lang.Double[][]
toDoubleMat()
abstract java.lang.Double[]
toDoubleVec()
abstract double[]
toFlatternedArray()
Create a one dimensional array.
-
-
-
Method Detail
-
getDimensions
public abstract Dimensions getDimensions()
The Dimension of the object. UsegetDimensions().order()
to tell if this object represents a scaler (0), vector (1) or matrix (2).- Returns:
- an object representing the dimensions
-
doubleValue
public double doubleValue()
If the result is a scaler return the value- Returns:
- result of a scaler computation.
-
toArrayMat
public abstract double[][] toArrayMat()
If the result is a matrix return a two dimensional array of doubles. Returns null for vectors and scalers.- Returns:
- a new matrix
-
toDoubleMat
public abstract java.lang.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 scalers.- Returns:
- a new vector
-
toDoubleVec
public abstract java.lang.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
-
toFlatternedArray
public abstract double[] toFlatternedArray()
Create a one dimensional array. Scaler values will give an 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
-
-