org.ojalgo.matrix.store
Interface MatrixStore<N extends Number>

All Superinterfaces:
Serializable
All Known Subinterfaces:
org.ojalgo.matrix.decomposition.ApplyHouseholder<N>, CholeskyDecomposition.CholeskyStore<N>, LUDecomposition.LUStore<N>, PhysicalStore<N>, QRDecomposition.QRStore<N>, org.ojalgo.matrix.decomposition.SubstituteBackwards<N>, org.ojalgo.matrix.decomposition.SubstituteForwards<N>
All Known Implementing Classes:
BigDenseStore, ComplexDenseStore, ConjugatedStore, IdentityStore, JamaMatrix, MergedColumnsStore, MergedRowsStore, PrimitiveDenseStore, RawStore, SelectedColumnsStore, SelectedRowsStore, SuperimposedMatrixStore, TransposedStore, ZeroStore

public interface MatrixStore<N extends Number>
extends Serializable

A MatrixStore is a matrix (two-dimensional) store of numbers/scalars.

This interface does not define methods that require any implementation to alter the matrix. Either the methods return matrix elements, some meta data or produce new instances.

The method toPhysicalStore() returns a PhysicalStore which extends MatrixSore and defines additional methods. A PhysicalStore is mutable.

Author:
apete

Method Summary
 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.
 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)
           
 PhysicalStore<N> toPhysicalStore()
          May (probably will) return the same instance with every call.
 Scalar<N> toScalar(int aRow, int aCol)
           
 

Method Detail

doubleValue

double doubleValue(int aRow,
                   int aCol)

getColDim

int getColDim()

getMinDim

int getMinDim()

getNumber

N getNumber(int aRow,
            int aCol)

getPhysicalFactory

PhysicalFactory<N> getPhysicalFactory()

getRowDim

int getRowDim()

isLowerLeftShaded

boolean isLowerLeftShaded()

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

See Also:
isUpperRightShaded(), isShaded(), PhysicalStore.shadeLowerLeft(), PhysicalStore.unshade()

isShaded

boolean isShaded()

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:
isLowerLeftShaded(), isUpperRightShaded(), PhysicalStore.unshade()

isUpperRightShaded

boolean isUpperRightShaded()

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

See Also:
isLowerLeftShaded(), isShaded(), PhysicalStore.shadeUpperRight(), PhysicalStore.unshade()

multiplyBothSides

N multiplyBothSides(MatrixStore<N> aStore)
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.


multiplyLeft

MatrixStore<N> multiplyLeft(MatrixStore<N> aStore)

multiplyRight

MatrixStore<N> multiplyRight(MatrixStore<N> aStore)

toPhysicalStore

PhysicalStore<N> toPhysicalStore()
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.

Returns:
A PhysicalStore representation of this MatrixStore.
See Also:
PhysicalStore.copy(), PhysicalStore.unshade()

toScalar

Scalar<N> toScalar(int aRow,
                   int aCol)