Interface MatrixFactoryI
- All Superinterfaces:
JepComponent,Serializable
- All Known Implementing Classes:
ComplexMatrixFactory,DoubleMatrixFactory,ExternalMatrixFactory,GenericMatrixFactory,ObjectMatrixFactory,RationalMatrixFactory,SequenceMatrixFactory
Defines basic methods for constructing matrices.
- Since:
- Jep 3.5 / Extensions 2.0
- Author:
- Richard Morris
-
Method Summary
Modifier and TypeMethodDescriptiondefault MatrixIReturn a copy of the matrix.default VectorIReturn a copy of the vector.Converts the argument to the type of elements of the matrixidentity(int size) Create a square identity matrixidentity(int rows, int cols) Create an identity matrix.Create a new MatrixI using the given dataCreate a new VectorI using the given datadefault VectorInewVector(Collection<?> set) Create a new VectorI from a collection.zeroMat(int rows, int cols) Create an zero matrix.zeroMat(Dimensions dimensions) Create a matrix with zero elementszeroVec(int size) Create a vector with zerosdefault VectorIzeroVec(Dimensions dimensions) Create a vector with zerosMethods inherited from interface com.singularsys.jep.JepComponent
getLightWeightInstance, init
-
Method Details
-
elementValue
Converts the argument to the type of elements of the matrix- Parameters:
o-- Returns:
- the element value or null if it cannot be converted
- Throws:
EvaluationException
-
newVector
Create a new VectorI using the given data- Parameters:
data-- Returns:
- a new VectorI the precise type depends on the implementing class
- Throws:
EvaluationException
-
newVector
Create a new VectorI from a collection. Default implementation simple callsnewVector(set.toArray()). Implementing classes can override this method to provide more efficient implementations.- Parameters:
set- any collection including Lists.- Returns:
- a new vector
- Throws:
EvaluationException
-
newMatrix
Create a new MatrixI using the given data- Parameters:
data-- Returns:
- a new MatrixI the precise type depends on the implementing class
- Throws:
EvaluationException
-
identity
Create a square identity matrix- Parameters:
size- size- Returns:
- a size by size identity matrix
- Throws:
EvaluationException
-
identity
Create an identity matrix.- Parameters:
rows-cols-- Returns:
- a
rowsbycolsidentity matrix - Throws:
EvaluationException
-
zeroMat
Create an zero matrix.- Parameters:
rows-cols-- Returns:
- a rows by cols matrix
- Throws:
EvaluationException
-
zeroVec
Create a vector with zeros- Parameters:
size-- Returns:
- a vector of zeros
- Throws:
EvaluationException
-
zeroMat
Create a matrix with zero elements- Parameters:
dimensions- dimensions specifying the size of a matrix.- Returns:
- a matrix filled with zeros
- Throws:
EvaluationException- if the dimensions are not of order 2
-
zeroVec
Create a vector with zeros- Parameters:
dimensions- size of vector- Returns:
- a vector filled with zeros
- Throws:
EvaluationException- if the dimensions are not 1 dimensional- Since:
- Jep 4.0/Extensions 2.0
-
duplicate
Return a copy of the matrix. Default implementation is a little inefficient creating a temporary data array.- Parameters:
mat- matrix to copy- Returns:
- a copy
- Throws:
EvaluationException
-
duplicate
Return a copy of the vector. Default implementation is a little inefficient.- Parameters:
l- vector to copy- Returns:
- a copy
- Throws:
EvaluationException
-