Module ojalgo
Package org.ojalgo.structure
Class AccessAnyD.VectorView<N extends java.lang.Comparable<N>>
- java.lang.Object
-
- org.ojalgo.structure.AccessAnyD.VectorView<N>
-
- All Implemented Interfaces:
java.lang.Comparable<AccessAnyD.VectorView<N>>,java.lang.Iterable<AccessAnyD.VectorView<N>>,java.util.Iterator<AccessAnyD.VectorView<N>>,Access1D<N>,Access1D.Collectable<N,Mutate1D>,Structure1D
- Enclosing interface:
- AccessAnyD<N extends java.lang.Comparable<N>>
public static final class AccessAnyD.VectorView<N extends java.lang.Comparable<N>> extends java.lang.Object implements Access1D<N>, java.lang.Iterable<AccessAnyD.VectorView<N>>, java.util.Iterator<AccessAnyD.VectorView<N>>, java.lang.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 java.lang.Comparable<N>>, Access1D.Collectable<N extends java.lang.Comparable<N>,R extends Mutate1D>, Access1D.ElementView<N extends java.lang.Comparable<N>>, Access1D.SelectionView<N extends java.lang.Comparable<N>>, Access1D.Sliceable<N extends java.lang.Comparable<N>>, Access1D.Visitable<N extends java.lang.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
Fields Modifier and Type Field Description private longmyCountprivate AccessAnyD<N>myDelegateAnyDprivate longmyLastOffsetprivate longmyOffset
-
Constructor Summary
Constructors Modifier Constructor Description protectedVectorView(AccessAnyD<N> access)(package private)VectorView(AccessAnyD<N> access, long index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(AccessAnyD.VectorView<N> other)longcount()The total number of elements in this structure.doubledoubleValue(int index)longestimateSize()Nget(long index)(package private) longgetOffset()voidgoToVector(long index)Move the view to a specific vector.booleanhasNext()booleanhasPrevious()longindex()If the underlyingAccessAnyDdata structure was created as 4x5x7, it can be viewed as 5x7 4-dimensional vectors.AccessAnyD.VectorView<N>iterator()AccessAnyD.VectorView<N>next()AccessAnyD.VectorView<N>previous()voidremove()intsize()The total number of elements in this structure.voidsupplyTo(Mutate1D receiver)java.lang.StringtoString()-
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, asList, axpy, byteValue, byteValue, dot, doubleValue, elements, floatValue, floatValue, intValue, intValue, longValue, longValue, nonzeros, select, shortValue, shortValue, supplyTo, toList, toRawCopy1D
-
Methods inherited from interface org.ojalgo.structure.Access1D.Collectable
collect
-
-
-
-
Field Detail
-
myCount
private final long myCount
-
myDelegateAnyD
private final AccessAnyD<N extends java.lang.Comparable<N>> myDelegateAnyD
-
myLastOffset
private final long myLastOffset
-
myOffset
private long myOffset
-
-
Constructor Detail
-
VectorView
protected VectorView(AccessAnyD<N> access)
-
VectorView
VectorView(AccessAnyD<N> access, long index)
-
-
Method Detail
-
compareTo
public int compareTo(AccessAnyD.VectorView<N> other)
-
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 java.lang.Comparable<N>>
-
estimateSize
public long estimateSize()
-
get
public N get(long index)
-
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:
index()
-
hasNext
public boolean hasNext()
-
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
public AccessAnyD.VectorView<N> iterator()
-
next
public AccessAnyD.VectorView<N> next()
-
previous
public AccessAnyD.VectorView<N> previous()
-
remove
public void remove()
-
size
public int size()
Description copied from interface:Structure1DThe total number of elements in this structure.- Specified by:
sizein interfaceStructure1D
-
supplyTo
public void supplyTo(Mutate1D receiver)
- Specified by:
supplyToin interfaceAccess1D.Collectable<N extends java.lang.Comparable<N>,Mutate1D>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getOffset
long getOffset()
-
-