Matrix Class Reference

The Matrix class. More...

#include <matpackI.h>

Inheritance diagram for Matrix:

MatrixView ConstMatrixView

List of all members.

Public Member Functions

 Matrix ()
 Default constructor.
 Matrix (Index r, Index c)
 Constructor setting size.
 Matrix (Index r, Index c, Numeric fill)
 Constructor setting size and filling with constant value.
 Matrix (const ConstMatrixView &v)
 Copy constructor from MatrixView.
 Matrix (const Matrix &v)
 Copy constructor from Matrix.
Matrixoperator= (const Matrix &x)
 Assignment operator from another matrix.
Matrixoperator= (Numeric x)
 Assignment operator from scalar.
Matrixoperator= (const ConstVectorView &v)
 Assignment from a vector.
void resize (Index r, Index c)
 Resize function.
 ~Matrix ()
 Destructor for Matrix.


Detailed Description

The Matrix class.

This is a MatrixView that also allocates storage automatically, and deallocates it when it is destroyed. We take all the functionality from MatrixView. Additionally defined here are:

1. Constructors and destructor. 2. Assignment operator from scalar. 3. Resize function.

Definition at line 544 of file matpackI.h.


Constructor & Destructor Documentation

Matrix::Matrix (  )  [inline]

Default constructor.

Definition at line 2123 of file matpackI.h.

Matrix::Matrix ( Index  r,
Index  c 
) [inline]

Constructor setting size.

This constructor has to set the stride in the row range correctly!

Definition at line 2134 of file matpackI.h.

Matrix::Matrix ( Index  r,
Index  c,
Numeric  fill 
) [inline]

Constructor setting size and filling with constant value.

Definition at line 2143 of file matpackI.h.

Matrix::Matrix ( const ConstMatrixView m  )  [inline]

Copy constructor from MatrixView.

This automatically sets the size and copies the data.

Definition at line 2156 of file matpackI.h.

Matrix::Matrix ( const Matrix m  )  [inline]

Copy constructor from Matrix.

This automatically sets the size and copies the data.

Definition at line 2166 of file matpackI.h.

Matrix::~Matrix (  )  [inline]

Destructor for Matrix.

This is important, since Matrix uses new to allocate storage.

Definition at line 2259 of file matpackI.h.


Member Function Documentation

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

Assignment operator from another matrix.

It is important that this operator exists. Otherwise the = operator seems to copy references instead of content in some cases.

The Behavior of this one is a bit special: If the size of the target Matrix is 0 then it will be automatically resized to match (this is needed to have the correct initialization for constructed classes that use the assignment operator to initialize their data).

Reimplemented from MatrixView.

Definition at line 2188 of file matpackI.h.

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

Assignment operator from scalar.

Assignment operators also seem to be not inherited.

Reimplemented from MatrixView.

Definition at line 2213 of file matpackI.h.

Matrix & Matrix::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 from MatrixView.

Definition at line 2223 of file matpackI.h.

void Matrix::resize ( Index  r,
Index  c 
) [inline]

Resize function.

If the size is already correct this function does nothing. All data is lost after resizing! The new Matrix is not initialized, so it will contain random values.

Definition at line 2237 of file matpackI.h.


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

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