Package org.ojalgo.structure
Class AccessAnyD.VectorView<N extends Comparable<N>>
java.lang.Object
org.ojalgo.structure.AccessAnyD.VectorView<N>
- All Implemented Interfaces:
Comparable<AccessAnyD.VectorView<N>>
,Iterable<AccessAnyD.VectorView<N>>
,Iterator<AccessAnyD.VectorView<N>>
,Access1D<N>
,Access1D.Collectable<N,
,Mutate1D> Structure1D
- Enclosing interface:
AccessAnyD<N extends Comparable<N>>
public static final class AccessAnyD.VectorView<N extends Comparable<N>>
extends Object
implements Access1D<N>, Iterable<AccessAnyD.VectorView<N>>, Iterator<AccessAnyD.VectorView<N>>, Comparable<AccessAnyD.VectorView<N>>, Access1D.Collectable<N,Mutate1D>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ojalgo.structure.Access1D
Access1D.Aggregatable<N extends Comparable<N>>, Access1D.Collectable<N extends Comparable<N>,
R extends Mutate1D>, Access1D.ElementView<N extends Comparable<N>>, Access1D.SelectionView<N extends Comparable<N>>, Access1D.Sliceable<N extends Comparable<N>>, Access1D.Visitable<N extends Comparable<N>> Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S extends Structure1D,
B extends Structure1D.Logical<S, B>>, Structure1D.LongIndex, Structure1D.LoopCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
private final AccessAnyD
<N> private final long
private long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
VectorView
(AccessAnyD<N> access) (package private)
VectorView
(AccessAnyD<N> access, long index) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(AccessAnyD.VectorView<N> other) long
count()
The total number of elements in this structure.double
doubleValue
(int index) long
get
(long index) (package private) long
void
goToVector
(long index) Move the view to a specific vector.boolean
hasNext()
boolean
long
index()
If the underlyingAccessAnyD
data structure was created as 4x5x7, it can be viewed as 5x7 4-dimensional vectors.iterator()
next()
previous()
void
remove()
int
size()
The total number of elements in this structure.void
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ojalgo.structure.Access1D
asCollectable1D, asKeyed1D, axpy, byteValue, byteValue, dot, doubleValue, elements, floatValue, floatValue, intValue, intValue, longValue, longValue, nonzeros, select, shortValue, shortValue, supplyTo, toRawCopy1D
Methods inherited from interface org.ojalgo.structure.Access1D.Collectable
collect
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
myCount
private final long myCount -
myDelegateAnyD
-
myLastOffset
private final long myLastOffset -
myOffset
private long myOffset
-
-
Constructor Details
-
VectorView
-
VectorView
VectorView(AccessAnyD<N> access, long index)
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<N extends Comparable<N>>
-
count
public long count()Description copied from interface:Structure1D
The total number of elements in this structure.You only need to implement this method if the structure can contain more than Integer.MAX_VALUE elements.
- Specified by:
count
in interfaceStructure1D
-
doubleValue
public double doubleValue(int index) - Specified by:
doubleValue
in interfaceAccess1D<N extends Comparable<N>>
-
estimateSize
public long estimateSize() -
get
- Specified by:
get
in interfaceAccess1D<N extends Comparable<N>>
-
goToVector
public void goToVector(long index) Move the view to a specific vector. The index specified here should correspond to what is returned by theindex()
method.- See Also:
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<N extends Comparable<N>>
-
hasPrevious
public boolean hasPrevious() -
index
public long index()If the underlyingAccessAnyD
data structure was created as 4x5x7, it can be viewed as 5x7 4-dimensional vectors. The size of the VectorView would be 4, and the index returned by this method indicates which of 5x7 vectors the view currently points to. The range of these indices would be 0-34.- Returns:
- The index of the vector (which vector are we currently viewing).
-
iterator
- Specified by:
iterator
in interfaceIterable<N extends Comparable<N>>
-
next
- Specified by:
next
in interfaceIterator<N extends Comparable<N>>
-
previous
-
remove
public void remove()- Specified by:
remove
in interfaceIterator<N extends Comparable<N>>
-
size
public int size()Description copied from interface:Structure1D
The total number of elements in this structure.- Specified by:
size
in interfaceStructure1D
-
supplyTo
- Specified by:
supplyTo
in interfaceAccess1D.Collectable<N extends Comparable<N>,
Mutate1D>
-
toString
-
getOffset
long getOffset()
-