public interface MatrixStore<N extends Number> extends ElementsSupplier<N>, Access2D<N>, Access2D.Elements, Access2D.Visitable<N>, Access2D.Aggregatable<N>, Structure2D.ReducibleTo1D<ElementsSupplier<N>>, Access2D.Sliceable<N>, NormedVectorSpace<MatrixStore<N>,N>, Operation.Multiplication<MatrixStore<N>>
A MatrixStore is a two dimensional store of numbers/scalars.
A MatrixStore extends Access2D (as well as Access2D.Visitable and Access2D.Elements) and defines some futher funtionality - mainly matrix multiplication.
This interface does not define any methods that require implementations to alter the matrix. Either the methods return matrix elements, some meta data or produce new instances.
The methods conjugate(), copy() and transpose() return PhysicalStore instances. PhysicalStore extends MatrixStore. It defines additional methods, and is mutable.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
MatrixStore.Factory<N extends Number> |
static class |
MatrixStore.LogicalBuilder<N extends Number>
A builder that lets you logically construct matrices and/or encode element structure.
|
Structure2D.IntRowColumn, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.RowColumnCallback, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>Structure1D.BasicMapper<T>, Structure1D.IndexCallback, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallbackAccess2D.Aggregatable<N extends Number>, Access2D.Collectable<N extends Number,R extends Mutate2D.Receiver<N>>, Access2D.Elements, Access2D.ElementView<N extends Number>, Access2D.IndexOf, Access2D.Sliceable<N extends Number>, Access2D.Visitable<N extends Number>Group.Additive<S>, Group.Multiplicative<S>Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>ScalarOperation.Addition<T,N extends Number>, ScalarOperation.Division<T,N extends Number>, ScalarOperation.Multiplication<T,N extends Number>, ScalarOperation.Subtraction<T,N extends Number>| Modifier and Type | Field and Description |
|---|---|
static MatrixStore.Factory<BigDecimal> |
BIG |
static MatrixStore.Factory<ComplexNumber> |
COMPLEX |
static MatrixStore.Factory<Double> |
PRIMITIVE |
| Modifier and Type | Method and Description |
|---|---|
default MatrixStore<N> |
add(MatrixStore<N> addend) |
default N |
aggregateAll(Aggregator aggregator) |
default N |
aggregateColumn(long row,
long col,
Aggregator aggregator) |
default N |
aggregateDiagonal(long row,
long col,
Aggregator aggregator) |
default N |
aggregateRange(long first,
long limit,
Aggregator aggregator) |
default N |
aggregateRow(long row,
long col,
Aggregator aggregator) |
default MatrixStore<N> |
conjugate()
Returns the conjugate transpose of this matrix.
|
default PhysicalStore<N> |
copy()
Each call must produce a new instance.
|
default double |
doubleValue(long row,
long col)
Extracts one element of this matrix as a double.
|
default boolean |
equals(MatrixStore<N> other,
NumberContext context) |
default int |
firstInColumn(int col)
The default value is simply
0, and if all elements are zeros then
this.countRows(). |
default int |
firstInRow(int row)
The default value is simply
0, and if all elements are zeros then
this.countColumns(). |
default MatrixStore<N> |
get() |
default boolean |
isAbsolute(long row,
long col) |
default boolean |
isSmall(double comparedTo) |
default boolean |
isSmall(long row,
long col,
double comparedTo) |
default int |
limitOfColumn(int col)
The default value is simply
this.countRows(), and if all elements are zeros then
0. |
default int |
limitOfRow(int row)
The default value is simply
this.countColumns(), and if all elements are zeros then
0. |
default MatrixStore.LogicalBuilder<N> |
logical() |
default void |
multiply(Access1D<N> right,
ElementsConsumer<N> target) |
default MatrixStore<N> |
multiply(double scalar) |
default MatrixStore<N> |
multiply(MatrixStore<N> right) |
default MatrixStore<N> |
multiply(N scalar) |
default N |
multiplyBoth(Access1D<N> leftAndRight)
Assumes [leftAndRight] is a vector and will calulate [leftAndRight]H[this][leftAndRight]
|
default MatrixStore<N> |
negate()
The additive inverse of this.
|
default double |
norm()
this == this.signum().multiply(this.norm()) |
default ElementsSupplier<N> |
premultiply(Access1D<N> left)
The
premultiply method differs from multiply in 3 ways:
The matrix positions are swapped - left/right.
It does NOT return a MatrixStore but an ElementsSupplier instead.
It accepts an Access1D as the argument left matrix.
|
default ElementsSupplier<N> |
reduceColumns(Aggregator aggregator) |
default ElementsSupplier<N> |
reduceRows(Aggregator aggregator) |
default MatrixStore<N> |
signum()
this == this.signum().multiply(this.norm()) |
default Access1D<N> |
sliceColumn(long row,
long col) |
default Access1D<N> |
sliceDiagonal(long row,
long col) |
default Access1D<N> |
sliceRange(long first,
long limit) |
default Access1D<N> |
sliceRow(long row,
long col) |
default MatrixStore<N> |
subtract(MatrixStore<N> subtrahend) |
default void |
supplyTo(ElementsConsumer<N> receiver) |
default Scalar<N> |
toScalar(long row,
long column) |
default MatrixStore<N> |
transpose() |
default void |
visitOne(long row,
long col,
VoidFunction<N> visitor) |
operateOnAll, operateOnMatching, operateOnMatching, physicaloperateOnAll, operateOnAll, operateOnAll, operateOnAll, operateOnAllcollectcolumn, column, column, column, column, count, countColumns, countRows, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, rowloopAll, loopMatching, loopRange, mapperasCollectable2D, asPrimitive2D, columns, doubleValue, elements, equals, get, get, newPrimitiveColumnCollectable, newPrimitiveRowCollectable, rows, toRawCopy2D, toString, wrap, wrap, wrapAccess2D, wrapAccess2DasCollectable1D, asPrimitive1D, axpy, dot, equals, hashCode, iterator, nonzeros, stream, supplyTo, toRawCopy1D, wrap, wrap, wrap, wrapAccess1D, wrapAccess1D, wrapAccess1DforEach, spliteratorisAbsolute, isColumnSmall, isColumnSmall, isRowSmall, isRowSmall, isSmallisAllSmallvisitColumn, visitColumn, visitDiagonal, visitDiagonal, visitOne, visitRow, visitRowvisitAll, visitRangeaggregateColumn, aggregateRow, reduceColumns, reduceRowssliceColumn, sliceRowstatic final MatrixStore.Factory<BigDecimal> BIG
static final MatrixStore.Factory<ComplexNumber> COMPLEX
static final MatrixStore.Factory<Double> PRIMITIVE
default MatrixStore<N> add(MatrixStore<N> addend)
add in interface Operation.Addition<MatrixStore<N extends Number>>addend - What to addthis + addenddefault N aggregateAll(Aggregator aggregator)
aggregateAll in interface Access1D.Aggregatable<N extends Number>default N aggregateColumn(long row, long col, Aggregator aggregator)
aggregateColumn in interface Access2D.Aggregatable<N extends Number>default N aggregateDiagonal(long row, long col, Aggregator aggregator)
aggregateDiagonal in interface Access2D.Aggregatable<N extends Number>default N aggregateRange(long first, long limit, Aggregator aggregator)
aggregateRange in interface Access1D.Aggregatable<N extends Number>default N aggregateRow(long row, long col, Aggregator aggregator)
aggregateRow in interface Access2D.Aggregatable<N extends Number>default MatrixStore<N> conjugate()
conjugate in interface VectorSpace<MatrixStore<N extends Number>,N extends Number>VectorSpace.conjugate()default PhysicalStore<N> copy()
default double doubleValue(long row,
long col)
Access2DdoubleValue in interface Access2D<N extends Number>row - A row index.col - A column index.default boolean equals(MatrixStore<N> other, NumberContext context)
default int firstInColumn(int col)
0, and if all elements are zeros then
this.countRows().col - The column indexdefault int firstInRow(int row)
0, and if all elements are zeros then
this.countColumns().row - default MatrixStore<N> get()
get in interface ElementsSupplier<N extends Number>get in interface Supplier<MatrixStore<N extends Number>>default boolean isAbsolute(long row,
long col)
isAbsolute in interface Access2D.ElementsScalar.isAbsolute()default boolean isSmall(double comparedTo)
isSmall in interface NormedVectorSpace<MatrixStore<N extends Number>,N extends Number>comparedTo - What to compare withdefault boolean isSmall(long row,
long col,
double comparedTo)
isSmall in interface Access2D.ElementsNormedVectorSpace.isSmall(double)default int limitOfColumn(int col)
this.countRows(), and if all elements are zeros then
0.col - default int limitOfRow(int row)
this.countColumns(), and if all elements are zeros then
0.row - default MatrixStore.LogicalBuilder<N> logical()
default void multiply(Access1D<N> right, ElementsConsumer<N> target)
default MatrixStore<N> multiply(double scalar)
multiply in interface ScalarOperation.Multiplication<MatrixStore<N extends Number>,N extends Number>this * scalarMultiplicand.default MatrixStore<N> multiply(MatrixStore<N> right)
multiply in interface Operation.Multiplication<MatrixStore<N extends Number>>right - The multiplicandthis * multiplicand.default MatrixStore<N> multiply(N scalar)
multiply in interface ScalarOperation.Multiplication<MatrixStore<N extends Number>,N extends Number>this * multiplicand.default N multiplyBoth(Access1D<N> leftAndRight)
leftAndRight - The argument vectordefault MatrixStore<N> negate()
Group.Additivenegate in interface Group.Additive<MatrixStore<N extends Number>>-this.default double norm()
NormedVectorSpacethis == this.signum().multiply(this.norm())norm in interface NormedVectorSpace<MatrixStore<N extends Number>,N extends Number>default ElementsSupplier<N> premultiply(Access1D<N> left)
premultiply method differs from multiply in 3 ways:
left - The left matrixdefault ElementsSupplier<N> reduceColumns(Aggregator aggregator)
reduceColumns in interface Structure2D.ReducibleTo1D<ElementsSupplier<N extends Number>>default ElementsSupplier<N> reduceRows(Aggregator aggregator)
reduceRows in interface Structure2D.ReducibleTo1D<ElementsSupplier<N extends Number>>default MatrixStore<N> signum()
NormedVectorSpacethis == this.signum().multiply(this.norm())signum in interface NormedVectorSpace<MatrixStore<N extends Number>,N extends Number>default Access1D<N> sliceColumn(long row, long col)
sliceColumn in interface Access2D.Sliceable<N extends Number>default Access1D<N> sliceDiagonal(long row, long col)
sliceDiagonal in interface Access2D.Sliceable<N extends Number>default Access1D<N> sliceRange(long first, long limit)
sliceRange in interface Access1D.Sliceable<N extends Number>default Access1D<N> sliceRow(long row, long col)
sliceRow in interface Access2D.Sliceable<N extends Number>default MatrixStore<N> subtract(MatrixStore<N> subtrahend)
default void supplyTo(ElementsConsumer<N> receiver)
supplyTo in interface Access2D.Collectable<N extends Number,ElementsConsumer<N extends Number>>default MatrixStore<N> transpose()
transpose in interface ElementsSupplier<N extends Number>transpose in interface Stream2D<N extends Number,MatrixStore<N extends Number>,ElementsConsumer<N extends Number>,ElementsSupplier<N extends Number>>default void visitOne(long row,
long col,
VoidFunction<N> visitor)
visitOne in interface Access2D.Visitable<N extends Number>Copyright © 2018 Optimatika. All rights reserved.