java.lang.Object
com.singularsys.extensions.matrix.externalmat.ExternalMatrixFactory<M,V>
- Type Parameters:
M- Type of matrix usedV- Type of vector used
- All Implemented Interfaces:
MatrixFactoryI,JepComponent,Serializable
public abstract class ExternalMatrixFactory<M extends MatrixI,V extends VectorI>
extends Object
implements MatrixFactoryI
Base class for MatrixFactories where external matrix libraries are used for the matrix implementation.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTry to convert argument to base type of elements of Vector/Matrix.abstract Midentity(int size) Create a square identity matrixabstract Midentity(int rows, int cols) Create an identity matrix.abstract MCreate a new MatrixI using the given dataabstract VCreate a new VectorI using the given dataabstract MzeroMat(int rows, int cols) Create an zero matrix.zeroMat(Dimensions dimensions) Create a zero matrix of given sizeabstract VzeroVec(int size) Create a vector with zeroszeroVec(Dimensions dimensions) Create a zero vector of given sizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.singularsys.jep.JepComponent
getLightWeightInstance, initMethods inherited from interface com.singularsys.extensions.matrix.MatrixFactoryI
duplicate, duplicate, newVector
-
Constructor Details
-
ExternalMatrixFactory
public ExternalMatrixFactory()
-
-
Method Details
-
newVector
Description copied from interface:MatrixFactoryICreate a new VectorI using the given data- Specified by:
newVectorin interfaceMatrixFactoryI- Parameters:
data-- Returns:
- a new VectorI the precise type depends on the implementing class
- Throws:
EvaluationException
-
zeroVec
Description copied from interface:MatrixFactoryICreate a vector with zeros- Specified by:
zeroVecin interfaceMatrixFactoryI- Parameters:
size-- Returns:
- a vector of zeros
- Throws:
EvaluationException
-
newMatrix
Description copied from interface:MatrixFactoryICreate a new MatrixI using the given data- Specified by:
newMatrixin interfaceMatrixFactoryI- Parameters:
data-- Returns:
- a new MatrixI the precise type depends on the implementing class
- Throws:
EvaluationException
-
zeroMat
Description copied from interface:MatrixFactoryICreate an zero matrix.- Specified by:
zeroMatin interfaceMatrixFactoryI- Parameters:
rows-cols-- Returns:
- a rows by cols matrix
- Throws:
EvaluationException
-
identity
Description copied from interface:MatrixFactoryICreate a square identity matrix- Specified by:
identityin interfaceMatrixFactoryI- Parameters:
size- size- Returns:
- a size by size identity matrix
- Throws:
EvaluationException
-
identity
Description copied from interface:MatrixFactoryICreate an identity matrix.- Specified by:
identityin interfaceMatrixFactoryI- Parameters:
rows-cols-- Returns:
- a
rowsbycolsidentity matrix - Throws:
EvaluationException
-
zeroMat
Create a zero matrix of given size- Specified by:
zeroMatin interfaceMatrixFactoryI- Parameters:
dimensions- of desired matrix- Returns:
- matrix of desired type
- Throws:
EvaluationException- if dimensions are not 2D
-
zeroVec
Create a zero vector of given size- Specified by:
zeroVecin interfaceMatrixFactoryI- Parameters:
dimensions- of desired matrix- Returns:
- vector of desired type
- Throws:
EvaluationException- if dimensions are not 1D
-
elementValue
Try to convert argument to base type of elements of Vector/Matrix. Subclass can call this method to ensure elements are not vectors or matrices.- Specified by:
elementValuein interfaceMatrixFactoryI- Parameters:
o- item to convert- Returns:
- o
- Throws:
EvaluationException
-