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 creatingDoubleMatrix
andDoubleVector
- 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.Double
elementValue(java.lang.Object o)
Converts the argument to the type of elements of the matrixJepComponent
getLightWeightInstance()
Returns thisMatrixI
identity(int size)
Create an square identity matrixMatrixI
identity(int rows, int cols)
Create an identity matrix.void
init(Jep jep)
Initialize the component.DoubleMatrix
newMatrix(double[][] data)
MatrixI
newMatrix(java.lang.Object[][] data)
Create a new MatrixI using the given dataDoubleVector
newVector(double[] data)
VectorI
newVector(java.lang.Object... data)
Create a new VectorI using the given dataMatrixI
zeroMat(int rows, int cols)
Create an zero matrix.MatrixI
zeroMat(Dimensions dimensions)
Create a matrix with zero elementsVectorI
zeroVec(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:MatrixFactoryI
Create a new MatrixI using the given data- Specified by:
newMatrix
in 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:MatrixFactoryI
Create a new VectorI using the given data- Specified by:
newVector
in 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:MatrixFactoryI
Converts the argument to the type of elements of the matrix- Specified by:
elementValue
in interfaceMatrixFactoryI
- Returns:
- the element value or null if it cannot be converted
-
identity
public MatrixI identity(int size)
Description copied from interface:MatrixFactoryI
Create an square identity matrix- Specified by:
identity
in interfaceMatrixFactoryI
- Parameters:
size
- size- Returns:
- a size by size identity matrix
-
identity
public MatrixI identity(int rows, int cols)
Description copied from interface:MatrixFactoryI
Create an identity matrix.- Specified by:
identity
in interfaceMatrixFactoryI
- Returns:
- a rows by cols identity matrix
-
zeroVec
public VectorI zeroVec(int size)
Description copied from interface:MatrixFactoryI
Create a vector with zeros- Specified by:
zeroVec
in interfaceMatrixFactoryI
- Returns:
- a vector of zeros
-
zeroMat
public MatrixI zeroMat(int rows, int cols)
Description copied from interface:MatrixFactoryI
Create an zero matrix.- Specified by:
zeroMat
in interfaceMatrixFactoryI
- Returns:
- a rows by cols matrix
-
zeroMat
public MatrixI zeroMat(Dimensions dimensions) throws EvaluationException
Description copied from interface:MatrixFactoryI
Create a matrix with zero elements- Specified by:
zeroMat
in 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:JepComponent
Initialize 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:
init
in interfaceJepComponent
- Parameters:
jep
- the current Jep instance
-
getLightWeightInstance
public JepComponent getLightWeightInstance()
Returns this- Specified by:
getLightWeightInstance
in interfaceJepComponent
- Returns:
- either an new instance, null or 'this'.
-
-