Module ojalgo
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>myConstructorprivate 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 Mcopy(Access2D<?> source)(package private) abstract DRdense(PhysicalStore<N> delegate)FunctionSet<N>function()private static java.lang.reflect.Constructor<? extends BasicMatrix<?,?>>getConstructor(java.lang.Class<? extends BasicMatrix<?,?>> template)MathTypegetMathType()(package private) PhysicalStore.Factory<N,?>getPhysicalFactory()(package private) Minstantiate(ElementsSupplier<N> supplier)This method is for internal use only - YOU should NOT use it!Mmake(int nbRows, int nbCols)Mmake(long nbRows, long nbCols)DRmakeDense(int count)MmakeDiagonal(double... diagonal)MmakeDiagonal(Access1D<?> diagonal)MmakeEye(int rows, int columns)MmakeEye(Structure2D shape)MmakeFilled(long rows, long columns, NullaryFunction<?> supplier)MmakeIdentity(int dimension)MmakeSingle(N element)MmakeWrapper(Access2D<?> elements)DRnewDenseBuilder(long nbRows, long nbCols)SRnewSparseBuilder(long nbRows, long nbCols)Scalar.Factory<N>scalar()(package private) abstract SRsparse(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:
copyin interfaceFactory2D.TwoStep<N extends java.lang.Comparable<N>,M extends BasicMatrix<N,M>>
-
function
public FunctionSet<N> function()
- Specified by:
functionin interfaceFactorySupplement
-
getMathType
public MathType getMathType()
- Specified by:
getMathTypein 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:
makeFilledin 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:
newDenseBuilderin 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:
newSparseBuilderin 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:
scalarin 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)
-
-