ARTS  2.2.66
ConstMatrixView Class Reference

A constant view of a Matrix. More...

#include <matpackI.h>

Inheritance diagram for ConstMatrixView:
MatrixView Matrix

Public Types

typedef ConstIterator2D const_iterator
 

Public Member Functions

Index nrows () const
 Returns the number of rows. More...
 
Index ncols () const
 Returns the number of columns. More...
 
Numeric operator() (Index r, Index c) const
 Plain const index operator. More...
 
Numeric get (Index r, Index c) const
 Get element implementation without assertions. More...
 
ConstMatrixView operator() (const Range &r, const Range &c) const
 Const index operator for subrange. More...
 
ConstVectorView operator() (const Range &r, Index c) const
 Const index operator returning a column as an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index r, const Range &c) const
 Const index operator returning a row as an object of type ConstVectorView. More...
 
ConstIterator2D begin () const
 Return const iterator to first row. More...
 
ConstIterator2D end () const
 Return const iterator behind last row. More...
 
virtual ~ConstMatrixView ()
 Destructor. More...
 

Protected Member Functions

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

Protected Attributes

Range mrr
 The row range of mdata that is actually used. More...
 
Range mcr
 The column range of mdata that is actually used. More...
 
Numericmdata
 Pointer to the plain C array that holds the data. More...
 

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. More...
 
int poly_root_solve (Matrix &roots, Vector &coeffs)
 
void mult (VectorView, const ConstMatrixView &, const ConstVectorView &)
 Matrix Vector multiplication. More...
 

Detailed Description

A constant view of a Matrix.

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

Member Typedef Documentation

◆ const_iterator

Definition at line 599 of file matpackI.h.

Constructor & Destructor Documentation

◆ ~ConstMatrixView()

virtual ConstMatrixView::~ConstMatrixView ( )
inlinevirtual

Destructor.

Definition at line 636 of file matpackI.h.

◆ ConstMatrixView() [1/3]

ConstMatrixView::ConstMatrixView ( )
protected

Default constructor.

This is necessary, so that we can have a default constructor for derived classes.

Definition at line 900 of file matpackI.cc.

Referenced by operator()().

◆ ConstMatrixView() [2/3]

ConstMatrixView::ConstMatrixView ( Numeric data,
const Range rr,
const Range cr 
)
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 909 of file matpackI.cc.

◆ ConstMatrixView() [3/3]

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.

Parameters
*dataThe actual data.
prPrevious range.
pcPrevious range.
nrNew Range.
ncNew Range.

Definition at line 933 of file matpackI.cc.

Member Function Documentation

◆ begin()

◆ end()

ConstIterator2D ConstMatrixView::end ( ) const

Return const iterator behind last row.

Definition at line 891 of file matpackI.cc.

References ConstVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.

Referenced by copy(), MatrixView::end(), Matrix::Matrix(), max(), mean(), min(), operator<<(), MatrixView::operator=(), Matrix::operator=(), and transform().

◆ get()

Numeric ConstMatrixView::get ( Index  r,
Index  c 
) const
inline

Get element implementation without assertions.

Definition at line 618 of file matpackI.h.

References mcr, mdata, mrr, Range::mstart, and Range::mstride.

Referenced by MatrixView::get(), interp(), and operator()().

◆ ncols()

Index ConstMatrixView::ncols ( ) const

Returns the number of columns.

Definition at line 838 of file matpackI.cc.

References mcr, and Range::mextent.

Referenced by abs_coefCalcFromXsec(), abs_h2oSet(), abs_lookupSetupBatch(), abs_n2Set(), abs_o2Set(), abs_vecAddGas(), abs_vecAddPart(), abs_xsec_per_speciesAddCIA(), abs_xsec_per_speciesAddConts(), AntennaMultiBeamsToPencilBeams(), Append(), apply_iy_unit(), apply_iy_unit2(), atm_fields_compactFromMatrix(), atmgeom_checkedCalc(), attenuation_matrix(), BF86_CIA_N2(), calc_lookup_error(), calcSingleScatteringDataProperties(), GriddedField2::checksize(), GriddedField2::checksize_strict(), 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_250_CIAfun_n2(), CKD_mt_250_CIArot_n2(), CKD_mt_250_co2(), CKD_mt_250_foreign_h2o(), CKD_mt_250_o2_vis(), CKD_mt_250_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(), Compare(), complex_n_interp(), CP98H2OAbsModel(), describe(), det(), ext2trans(), ext_matFromabs_vec(), ext_matTransform(), fos(), from_dpath_to_dx(), get_iy_of_background(), GriddedFieldLatLonExpand(), Ho66_CO2_foreign_continuum(), Ho66_CO2_self_continuum(), id_mat(), interp(), interp_atmfield_by_itw(), interp_atmsurface_by_itw(), is_diagonal(), is_singular(), is_size(), itw2p(), iwp_cloud_opt_pathCalc(), iy_auxFillParticleVariables(), iyb_calc_za_loop_body(), iyCloudRadar(), iyFOS(), iyRadioLink(), iySurfaceRtpropAgenda(), iyTransmissionStandard(), MaTipping_H2O_foreign_continuum(), matrix_exp(), matrix_exp_p30(), MatrixAddScalar(), MatrixMatrixMultiply(), MatrixScale(), mc_IWP_cloud_opt_pathCalc(), MCGeneral(), mean(), MPM02H2OAbsModel(), MPM85O2AbsModel(), MPM87H2OAbsModel(), MPM87O2AbsModel(), MPM89H2OAbsModel(), MPM89O2AbsModel(), MPM92O2AbsModel(), MPM93_H2O_continuum(), MPM93_N2_continuum(), MPM93_O2_continuum(), MPM93H2OAbsModel(), MPM93IceCrystalAbs(), MPM93O2AbsModel(), MPM93RainExt(), MPM93WaterDropletAbs(), mult(), nca_def_Matrix(), nca_put_var_Matrix(), nca_write_to_file(), norm_inf(), MatrixView::operator*=(), MatrixView::operator+=(), MatrixView::operator-=(), MatrixView::operator/=(), operator<<(), opt_propCalc(), Pardo_ATM_H2O_ForeignContinuum(), Pardo_ATM_N2_dry_continuum(), perturbation_field_2d(), pha_mat_labCalc(), pha_matTransform(), phase_functionCalc(), phase_matrix(), poly_root_solve(), PWR93O2AbsModel(), PWR98H2OAbsModel(), Reduce(), Rosenkranz_CO2_foreign_continuum(), Rosenkranz_CO2_self_continuum(), Rosenkranz_N2_self_continuum(), Rosenkranz_O2_continuum(), rotationmat3D(), Select(), select_dims_by_size(), sensor_checkedCalc(), sensor_responseAntenna(), sensor_responseGenericAMSU(), sensor_responseSimpleAMSU(), sensor_responseStokesRotation(), Standard_H2O_foreign_continuum(), Standard_H2O_self_continuum(), Standard_N2_self_continuum(), Standard_O2_continuum(), surface_specular_R_and_b(), TangentPointExtract(), TangentPointPrint(), test30(), transform(), TRE05O2AbsModel(), VectorExtractFromMatrix(), xml_write_to_stream(), xsec_continuum_tag(), xsec_species(), yApplyUnit(), ybatchCalc(), yCalc(), yCalcAppend(), and z_fieldFromHSE().

◆ nrows()

Index ConstMatrixView::nrows ( ) const

Returns the number of rows.

Definition at line 832 of file matpackI.cc.

References Range::mextent, and mrr.

Referenced by abs_coefCalcFromXsec(), abs_lookupSetupBatch(), abs_vecAddGas(), abs_vecAddPart(), abs_xsec_per_speciesAddCIA(), abs_xsec_per_speciesAddConts(), abs_xsec_per_speciesAddLines(), AntennaMultiBeamsToPencilBeams(), Append(), apply_iy_unit(), apply_iy_unit2(), atm_fields_compactFromMatrix(), atmgeom_checkedCalc(), attenuation_matrix(), BF86_CIA_N2(), calcSingleScatteringDataProperties(), GriddedField2::checksize(), GriddedField2::checksize_strict(), 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_250_CIAfun_n2(), CKD_mt_250_CIArot_n2(), CKD_mt_250_co2(), CKD_mt_250_foreign_h2o(), CKD_mt_250_o2_vis(), CKD_mt_250_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(), cloudbox_checkedCalc(), Compare(), complex_n_interp(), CP98H2OAbsModel(), describe(), det(), ext2trans(), ext_matFromabs_vec(), fos(), from_dpath_to_dx(), get_iy_of_background(), get_ppath_abs(), get_ppath_blackrad(), get_ppath_ext(), GriddedFieldLatLonExpand(), Ho66_CO2_foreign_continuum(), Ho66_CO2_self_continuum(), id_mat(), interp(), is_diagonal(), is_singular(), is_size(), itw2p(), iwp_cloud_opt_pathCalc(), iyb_calc_za_loop_body(), iyCloudRadar(), iyRadioLink(), iyReplaceFromAux(), iySurfaceRtpropAgenda(), iyTransmissionStandard(), jacobianAddFreqShift(), jacobianAddFreqStretch(), jacobianAddPointingZa(), jacobianAddPolyfit(), jacobianAddSinefit(), jacobianCalcFreqShift(), jacobianCalcFreqStretch(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), jacobianClose(), lubacksub(), ludcmp(), MaTipping_H2O_foreign_continuum(), matrix_exp_p30(), MatrixAddScalar(), 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(), nca_def_Matrix(), nca_put_var_Matrix(), nca_write_to_file(), norm_inf(), MatrixView::operator*=(), MatrixView::operator+=(), MatrixView::operator-=(), MatrixView::operator/=(), operator<<(), opt_prop_sptFromData(), opt_prop_sptFromMonoData(), opt_propCalc(), Pardo_ATM_H2O_ForeignContinuum(), Pardo_ATM_N2_dry_continuum(), perturbation_field_2d(), phase_matrix(), pmomCalc(), poly_root_solve(), ppath_end_2d(), PWR93O2AbsModel(), PWR98H2OAbsModel(), Reduce(), Rosenkranz_CO2_foreign_continuum(), Rosenkranz_CO2_self_continuum(), Rosenkranz_N2_self_continuum(), Rosenkranz_O2_continuum(), rotationmat3D(), rte_pos_losMoveToStartOfPpath(), Select(), select_dims_by_size(), sensor_checkedCalc(), sensor_responseGenericAMSU(), sensor_responseSimpleAMSU(), sensor_responseStokesRotation(), Standard_H2O_foreign_continuum(), Standard_H2O_self_continuum(), Standard_N2_self_continuum(), Standard_O2_continuum(), surface_calc(), surface_specular_R_and_b(), test30(), transform(), TRE05O2AbsModel(), VectorExtractFromMatrix(), VectorZtanToZa1D(), VectorZtanToZaRefr1D(), xml_write_to_stream(), xsec_continuum_tag(), xsec_species(), xsec_species_line_mixing_2nd_order(), yApplyUnit(), ybatchCalc(), ybatchMetProfiles(), ybatchMetProfilesClear(), yCalc(), yCalcAppend(), yCloudRadar(), and z_fieldFromHSE().

◆ operator()() [1/4]

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.

Definition at line 846 of file matpackI.cc.

References ConstMatrixView(), mcr, mdata, and mrr.

◆ operator()() [2/4]

ConstVectorView ConstMatrixView::operator() ( const Range r,
Index  c 
) const

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

Parameters
rA range of rows.
cIndex of selected column

Definition at line 857 of file matpackI.cc.

References ConstVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.

◆ operator()() [3/4]

ConstVectorView ConstMatrixView::operator() ( Index  r,
const Range c 
) const

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

Parameters
rIndex of selected row.
cRange of columns

Definition at line 872 of file matpackI.cc.

References ConstVectorView, mcr, mdata, Range::mextent, mrr, Range::mstart, and Range::mstride.

◆ operator()() [4/4]

Numeric ConstMatrixView::operator() ( Index  r,
Index  c 
) const
inline

Plain const index operator.

Definition at line 607 of file matpackI.h.

References get(), mcr, Range::mextent, and mrr.

Referenced by MatrixView::operator()().

Friends And Related Function Documentation

◆ ConstIterator3D

friend class ConstIterator3D
friend

Definition at line 640 of file matpackI.h.

◆ ConstTensor3View

friend class ConstTensor3View
friend

Definition at line 642 of file matpackI.h.

◆ ConstTensor4View

friend class ConstTensor4View
friend

Definition at line 643 of file matpackI.h.

◆ ConstTensor5View

friend class ConstTensor5View
friend

Definition at line 644 of file matpackI.h.

◆ ConstTensor6View

friend class ConstTensor6View
friend

Definition at line 645 of file matpackI.h.

◆ ConstTensor7View

friend class ConstTensor7View
friend

Definition at line 646 of file matpackI.h.

◆ ConstVectorView

friend class ConstVectorView
friend

Definition at line 641 of file matpackI.h.

Referenced by begin(), end(), and operator()().

◆ MatrixView

friend class MatrixView
friend

Definition at line 639 of file matpackI.h.

◆ mult

void mult ( VectorView  ,
const ConstMatrixView ,
const ConstVectorView  
)
friend

Matrix Vector multiplication.

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 1648 of file matpackI.cc.

◆ poly_root_solve

int poly_root_solve ( Matrix roots,
Vector coeffs 
)
friend

Definition at line 100 of file poly_roots.cc.

◆ transpose

ConstMatrixView transpose ( ConstMatrixView  m)
friend

Const version of transpose.

Definition at line 1799 of file matpackI.cc.

Member Data Documentation

◆ mcr

◆ mdata

◆ mrr


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