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

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

public final class ZeroStore<N extends Number>
extends Object

ZeroStore

Author:
apete

Constructor Summary
ZeroStore(PhysicalFactory<N> aFactory, int aRowDim, int aColDim)
           
 
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.
static ZeroStore<BigDecimal> makeBig(int aRowDim, int aColDim)
           
static ZeroStore<ComplexNumber> makeComplex(int aRowDim, int aColDim)
           
static ZeroStore<Double> makePrimitive(int aRowDim, int aColDim)
           
 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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZeroStore

public ZeroStore(PhysicalFactory<N> aFactory,
                 int aRowDim,
                 int aColDim)
Method Detail

makeBig

public static ZeroStore<BigDecimal> makeBig(int aRowDim,
                                            int aColDim)

makeComplex

public static ZeroStore<ComplexNumber> makeComplex(int aRowDim,
                                                   int aColDim)

makePrimitive

public static ZeroStore<Double> makePrimitive(int aRowDim,
                                              int aColDim)

doubleValue

public double doubleValue(int aRow,
                          int aCol)

getColDim

public int getColDim()

getNumber

public N getNumber(int aRow,
                   int aCol)

getRowDim

public int getRowDim()

isLowerLeftShaded

public boolean isLowerLeftShaded()
Description copied from interface: MatrixStore

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

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.

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.


multiplyLeft

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

multiplyRight

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

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.

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

toScalar

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

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>