public interface MatrixStore<N extends Number> extends ElementsSupplier<N>, Access2D<N>, Access2D.Visitable<N>, Access2D.Aggregatable<N>, Access2D.Sliceable<N>, Access2D.Elements, Structure2D.ReducibleTo1D<ElementsSupplier<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.Logical<S extends Structure2D,B extends Structure2D.Logical<S,?>>, 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.LoopCallback
Access2D.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<ComplexNumber> |
COMPLEX |
static MatrixStore.Factory<Double> |
PRIMITIVE |
static MatrixStore.Factory<Quaternion> |
QUATERNION |
static MatrixStore.Factory<RationalNumber> |
RATIONAL |
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) |
static int |
firstInColumn(Access1D<?> matrix,
int col,
int defaultAndMinimum) |
static long |
firstInColumn(Access1D<?> matrix,
long col,
long defaultAndMinimum) |
default int |
firstInColumn(int col)
The default value is simply
0 , and if all elements are zeros then
this.countRows() . |
static int |
firstInRow(Access1D<?> matrix,
int row,
int defaultAndMinimum) |
static long |
firstInRow(Access1D<?> matrix,
long row,
long defaultAndMinimum) |
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 |
isHermitian() |
default boolean |
isNormal() |
default boolean |
isSmall(double comparedTo) |
default boolean |
isSmall(long row,
long col,
double comparedTo) |
static int |
limitOfColumn(Access1D<?> matrix,
int col,
int defaultAndMaximum) |
static long |
limitOfColumn(Access1D<?> matrix,
long col,
long defaultAndMaximum) |
default int |
limitOfColumn(int col)
The default value is simply
this.countRows() , and if all elements are zeros then
0 . |
static int |
limitOfRow(Access1D<?> matrix,
int row,
int defaultAndMaximum) |
static long |
limitOfRow(Access1D<?> matrix,
long row,
long defaultAndMaximum) |
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,
TransformableRegion<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 MatrixStore<N> |
operateOnAll(UnaryFunction<N> operator) |
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(TransformableRegion<N> receiver) |
default Scalar<N> |
toScalar(long row,
long column) |
default MatrixStore<N> |
transpose() |
default void |
visitOne(long row,
long col,
VoidFunction<N> visitor) |
operateOnAny, operateOnColumns, operateOnMatching, operateOnMatching, operateOnRows, physical
operateOnAll, operateOnAll, operateOnAll, operateOnAll, operateOnAll
collect
column, column, column, column, column, count, count, countColumns, countRows, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, row
index, loopAll, loopMatching, loopRange, mapper, size
asCollectable2D, asPrimitive2D, byteValue, byteValue, columns, doubleValue, elements, equals, floatValue, floatValue, get, get, intValue, intValue, longValue, longValue, newPrimitiveColumnCollectable, newPrimitiveRowCollectable, rows, shortValue, shortValue, toRawCopy2D, toString, wrap, wrap
asCollectable1D, asPrimitive1D, axpy, dot, equals, hashCode, nonzeros, supplyTo, toRawCopy1D, toString, wrap, wrap, wrap
visitColumn, visitColumn, visitDiagonal, visitDiagonal, visitOne, visitRow, visitRow
visitAll, visitRange
aggregateColumn, aggregateDiagonal, aggregateRow, reduceColumns, reduceRows
sliceColumn, sliceDiagonal, sliceRow
isAbsolute, isColumnSmall, isColumnSmall, isRowSmall, isRowSmall, isSmall
isAllSmall
static final MatrixStore.Factory<ComplexNumber> COMPLEX
static final MatrixStore.Factory<Double> PRIMITIVE
static final MatrixStore.Factory<Quaternion> QUATERNION
static final MatrixStore.Factory<RationalNumber> RATIONAL
static int firstInColumn(Access1D<?> matrix, int col, int defaultAndMinimum)
static long firstInColumn(Access1D<?> matrix, long col, long defaultAndMinimum)
static int firstInRow(Access1D<?> matrix, int row, int defaultAndMinimum)
static long firstInRow(Access1D<?> matrix, long row, long defaultAndMinimum)
static int limitOfColumn(Access1D<?> matrix, int col, int defaultAndMaximum)
static long limitOfColumn(Access1D<?> matrix, long col, long defaultAndMaximum)
static int limitOfRow(Access1D<?> matrix, int row, int defaultAndMaximum)
static long limitOfRow(Access1D<?> matrix, long row, long defaultAndMaximum)
default MatrixStore<N> add(MatrixStore<N> addend)
add
in interface Operation.Addition<MatrixStore<N extends Number>>
addend
- What to addthis + addend
default 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)
Access2D
doubleValue
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()
.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.Elements
Scalar.isAbsolute()
default boolean isHermitian()
default boolean isNormal()
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.Elements
NormedVectorSpace.isSmall(double)
default int limitOfColumn(int col)
this.countRows()
, and if all elements are zeros then
0
.default int limitOfRow(int row)
this.countColumns()
, and if all elements are zeros then
0
.default MatrixStore.LogicalBuilder<N> logical()
default void multiply(Access1D<N> right, TransformableRegion<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.Additive
negate
in interface Group.Additive<MatrixStore<N extends Number>>
-this
.default double norm()
NormedVectorSpace
this == this.signum().multiply(this.norm())
norm
in interface NormedVectorSpace<MatrixStore<N extends Number>,N extends Number>
default MatrixStore<N> operateOnAll(UnaryFunction<N> operator)
operateOnAll
in interface ElementsSupplier<N extends Number>
operateOnAll
in interface Stream2D<N extends Number,MatrixStore<N extends Number>,TransformableRegion<N extends Number>,ElementsSupplier<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()
NormedVectorSpace
this == 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(TransformableRegion<N> receiver)
supplyTo
in interface Access2D.Collectable<N extends Number,TransformableRegion<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>,TransformableRegion<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 © 2019 Optimatika. All rights reserved.