#include <matpackI.h>
Public Types | |
typedef ConstIterator2D | const_iterator |
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. | |
virtual | ~ConstMatrixView () |
Destructor. | |
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. | |
Numeric * | mdata |
Pointer to the plain C array that holds the data. | |
Friends | |
class | MatrixView |
class | ConstIterator3D |
class | ConstVectorView |
class | ConstTensor3View |
class | ConstTensor4View |
class | ConstTensor5View |
class | ConstTensor6View |
class | ConstTensor7View |
ConstMatrixView | transpose (ConstMatrixView m) |
Const version of transpose. | |
int | poly_root_solve (Matrix &roots, Vector &coeffs) |
void | mult (VectorView, const ConstMatrixView &, const ConstVectorView &) |
Matrix Vector multiplication. |
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 582 of file matpackI.h.
Definition at line 585 of file matpackI.h.
virtual ConstMatrixView::~ConstMatrixView | ( | ) | [inline, virtual] |
ConstMatrixView::ConstMatrixView | ( | ) | [protected] |
Default constructor.
This is necessary, so that we can have a default constructor for derived classes.
Definition at line 855 of file matpackI.cc.
Referenced by operator()(), and transpose().
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 864 of file matpackI.cc.
ConstMatrixView::ConstMatrixView | ( | Numeric * | data, | |
const Range & | pr, | |||
const Range & | pc, | |||
const Range & | nr, | |||
const Range & | nc | |||
) | [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.
*data | The actual data. | |
pr | Previous range. | |
pc | Previous range. | |
nr | New Range. | |
nc | New Range. |
Definition at line 888 of file matpackI.cc.
Index ConstMatrixView::nrows | ( | ) | const |
Returns the number of rows.
Definition at line 787 of file matpackI.cc.
References Range::mextent, and mrr.
Referenced by abs_coefCalcFromXsec(), abs_coefCalcSaveMemory(), abs_fieldCalc(), abs_lookupSetupBatch(), abs_vecAddGas(), abs_vecAddPart(), abs_xsec_per_speciesAddConts(), abs_xsec_per_speciesAddLines(), apply_y_unit(), atm_fields_compactFromMatrix(), BF86_CIA_N2(), calc_lookup_error(), GField2::checksize(), chk_atm_surface(), chk_matrix_nrows(), chk_size(), CKD24_H20(), CKD_222_foreign_h2o(), CKD_222_self_h2o(), CKD_241_co2(), CKD_242_foreign_h2o(), CKD_242_self_h2o(), CKD_mt_100_foreign_h2o(), CKD_mt_100_self_h2o(), CKD_mt_CIAfun_n2(), CKD_mt_CIAfun_o2(), CKD_mt_CIArot_n2(), CKD_mt_co2(), CKD_mt_v0v0_o2(), CKD_mt_v1v0_o2(), cloud_RT_no_background(), cloud_RT_surface(), CP98H2OAbsModel(), describe(), ext_matAddGas(), from_dq_to_dx(), get_radiative_background(), get_refr_index_1d(), id_mat(), is_diagonal(), is_singular(), is_size(), itw2p(), jacobianAddAbsSpecies(), jacobianAddPointing(), jacobianAddPolyfit(), jacobianAddTemperature(), jacobianCalcPointing(), jacobianCalcPolyfit(), jacobianClose(), lubacksub(), ludcmp(), MaTipping_H2O_foreign_continuum(), matrix_exp_p30(), MatrixMatrixMultiply(), MatrixScale(), MCGeneral(), MCIPA(), mean(), MPM02H2OAbsModel(), MPM85O2AbsModel(), MPM87H2OAbsModel(), MPM87O2AbsModel(), MPM89H2OAbsModel(), MPM89O2AbsModel(), MPM92O2AbsModel(), MPM93_H2O_continuum(), MPM93_N2_continuum(), MPM93_O2_continuum(), MPM93H2OAbsModel(), MPM93IceCrystalAbs(), MPM93O2AbsModel(), MPM93RainExt(), MPM93WaterDropletAbs(), mult(), nc_write_to_file(), norm_inf(), MatrixView::operator*=(), MatrixView::operator+=(), MatrixView::operator-=(), MatrixView::operator/=(), opt_prop_sptFromData(), opt_prop_sptFromMonoData(), Pardo_ATM_H2O_ForeignContinuum(), Pardo_ATM_N2_dry_continuum(), perturbation_field_2d(), pmomCalc(), poly_root_solve(), ppath_copy(), ppath_step_refr_2d(), PWR93O2AbsModel(), PWR98H2OAbsModel(), r_geoidSpherical(), r_geoidWGS84(), Rosenkranz_CO2_foreign_continuum(), Rosenkranz_CO2_self_continuum(), Rosenkranz_N2_self_continuum(), Rosenkranz_O2_continuum(), rte_std(), rtecalc_check_input(), Select(), sensor_posAddGeoidWGS84(), sensor_posAddRgeoid(), Standard_H2O_foreign_continuum(), Standard_H2O_self_continuum(), Standard_N2_self_continuum(), Standard_O2_continuum(), surface_calc(), surface_specular_R_and_b(), surfaceFlatRefractiveIndex(), test1(), test30(), transform(), VectorExtractFromMatrix(), VectorMatrixMultiply(), VectorZtanToZa1D(), VectorZtanToZaRefr1D(), xml_write_to_stream(), xsec_continuum_tag(), xsec_species(), ybatchMetProfiles(), ybatchMetProfilesClear(), and ybatchUnit().
Index ConstMatrixView::ncols | ( | ) | const |
Returns the number of columns.
Definition at line 793 of file matpackI.cc.
References mcr, and Range::mextent.
Referenced by abs_coefCalcFromXsec(), abs_coefCalcSaveMemory(), abs_fieldCalc(), abs_h2oSet(), abs_lookupSetupBatch(), abs_n2Set(), abs_vecAddPart(), abs_xsec_per_speciesAddConts(), apply_y_unit(), atm_fields_compactFromMatrix(), BF86_CIA_N2(), GField2::checksize(), chk_atm_surface(), chk_matrix_ncols(), chk_size(), CKD24_H20(), CKD_222_foreign_h2o(), CKD_222_self_h2o(), CKD_241_co2(), CKD_242_foreign_h2o(), CKD_242_self_h2o(), CKD_mt_100_foreign_h2o(), CKD_mt_100_self_h2o(), CKD_mt_CIAfun_n2(), CKD_mt_CIAfun_o2(), CKD_mt_CIArot_n2(), CKD_mt_co2(), CKD_mt_v0v0_o2(), CKD_mt_v1v0_o2(), cloud_RT_surface(), CP98H2OAbsModel(), describe(), DoitCloudboxFieldPut(), ext_matTransform(), from_dq_to_dx(), get_radiative_background(), id_mat(), interp_atmfield_by_itw(), interp_atmsurface_by_itw(), is_diagonal(), is_singular(), is_size(), itw2p(), jacobianAddAbsSpecies(), jacobianAddPointing(), jacobianAddPolyfit(), jacobianAddTemperature(), jacobianCalc(), jacobianClose(), MaTipping_H2O_foreign_continuum(), matrix_exp(), matrix_exp_p30(), MatrixMatrixMultiply(), MatrixScale(), mean(), MPM02H2OAbsModel(), MPM85O2AbsModel(), MPM87H2OAbsModel(), MPM87O2AbsModel(), MPM89H2OAbsModel(), MPM89O2AbsModel(), MPM92O2AbsModel(), MPM93_H2O_continuum(), MPM93_N2_continuum(), MPM93_O2_continuum(), MPM93H2OAbsModel(), MPM93IceCrystalAbs(), MPM93O2AbsModel(), MPM93RainExt(), MPM93WaterDropletAbs(), mult(), nc_write_to_file(), norm_inf(), MatrixView::operator*=(), MatrixView::operator+=(), MatrixView::operator-=(), MatrixView::operator/=(), Pardo_ATM_H2O_ForeignContinuum(), Pardo_ATM_N2_dry_continuum(), perturbation_field_2d(), pha_mat_labCalc(), pha_matTransform(), phase_functionCalc(), poly_root_solve(), ppath_step_refr_1d(), ppath_step_refr_2d(), PWR93O2AbsModel(), PWR98H2OAbsModel(), r_geoidSpherical(), r_geoidWGS84(), Rosenkranz_CO2_foreign_continuum(), Rosenkranz_CO2_self_continuum(), Rosenkranz_N2_self_continuum(), Rosenkranz_O2_continuum(), rte_posShift(), RteCalc(), rtecalc_check_input(), RteCalcMC(), Select(), sensor_responseAntenna(), Standard_H2O_foreign_continuum(), Standard_H2O_self_continuum(), Standard_N2_self_continuum(), Standard_O2_continuum(), surface_specular_R_and_b(), test1(), test30(), transform(), VectorExtractFromMatrix(), VectorMatrixMultiply(), xml_write_to_stream(), xsec_continuum_tag(), xsec_species(), and ybatchUnit().
Plain const index operator.
Reimplemented in MatrixView.
Definition at line 593 of file matpackI.h.
References mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
Referenced by MatrixView::operator()().
ConstMatrixView ConstMatrixView::operator() | ( | const Range & | r, | |
const Range & | c | |||
) | const |
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 801 of file matpackI.cc.
References ConstMatrixView(), mcr, mdata, and mrr.
ConstVectorView ConstMatrixView::operator() | ( | const Range & | r, | |
Index | c | |||
) | const |
Const index operator returning a column as an object of type ConstVectorView.
r | A range of rows. | |
c | Index of selected column |
Reimplemented in MatrixView.
Definition at line 812 of file matpackI.cc.
References ConstVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
ConstVectorView ConstMatrixView::operator() | ( | Index | r, | |
const Range & | c | |||
) | const |
Const index operator returning a row as an object of type ConstVectorView.
r | Index of selected row. | |
c | Range of columns |
Reimplemented in MatrixView.
Definition at line 827 of file matpackI.cc.
References ConstVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
ConstIterator2D ConstMatrixView::begin | ( | ) | const |
Return const iterator to first row.
Reimplemented in MatrixView.
Definition at line 838 of file matpackI.cc.
References ConstVectorView, mcr, mdata, mrr, Range::mstart, and Range::mstride.
Referenced by MatrixView::begin(), Matrix::Matrix(), max(), mean(), min(), mult(), MatrixView::operator*=(), MatrixView::operator+=(), MatrixView::operator-=(), MatrixView::operator/=(), operator<<(), MatrixView::operator=(), and transform().
ConstIterator2D ConstMatrixView::end | ( | ) | const |
Return const iterator behind last row.
Reimplemented in MatrixView.
Definition at line 846 of file matpackI.cc.
References ConstVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.
Referenced by MatrixView::end(), Matrix::Matrix(), max(), mean(), min(), operator<<(), MatrixView::operator=(), and transform().
friend class MatrixView [friend] |
Definition at line 616 of file matpackI.h.
friend class ConstIterator3D [friend] |
Definition at line 620 of file matpackI.h.
friend class ConstVectorView [friend] |
friend class ConstTensor3View [friend] |
Definition at line 622 of file matpackI.h.
friend class ConstTensor4View [friend] |
Definition at line 623 of file matpackI.h.
friend class ConstTensor5View [friend] |
Definition at line 624 of file matpackI.h.
friend class ConstTensor6View [friend] |
Definition at line 625 of file matpackI.h.
friend class ConstTensor7View [friend] |
Definition at line 626 of file matpackI.h.
ConstMatrixView transpose | ( | ConstMatrixView | m | ) | [friend] |
Const version of transpose.
Reimplemented in MatrixView.
Definition at line 1680 of file matpackI.cc.
Definition at line 100 of file poly_roots.cc.
void mult | ( | VectorView | , | |
const ConstMatrixView & | , | |||
const ConstVectorView & | ||||
) | [friend] |
y = M*x. Note that the order is different from MTL, output comes first! Dimensions of y, M, and x must match. No memory reallocation takes place, only the data is copied. Using this function on overlapping MatrixViews belonging to the same Matrix will lead to unpredictable results. In particular, this means that A and B must not be the same matrix! The implementation here is different from the other multiplication routines. It does not use iterators but a more drastic approach to gain maximum performance.
Definition at line 1598 of file matpackI.cc.
Range ConstMatrixView::mrr [protected] |
The row range of mdata that is actually used.
Definition at line 643 of file matpackI.h.
Referenced by MatrixView::begin(), begin(), MatrixView::end(), end(), MatrixView::get_c_array(), mult(), nrows(), ConstIterator3D::operator!=(), Iterator3D::operator!=(), MatrixView::operator()(), operator()(), Matrix::operator=(), MatrixView::operator=(), Matrix::resize(), and transpose().
Range ConstMatrixView::mcr [protected] |
The column range of mdata that is actually used.
Definition at line 645 of file matpackI.h.
Referenced by MatrixView::begin(), begin(), MatrixView::end(), end(), MatrixView::get_c_array(), mult(), ncols(), ConstIterator3D::operator!=(), Iterator3D::operator!=(), MatrixView::operator()(), operator()(), Matrix::operator=(), MatrixView::operator=(), Matrix::resize(), and transpose().
Numeric* ConstMatrixView::mdata [protected] |
Pointer to the plain C array that holds the data.
Definition at line 647 of file matpackI.h.
Referenced by MatrixView::begin(), begin(), MatrixView::end(), end(), MatrixView::get_c_array(), Matrix::get_raw_data(), Matrix::Matrix(), mult(), ConstIterator3D::operator!=(), Iterator3D::operator!=(), MatrixView::operator()(), operator()(), ConstIterator3D::operator++(), Iterator3D::operator++(), poly_root_solve(), Matrix::resize(), transpose(), and Matrix::~Matrix().