ARTS 2.5.10 (git: 2f1c442c)
Iterator1D Class Reference

The iterator class for sub vectors. More...

#include <matpackI.h>

Public Types

using difference_type = Index
 
using value_type = Numeric
 
using pointer = Numeric *
 
using reference = Numeric &
 
using iterator_category = std::random_access_iterator_tag
 

Public Member Functions

 Iterator1D ()=default
 Default constructor.
 
 Iterator1D (Numeric *x, Index stride) ARTS_NOEXCEPT
 Explicit constructor.
 
Iterator1Doperator++ () ARTS_NOEXCEPT
 Prefix increment operator.
 
Numericoperator* () const ARTS_NOEXCEPT
 Dereferencing.
 
bool operator!= (const Iterator1D &other) const ARTS_NOEXCEPT
 Not equal operator, needed for algorithms like copy.
 
bool operator== (const Iterator1D &other) const ARTS_NOEXCEPT
 
Index operator- (const Iterator1D &other) const ARTS_NOEXCEPT
 

Private Attributes

Numericmx {nullptr}
 Current position.
 
Index mstride {0}
 Stride.
 

Friends

void copy (ConstIterator1D origin, const ConstIterator1D &end, Iterator1D target)
 Copy data between begin and end to target.
 

Detailed Description

The iterator class for sub vectors.

This takes into account the defined stride.

Definition at line 399 of file matpackI.h.

Member Typedef Documentation

◆ difference_type

Definition at line 401 of file matpackI.h.

◆ iterator_category

using Iterator1D::iterator_category = std::random_access_iterator_tag

Definition at line 405 of file matpackI.h.

◆ pointer

Definition at line 403 of file matpackI.h.

◆ reference

Definition at line 404 of file matpackI.h.

◆ value_type

Definition at line 402 of file matpackI.h.

Constructor & Destructor Documentation

◆ Iterator1D() [1/2]

Iterator1D::Iterator1D ( )
default

Default constructor.

◆ Iterator1D() [2/2]

Iterator1D::Iterator1D ( Numeric x,
Index  stride 
)
inline

Explicit constructor.

Definition at line 411 of file matpackI.h.

Member Function Documentation

◆ operator!=()

bool Iterator1D::operator!= ( const Iterator1D other) const
inline

Not equal operator, needed for algorithms like copy.

Definition at line 428 of file matpackI.h.

References mx.

Referenced by operator==().

◆ operator*()

Numeric & Iterator1D::operator* ( ) const
inline

Dereferencing.

Definition at line 425 of file matpackI.h.

References mx.

◆ operator++()

Iterator1D & Iterator1D::operator++ ( )
inline

Prefix increment operator.

Definition at line 419 of file matpackI.h.

References mstride, and mx.

◆ operator-()

Index Iterator1D::operator- ( const Iterator1D other) const
inline

Definition at line 437 of file matpackI.h.

References mstride, and mx.

◆ operator==()

bool Iterator1D::operator== ( const Iterator1D other) const
inline

Definition at line 433 of file matpackI.h.

References operator!=().

Friends And Related Function Documentation

◆ copy

void copy ( ConstIterator1D  origin,
const ConstIterator1D end,
Iterator1D  target 
)
friend

Copy data between begin and end to target.

Target must be a valid area of memory. Note that the strides in the iterators can be different, so that we can for example copy data between different kinds of subvectors.

Definition at line 288 of file matpackI.cc.

Member Data Documentation

◆ mstride

Index Iterator1D::mstride {0}
private

Stride.

Definition at line 453 of file matpackI.h.

Referenced by operator++(), and operator-().

◆ mx

Numeric* Iterator1D::mx {nullptr}
private

Current position.

Definition at line 451 of file matpackI.h.

Referenced by operator!=(), operator*(), operator++(), and operator-().


The documentation for this class was generated from the following file: