#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. | |
virtual | ~Matrix () |
Destructor for Matrix. | |
Numeric * | get_raw_data () |
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 758 of file matpackI.h.
Matrix::Matrix | ( | ) |
Constructor setting size.
This constructor has to set the stride in the row range correctly!
Definition at line 1427 of file matpackI.cc.
Constructor setting size and filling with constant value.
Definition at line 1436 of file matpackI.cc.
References ConstMatrixView::mdata.
Matrix::Matrix | ( | const ConstMatrixView & | m | ) |
Copy constructor from MatrixView.
This automatically sets the size and copies the data.
Definition at line 1450 of file matpackI.cc.
References MatrixView::begin(), ConstMatrixView::begin(), copy(), and ConstMatrixView::end().
Matrix::Matrix | ( | const Matrix & | m | ) |
Copy constructor from Matrix.
This automatically sets the size and copies the data.
Definition at line 1460 of file matpackI.cc.
References MatrixView::begin(), copy(), and MatrixView::end().
Matrix::~Matrix | ( | ) | [virtual] |
Destructor for Matrix.
This is important, since Matrix uses new to allocate storage.
Definition at line 1562 of file matpackI.cc.
References ConstMatrixView::mdata.
Assignment operator from another matrix.
While dimensions of MatrixViews can not be adjusted, dimensions of matrices *can* be adjusted. Hence, the behavior of the assignment operator is different.
In this case the size of the target is automatically adjusted. This is important, so that structures containing matrices are copied correctly.
This is a deviation from the old ARTS paradigm that sizes must match exactly before copying!
Note: It is sufficient to have only this one version of the assignment (Matrix = Matrix). It implicitly covers the cases Matrix=MatrixView, etc, because there is a default constructor for Matrix from MatrixView. (See C++ Primer Plus, page 571ff.)
m | The other matrix to assign to this one. |
Reimplemented from MatrixView.
Definition at line 1497 of file matpackI.cc.
References MatrixView::begin(), copy(), MatrixView::end(), ConstMatrixView::mcr, Range::mextent, ConstMatrixView::mrr, and resize().
Assignment operator from scalar.
Assignment operators also seem to be not inherited.
Reimplemented from MatrixView.
Definition at line 1510 of file matpackI.cc.
References MatrixView::begin(), copy(), and MatrixView::end().
Matrix & Matrix::operator= | ( | const ConstVectorView & | v | ) |
Assignment from a vector.
This copies the data from a VectorView to this MatrixView.
The dimension is adjusted automatically.
v | The vector to assign to this matrix. |
Reimplemented from MatrixView.
Definition at line 1529 of file matpackI.cc.
References MatrixView::begin(), copy(), ConstVectorView::nelem(), and resize().
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.
Reimplemented in GField2.
Definition at line 1540 of file matpackI.cc.
References ConstMatrixView::mcr, ConstMatrixView::mdata, Range::mextent, ConstMatrixView::mrr, Range::mstart, and Range::mstride.
Referenced by abs_coefCalcFromXsec(), abs_coefCalcSaveMemory(), abs_lookupSetup(), abs_lookupSetupBatch(), abs_lookupSetupWide(), abs_scalar_gasFromAbsCoef(), abs_vecInit(), AbsInputFromRteScalars(), GasAbsLookup::Adapt(), complex_nWaterLiebe93(), GasAbsLookup::Extract(), get_refr_index_2d(), get_refr_index_3d(), interp_atmfield_gp2itw(), interp_atmsurface_gp2itw(), iy_calc(), iy_interp_cloudbox_field(), jacobianClose(), jacobianInit(), Matrix1ColFromVector(), Matrix1RowFromVector(), Matrix2ColFromVectors(), Matrix2RowFromVectors(), Matrix3ColFromVectors(), Matrix3RowFromVectors(), MatrixCBR(), MatrixMatrixMultiply(), MatrixPlanck(), MatrixScale(), MatrixSetConstant(), MatrixUnitIntensity(), nc_read_from_file(), operator=(), opt_prop_sptFromData(), ppath_copy(), ppath_init_structure(), r_geoidSpherical(), r_geoidWGS84(), GField2::resize(), RteCalc(), RteCalcMC(), surfaceBlackbody(), surfaceFlatRefractiveIndex(), surfaceFlatVaryingEmissivity(), TArrayCalc(), test29(), test30(), xml_read_from_stream(), ybatchCalc_implementation(), ybatchMetProfiles(), ybatchMetProfilesClear(), and za_gridOpt().
Numeric* Matrix::get_raw_data | ( | ) | [inline] |