Package org.ojalgo.matrix
Class MatrixFactory<N extends java.lang.Comparable<N>,M extends BasicMatrix<N,M>,DR extends Mutate2D.ModifiableReceiver<N> & Factory2D.Builder<M>,SR extends Factory2D.Builder<M>>
- java.lang.Object
-
- org.ojalgo.matrix.MatrixFactory<N,M,DR,SR>
-
- All Implemented Interfaces:
Factory2D<M>
,Factory2D.MayBeSparse<M,DR,SR>
,Factory2D.TwoStep<M,DR>
,FactorySupplement
- Direct Known Subclasses:
MatrixC128.Factory
,MatrixH256.Factory
,MatrixQ128.Factory
,MatrixR032.Factory
,MatrixR064.Factory
,MatrixR128.Factory
public abstract class MatrixFactory<N extends java.lang.Comparable<N>,M extends BasicMatrix<N,M>,DR extends Mutate2D.ModifiableReceiver<N> & Factory2D.Builder<M>,SR extends Factory2D.Builder<M>> extends java.lang.Object implements Factory2D.MayBeSparse<M,DR,SR>
MatrixFactory creates instances of classes that implement the BasicMatrix interface and have a constructor that takes a MatrixStore as input.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Factory2D
Factory2D.Builder<I extends Structure2D>, Factory2D.MayBeSparse<I extends Structure2D,DENSE extends Factory2D.Builder<I>,SPARSE extends Factory2D.Builder<I>>, Factory2D.TwoStep<I extends Structure2D,B extends Factory2D.Builder<I>>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Constructor<M>
myConstructor
private PhysicalStore.Factory<N,?>
myPhysicalFactory
-
Constructor Summary
Constructors Constructor Description MatrixFactory(java.lang.Class<M> template, PhysicalStore.Factory<N,?> factory)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description M
copy(Access2D<?> source)
(package private) abstract DR
dense(PhysicalStore<N> delegate)
FunctionSet<N>
function()
private static java.lang.reflect.Constructor<? extends BasicMatrix<?,?>>
getConstructor(java.lang.Class<? extends BasicMatrix<?,?>> template)
MathType
getMathType()
(package private) PhysicalStore.Factory<N,?>
getPhysicalFactory()
(package private) M
instantiate(ElementsSupplier<N> supplier)
This method is for internal use only - YOU should NOT use it!M
make(int nbRows, int nbCols)
M
make(long nbRows, long nbCols)
DR
makeDense(int count)
M
makeDiagonal(double... diagonal)
M
makeDiagonal(Access1D<?> diagonal)
M
makeEye(int rows, int columns)
M
makeEye(Structure2D shape)
M
makeFilled(long rows, long columns, NullaryFunction<?> supplier)
M
makeIdentity(int dimension)
M
makeSingle(N element)
M
makeWrapper(Access2D<?> elements)
DR
newDenseBuilder(long nbRows, long nbCols)
SR
newSparseBuilder(long nbRows, long nbCols)
Scalar.Factory<N>
scalar()
(package private) abstract SR
sparse(SparseStore.Builder<N> delegate)
TensorFactory1D<N,DR>
tensor1D()
TensorFactory2D<N,DR>
tensor2D()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.structure.Factory2D
asFactory1D, make
-
Methods inherited from interface org.ojalgo.structure.Factory2D.MayBeSparse
newBuilder
-
-
-
-
Field Detail
-
myConstructor
private final java.lang.reflect.Constructor<M extends BasicMatrix<N,M>> myConstructor
-
myPhysicalFactory
private final PhysicalStore.Factory<N extends java.lang.Comparable<N>,?> myPhysicalFactory
-
-
Constructor Detail
-
MatrixFactory
MatrixFactory(java.lang.Class<M> template, PhysicalStore.Factory<N,?> factory)
-
-
Method Detail
-
getConstructor
private static java.lang.reflect.Constructor<? extends BasicMatrix<?,?>> getConstructor(java.lang.Class<? extends BasicMatrix<?,?>> template)
-
copy
public M copy(Access2D<?> source)
- Specified by:
copy
in interfaceFactory2D.TwoStep<N extends java.lang.Comparable<N>,M extends BasicMatrix<N,M>>
-
function
public FunctionSet<N> function()
- Specified by:
function
in interfaceFactorySupplement
-
getMathType
public MathType getMathType()
- Specified by:
getMathType
in interfaceFactorySupplement
-
make
public M make(int nbRows, int nbCols)
-
make
public M make(long nbRows, long nbCols)
-
makeDense
public DR makeDense(int count)
-
makeDiagonal
public M makeDiagonal(double... diagonal)
-
makeEye
public M makeEye(int rows, int columns)
-
makeEye
public M makeEye(Structure2D shape)
-
makeFilled
public M makeFilled(long rows, long columns, NullaryFunction<?> supplier)
- Specified by:
makeFilled
in interfaceFactory2D.TwoStep<N extends java.lang.Comparable<N>,M extends BasicMatrix<N,M>>
-
makeIdentity
public M makeIdentity(int dimension)
-
newDenseBuilder
public DR newDenseBuilder(long nbRows, long nbCols)
- Specified by:
newDenseBuilder
in interfaceFactory2D.MayBeSparse<N extends java.lang.Comparable<N>,M extends BasicMatrix<N,M>,DR extends Mutate2D.ModifiableReceiver<N> & Factory2D.Builder<M>>
-
newSparseBuilder
public SR newSparseBuilder(long nbRows, long nbCols)
- Specified by:
newSparseBuilder
in interfaceFactory2D.MayBeSparse<N extends java.lang.Comparable<N>,M extends BasicMatrix<N,M>,DR extends Mutate2D.ModifiableReceiver<N> & Factory2D.Builder<M>>
-
scalar
public Scalar.Factory<N> scalar()
- Specified by:
scalar
in interfaceFactorySupplement
-
tensor1D
public TensorFactory1D<N,DR> tensor1D()
-
tensor2D
public TensorFactory2D<N,DR> tensor2D()
-
dense
abstract DR dense(PhysicalStore<N> delegate)
-
getPhysicalFactory
final PhysicalStore.Factory<N,?> getPhysicalFactory()
-
instantiate
M instantiate(ElementsSupplier<N> supplier)
This method is for internal use only - YOU should NOT use it!
-
sparse
abstract SR sparse(SparseStore.Builder<N> delegate)
-
-