public final class SparseArray<N extends Number> extends BasicArray<N>
Only stores nonzero elements and/or elements specifically set by the user. The nonzero elements are stored
internally in a DenseArray.
| Modifier and Type | Class and Description |
|---|---|
static class |
SparseArray.NonzeroView<N extends Number> |
static class |
SparseArray.SparseFactory<N extends Number> |
BasicArray.Factory<N extends Number>Access1D.Aggregatable<N extends Number>, Access1D.Collectable<N extends Number,R extends Mutate1D.Receiver<N>>, Access1D.Elements, Access1D.ElementView<N extends Number>, Access1D.IndexOf, Access1D.Sliceable<N extends Number>, Access1D.Visitable<N extends Number>Mutate1D.BiModifiable<N extends Number>, Mutate1D.Fillable<N extends Number>, Mutate1D.Mixable<N extends Number>, Mutate1D.Modifiable<N extends Number>, Mutate1D.Receiver<N extends Number>, Mutate1D.SortableStructure1D.BasicMapper<T>, Structure1D.IndexCallback, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback| Modifier and Type | Method and Description |
|---|---|
void |
add(long index,
double addend) |
void |
add(long index,
Number addend) |
void |
axpy(double a,
Mutate1D y)
Will calculate y = y + a x, will add "a" times "this" to "y"
|
long |
count() |
long |
countNonzeros() |
long |
countZeros() |
double |
dot(Access1D<?> vector)
Will calculate and return the dot product of this 1D-structure and another input 1D-vector.
|
double |
doubleValue(long index) |
protected void |
exchange(long firstA,
long firstB,
long step,
long count) |
static <N extends Number> |
factory(DenseArray.Factory<N> denseFactory,
long count) |
protected void |
fill(long first,
long limit,
long step,
N value) |
protected void |
fill(long first,
long limit,
long step,
NullaryFunction<N> supplier) |
void |
fillAll(N value) |
void |
fillAll(NullaryFunction<N> supplier) |
void |
fillOne(long index,
Access1D<?> values,
long valueIndex) |
void |
fillOne(long index,
N value) |
void |
fillOne(long index,
NullaryFunction<N> supplier) |
void |
fillRange(long first,
long limit,
N value) |
void |
fillRange(long first,
long limit,
NullaryFunction<N> supplier) |
long |
firstInRange(long rangeFirst,
long rangeLimit) |
N |
get(long index) |
protected long |
indexOfLargest(long first,
long limit,
long step) |
boolean |
isAbsolute(long index) |
boolean |
isSmall(long index,
double comparedTo) |
protected boolean |
isSmall(long first,
long limit,
long step,
double comparedTo) |
long |
limitOfRange(long rangeFirst,
long rangeLimit) |
protected void |
modify(long first,
long limit,
long step,
Access1D<N> left,
BinaryFunction<N> function) |
protected void |
modify(long first,
long limit,
long step,
BinaryFunction<N> function,
Access1D<N> right) |
protected void |
modify(long first,
long limit,
long step,
UnaryFunction<N> function) |
void |
modifyAll(UnaryFunction<N> modifier) |
void |
modifyOne(long index,
UnaryFunction<N> modifier) |
SparseArray.NonzeroView<N> |
nonzeros() |
void |
reset()
Reset this mutable structure to some standard (all zeros) initial state.
|
void |
set(long index,
double value) |
void |
set(long index,
Number value) |
void |
supplyNonZerosTo(Mutate1D consumer) |
protected void |
visit(long first,
long limit,
long step,
VoidFunction<N> visitor) |
void |
visitOne(long index,
VoidFunction<N> visitor) |
factory, indexOfLargest, indexOfLargestInRange, makeDecreasingRange, makeDecreasingRange, makeIncreasingRange, makeIncreasingRange, modifyRange, toString, visitAll, visitRange, wrapInArray1D, wrapInArray2D, wrapInArrayAnyDclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasCollectable1D, asPrimitive1D, elements, equals, hashCode, iterator, stream, supplyTo, toRawCopy1D, wrap, wrap, wrap, wrapAccess1D, wrapAccess1D, wrapAccess1DforEach, spliteratorisAllSmallfillMatching, fillMatching, fillMatchingloopAll, loopMatching, loopRange, mapperpublic static <N extends Number> SparseArray.SparseFactory<N> factory(DenseArray.Factory<N> denseFactory, long count)
public void add(long index,
double addend)
public void add(long index,
Number addend)
public void axpy(double a,
Mutate1D y)
Access1Da - The scaley - The "vector" to updatepublic final long count()
public final long countNonzeros()
public final long countZeros()
public double dot(Access1D<?> vector)
Access1Dvector - Another 1D-structurepublic double doubleValue(long index)
public void fillAll(N value)
public void fillAll(NullaryFunction<N> supplier)
public void fillOne(long index,
Access1D<?> values,
long valueIndex)
public void fillOne(long index,
N value)
public void fillOne(long index,
NullaryFunction<N> supplier)
public void fillRange(long first,
long limit,
N value)
public void fillRange(long first,
long limit,
NullaryFunction<N> supplier)
public long firstInRange(long rangeFirst,
long rangeLimit)
public N get(long index)
public boolean isAbsolute(long index)
Scalar.isAbsolute()public boolean isSmall(long index,
double comparedTo)
NormedVectorSpace.isSmall(double)public long limitOfRange(long rangeFirst,
long rangeLimit)
public void modifyAll(UnaryFunction<N> modifier)
modifyAll in interface Mutate1D.Modifiable<N extends Number>modifyAll in class BasicArray<N extends Number>public void modifyOne(long index,
UnaryFunction<N> modifier)
public SparseArray.NonzeroView<N> nonzeros()
public void reset()
Mutate1Dpublic void set(long index,
double value)
public void set(long index,
Number value)
public void supplyNonZerosTo(Mutate1D consumer)
public void visitOne(long index,
VoidFunction<N> visitor)
protected void exchange(long firstA,
long firstB,
long step,
long count)
exchange in class BasicArray<N extends Number>protected void fill(long first,
long limit,
long step,
N value)
fill in class BasicArray<N extends Number>protected void fill(long first,
long limit,
long step,
NullaryFunction<N> supplier)
fill in class BasicArray<N extends Number>protected long indexOfLargest(long first,
long limit,
long step)
indexOfLargest in class BasicArray<N extends Number>protected boolean isSmall(long first,
long limit,
long step,
double comparedTo)
isSmall in class BasicArray<N extends Number>protected void modify(long first,
long limit,
long step,
Access1D<N> left,
BinaryFunction<N> function)
modify in class BasicArray<N extends Number>protected void modify(long first,
long limit,
long step,
BinaryFunction<N> function,
Access1D<N> right)
modify in class BasicArray<N extends Number>protected void modify(long first,
long limit,
long step,
UnaryFunction<N> function)
modify in class BasicArray<N extends Number>protected void visit(long first,
long limit,
long step,
VoidFunction<N> visitor)
visit in class BasicArray<N extends Number>Copyright © 2018 Optimatika. All rights reserved.