Module ojalgo
Package org.ojalgo.array
Class SparseArray.NonzeroView<N extends java.lang.Comparable<N>>
- java.lang.Object
-
- org.ojalgo.array.SparseArray.NonzeroView<N>
-
- All Implemented Interfaces:
java.lang.Comparable<SparseArray.NonzeroView<N>>,java.lang.Iterable<SparseArray.NonzeroView<N>>,java.util.Iterator<SparseArray.NonzeroView<N>>,java.util.Spliterator<SparseArray.NonzeroView<N>>,AccessScalar<N>,ElementView1D<N,SparseArray.NonzeroView<N>>,NumberDefinition
- Enclosing class:
- SparseArray<N extends java.lang.Comparable<N>>
public static final class SparseArray.NonzeroView<N extends java.lang.Comparable<N>> extends java.lang.Object implements ElementView1D<N,SparseArray.NonzeroView<N>>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.Spliterator
java.util.Spliterator.OfDouble, java.util.Spliterator.OfInt, java.util.Spliterator.OfLong, java.util.Spliterator.OfPrimitive<T extends java.lang.Object,T_CONS extends java.lang.Object,T_SPLITR extends java.util.Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>
-
-
Field Summary
Fields Modifier and Type Field Description private intmyCursorprivate int[]myIndicesprivate intmyLastCursorprivate DenseArray<N>myValues-
Fields inherited from interface org.ojalgo.structure.ElementView1D
CHARACTERISTICS
-
-
Constructor Summary
Constructors Modifier Constructor Description (package private)NonzeroView(int[] indices, DenseArray<N> values, int actualLength)privateNonzeroView(int[] indices, DenseArray<N> values, int initial, int last)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledoubleValue()longestimateSize()voidforEachRemaining(java.util.function.Consumer<? super SparseArray.NonzeroView<N>> action)Nget()booleanhasNext()booleanhasPrevious()longindex()SparseArray.NonzeroView<N>iterator()voidmodify(double left, BinaryFunction<N> function)voidmodify(N left, BinaryFunction<N> function)voidmodify(BinaryFunction<N> function, double right)voidmodify(BinaryFunction<N> function, N right)SparseArray.NonzeroView<N>next()longnextIndex()SparseArray.NonzeroView<N>previous()longpreviousIndex()booleantryAdvance(java.util.function.Consumer<? super SparseArray.NonzeroView<N>> action)SparseArray.NonzeroView<N>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 org.ojalgo.type.NumberDefinition
booleanValue, byteValue, floatValue, intValue, longValue, shortValue
-
-
-
-
Field Detail
-
myCursor
private int myCursor
-
myIndices
private final int[] myIndices
-
myLastCursor
private final int myLastCursor
-
myValues
private final DenseArray<N extends java.lang.Comparable<N>> myValues
-
-
Constructor Detail
-
NonzeroView
private NonzeroView(int[] indices, DenseArray<N> values, int initial, int last)
-
NonzeroView
NonzeroView(int[] indices, DenseArray<N> values, int actualLength)
-
-
Method Detail
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein interfaceNumberDefinition
-
estimateSize
public long estimateSize()
-
forEachRemaining
public void forEachRemaining(java.util.function.Consumer<? super SparseArray.NonzeroView<N>> action)
- Specified by:
forEachRemainingin interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>- Specified by:
forEachRemainingin interfacejava.util.Iterator<N extends java.lang.Comparable<N>>- Specified by:
forEachRemainingin interfacejava.util.Spliterator<N extends java.lang.Comparable<N>>
-
get
public N get()
- Specified by:
getin interfaceAccessScalar<N extends java.lang.Comparable<N>>
-
hasNext
public boolean hasNext()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPreviousin interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>
-
index
public long index()
- Specified by:
indexin interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>
-
iterator
public SparseArray.NonzeroView<N> iterator()
- Specified by:
iteratorin interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>- Specified by:
iteratorin interfacejava.lang.Iterable<N extends java.lang.Comparable<N>>
-
modify
public void modify(BinaryFunction<N> function, double right)
-
modify
public void modify(BinaryFunction<N> function, N right)
-
modify
public void modify(double left, BinaryFunction<N> function)
-
modify
public void modify(N left, BinaryFunction<N> function)
-
next
public SparseArray.NonzeroView<N> next()
-
nextIndex
public long nextIndex()
- Specified by:
nextIndexin interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>
-
previous
public SparseArray.NonzeroView<N> previous()
- Specified by:
previousin interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>
-
previousIndex
public long previousIndex()
- Specified by:
previousIndexin interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>
-
tryAdvance
public boolean tryAdvance(java.util.function.Consumer<? super SparseArray.NonzeroView<N>> action)
- Specified by:
tryAdvancein interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>- Specified by:
tryAdvancein interfacejava.util.Spliterator<N extends java.lang.Comparable<N>>
-
trySplit
public SparseArray.NonzeroView<N> trySplit()
- Specified by:
trySplitin interfaceElementView1D<N extends java.lang.Comparable<N>,SparseArray.NonzeroView<N extends java.lang.Comparable<N>>>- Specified by:
trySplitin interfacejava.util.Spliterator<N extends java.lang.Comparable<N>>
-
-