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 Access1D
Access1D.Aggregatable<N>, Access1D.Collectable<N,R>, Access1D.ElementView<N>, Access1D.SelectionView<N>, Access1D.Sliceable<N>, Access1D.Visitable<N> Nested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S,B>, Structure1D.LongIndex, Structure1D.LoopCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longprivate final AccessAnyD<N> private final longprivate long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVectorView(AccessAnyD<N> access) (package private)VectorView(AccessAnyD<N> access, long index) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(AccessAnyD.VectorView<N> other) longcount()The total number of elements in this structure.doubledoubleValue(int index) longget(long index) (package private) longvoidgoToVector(long index) Move the view to a specific vector.booleanhasNext()booleanlongindex()If the underlyingAccessAnyDdata structure was created as 4x5x7, it can be viewed as 5x7 4-dimensional vectors.iterator()next()previous()voidremove()intsize()The total number of elements in this structure.voidtoString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Access1D
asCollectable1D, asKeyed1D, asList, axpy, byteValue, byteValue, dot, doubleValue, elements, floatValue, floatValue, intValue, intValue, longValue, longValue, nonzeros, select, shortValue, shortValue, supplyTo, toList, toRawCopy1DMethods inherited from interface Access1D.Collectable
collectMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface 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:
compareToin interfaceComparable<N extends Comparable<N>>
-
count
public long count()Description copied from interface:Structure1DThe 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:
countin interfaceStructure1D
-
doubleValue
public double doubleValue(int index) - Specified by:
doubleValuein interfaceAccess1D<N extends Comparable<N>>
-
estimateSize
public long estimateSize() -
get
-
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:
hasNextin interfaceIterator<N extends Comparable<N>>
-
hasPrevious
public boolean hasPrevious() -
index
public long index()If the underlyingAccessAnyDdata 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:
iteratorin interfaceIterable<N extends Comparable<N>>
-
next
- Specified by:
nextin interfaceIterator<N extends Comparable<N>>
-
previous
-
remove
public void remove()- Specified by:
removein interfaceIterator<N extends Comparable<N>>
-
size
public int size()Description copied from interface:Structure1DThe total number of elements in this structure.- Specified by:
sizein interfaceStructure1D
-
supplyTo
- Specified by:
supplyToin interfaceAccess1D.Collectable<N extends Comparable<N>, Mutate1D>
-
toString
-
getOffset
long getOffset()
-