ARTS  1.0.222
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ConstMatrixView Class Reference

A constant view of a Matrix. More...

#include <matpackI.h>

Inheritance diagram for ConstMatrixView:
MatrixView Matrix

Public Member Functions

Index nrows () const
 Returns the number of rows. More...
 
Index ncols () const
 Returns the number of columns. More...
 
Numeric operator() (Index r, Index c) const
 Plain const index operator. More...
 
ConstMatrixView operator() (const Range &r, const Range &c) const
 Const index operator for subrange. More...
 
ConstVectorView operator() (const Range &r, Index c) const
 Const index operator returning a column as an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index r, const Range &c) const
 Const index operator returning a row as an object of type ConstVectorView. More...
 
ConstIterator2D begin () const
 Return const iterator to first row. More...
 
ConstIterator2D end () const
 Return const iterator behind last row. More...
 

Protected Member Functions

 ConstMatrixView ()
 Default constructor. More...
 
 ConstMatrixView (Numeric *data, const Range &r, const Range &c)
 Explicit constructor. More...
 
 ConstMatrixView (Numeric *data, const Range &pr, const Range &pc, const Range &nr, const Range &nc)
 Recursive constructor. More...
 

Protected Attributes

Range mrr
 The row range of mdata that is actually used. More...
 
Range mcr
 The column range of mdata that is actually used. More...
 
Numericmdata
 Pointer to the plain C array that holds the data. More...
 

Friends

class ConstVectorView
 
class MatrixView
 
class ConstIterator3D
 
class ConstTensor3View
 
ConstMatrixView transpose (ConstMatrixView m)
 Const version of transpose. More...
 

Detailed Description

A constant view of a Matrix.

This, together with the derived class MatrixView, contains the main implementation of a Matrix. It defines the concepts of MatrixView. Plus additionally the recursive subrange operator, which makes it possible to create a MatrixView from a subrange of a MatrixView.

The class Matrix is just a special case of a MatrixView which also allocates storage.

Definition at line 426 of file matpackI.h.

Constructor & Destructor Documentation

◆ ConstMatrixView() [1/3]

ConstMatrixView::ConstMatrixView ( )
inlineprotected

Default constructor.

This is necessary, so that we can have a default constructor for derived classes.

Definition at line 1575 of file matpackI.h.

◆ ConstMatrixView() [2/3]

ConstMatrixView::ConstMatrixView ( Numeric data,
const Range rr,
const Range cr 
)
inlineprotected

Explicit constructor.

This one is used by Matrix to initialize its own MatrixView part. The row range rr must have a stride to account for the length of one row.

Definition at line 1584 of file matpackI.h.

◆ ConstMatrixView() [3/3]

ConstMatrixView::ConstMatrixView ( Numeric data,
const Range pr,
const Range pc,
const Range nr,
const Range nc 
)
inlineprotected

Recursive constructor.

This is used to construct SubMatrices from SubMatrices. That means that the new ranges have to be interpreted relative to the original ranges.

The new ranges may contain -1 for the extent which acts as a joker. However, the used Range constructor converts this to an explicit range, consistent with the original Range.

Parameters
*dataThe actual data.
pPrevious range.
nNew Range.

Definition at line 1605 of file matpackI.h.

Member Function Documentation

◆ begin()

ConstIterator2D ConstMatrixView::begin ( ) const
inline

Return const iterator to first row.

Definition at line 1558 of file matpackI.h.

◆ end()

ConstIterator2D ConstMatrixView::end ( ) const
inline

Return const iterator behind last row.

Definition at line 1566 of file matpackI.h.

◆ ncols()

Index ConstMatrixView::ncols ( ) const
inline

Returns the number of columns.

Definition at line 1497 of file matpackI.h.

◆ nrows()

Index ConstMatrixView::nrows ( ) const
inline

Returns the number of rows.

Definition at line 1491 of file matpackI.h.

◆ operator()() [1/4]

ConstMatrixView ConstMatrixView::operator() ( const Range r,
const Range c 
) const
inline

Const index operator for subrange.

We have to also account for the case, that *this is already a subrange of a Matrix. This allows correct recursive behavior.

Definition at line 1521 of file matpackI.h.

◆ operator()() [2/4]

ConstVectorView ConstMatrixView::operator() ( const Range r,
Index  c 
) const
inline

Const index operator returning a column as an object of type ConstVectorView.

Parameters
rA range of rows.
cIndex of selected column

Definition at line 1532 of file matpackI.h.

◆ operator()() [3/4]

ConstVectorView ConstMatrixView::operator() ( Index  r,
const Range c 
) const
inline

Const index operator returning a row as an object of type ConstVectorView.

Parameters
rIndex of selected row.
cRange of columns

Definition at line 1547 of file matpackI.h.

◆ operator()() [4/4]

Numeric ConstMatrixView::operator() ( Index  r,
Index  c 
) const
inline

Plain const index operator.

Definition at line 1503 of file matpackI.h.

Friends And Related Function Documentation

◆ ConstIterator3D

friend class ConstIterator3D
friend

Definition at line 445 of file matpackI.h.

◆ ConstTensor3View

friend class ConstTensor3View
friend

Definition at line 446 of file matpackI.h.

◆ ConstVectorView

friend class ConstVectorView
friend

Definition at line 443 of file matpackI.h.

◆ MatrixView

friend class MatrixView
friend

Definition at line 444 of file matpackI.h.

◆ transpose

ConstMatrixView transpose ( ConstMatrixView  m)
friend

Const version of transpose.

Definition at line 2373 of file matpackI.h.

Member Data Documentation

◆ mcr

Range ConstMatrixView::mcr
protected

The column range of mdata that is actually used.

Definition at line 462 of file matpackI.h.

◆ mdata

Numeric* ConstMatrixView::mdata
protected

Pointer to the plain C array that holds the data.

Definition at line 464 of file matpackI.h.

◆ mrr

Range ConstMatrixView::mrr
protected

The row range of mdata that is actually used.

Definition at line 460 of file matpackI.h.


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