Class ObjectMatrixFactory
java.lang.Object
com.singularsys.extensions.matrix.genericmat.GenericMatrixFactory<Object>
com.singularsys.extensions.matrix.objectmat.ObjectMatrixFactory
- All Implemented Interfaces:
MatrixFactoryI,JepComponent,Serializable
An implementation of vectors and matrices where elements are Objects.
To set up use
MatrixFactoryI mfac = new ObjectMatrixFactory();
MatrixFieldI mf = new SimpleMatrixField(mfac);
MatrixOperatorTable opTab = new MatrixOperatorTable(mfac, mf);
MatrixFunctionTable mftab = new MatrixFunctionTable(mfac, mf);
jep = new Jep(opTab,mftab);
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.extensions.matrix.genericmat.GenericMatrixFactory
ONE, ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[]buildDataArray(int len) Build a data array.Object[][]buildDataArray(int rows, int cols) Build a data array.A typical implementation will just usereturn (GenericMatrix<E>) m;A typical implementation will just usereturn (V) v;Convert the element o to type E.Returns thisnewMatrixUnchecked(Object[][] data) newVectorUnchecked(Object[] data) Methods inherited from class com.singularsys.extensions.matrix.genericmat.GenericMatrixFactory
duplicate, duplicate, duplicateGM, duplicateGV, getONE, identity, identity, init, newMatrix, newVector, newVector, zeroElement, zeroMat, zeroMat, zeroMat, zeroVecMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.singularsys.extensions.matrix.MatrixFactoryI
zeroVec
-
Constructor Details
-
ObjectMatrixFactory
public ObjectMatrixFactory() -
ObjectMatrixFactory
-
ObjectMatrixFactory
-
-
Method Details
-
buildDataArray
Description copied from class:GenericMatrixFactoryBuild a data array. A typical concrete implementation will just usereturn new E[rows][cols].- Overrides:
buildDataArrayin classGenericMatrixFactory<Object>- Parameters:
rows- number of rowscols- number of cols- Returns:
- the array.
-
buildDataArray
Description copied from class:GenericMatrixFactoryBuild a data array. A typical concrete implementation will just usereturn new E[rows][len].- Overrides:
buildDataArrayin classGenericMatrixFactory<Object>- Parameters:
len- number of elements- Returns:
- the array.
-
elementValue
Description copied from class:GenericMatrixFactoryConvert the element o to type E. A typical implementation will just usepublic abstract E elementValue(Object o) { if(o instanceof E) return (E) o; return null; }- Specified by:
elementValuein interfaceMatrixFactoryI- Overrides:
elementValuein classGenericMatrixFactory<Object>- Parameters:
o- value to convert- Returns:
- the value cast to type E or null if the type cannot be converted.
-
cast
Description copied from class:GenericMatrixFactoryA typical implementation will just usereturn (GenericMatrix<E>) m;- Overrides:
castin classGenericMatrixFactory<Object>- Parameters:
m- the matrix to cast- Returns:
- a matrix of type GenericMatrix<E> = GenericMatrix<E>
-
cast
Description copied from class:GenericMatrixFactoryA typical implementation will just usereturn (V) v;- Overrides:
castin classGenericMatrixFactory<Object>- Parameters:
v- the vector to cast- Returns:
- a vector of type V = GenericVector<E>
-
newMatrixUnchecked
- Overrides:
newMatrixUncheckedin classGenericMatrixFactory<Object>
-
newVectorUnchecked
- Overrides:
newVectorUncheckedin classGenericMatrixFactory<Object>
-
getLightWeightInstance
Returns this- Specified by:
getLightWeightInstancein interfaceJepComponent- Overrides:
getLightWeightInstancein classGenericMatrixFactory<Object>- Returns:
- either a new instance, null or 'this'.
-