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>
  • Field Details

    • myCount

      private final long myCount
    • myDelegateAnyD

      private final AccessAnyD<N extends Comparable<N>> myDelegateAnyD
    • myLastOffset

      private final long myLastOffset
    • myOffset

      private long myOffset
  • Constructor Details

    • VectorView

      protected VectorView(AccessAnyD<N> access)
    • VectorView

      VectorView(AccessAnyD<N> access, long index)
  • Method Details

    • compareTo

      public int compareTo(AccessAnyD.VectorView<N> other)
      Specified by:
      compareTo in interface Comparable<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 interface Structure1D
    • doubleValue

      public double doubleValue(int index)
      Specified by:
      doubleValue in interface Access1D<N extends Comparable<N>>
    • estimateSize

      public long estimateSize()
    • get

      public N get(long index)
      Specified by:
      get in interface Access1D<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 the index() method.
      See Also:
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<N extends Comparable<N>>
    • hasPrevious

      public boolean hasPrevious()
    • index

      public long index()
      If the underlying AccessAnyD 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()
      Specified by:
      iterator in interface Iterable<N extends Comparable<N>>
    • next

      public AccessAnyD.VectorView<N> next()
      Specified by:
      next in interface Iterator<N extends Comparable<N>>
    • previous

      public AccessAnyD.VectorView<N> previous()
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<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 interface Structure1D
    • supplyTo

      public void supplyTo(Mutate1D receiver)
      Specified by:
      supplyTo in interface Access1D.Collectable<N extends Comparable<N>,Mutate1D>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getOffset

      long getOffset()