ARTS 2.5.10 (git: 2f1c442c)
|
A constant view of a Tensor3. More...
#include <matpackIII.h>
Public Member Functions | |
constexpr | ConstTensor3View (const ConstTensor3View &)=default |
constexpr | ConstTensor3View (ConstTensor3View &&)=default |
ConstTensor3View & | operator= (const ConstTensor3View &)=default |
ConstTensor3View & | operator= (ConstTensor3View &&)=default |
Index | npages () const |
Returns the number of pages. | |
Index | nrows () const |
Returns the number of rows. | |
Index | ncols () const |
Returns the number of columns. | |
Index | size () const noexcept |
bool | empty () const noexcept |
Shape< 3 > | shape () const |
ConstTensor3View | operator() (const Range &p, const Range &r, const Range &c) const |
Const index operator for subrange. | |
ConstMatrixView | operator() (const Range &p, const Range &r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (const Range &p, Index r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstVectorView | operator() (Index p, Index r, const Range &c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index p, const Range &r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (const Range &p, Index r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
Numeric | operator() (Index p, Index r, Index c) const |
Plain const index operator. | |
Numeric | get (Index p, Index r, Index c) const |
Get element implementation without assertions. | |
ConstIterator3D | begin () const |
Return const iterator to first page. | |
ConstIterator3D | end () const |
Return const iterator behind last page. | |
virtual | ~ConstTensor3View ()=default |
Destructor. | |
ConstTensor3View (const ConstMatrixView &a) | |
Special constructor to make a Tensor3 view of a matrix. | |
Static Public Attributes | |
static constexpr bool | matpack_type {true} |
Protected Member Functions | |
ConstTensor3View ()=default | |
ConstTensor3View (Numeric *data, const Range &p, const Range &r, const Range &c) | |
Explicit constructor. | |
ConstTensor3View (Numeric *data, const Range &pp, const Range &pr, const Range &pc, const Range &np, const Range &nr, const Range &nc) | |
Recursive constructor. | |
Protected Attributes | |
Range | mpr {0, 0, 1} |
The page range of mdata that is actually used. | |
Range | mrr {0, 0, 1} |
The row range of mdata that is actually used. | |
Range | mcr {0, 0, 1} |
The column range of mdata that is actually used. | |
Numeric * | mdata {nullptr} |
Pointer to the plain C array that holds the data. | |
Friends | |
class | Tensor3View |
class | ConstIterator4D |
class | ConstTensor4View |
class | ConstTensor5View |
class | ConstTensor6View |
class | ConstTensor7View |
std::ostream & | operator<< (std::ostream &os, const ConstTensor3View &v) |
Output operator. | |
A constant view of a Tensor3.
This, together with the derived class Tensor3View, contains the main implementation of a Tensor3. It defines the concepts of Tensor3View. Plus additionally the recursive subrange operator, which makes it possible to create a Tensor3View from a subrange of a Tensor3View.
The three dimensions of the tensor are called: page, row, column.
The class Tensor3 is just a special case of a Tensor3View which also allocates storage.
Definition at line 133 of file matpackIII.h.
|
constexprdefault |
|
constexprdefault |
|
virtualdefault |
Destructor.
ConstTensor3View::ConstTensor3View | ( | const ConstMatrixView & | a | ) |
Special constructor to make a Tensor3 view of a matrix.
Definition at line 144 of file matpackIII.cc.
|
protecteddefault |
Referenced by operator()().
|
protected |
Explicit constructor.
This one is used by Tensor3 to initialize its own Tensor3View part. The row range rr must have a stride to account for the length of one row. The page range pr must have a stride to account for the length of one page.
Definition at line 156 of file matpackIII.cc.
|
protected |
Recursive constructor.
This is used to construct sub-tensors from sub-tensors. 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.
Definition at line 171 of file matpackIII.cc.
ConstIterator3D ConstTensor3View::begin | ( | ) | const |
Return const iterator to first page.
Definition at line 130 of file matpackIII.cc.
References mcr, mdata, mpr, mrr, Range::mstart, and Range::mstride.
Referenced by copy(), max(), min(), Tensor3View::operator*=(), Tensor3View::operator+=(), Tensor3View::operator-=(), Tensor3View::operator/=(), Tensor3View::operator=(), Tensor3::Tensor3(), and transform().
|
inlinenoexcept |
Definition at line 157 of file matpackIII.h.
References size().
Referenced by cloudbox_checkedCalc(), iyIndependentBeamApproximation(), iyTransmissionStandard(), pndFromPsd(), pndFromPsdBasic(), and x2artsAtmAndSurf().
ConstIterator3D ConstTensor3View::end | ( | ) | const |
Return const iterator behind last page.
Definition at line 136 of file matpackIII.cc.
References mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
Referenced by copy(), max(), min(), Tensor3View::operator=(), Tensor3::Tensor3(), and transform().
Get element implementation without assertions.
Definition at line 190 of file matpackIII.h.
References c, mcr, mdata, mpr, mrr, Range::mstart, and Range::mstride.
Referenced by interp(), and operator()().
|
inline |
Returns the number of columns.
Definition at line 151 of file matpackIII.h.
References mcr, and Range::mextent.
Referenced by abs_vecTransform(), add_normed_phase_functions(), Append(), apply_iy_unit2(), AtmFieldPRegrid(), atmgeom_checkedCalc(), GriddedField3::checksize(), chk_atm_field(), chk_atm_vecfield_lat90(), chk_scat_species_field(), chk_size(), complex_n_interp(), IGRF::compute(), describe(), ext_abs_pfun_from_tro(), ext_matTransform(), field_of_propagation(), flat(), get_pfct(), get_pmom(), GriddedFieldLatLonExpand(), GriddedFieldPRegrid(), GriddedFieldZToPRegrid(), Interpolation::interp(), is_size(), iy_transmittance_mult(), iyLoopFrequencies(), iyMC(), MagFieldsCalcIGRF(), MagFieldsFromAltitudeRawCalc(), MatrixExtractFromTensor3(), MatrixReshapeTensor3(), mult(), nca_write_to_file(), Tensor3View::operator*=(), Tensor3View::operator+=(), Tensor3View::operator-=(), Tensor3View::operator/=(), Tensor3::operator=(), particle_bulkpropRadarOnionPeeling(), pndFromPsd(), pndFromPsdBasic(), Reduce(), Tensor3::reduce_rank(), regrid_atmfield_by_gp_oem(), reshape(), run_cdisort(), run_cdisort_flux(), select_dims_by_size(), shape(), size(), surface_calc(), surface_props_check(), surfaceFlatReflectivity(), Tensor3::Tensor3(), Tensor3Add(), Tensor3Multiply(), test01(), test06(), transform(), water_p_eq_fieldMK05(), x2artsAtmAndSurf(), and xml_write_to_stream().
|
inline |
Returns the number of pages.
Definition at line 145 of file matpackIII.h.
References Range::mextent, and mpr.
Referenced by add_normed_phase_functions(), Append(), apply_iy_unit2(), AtmFieldPRegrid(), atmfields_checkedCalc(), AtmFieldsCalcExpand1D(), AtmFieldsExtract1D(), atmgeom_checkedCalc(), GriddedField3::checksize(), chk_atm_field(), chk_atm_vecfield_lat90(), chk_scat_species_field(), chk_size(), cloudboxSetManuallyAltitude(), complex_n_interp(), IGRF::compute(), describe(), ext_abs_pfun_from_tro(), Extract(), field_of_propagation(), find_cloudlimits(), flat(), get_pfct(), get_pmom(), get_ppath_atmvars(), GriddedFieldLatLonExpand(), GriddedFieldLatLonRegrid(), GriddedFieldZToPRegrid(), Interpolation::interp(), is_size(), iy_transmittance_mult(), iySurfaceFastem(), iySurfaceFlatReflectivity(), iySurfaceFlatRefractiveIndex(), iySurfaceLambertian(), iySurfaceRtpropAgenda(), iySurfaceRtpropCalc(), MagFieldsCalcExpand1D(), MagFieldsCalcIGRF(), MagFieldsFromAltitudeRawCalc(), MatrixExtractFromTensor3(), MatrixReshapeTensor3(), mult(), nca_write_to_file(), Tensor3View::operator*=(), Tensor3View::operator+=(), Tensor3View::operator-=(), Tensor3View::operator/=(), Tensor3::operator=(), OptimizeDoitPressureGrid(), particle_bulkpropRadarOnionPeeling(), pndFromPsd(), pndFromPsdBasic(), ppath_end_3d(), Reduce(), Tensor3::reduce_rank(), regrid_atmfield_by_gp_oem(), reshape(), rtmethods_jacobian_finalisation(), select_dims_by_size(), shape(), size(), surface_props_check(), surface_props_interp(), surfaceFlatReflectivity(), Tensor3::Tensor3(), Tensor3Add(), Tensor3Multiply(), test04(), transform(), water_p_eq_fieldMK05(), WindFieldsCalcExpand1D(), WriteMolTau(), x2artsAtmAndSurf(), and xml_write_to_stream().
|
inline |
Returns the number of rows.
Definition at line 148 of file matpackIII.h.
References Range::mextent, and mrr.
Referenced by add_normed_phase_functions(), Append(), apply_iy_unit2(), AtmFieldPRegrid(), atmgeom_checkedCalc(), GriddedField3::checksize(), chk_atm_field(), chk_atm_vecfield_lat90(), chk_scat_species_field(), chk_size(), complex_n_interp(), IGRF::compute(), describe(), ext_abs_pfun_from_tro(), field_of_propagation(), flat(), get_pfct(), get_pmom(), GriddedFieldLatLonExpand(), GriddedFieldPRegrid(), GriddedFieldZToPRegrid(), Interpolation::interp(), is_size(), iy_transmittance_mult(), MagFieldsCalcIGRF(), MagFieldsFromAltitudeRawCalc(), MatrixExtractFromTensor3(), MatrixReshapeTensor3(), mult(), nca_write_to_file(), Tensor3View::operator*=(), Tensor3View::operator+=(), Tensor3View::operator-=(), Tensor3View::operator/=(), Tensor3::operator=(), particle_bulkpropRadarOnionPeeling(), Reduce(), Tensor3::reduce_rank(), regrid_atmfield_by_gp_oem(), reshape(), run_cdisort(), run_cdisort_flux(), select_dims_by_size(), shape(), size(), surface_calc(), surface_props_check(), surfaceFlatReflectivity(), Tensor3::Tensor3(), Tensor3Add(), Tensor3Multiply(), transform(), water_p_eq_fieldMK05(), x2artsAtmAndSurf(), and xml_write_to_stream().
ConstTensor3View ConstTensor3View::operator() | ( | const Range & | p, |
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 Tensor3. This allows correct recursive behavior.
Definition at line 36 of file matpackIII.cc.
ConstMatrixView ConstTensor3View::operator() | ( | const Range & | p, |
const Range & | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by one.)
Definition at line 44 of file matpackIII.cc.
References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstMatrixView ConstTensor3View::operator() | ( | const Range & | p, |
Index | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by one.)
Definition at line 56 of file matpackIII.cc.
References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstVectorView ConstTensor3View::operator() | ( | const Range & | p, |
Index | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by two.)
Definition at line 114 of file matpackIII.cc.
References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstMatrixView ConstTensor3View::operator() | ( | Index | p, |
const Range & | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by one.)
Definition at line 68 of file matpackIII.cc.
References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstVectorView ConstTensor3View::operator() | ( | Index | p, |
const Range & | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by two.)
Definition at line 97 of file matpackIII.cc.
References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstVectorView ConstTensor3View::operator() | ( | Index | p, |
Index | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by two.)
Definition at line 80 of file matpackIII.cc.
References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
Plain const index operator.
Definition at line 176 of file matpackIII.h.
References ARTS_ASSERT, c, get(), mcr, Range::mextent, mpr, and mrr.
|
default |
|
default |
|
inline |
Returns the shape as an array (to allow templates to just look for shape on different matpack objects)
Definition at line 160 of file matpackIII.h.
References ncols(), npages(), and nrows().
Referenced by Tensor3::operator=().
|
inlinenoexcept |
Definition at line 154 of file matpackIII.h.
References ncols(), npages(), and nrows().
Referenced by empty(), Tensor3View::get_c_array(), Tensor3::reduce_rank(), Tensor4::reduce_rank(), Tensor5::reduce_rank(), Tensor6::reduce_rank(), Tensor7::reduce_rank(), and Tensor3::transform_elementwise().
|
friend |
Definition at line 204 of file matpackIII.h.
|
friend |
Definition at line 205 of file matpackIII.h.
|
friend |
Definition at line 206 of file matpackIII.h.
|
friend |
Definition at line 207 of file matpackIII.h.
|
friend |
Definition at line 208 of file matpackIII.h.
|
friend |
Output operator.
This demonstrates how iterators can be used to traverse the tensor. We use the standard output operator for Matrix to print each page in turn.
Definition at line 185 of file matpackIII.cc.
|
friend |
Definition at line 203 of file matpackIII.h.
|
staticconstexpr |
Definition at line 135 of file matpackIII.h.
Referenced by test_concepts().
|
protected |
The column range of mdata that is actually used.
Definition at line 237 of file matpackIII.h.
Referenced by Tensor3View::begin(), begin(), Tensor3View::end(), end(), get(), Tensor3View::get_c_array(), ncols(), ConstIterator4D::operator!=(), Iterator4D::operator!=(), Tensor3View::operator()(), operator()(), Tensor3View::operator=(), and Tensor3::resize().
|
protected |
Pointer to the plain C array that holds the data.
Definition at line 239 of file matpackIII.h.
Referenced by Tensor3View::begin(), begin(), Tensor3View::end(), end(), get(), Tensor3View::get_c_array(), ConstIterator4D::operator!=(), Iterator4D::operator!=(), Tensor3View::operator()(), operator()(), Iterator4D::operator++(), ConstIterator4D::operator++(), Tensor3::operator=(), Tensor3::reduce_rank(), Tensor3::resize(), Tensor3::Tensor3(), Tensor3::transform_elementwise(), and Tensor3::~Tensor3().
|
protected |
The page range of mdata that is actually used.
Definition at line 233 of file matpackIII.h.
Referenced by Tensor3View::begin(), begin(), Tensor3View::end(), end(), get(), Tensor3View::get_c_array(), npages(), ConstIterator4D::operator!=(), Iterator4D::operator!=(), Tensor3View::operator()(), operator()(), Tensor3View::operator=(), and Tensor3::resize().
|
protected |
The row range of mdata that is actually used.
Definition at line 235 of file matpackIII.h.
Referenced by Tensor3View::begin(), begin(), Tensor3View::end(), end(), get(), Tensor3View::get_c_array(), nrows(), ConstIterator4D::operator!=(), Iterator4D::operator!=(), Tensor3View::operator()(), operator()(), Tensor3View::operator=(), and Tensor3::resize().