ConstMatrixView Class Reference

A constant view of a Matrix. More...

#include <matpackI.h>

Inheritance diagram for ConstMatrixView:

MatrixView Matrix

List of all members.

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Friends

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


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::ConstMatrixView (  )  [inline, protected]

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::ConstMatrixView ( Numeric data,
const Range rr,
const Range cr 
) [inline, protected]

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::ConstMatrixView ( Numeric data,
const Range pr,
const Range pc,
const Range nr,
const Range nc 
) [inline, protected]

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:
*data The actual data.
p Previous range.
n New Range.

Definition at line 1605 of file matpackI.h.


Member Function Documentation

Index ConstMatrixView::nrows (  )  const [inline]

Returns the number of rows.

Definition at line 1491 of file matpackI.h.

Index ConstMatrixView::ncols (  )  const [inline]

Returns the number of columns.

Definition at line 1497 of file matpackI.h.

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

Plain const index operator.

Reimplemented in MatrixView.

Definition at line 1503 of file matpackI.h.

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.

Reimplemented in MatrixView.

Definition at line 1521 of file matpackI.h.

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

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

Parameters:
r A range of rows.
c Index of selected column

Reimplemented in MatrixView.

Definition at line 1532 of file matpackI.h.

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

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

Parameters:
r Index of selected row.
c Range of columns

Reimplemented in MatrixView.

Definition at line 1547 of file matpackI.h.

ConstIterator2D ConstMatrixView::begin (  )  const [inline]

Return const iterator to first row.

Reimplemented in MatrixView.

Definition at line 1558 of file matpackI.h.

ConstIterator2D ConstMatrixView::end (  )  const [inline]

Return const iterator behind last row.

Reimplemented in MatrixView.

Definition at line 1566 of file matpackI.h.


Friends And Related Function Documentation

friend class ConstVectorView [friend]

Definition at line 443 of file matpackI.h.

friend class MatrixView [friend]

Definition at line 444 of file matpackI.h.

friend class ConstIterator3D [friend]

Definition at line 445 of file matpackI.h.

friend class ConstTensor3View [friend]

Definition at line 446 of file matpackI.h.

ConstMatrixView transpose ( ConstMatrixView  m  )  [friend]

Const version of transpose.

Reimplemented in MatrixView.

Definition at line 2373 of file matpackI.h.


Member Data Documentation

The row range of mdata that is actually used.

Definition at line 460 of file matpackI.h.

The column range of mdata that is actually used.

Definition at line 462 of file matpackI.h.

Pointer to the plain C array that holds the data.

Definition at line 464 of file matpackI.h.


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

Generated on Wed Feb 4 08:17:29 2009 for ARTS by  doxygen 1.5.6