public final class SparseStore<N extends Number> extends Object implements ElementsConsumer<N>
| Modifier and Type | Class and Description |
|---|---|
static interface |
SparseStore.Factory<N extends Number> |
ElementsConsumer.ColumnsRegion<N extends Number>, ElementsConsumer.ConsumerRegion<N extends Number>, ElementsConsumer.FillByMultiplying<N extends Number>, ElementsConsumer.LimitRegion<N extends Number>, ElementsConsumer.OffsetRegion<N extends Number>, ElementsConsumer.RowsRegion<N extends Number>, ElementsConsumer.TransposedRegion<N extends Number>Mutate2D.BiModifiable<N extends Number>, Mutate2D.Exchangeable, Mutate2D.Fillable<N extends Number>, Mutate2D.Mixable<N extends Number>, Mutate2D.Modifiable<N extends Number>, Mutate2D.Receiver<N extends Number>Mutate1D.SortableStructure2D.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.LoopCallbackMatrixStore.LogicalBuilder<N extends Number>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 SparseStore.Factory<BigDecimal> |
BIG |
static SparseStore.Factory<ComplexNumber> |
COMPLEX |
static SparseStore.Factory<Double> |
PRIMITIVE |
| 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<BigDecimal> |
makeBig(int rowsCount,
int columnsCount) |
static SparseStore<ComplexNumber> |
makeComplex(int rowsCount,
int columnsCount) |
static SparseStore<Double> |
makePrimitive(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,
ElementsConsumer<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.
|
ElementsConsumer<N> |
regionByColumns(int... columns) |
ElementsConsumer<N> |
regionByLimits(int rowLimit,
int columnLimit) |
ElementsConsumer<N> |
regionByOffsets(int rowOffset,
int columnOffset) |
ElementsConsumer<N> |
regionByRows(int... rows) |
ElementsConsumer<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(ElementsConsumer<N> receiver) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitaccept, isAcceptablefillColumn, fillColumn, fillColumn, fillColumn, fillColumn, fillColumn, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillOne, fillOne, fillOne, fillRow, fillRow, fillRow, fillRow, fillRow, fillRowcolumn, 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, rowfillAll, fillAll, fillMatching, fillMatching, fillMatching, fillRange, fillRangeloopAll, loopMatching, loopRange, mappermodifyColumn, modifyColumn, modifyDiagonal, modifyDiagonal, modifyOne, modifyRow, modifyRowmodifyRangeadd, aggregateAll, aggregateColumn, aggregateDiagonal, aggregateRange, aggregateRow, conjugate, copy, equals, isAbsolute, isSmall, isSmall, logical, negate, norm, reduceColumns, reduceRows, signum, sliceColumn, sliceDiagonal, sliceRange, sliceRow, subtract, toScalar, transpose, visitOneoperateOnAll, operateOnMatching, operateOnMatchingoperateOnAll, operateOnAll, operateOnAll, operateOnAll, operateOnAllcollectasCollectable2D, asPrimitive2D, columns, doubleValue, elements, equals, get, newPrimitiveColumnCollectable, newPrimitiveRowCollectable, rows, toRawCopy2D, toString, wrap, wrap, wrapAccess2D, wrapAccess2DasCollectable1D, asPrimitive1D, axpy, dot, equals, hashCode, iterator, 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, sliceRowpublic static final SparseStore.Factory<BigDecimal> BIG
public static final SparseStore.Factory<ComplexNumber> COMPLEX
public static final SparseStore.Factory<Double> PRIMITIVE
public static SparseStore<BigDecimal> makeBig(int rowsCount, int columnsCount)
public static SparseStore<ComplexNumber> makeComplex(int rowsCount, int columnsCount)
public static SparseStore<Double> makePrimitive(int rowsCount, int columnsCount)
public double doubleValue(long row,
long col)
Access2DdoubleValue in interface Access2D<N extends Number>doubleValue in interface MatrixStore<N extends Number>row - A row index.col - A column index.public void fillByMultiplying(Access1D<N> left, Access1D<N> right)
fillByMultiplying in interface ElementsConsumer<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)
MatrixStore0, and if all elements are zeros then
this.countRows().firstInColumn in interface MatrixStore<N extends Number>col - The column indexpublic int firstInRow(int row)
MatrixStore0, and if all elements are zeros then
this.countColumns().firstInRow in interface MatrixStore<N extends Number>public int limitOfColumn(int col)
MatrixStorethis.countRows(), and if all elements are zeros then
0.limitOfColumn in interface MatrixStore<N extends Number>public int limitOfRow(int row)
MatrixStorethis.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.BiModifiable<N extends Number>public void modifyMatching(BinaryFunction<N> function, Access1D<N> right)
modifyMatching in interface Mutate1D.BiModifiable<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, ElementsConsumer<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)
MatrixStoremultiplyBoth in interface MatrixStore<N extends Number>leftAndRight - The argument vectorpublic ElementView2D<N,?> nonzeros()
public ElementsSupplier<N> premultiply(Access1D<N> left)
MatrixStorepremultiply method differs from multiply in 3 ways:
premultiply in interface MatrixStore<N extends Number>left - The left matrixpublic ElementsConsumer<N> regionByColumns(int... columns)
regionByColumns in interface ElementsConsumer<N extends Number>public ElementsConsumer<N> regionByLimits(int rowLimit, int columnLimit)
regionByLimits in interface ElementsConsumer<N extends Number>public ElementsConsumer<N> regionByOffsets(int rowOffset, int columnOffset)
regionByOffsets in interface ElementsConsumer<N extends Number>public ElementsConsumer<N> regionByRows(int... rows)
regionByRows in interface ElementsConsumer<N extends Number>public ElementsConsumer<N> regionByTransposing()
regionByTransposing in interface ElementsConsumer<N extends Number>public void reset()
Mutate1Dpublic void supplyTo(ElementsConsumer<N> receiver)
supplyTo in interface Access2D.Collectable<N extends Number,ElementsConsumer<N extends Number>>supplyTo in interface MatrixStore<N extends Number>public final PhysicalStore.Factory<N,?> physical()
public long countColumns()
countColumns in interface Structure2Dpublic long countRows()
countRows in interface Structure2Dpublic 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 © 2018 Optimatika. All rights reserved.