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

java.lang.Object
  extended by org.ojalgo.matrix.store.MergedColumnsStore<N>
All Implemented Interfaces:
MatrixStore<N>

public final class MergedColumnsStore<N extends Number>
extends Object

A merger of two MatrixStore instances by placing one store below the other. The two matrices must have the same number of columns. The columns of the two matrices are logically merged to form new longer columns.

Author:
apete

Constructor Summary
MergedColumnsStore(MatrixStore<N> aBase, MatrixStore<N> aLowerStore)
           
 
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)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MergedColumnsStore

public MergedColumnsStore(MatrixStore<N> aBase,
                          MatrixStore<N> aLowerStore)
Method Detail

doubleValue

public double doubleValue(int aRow,
                          int aCol)
See Also:
MatrixStore.doubleValue(int, int)

getNumber

public N getNumber(int aRow,
                   int aCol)

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()

multiplyLeft

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

multiplyRight

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

toScalar

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

getColDim

public int getColDim()

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()

multiplyBothSides

public final 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.


toPhysicalStore

public final 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.

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

toString

public final String toString()
Overrides:
toString in class Object

getMinDim

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