#include <matpackI.h>
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. | |
Matrix & | operator= (const Matrix &x) |
Assignment operator from another matrix. | |
Matrix & | operator= (Numeric x) |
Assignment operator from scalar. | |
Matrix & | operator= (const ConstVectorView &v) |
Assignment from a vector. | |
void | resize (Index r, Index c) |
Resize function. | |
~Matrix () | |
Destructor for Matrix. |
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.
Matrix::Matrix | ( | ) | [inline] |
Constructor setting size.
This constructor has to set the stride in the row range correctly!
Definition at line 2134 of file matpackI.h.
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.
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.
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.
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.