org.ojalgo.matrix.store
Class RawStore<N extends Number>

java.lang.Object
  extended by org.ojalgo.matrix.store.RawStore<N>
All Implemented Interfaces:
LUDecomposition.LUStore<N>, MatrixStore<N>

public final class RawStore<N extends Number>
extends Object
implements LUDecomposition.LUStore<N>

RawStore

Author:
apete

Method Summary
 LUDecomposition.Pivot computeLU()
           
 double doubleValue(int aRow, int aCol)
           
 int getColDim()
           
 int getMinDim()
           
 N getNumber(int aRow, int aCol)
           
 PhysicalFactory<N> getPhysicalFactory()
           
 int getRowDim()
           
 boolean isLowerLeftShaded()
           The lower (left) triangle is shaded leaving an upper Hessenberg matrix.
 boolean isShaded()
           Either the lower (left) or the upper (right) triangles are shaded.
 boolean isUpperRightShaded()
           The upper (right) triangle is shaded leaving a lower Hessenberg matrix.
static RawStore<BigDecimal> makeBig(double[][] aRaw)
           
static RawStore<ComplexNumber> makeComplex(double[][] aRaw)
           
static RawStore<Double> makePrimitive(double[][] aRaw)
           
 N multiplyBothSides(MatrixStore<N> aStore)
          Calculates [aStore]T[this][aStore] as in a quadratic function [x]T[Q][x].
 MatrixStore<N> multiplyLeft(MatrixStore<N> aStore)
           
 MatrixStore<N> multiplyRight(MatrixStore<N> aStore)
           
 void substituteBackwards(MatrixStore<N> aBody, boolean assumeOne)
           
 void substituteForwards(MatrixStore<N> aBody, boolean assumeOne)
           
 PhysicalStore<N> toPhysicalStore()
          May (probably will) return the same instance with every call.
 Scalar<N> toScalar(int aRow, int aCol)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ojalgo.matrix.store.MatrixStore
getMinDim, getPhysicalFactory, isShaded
 
Methods inherited from interface org.ojalgo.matrix.store.MatrixStore
getMinDim, getPhysicalFactory, isShaded
 

Method Detail

makeBig

public static RawStore<BigDecimal> makeBig(double[][] aRaw)

makeComplex

public static RawStore<ComplexNumber> makeComplex(double[][] aRaw)

makePrimitive

public static RawStore<Double> makePrimitive(double[][] aRaw)

computeLU

public LUDecomposition.Pivot computeLU()
Specified by:
computeLU in interface LUDecomposition.LUStore<N extends Number>
See Also:
LUDecomposition.LUStore.computeLU()

doubleValue

public double doubleValue(int aRow,
                          int aCol)
Specified by:
doubleValue in interface MatrixStore<N extends Number>

getColDim

public int getColDim()
Specified by:
getColDim in interface MatrixStore<N extends Number>

getNumber

public N getNumber(int aRow,
                   int aCol)
Specified by:
getNumber in interface MatrixStore<N extends Number>

getRowDim

public int getRowDim()
Specified by:
getRowDim in interface MatrixStore<N extends Number>

isLowerLeftShaded

public boolean isLowerLeftShaded()
Description copied from interface: MatrixStore

The lower (left) triangle is shaded leaving an upper Hessenberg matrix.

Specified by:
isLowerLeftShaded in interface MatrixStore<N extends Number>
See Also:
MatrixStore.isUpperRightShaded(), MatrixStore.isShaded(), PhysicalStore.shadeLowerLeft(), PhysicalStore.unshade()

isUpperRightShaded

public boolean isUpperRightShaded()
Description copied from interface: MatrixStore

The upper (right) triangle is shaded leaving a lower Hessenberg matrix.

Specified by:
isUpperRightShaded in interface MatrixStore<N extends Number>
See Also:
MatrixStore.isLowerLeftShaded(), MatrixStore.isShaded(), PhysicalStore.shadeUpperRight(), PhysicalStore.unshade()

multiplyBothSides

public N multiplyBothSides(MatrixStore<N> aStore)
Description copied from interface: MatrixStore
Calculates [aStore]T[this][aStore] as in a quadratic function [x]T[Q][x]. The input parameter is assumed to be a vector, but it does not matter if it's a row vector or a column vector. "this" is assumed to be a square matrix. Instead of returning a 1-by-1 matrix this method returns a scalar.

Specified by:
multiplyBothSides in interface MatrixStore<N extends Number>

multiplyLeft

public MatrixStore<N> multiplyLeft(MatrixStore<N> aStore)
Specified by:
multiplyLeft in interface MatrixStore<N extends Number>

multiplyRight

public MatrixStore<N> multiplyRight(MatrixStore<N> aStore)
Specified by:
multiplyRight in interface MatrixStore<N extends Number>

substituteBackwards

public void substituteBackwards(MatrixStore<N> aBody,
                                boolean assumeOne)

substituteForwards

public void substituteForwards(MatrixStore<N> aBody,
                               boolean assumeOne)

toPhysicalStore

public PhysicalStore<N> toPhysicalStore()
Description copied from interface: MatrixStore
May (probably will) return the same instance with every call. PhysicalStore instances are mutable. If you plan to modify it you should make a copy first. Depending on what you do with the PhysicalStore you may have to unshade it.

Specified by:
toPhysicalStore in interface MatrixStore<N extends Number>
Returns:
A PhysicalStore representation of this MatrixStore.
See Also:
PhysicalStore.copy(), PhysicalStore.unshade()

toScalar

public Scalar<N> toScalar(int aRow,
                          int aCol)
Specified by:
toScalar in interface MatrixStore<N extends Number>

getPhysicalFactory

public final PhysicalFactory<N> getPhysicalFactory()

isShaded

public final boolean isShaded()
Description copied from interface: MatrixStore

Either the lower (left) or the upper (right) triangles are shaded.

Shading part of a MatrixStore causes that part to be ignored (as if it had zero valued elements) when doing matrix multiplication. It is possible to shade part of a PhysicalStore even though the shaded elements are not actually zero valued. Calling doubleValue(i, j), getNumber(i, j) or toScalar(i, j) will return the actual stored value.

See Also:
MatrixStore.isLowerLeftShaded(), MatrixStore.isUpperRightShaded(), PhysicalStore.unshade()

getMinDim

public final int getMinDim()
Specified by:
getMinDim in interface MatrixStore<N extends Number>