MatrixView Class Reference

The MatrixView class. More...

#include <matpackI.h>

Inheritance diagram for MatrixView:

ConstMatrixView Matrix

List of all members.

Public Member Functions

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.
Numericoperator() (Index r, Index c)
 Plain index operator.
MatrixView operator() (const Range &r, const Range &c)
 Index operator for subrange.
VectorView operator() (const Range &r, Index c)
 Index operator returning a column as an object of type VectorView.
VectorView operator() (Index r, const Range &c)
 Index operator returning a row as an object of type VectorView.
ConstIterator2D begin () const
 Return const iterator to first row.
ConstIterator2D end () const
 Return const iterator behind last row.
Iterator2D begin ()
 Return iterator to first row.
Iterator2D end ()
 Return iterator behind last row.
MatrixViewoperator= (const ConstMatrixView &v)
 Assignment operator.
MatrixViewoperator= (const MatrixView &v)
 Assignment from MatrixView to MatrixView.
MatrixViewoperator= (const Matrix &v)
 Assignment from a Matrix.
MatrixViewoperator= (const ConstVectorView &v)
 Assignment from a vector.
MatrixViewoperator= (Numeric x)
 Assigning a scalar to a MatrixView will set all elements to this value.
MatrixViewoperator*= (Numeric x)
 Multiplication by scalar.
MatrixViewoperator/= (Numeric x)
 Division by scalar.
MatrixViewoperator+= (Numeric x)
 Addition of scalar.
MatrixViewoperator-= (Numeric x)
 Subtraction of scalar.
MatrixViewoperator*= (const ConstMatrixView &x)
 Element-vise multiplication by another Matrix.
MatrixViewoperator/= (const ConstMatrixView &x)
 Element-vise division by another Matrix.
MatrixViewoperator+= (const ConstMatrixView &x)
 Element-vise addition of another Matrix.
MatrixViewoperator-= (const ConstMatrixView &x)
 Element-vise subtraction of another Matrix.
MatrixViewoperator*= (const ConstVectorView &x)
 Element-vise multiplication by a Vector (acting like a 1-column Matrix).
MatrixViewoperator/= (const ConstVectorView &x)
 Element-vise division by a Vector (acting like a 1-column Matrix).
MatrixViewoperator+= (const ConstVectorView &x)
 Element-vise addition of a Vector (acting like a 1-column Matrix).
MatrixViewoperator-= (const ConstVectorView &x)
 Element-vise subtraction of a Vector (acting like a 1-column Matrix).

Protected Member Functions

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

Friends

class VectorView
class Iterator3D
class Tensor3View
ConstMatrixView transpose (ConstMatrixView m)
 Const version of transpose.
MatrixView transpose (MatrixView m)
 Returns the transpose.


Detailed Description

The MatrixView class.

This 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 476 of file matpackI.h.


Constructor & Destructor Documentation

MatrixView::MatrixView (  )  [inline, protected]

Default constructor.

This is necessary, so that we can have a default constructor for the derived class Matrix.

Definition at line 2045 of file matpackI.h.

MatrixView::MatrixView ( 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 2054 of file matpackI.h.

MatrixView::MatrixView ( 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 2073 of file matpackI.h.


Member Function Documentation

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

Plain const index operator.

Has to be redefined here, since it is hiden by the non-const operator of the derived class.

Reimplemented from ConstMatrixView.

Definition at line 1670 of file matpackI.h.

ConstMatrixView MatrixView::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. Has to be redefined here, since it is hiden by the non-const operator of the derived class.

Reimplemented from ConstMatrixView.

Definition at line 1679 of file matpackI.h.

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

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

Has to be redefined here, since it is hiden by the non-const operator of the derived class.

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

Reimplemented from ConstMatrixView.

Definition at line 1690 of file matpackI.h.

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

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

Has to be redefined here, since it is hiden by the non-const operator of the derived class.

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

Reimplemented from ConstMatrixView.

Definition at line 1701 of file matpackI.h.

Numeric & MatrixView::operator() ( Index  r,
Index  c 
) [inline]

Plain index operator.

Definition at line 1707 of file matpackI.h.

MatrixView MatrixView::operator() ( const Range r,
const Range c 
) [inline]

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 1725 of file matpackI.h.

VectorView MatrixView::operator() ( const Range r,
Index  c 
) [inline]

Index operator returning a column as an object of type VectorView.

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

Definition at line 1734 of file matpackI.h.

VectorView MatrixView::operator() ( Index  r,
const Range c 
) [inline]

Index operator returning a row as an object of type VectorView.

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

Definition at line 1748 of file matpackI.h.

ConstIterator2D MatrixView::begin (  )  const [inline]

Return const iterator to first row.

Has to be redefined here, since it is hiden by the non-const operator of the derived class.

Reimplemented from ConstMatrixView.

Definition at line 1760 of file matpackI.h.

ConstIterator2D MatrixView::end (  )  const [inline]

Return const iterator behind last row.

Reimplemented from ConstMatrixView.

Definition at line 1766 of file matpackI.h.

Iterator2D MatrixView::begin (  )  [inline]

Return iterator to first row.

Definition at line 1772 of file matpackI.h.

Iterator2D MatrixView::end (  )  [inline]

Return iterator behind last row.

Definition at line 1779 of file matpackI.h.

MatrixView & MatrixView::operator= ( const ConstMatrixView m  )  [inline]

Assignment operator.

This copies the data from another MatrixView to this MatrixView. Dimensions must agree! Resizing would destroy the selection that we might have done in this MatrixView by setting its range.

Definition at line 1790 of file matpackI.h.

MatrixView & MatrixView::operator= ( const MatrixView m  )  [inline]

Assignment from MatrixView to MatrixView.

This is a tricky one. The problem is that since MatrixView is derived from ConstMatrixView, a default = operator is generated by the compiler, which does not do what we want. So we need this one to override the default.

Definition at line 1805 of file matpackI.h.

MatrixView & MatrixView::operator= ( const Matrix m  )  [inline]

Assignment from a Matrix.

This must exist to overide the automatically generated assignment operators, which don't copy the contents!

Reimplemented in Matrix.

Definition at line 1818 of file matpackI.h.

MatrixView & MatrixView::operator= ( const ConstVectorView v  )  [inline]

Assignment from a vector.

This copies the data from a VectorView to this MatrixView. Dimensions must agree! Resizing would destroy the selection that we might have done in this MatrixView by setting its range.

Reimplemented in Matrix.

Definition at line 1832 of file matpackI.h.

MatrixView & MatrixView::operator= ( Numeric  x  )  [inline]

Assigning a scalar to a MatrixView will set all elements to this value.

Reimplemented in Matrix.

Definition at line 1845 of file matpackI.h.

MatrixView & MatrixView::operator*= ( Numeric  x  )  [inline]

Multiplication by scalar.

Definition at line 1852 of file matpackI.h.

MatrixView & MatrixView::operator/= ( Numeric  x  )  [inline]

Division by scalar.

Definition at line 1865 of file matpackI.h.

MatrixView & MatrixView::operator+= ( Numeric  x  )  [inline]

Addition of scalar.

Definition at line 1878 of file matpackI.h.

MatrixView & MatrixView::operator-= ( Numeric  x  )  [inline]

Subtraction of scalar.

Definition at line 1891 of file matpackI.h.

MatrixView & MatrixView::operator*= ( const ConstMatrixView x  )  [inline]

Element-vise multiplication by another Matrix.

Definition at line 1904 of file matpackI.h.

MatrixView & MatrixView::operator/= ( const ConstMatrixView x  )  [inline]

Element-vise division by another Matrix.

Definition at line 1923 of file matpackI.h.

MatrixView & MatrixView::operator+= ( const ConstMatrixView x  )  [inline]

Element-vise addition of another Matrix.

Definition at line 1942 of file matpackI.h.

MatrixView & MatrixView::operator-= ( const ConstMatrixView x  )  [inline]

Element-vise subtraction of another Matrix.

Definition at line 1961 of file matpackI.h.

MatrixView & MatrixView::operator*= ( const ConstVectorView x  )  [inline]

Element-vise multiplication by a Vector (acting like a 1-column Matrix).

Definition at line 1980 of file matpackI.h.

MatrixView & MatrixView::operator/= ( const ConstVectorView x  )  [inline]

Element-vise division by a Vector (acting like a 1-column Matrix).

Definition at line 1996 of file matpackI.h.

MatrixView & MatrixView::operator+= ( const ConstVectorView x  )  [inline]

Element-vise addition of a Vector (acting like a 1-column Matrix).

Definition at line 2012 of file matpackI.h.

MatrixView & MatrixView::operator-= ( const ConstVectorView x  )  [inline]

Element-vise subtraction of a Vector (acting like a 1-column Matrix).

Definition at line 2028 of file matpackI.h.


Friends And Related Function Documentation

friend class VectorView [friend]

Definition at line 521 of file matpackI.h.

friend class Iterator3D [friend]

Definition at line 522 of file matpackI.h.

friend class Tensor3View [friend]

Definition at line 523 of file matpackI.h.

ConstMatrixView transpose ( ConstMatrixView  m  )  [friend]

Const version of transpose.

Reimplemented from ConstMatrixView.

Definition at line 2373 of file matpackI.h.

MatrixView transpose ( MatrixView  m  )  [friend]

Returns the transpose.

This creates a special MatrixView for the transpose. The original is not changed!

Definition at line 2380 of file matpackI.h.


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

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