Package org.ojalgo.array
Class SparseArray.NonzeroView<N extends Comparable<N>>
java.lang.Object
org.ojalgo.array.SparseArray.NonzeroView<N>
- All Implemented Interfaces:
Comparable<SparseArray.NonzeroView<N>>
,Iterable<SparseArray.NonzeroView<N>>
,Iterator<SparseArray.NonzeroView<N>>
,Spliterator<SparseArray.NonzeroView<N>>
,AccessScalar<N>
,ElementView1D<N,
,SparseArray.NonzeroView<N>> NumberDefinition
- Enclosing class:
SparseArray<N extends Comparable<N>>
public static final class SparseArray.NonzeroView<N extends Comparable<N>>
extends Object
implements ElementView1D<N,SparseArray.NonzeroView<N>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,
T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private final long[]
private final int
private final DenseArray
<N> Fields inherited from interface org.ojalgo.structure.ElementView1D
CHARACTERISTICS
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
NonzeroView
(long[] indices, DenseArray<N> values, int actualLength) private
NonzeroView
(long[] indices, DenseArray<N> values, int initial, int last) -
Method Summary
Modifier and TypeMethodDescriptiondouble
long
void
forEachRemaining
(Consumer<? super SparseArray.NonzeroView<N>> action) get()
boolean
hasNext()
boolean
long
index()
iterator()
void
modify
(double left, BinaryFunction<N> function) void
modify
(N left, BinaryFunction<N> function) void
modify
(BinaryFunction<N> function, double right) void
modify
(BinaryFunction<N> function, N right) next()
long
previous()
long
boolean
tryAdvance
(Consumer<? super SparseArray.NonzeroView<N>> action) trySplit()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ojalgo.structure.ElementView1D
characteristics, compareTo, getComparator, remove, step, stream
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.ojalgo.type.NumberDefinition
booleanValue, byteValue, floatValue, intValue, longValue, shortValue
Methods inherited from interface java.util.Spliterator
getExactSizeIfKnown, hasCharacteristics
-
Field Details
-
myCursor
private int myCursor -
myIndices
private final long[] myIndices -
myLastCursor
private final int myLastCursor -
myValues
-
-
Constructor Details
-
NonzeroView
-
NonzeroView
NonzeroView(long[] indices, DenseArray<N> values, int actualLength)
-
-
Method Details
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in interfaceNumberDefinition
-
estimateSize
public long estimateSize()- Specified by:
estimateSize
in interfaceSpliterator<N extends Comparable<N>>
-
forEachRemaining
- Specified by:
forEachRemaining
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>> - Specified by:
forEachRemaining
in interfaceIterator<N extends Comparable<N>>
- Specified by:
forEachRemaining
in interfaceSpliterator<N extends Comparable<N>>
-
get
- Specified by:
get
in interfaceAccessScalar<N extends Comparable<N>>
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<N extends Comparable<N>>
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPrevious
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>>
-
index
public long index()- Specified by:
index
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>>
-
iterator
- Specified by:
iterator
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>> - Specified by:
iterator
in interfaceIterable<N extends Comparable<N>>
-
modify
-
modify
-
modify
-
modify
-
next
- Specified by:
next
in interfaceIterator<N extends Comparable<N>>
-
nextIndex
public long nextIndex()- Specified by:
nextIndex
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>>
-
previous
- Specified by:
previous
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>>
-
previousIndex
public long previousIndex()- Specified by:
previousIndex
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>>
-
tryAdvance
- Specified by:
tryAdvance
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>> - Specified by:
tryAdvance
in interfaceSpliterator<N extends Comparable<N>>
-
trySplit
- Specified by:
trySplit
in interfaceElementView1D<N extends Comparable<N>,
SparseArray.NonzeroView<N extends Comparable<N>>> - Specified by:
trySplit
in interfaceSpliterator<N extends Comparable<N>>
-