ARTS 2.5.0 (git: 9ee3ac6c)
ConstIterator1D Class Reference

The constant iterator class for sub vectors. More...

#include <matpackI.h>

Public Types

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

Public Member Functions

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

Private Attributes

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

Friends

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

Detailed Description

The constant iterator class for sub vectors.

This takes into account the defined stride.

Definition at line 425 of file matpackI.h.

Member Typedef Documentation

◆ difference_type

Definition at line 427 of file matpackI.h.

◆ iterator_category

using ConstIterator1D::iterator_category = std::random_access_iterator_tag

Definition at line 431 of file matpackI.h.

◆ pointer

Definition at line 429 of file matpackI.h.

◆ reference

Definition at line 430 of file matpackI.h.

◆ value_type

Definition at line 428 of file matpackI.h.

Constructor & Destructor Documentation

◆ ConstIterator1D() [1/2]

ConstIterator1D::ConstIterator1D ( )
default

Default constructor.

◆ ConstIterator1D() [2/2]

ConstIterator1D::ConstIterator1D ( const Numeric x,
Index  stride 
)
inline

Explicit constructor.

Definition at line 437 of file matpackI.h.

Member Function Documentation

◆ operator!=()

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

Not equal operator, needed for algorithms like copy.

Definition at line 452 of file matpackI.h.

References mx.

Referenced by operator==().

◆ operator*()

const Numeric & ConstIterator1D::operator* ( ) const
inline

Dereferencing.

Definition at line 449 of file matpackI.h.

References mx.

◆ operator++()

ConstIterator1D & ConstIterator1D::operator++ ( )
inline

Prefix increment operator.

Definition at line 443 of file matpackI.h.

References mstride, and mx.

◆ operator-()

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

Definition at line 463 of file matpackI.h.

References mstride, and mx.

◆ operator==()

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

Definition at line 459 of file matpackI.h.

References operator!=().

Friends And Related Function Documentation

◆ copy

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

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 299 of file matpackI.cc.

Member Data Documentation

◆ mstride

Index ConstIterator1D::mstride {0}
private

Stride.

Definition at line 475 of file matpackI.h.

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

◆ mx

const Numeric* ConstIterator1D::mx {nullptr}
private

Current position.

Definition at line 473 of file matpackI.h.

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


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