Class DoubleMatrixFactory
- java.lang.Object
-
- com.singularsys.extensions.matrix.doublemat.DoubleMatrixFactory
-
- All Implemented Interfaces:
MatrixFactoryI,JepComponent,java.io.Serializable
public class DoubleMatrixFactory extends java.lang.Object implements MatrixFactoryI
A factory for creatingDoubleMatrixandDoubleVector- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DoubleMatrixFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.DoubleelementValue(java.lang.Object o)Converts the argument to the type of elements of the matrixJepComponentgetLightWeightInstance()Returns thisMatrixIidentity(int size)Create an square identity matrixMatrixIidentity(int rows, int cols)Create an identity matrix.voidinit(Jep jep)Initialize the component.DoubleMatrixnewMatrix(double[][] data)MatrixInewMatrix(java.lang.Object[][] data)Create a new MatrixI using the given dataDoubleVectornewVector(double[] data)VectorInewVector(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 zeros-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.singularsys.extensions.matrix.MatrixFactoryI
zeroVec
-
-
-
-
Method Detail
-
newMatrix
public DoubleMatrix newMatrix(double[][] data)
-
newVector
public DoubleVector newVector(double[] data)
-
newMatrix
public MatrixI newMatrix(java.lang.Object[][] data) throws EvaluationException
Description copied from interface:MatrixFactoryICreate a new MatrixI using the given data- Specified by:
newMatrixin interfaceMatrixFactoryI- Returns:
- a new MatrixI the precise type depends on the implementing class
- Throws:
EvaluationException
-
newVector
public VectorI newVector(java.lang.Object... data) throws EvaluationException
Description copied from interface:MatrixFactoryICreate a new VectorI using the given data- Specified by:
newVectorin interfaceMatrixFactoryI- Returns:
- a new VectorI the precise type depends on the implementing class
- Throws:
EvaluationException
-
elementValue
public java.lang.Double elementValue(java.lang.Object o)
Description copied from interface:MatrixFactoryIConverts the argument to the type of elements of the matrix- Specified by:
elementValuein interfaceMatrixFactoryI- Returns:
- the element value or null if it cannot be converted
-
identity
public MatrixI identity(int size)
Description copied from interface:MatrixFactoryICreate an square identity matrix- Specified by:
identityin interfaceMatrixFactoryI- Parameters:
size- size- Returns:
- a size by size identity matrix
-
identity
public MatrixI identity(int rows, int cols)
Description copied from interface:MatrixFactoryICreate an identity matrix.- Specified by:
identityin interfaceMatrixFactoryI- Returns:
- a rows by cols identity matrix
-
zeroVec
public VectorI zeroVec(int size)
Description copied from interface:MatrixFactoryICreate a vector with zeros- Specified by:
zeroVecin interfaceMatrixFactoryI- Returns:
- a vector of zeros
-
zeroMat
public MatrixI zeroMat(int rows, int cols)
Description copied from interface:MatrixFactoryICreate an zero matrix.- Specified by:
zeroMatin interfaceMatrixFactoryI- Returns:
- a rows by cols matrix
-
zeroMat
public MatrixI zeroMat(Dimensions dimensions) throws EvaluationException
Description copied from interface:MatrixFactoryICreate a matrix with zero elements- Specified by:
zeroMatin interfaceMatrixFactoryI- 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
-
init
public void init(Jep jep)
Description copied from interface:JepComponentInitialize the component. This methods is called whenever a component is added to Jep. Hence it allows components to keep track of the other components they may rely on.- Specified by:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
public JepComponent getLightWeightInstance()
Returns this- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either an new instance, null or 'this'.
-
-