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

java.lang.Object
  extended by org.ojalgo.matrix.store.IdentityStore<N>
All Implemented Interfaces:
Serializable, Access2D<N>, MatrixStore<N>

public final class IdentityStore<N extends Number>
extends Object

IdentityStore

Author:
apete
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ojalgo.matrix.store.MatrixStore
MatrixStore.Builder<N extends Number>
 
Constructor Summary
IdentityStore(PhysicalStore.Factory<N> aFactory, int aDim)
           
 
Method Summary
 N aggregateAll(ChainableAggregator aVisitor)
           
 N aggregateAll(CollectableAggregator aVisitor)
           
 MatrixStore.Builder<N> builder()
           
 PhysicalStore<N> conjugate()
          Each call must produce a new instance.
 PhysicalStore<N> copy()
          Each call must produce a new instance.
 double doubleValue(int aRow, int aCol)
           
 boolean equals(MatrixStore<N> aStore, NumberContext aCntxt)
           
 boolean equals(Object someObj)
           
 N get(int aRow, int aCol)
           
 int getColDim()
           
 PhysicalStore.Factory<N> getFactory()
           
 int getMinDim()
           
 N getNumber(int aRow, int aCol)
          Deprecated. v29 Use get(int,int) instead
 int getRowDim()
           
 int hashCode()
           
 boolean isAbsolute(int aRow, int aCol)
           
 boolean isLowerLeftShaded()
           The lower (left) triangle is shaded leaving an upper Hessenberg matrix.
 boolean isReal(int aRow, int aCol)
           
 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.
 boolean isZero(int aRow, int aCol)
           
static IdentityStore<BigDecimal> makeBig(int aDim)
           
static IdentityStore<ComplexNumber> makeComplex(int aDim)
           
static IdentityStore<Double> makePrimitive(int aDim)
           
 PhysicalStore<N> multiplyLeft(MatrixStore<N> aStore)
           
 PhysicalStore<N> multiplyRight(MatrixStore<N> aStore)
           
 int size()
           
 double[][] toRawCopy()
           
 Scalar<N> toScalar(int aRow, int aCol)
           
 PhysicalStore<N> transpose()
          Each call must produce a new instance.
 void visitAll(AggregatorFunction<N> aVisitor)
           
 void visitColumn(int aRow, int aCol, AggregatorFunction<N> aVisitor)
           
 void visitDiagonal(int aRow, int aCol, AggregatorFunction<N> aVisitor)
           
 void visitRow(int aRow, int aCol, AggregatorFunction<N> aVisitor)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityStore

public IdentityStore(PhysicalStore.Factory<N> aFactory,
                     int aDim)
Method Detail

makeBig

public static IdentityStore<BigDecimal> makeBig(int aDim)

makeComplex

public static IdentityStore<ComplexNumber> makeComplex(int aDim)

makePrimitive

public static IdentityStore<Double> makePrimitive(int aDim)

conjugate

public PhysicalStore<N> conjugate()
Description copied from interface: MatrixStore
Each call must produce a new instance.

Specified by:
conjugate in interface MatrixStore<N extends Number>
Returns:
A new conjugated PhysicalStore copy.

copy

public PhysicalStore<N> copy()
Description copied from interface: MatrixStore
Each call must produce a new instance.

Specified by:
copy in interface MatrixStore<N extends Number>
Returns:
A new PhysicalStore copy.

doubleValue

public double doubleValue(int aRow,
                          int aCol)

get

public N get(int aRow,
             int aCol)

getNumber

@Deprecated
public N getNumber(int aRow,
                              int aCol)
Deprecated. v29 Use get(int,int) instead


multiplyLeft

public PhysicalStore<N> multiplyLeft(MatrixStore<N> aStore)
Specified by:
multiplyLeft in interface MatrixStore<N extends Number>
See Also:
MatrixStore.multiplyLeft(org.ojalgo.matrix.store.MatrixStore)

multiplyRight

public PhysicalStore<N> multiplyRight(MatrixStore<N> aStore)
Specified by:
multiplyRight in interface MatrixStore<N extends Number>
See Also:
MatrixStore.multiplyRight(org.ojalgo.matrix.store.MatrixStore)

toRawCopy

public double[][] toRawCopy()
Specified by:
toRawCopy in interface MatrixStore<N extends Number>

toScalar

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

transpose

public PhysicalStore<N> transpose()
Description copied from interface: MatrixStore
Each call must produce a new instance.

Specified by:
transpose in interface MatrixStore<N extends Number>
Returns:
A new transposed PhysicalStore copy.

getFactory

public final PhysicalStore.Factory<N> getFactory()

aggregateAll

public N aggregateAll(ChainableAggregator aVisitor)
Specified by:
aggregateAll in interface MatrixStore<N extends Number>

aggregateAll

public N aggregateAll(CollectableAggregator aVisitor)
Specified by:
aggregateAll in interface MatrixStore<N extends Number>

builder

public final MatrixStore.Builder<N> builder()
Specified by:
builder in interface MatrixStore<N extends Number>

equals

public final boolean equals(MatrixStore<N> aStore,
                            NumberContext aCntxt)
Specified by:
equals in interface MatrixStore<N extends Number>

equals

public final boolean equals(Object someObj)
Overrides:
equals in class Object

getColDim

public final int getColDim()

getMinDim

public int getMinDim()

getRowDim

public final int getRowDim()

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

isAbsolute

public boolean isAbsolute(int aRow,
                          int aCol)
Specified by:
isAbsolute in interface MatrixStore<N extends Number>
See Also:
Scalar.isAbsolute()

isLowerLeftShaded

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

isReal

public boolean isReal(int aRow,
                      int aCol)
Specified by:
isReal in interface MatrixStore<N extends Number>
See Also:
Scalar.isReal()

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.

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

isUpperRightShaded

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

isZero

public boolean isZero(int aRow,
                      int aCol)
Specified by:
isZero in interface MatrixStore<N extends Number>
See Also:
Scalar.isZero()

size

public int size()

visitAll

public void visitAll(AggregatorFunction<N> aVisitor)
Specified by:
visitAll in interface MatrixStore<N extends Number>

visitColumn

public void visitColumn(int aRow,
                        int aCol,
                        AggregatorFunction<N> aVisitor)
Specified by:
visitColumn in interface MatrixStore<N extends Number>

visitDiagonal

public void visitDiagonal(int aRow,
                          int aCol,
                          AggregatorFunction<N> aVisitor)
Specified by:
visitDiagonal in interface MatrixStore<N extends Number>

visitRow

public void visitRow(int aRow,
                     int aCol,
                     AggregatorFunction<N> aVisitor)
Specified by:
visitRow in interface MatrixStore<N extends Number>