public final class SparseStore<N extends Number> extends Object implements TransformableRegion<N>
Modifier and Type | Class and Description |
---|---|
static interface |
SparseStore.Factory<N extends Number> |
TransformableRegion.ColumnsRegion<N extends Number>, TransformableRegion.FillByMultiplying<N extends Number>, TransformableRegion.LimitRegion<N extends Number>, TransformableRegion.OffsetRegion<N extends Number>, TransformableRegion.ReceiverRegion<N extends Number>, TransformableRegion.RowsRegion<N extends Number>, TransformableRegion.TransposedRegion<N extends Number>
Mutate2D.Exchangeable, Mutate2D.Fillable<N extends Number>, Mutate2D.Mixable<N extends Number>, Mutate2D.Modifiable<N extends Number>, Mutate2D.ModifiableReceiver<N extends Number>, Mutate2D.Receiver<N extends Number>
Mutate1D.Sortable
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>
MatrixStore.LogicalBuilder<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 SparseStore.Factory<ComplexNumber> |
COMPLEX |
static SparseStore.Factory<Double> |
PRIMITIVE |
static SparseStore.Factory<Quaternion> |
QUATERNION |
static SparseStore.Factory<RationalNumber> |
RATIONAL |
Modifier and Type | Method and Description |
---|---|
void |
add(long row,
long col,
double addend) |
void |
add(long row,
long col,
Number addend) |
long |
countColumns() |
long |
countRows() |
double |
doubleValue(long row,
long col)
Extracts one element of this matrix as a double.
|
boolean |
equals(Object someObj) |
void |
fillByMultiplying(Access1D<N> left,
Access1D<N> right) |
void |
fillOne(long row,
long col,
Access1D<?> values,
long valueIndex) |
void |
fillOne(long row,
long col,
N value) |
void |
fillOne(long row,
long col,
NullaryFunction<N> supplier) |
int |
firstInColumn(int col)
The default value is simply
0 , and if all elements are zeros then
this.countRows() . |
int |
firstInRow(int row)
The default value is simply
0 , and if all elements are zeros then
this.countColumns() . |
MatrixStore<N> |
get() |
N |
get(long row,
long col) |
protected int |
getColDim() |
protected int |
getMaxDim() |
protected int |
getMinDim() |
protected int |
getRowDim() |
int |
hashCode() |
protected boolean |
isPrimitive() |
int |
limitOfColumn(int col)
The default value is simply
this.countRows() , and if all elements are zeros then
0 . |
int |
limitOfRow(int row)
The default value is simply
this.countColumns() , and if all elements are zeros then
0 . |
static SparseStore<ComplexNumber> |
makeComplex(int rowsCount,
int columnsCount) |
static SparseStore<Double> |
makePrimitive(int rowsCount,
int columnsCount) |
static SparseStore<Quaternion> |
makeQuaternion(int rowsCount,
int columnsCount) |
static SparseStore<RationalNumber> |
makeRational(int rowsCount,
int columnsCount) |
void |
modifyAll(UnaryFunction<N> modifier) |
void |
modifyMatching(Access1D<N> left,
BinaryFunction<N> function) |
void |
modifyMatching(BinaryFunction<N> function,
Access1D<N> right) |
void |
modifyOne(long row,
long col,
UnaryFunction<N> modifier) |
void |
multiply(Access1D<N> right,
TransformableRegion<N> target) |
MatrixStore<N> |
multiply(double scalar) |
MatrixStore<N> |
multiply(MatrixStore<N> right) |
MatrixStore<N> |
multiply(N scalar) |
N |
multiplyBoth(Access1D<N> leftAndRight)
Assumes [leftAndRight] is a vector and will calulate [leftAndRight]H[this][leftAndRight]
|
ElementView2D<N,?> |
nonzeros() |
PhysicalStore.Factory<N,?> |
physical() |
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.
|
void |
reduceColumns(Aggregator aggregator,
Mutate1D receiver) |
void |
reduceRows(Aggregator aggregator,
Mutate1D receiver) |
TransformableRegion<N> |
regionByColumns(int... columns) |
TransformableRegion<N> |
regionByLimits(int rowLimit,
int columnLimit) |
TransformableRegion<N> |
regionByOffsets(int rowOffset,
int columnOffset) |
TransformableRegion<N> |
regionByRows(int... rows) |
TransformableRegion<N> |
regionByTransposing() |
void |
reset()
Reset this mutable structure to some standard (all zeros) initial state.
|
void |
set(long row,
long col,
double value) |
void |
set(long row,
long col,
Number value) |
void |
supplyTo(TransformableRegion<N> receiver) |
String |
toString() |
void |
visitColumn(long row,
long col,
VoidFunction<N> visitor) |
void |
visitRow(long row,
long col,
VoidFunction<N> visitor) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
exchangeColumns, exchangeRows, modifyAny
modifyColumn, modifyColumn, modifyDiagonal, modifyDiagonal, modifyMatchingInColumns, modifyMatchingInColumns, modifyMatchingInRows, modifyMatchingInRows, modifyOne, modifyRow, modifyRow
modifyRange
accept, isAcceptable
copyComplexArgument, copyComplexImaginary, copyComplexModulus, copyComplexModulusAndArgument, copyComplexReal, copyComplexRealAndImaginary
fillColumn, fillColumn, fillColumn, fillColumn, fillColumn, fillColumn, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillOne, fillOne, fillOne, fillRow, fillRow, fillRow, fillRow, fillRow, fillRow
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
fillAll, fillAll, fillMatching, fillMatching, fillMatching, fillRange, fillRange
index, loopAll, loopMatching, loopRange, mapper, size
asCollectable2D, asPrimitive2D, byteValue, byteValue, columns, doubleValue, elements, equals, floatValue, floatValue, get, intValue, intValue, longValue, longValue, newPrimitiveColumnCollectable, newPrimitiveRowCollectable, rows, shortValue, shortValue, toRawCopy2D, toString, wrap, wrap
asCollectable1D, asPrimitive1D, axpy, dot, equals, hashCode, supplyTo, toRawCopy1D, toString, wrap, wrap, wrap
add, aggregateAll, aggregateColumn, aggregateDiagonal, aggregateRange, aggregateRow, conjugate, copy, equals, firstInColumn, firstInColumn, firstInRow, firstInRow, isAbsolute, isHermitian, isNormal, isSmall, isSmall, limitOfColumn, limitOfColumn, limitOfRow, limitOfRow, logical, negate, norm, operateOnAll, reduceColumns, reduceRows, signum, sliceColumn, sliceDiagonal, sliceRange, sliceRow, subtract, toScalar, transpose, visitOne
operateOnAny, operateOnColumns, operateOnMatching, operateOnMatching, operateOnRows
operateOnAll, operateOnAll, operateOnAll, operateOnAll, operateOnAll
collect
visitColumn, visitDiagonal, visitDiagonal, visitOne, visitRow
visitAll, visitRange
aggregateColumn, aggregateDiagonal, aggregateRow
sliceColumn, sliceDiagonal, sliceRow
isAbsolute, isColumnSmall, isColumnSmall, isRowSmall, isRowSmall, isSmall
isAllSmall
public static final SparseStore.Factory<ComplexNumber> COMPLEX
public static final SparseStore.Factory<Double> PRIMITIVE
public static final SparseStore.Factory<Quaternion> QUATERNION
public static final SparseStore.Factory<RationalNumber> RATIONAL
public static SparseStore<ComplexNumber> makeComplex(int rowsCount, int columnsCount)
public static SparseStore<Double> makePrimitive(int rowsCount, int columnsCount)
public static SparseStore<Quaternion> makeQuaternion(int rowsCount, int columnsCount)
public static SparseStore<RationalNumber> makeRational(int rowsCount, int columnsCount)
public double doubleValue(long row, long col)
Access2D
doubleValue
in interface MatrixStore<N extends Number>
doubleValue
in interface Access2D<N extends Number>
row
- A row index.col
- A column index.public void fillByMultiplying(Access1D<N> left, Access1D<N> right)
fillByMultiplying
in interface TransformableRegion<N extends Number>
public void fillOne(long row, long col, Access1D<?> values, long valueIndex)
fillOne
in interface Mutate2D.Fillable<N extends Number>
public void fillOne(long row, long col, N value)
fillOne
in interface Mutate2D.Fillable<N extends Number>
public void fillOne(long row, long col, NullaryFunction<N> supplier)
fillOne
in interface Mutate2D.Fillable<N extends Number>
public int firstInColumn(int col)
MatrixStore
0
, and if all elements are zeros then
this.countRows()
.firstInColumn
in interface MatrixStore<N extends Number>
col
- The column indexpublic int firstInRow(int row)
MatrixStore
0
, and if all elements are zeros then
this.countColumns()
.firstInRow
in interface MatrixStore<N extends Number>
public int limitOfColumn(int col)
MatrixStore
this.countRows()
, and if all elements are zeros then
0
.limitOfColumn
in interface MatrixStore<N extends Number>
public int limitOfRow(int row)
MatrixStore
this.countColumns()
, and if all elements are zeros then
0
.limitOfRow
in interface MatrixStore<N extends Number>
public void modifyAll(UnaryFunction<N> modifier)
modifyAll
in interface Mutate1D.Modifiable<N extends Number>
public void modifyMatching(Access1D<N> left, BinaryFunction<N> function)
modifyMatching
in interface Mutate1D.Modifiable<N extends Number>
public void modifyMatching(BinaryFunction<N> function, Access1D<N> right)
modifyMatching
in interface Mutate1D.Modifiable<N extends Number>
public void modifyOne(long row, long col, UnaryFunction<N> modifier)
modifyOne
in interface Mutate2D.Modifiable<N extends Number>
public void multiply(Access1D<N> right, TransformableRegion<N> target)
multiply
in interface MatrixStore<N extends Number>
public MatrixStore<N> multiply(double scalar)
multiply
in interface ScalarOperation.Multiplication<MatrixStore<N extends Number>,N extends Number>
multiply
in interface MatrixStore<N extends Number>
this * scalarMultiplicand
.public MatrixStore<N> multiply(MatrixStore<N> right)
multiply
in interface Operation.Multiplication<MatrixStore<N extends Number>>
multiply
in interface MatrixStore<N extends Number>
right
- The multiplicandthis * multiplicand
.public MatrixStore<N> multiply(N scalar)
multiply
in interface ScalarOperation.Multiplication<MatrixStore<N extends Number>,N extends Number>
multiply
in interface MatrixStore<N extends Number>
this * multiplicand
.public N multiplyBoth(Access1D<N> leftAndRight)
MatrixStore
multiplyBoth
in interface MatrixStore<N extends Number>
leftAndRight
- The argument vectorpublic ElementView2D<N,?> nonzeros()
public ElementsSupplier<N> premultiply(Access1D<N> left)
MatrixStore
premultiply
method differs from multiply
in 3 ways:
premultiply
in interface MatrixStore<N extends Number>
left
- The left matrixpublic void reduceColumns(Aggregator aggregator, Mutate1D receiver)
reduceColumns
in interface Access2D.Aggregatable<N extends Number>
public void reduceRows(Aggregator aggregator, Mutate1D receiver)
reduceRows
in interface Access2D.Aggregatable<N extends Number>
public TransformableRegion<N> regionByColumns(int... columns)
regionByColumns
in interface TransformableRegion<N extends Number>
public TransformableRegion<N> regionByLimits(int rowLimit, int columnLimit)
regionByLimits
in interface TransformableRegion<N extends Number>
public TransformableRegion<N> regionByOffsets(int rowOffset, int columnOffset)
regionByOffsets
in interface TransformableRegion<N extends Number>
public TransformableRegion<N> regionByRows(int... rows)
regionByRows
in interface TransformableRegion<N extends Number>
public TransformableRegion<N> regionByTransposing()
regionByTransposing
in interface TransformableRegion<N extends Number>
public void reset()
Mutate1D
public void supplyTo(TransformableRegion<N> receiver)
supplyTo
in interface MatrixStore<N extends Number>
supplyTo
in interface Access2D.Collectable<N extends Number,TransformableRegion<N extends Number>>
public void visitColumn(long row, long col, VoidFunction<N> visitor)
visitColumn
in interface Access2D.Visitable<N extends Number>
public void visitRow(long row, long col, VoidFunction<N> visitor)
visitRow
in interface Access2D.Visitable<N extends Number>
public final PhysicalStore.Factory<N,?> physical()
public long countColumns()
countColumns
in interface Structure2D
public long countRows()
countRows
in interface Structure2D
public final MatrixStore<N> get()
get
in interface Supplier<MatrixStore<N extends Number>>
get
in interface ElementsSupplier<N extends Number>
get
in interface MatrixStore<N extends Number>
protected final int getColDim()
protected final int getMaxDim()
protected final int getMinDim()
protected final int getRowDim()
protected final boolean isPrimitive()
Copyright © 2019 Optimatika. All rights reserved.