org.ojalgo.matrix.factory
Class DefaultFactory<N extends Number>
java.lang.Object
org.ojalgo.matrix.factory.DefaultFactory<N>
- All Implemented Interfaces:
- MatrixFactory
- Direct Known Subclasses:
- JamaFactory
public class DefaultFactory<N extends Number>
- extends Object
- implements MatrixFactory
DefaultFactory creates instances of classes that implement the
BasicMatrix interface and have constructors
matching the MatrixFactory make(...)
methods.
DefaultFactory uses reflection to call the appropriate constructor.
This takes slightly longer than calling the matrix' constructors directly.
If you need to instantiate a large number of small matrices; using DefaultFactory
may not be your best alternative. In that case you should consider coding
a different MatrixFactory implementation. In the vast majority of cases
you do not need to worry about this.
- Author:
- apete
DefaultFactory
public DefaultFactory(Class<? extends BasicMatrix> aTemplate,
PhysicalFactory<N> aPhysical)
buildColumnVector
public BasicMatrix buildColumnVector(List<BigDecimal> aColumn)
- Specified by:
buildColumnVector in interface MatrixFactory
- See Also:
BasicMatrix.toListOfElements(),
Orginal
buildEye
public BasicMatrix buildEye(int aRowDim,
int aColDim)
- Description copied from interface:
MatrixFactory
- Orginal
- Specified by:
buildEye in interface MatrixFactory
buildRandom
public BasicMatrix buildRandom(int aRowDim,
int aColDim,
RandomNumber aRndm)
- Specified by:
buildRandom in interface MatrixFactory
buildRowVector
public BasicMatrix buildRowVector(List<BigDecimal> aRow)
- Specified by:
buildRowVector in interface MatrixFactory
- See Also:
BasicMatrix.toListOfElements(),
Orginal
buildZero
public BasicMatrix buildZero(int aRowDim,
int aColDim)
- Specified by:
buildZero in interface MatrixFactory
copy
public BasicMatrix copy(Array2Dim<? extends Number> anArray)
- Specified by:
copy in interface MatrixFactory
copy
public BasicMatrix copy(BasicMatrix aMtrx)
- Specified by:
copy in interface MatrixFactory
copy
public BasicMatrix copy(double[][] aRaw)
- Specified by:
copy in interface MatrixFactory
copy
public BasicMatrix copy(MatrixStore<? extends Number> aStore)
- Specified by:
copy in interface MatrixFactory
instantiate
public BasicMatrix instantiate(MatrixStore<N> aStore)