org.ojalgo.matrix
Class MatrixFactory<N extends Number>

java.lang.Object
  extended by org.ojalgo.matrix.MatrixFactory<N>
All Implemented Interfaces:
BasicMatrix.Factory

public final class MatrixFactory<N extends Number>
extends Object
implements BasicMatrix.Factory

MatrixFactory creates instances of classes that implement the BasicMatrix interface and have a constructor that takes a MatrixStore as input.

MatrixFactory uses reflection to call the 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

Method Summary
 BasicMatrix copy(Access2D<? extends Number> aSource)
           
 BasicMatrix copy(double[][] aSource)
           
 BasicMatrix instantiate(MatrixStore<N> aStore)
           
 BasicMatrix makeColumnVector(List<? extends Number> aColumn)
           
 BasicMatrix makeEye(int aRowDim, int aColDim)
           
 BasicMatrix makeRandom(int aRowDim, int aColDim, RandomNumber aRndm)
           
 BasicMatrix makeRowVector(List<? extends Number> aRow)
           
 BasicMatrix makeZero(int aRowDim, int aColDim)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copy

public BasicMatrix copy(Access2D<? extends Number> aSource)
Specified by:
copy in interface BasicMatrix.Factory

copy

public BasicMatrix copy(double[][] aSource)
Specified by:
copy in interface BasicMatrix.Factory

instantiate

public final BasicMatrix instantiate(MatrixStore<N> aStore)

makeColumnVector

public BasicMatrix makeColumnVector(List<? extends Number> aColumn)
Specified by:
makeColumnVector in interface BasicMatrix.Factory
See Also:
BasicMatrix.toListOfElements(), BasicMatrix.Factory.makeRowVector(List)

makeEye

public BasicMatrix makeEye(int aRowDim,
                           int aColDim)
Specified by:
makeEye in interface BasicMatrix.Factory

makeRandom

public BasicMatrix makeRandom(int aRowDim,
                              int aColDim,
                              RandomNumber aRndm)
Specified by:
makeRandom in interface BasicMatrix.Factory

makeRowVector

public BasicMatrix makeRowVector(List<? extends Number> aRow)
Specified by:
makeRowVector in interface BasicMatrix.Factory
See Also:
BasicMatrix.toListOfElements(), BasicMatrix.Factory.makeColumnVector(List)

makeZero

public BasicMatrix makeZero(int aRowDim,
                            int aColDim)
Specified by:
makeZero in interface BasicMatrix.Factory