Interface MatrixFactoryI
-
- All Superinterfaces:
JepComponent,java.io.Serializable
- All Known Implementing Classes:
ComplexMatrixFactory,DoubleMatrixFactory,GenericMatrixFactory,ObjectMatrixFactory,RationalMatrixFactory,SequenceMatrixFactory
public interface MatrixFactoryI extends JepComponent
Defines basic methods for constructing matrices.- Since:
- Jep 3.5 / Extensions 2.0
- Author:
- Richard Morris
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.ObjectelementValue(java.lang.Object o)Converts the argument to the type of elements of the matrixMatrixIidentity(int size)Create an square identity matrixMatrixIidentity(int rows, int cols)Create an identity matrix.MatrixInewMatrix(java.lang.Object[][] data)Create a new MatrixI using the given dataVectorInewVector(java.lang.Object... data)Create a new VectorI using the given dataMatrixIzeroMat(int rows, int cols)Create an zero matrix.MatrixIzeroMat(Dimensions dimensions)Create a matrix with zero elementsVectorIzeroVec(int size)Create a vector with zerosdefault VectorIzeroVec(Dimensions dimensions)Create a vector with zeros-
Methods inherited from interface com.singularsys.jep.JepComponent
getLightWeightInstance, init
-
-
-
-
Method Detail
-
elementValue
java.lang.Object elementValue(java.lang.Object o) throws EvaluationExceptionConverts 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
VectorI newVector(java.lang.Object... data) throws EvaluationException
Create a new VectorI using the given data- Parameters:
data-- Returns:
- a new VectorI the precise type depends on the implementing class
- Throws:
EvaluationException
-
newMatrix
MatrixI newMatrix(java.lang.Object[][] data) throws EvaluationException
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
MatrixI identity(int size) throws EvaluationException
Create an square identity matrix- Parameters:
size- size- Returns:
- a size by size identity matrix
- Throws:
EvaluationException
-
identity
MatrixI identity(int rows, int cols) throws EvaluationException
Create an identity matrix.- Parameters:
rows-cols-- Returns:
- a rows by cols identity matrix
- Throws:
EvaluationException
-
zeroMat
MatrixI zeroMat(int rows, int cols) throws EvaluationException
Create an zero matrix.- Parameters:
rows-cols-- Returns:
- a rows by cols matrix
- Throws:
EvaluationException
-
zeroVec
VectorI zeroVec(int size) throws EvaluationException
Create a vector with zeros- Parameters:
size-- Returns:
- a vector of zeros
- Throws:
EvaluationException
-
zeroMat
MatrixI zeroMat(Dimensions dimensions) throws EvaluationException
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
default VectorI zeroVec(Dimensions dimensions) throws EvaluationException
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
-
-