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 long
myCount
private AccessAnyD<N>
myDelegateAnyD
private long
myLastOffset
private long
myOffset
-
Constructor Summary
Constructors Modifier Constructor Description protected
VectorView(AccessAnyD<N> access)
(package private)
VectorView(AccessAnyD<N> access, long index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AccessAnyD.VectorView<N> other)
long
count()
The total number of elements in this structure.double
doubleValue(int index)
long
estimateSize()
N
get(long index)
(package private) long
getOffset()
void
goToVector(long index)
Move the view to a specific vector.boolean
hasNext()
boolean
hasPrevious()
long
index()
If the underlyingAccessAnyD
data 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()
void
remove()
int
size()
The total number of elements in this structure.void
supplyTo(Mutate1D receiver)
java.lang.String
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
-
-
-
-
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: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 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 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
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:Structure1D
The total number of elements in this structure.- Specified by:
size
in interfaceStructure1D
-
supplyTo
public void supplyTo(Mutate1D receiver)
- Specified by:
supplyTo
in interfaceAccess1D.Collectable<N extends java.lang.Comparable<N>,Mutate1D>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getOffset
long getOffset()
-
-