ARTS 2.5.10 (git: 2f1c442c)
|
A constant view of a Tensor4. More...
#include <matpackIV.h>
Public Member Functions | |
constexpr | ConstTensor4View (const ConstTensor4View &)=default |
constexpr | ConstTensor4View (ConstTensor4View &&)=default |
ConstTensor4View & | operator= (const ConstTensor4View &)=default |
ConstTensor4View & | operator= (ConstTensor4View &&)=default |
Index | nbooks () const noexcept |
Index | npages () const noexcept |
Index | nrows () const noexcept |
Index | ncols () const noexcept |
Index | size () const noexcept |
bool | empty () const noexcept |
Shape< 4 > | shape () const |
ConstTensor4View | operator() (const Range &b, const Range &p, const Range &r, const Range &c) const |
Const index operator for subrange. | |
ConstTensor3View | operator() (const Range &b, const Range &p, const Range &r, Index c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (const Range &b, const Range &p, Index r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (const Range &b, Index p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstTensor3View | operator() (Index b, const Range &p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstTensor3View. | |
ConstMatrixView | operator() (const Range &b, const Range &p, Index r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (const Range &b, Index p, const Range &r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (const Range &b, Index p, Index r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index b, const Range &p, Index r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index b, const Range &p, const Range &r, Index c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstMatrixView | operator() (Index b, Index p, const Range &r, const Range &c) const |
Const index operator returning an object of type ConstMatrixView. | |
ConstVectorView | operator() (const Range &b, Index p, Index r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index b, const Range &p, Index r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index b, Index p, const Range &r, Index c) const |
Const index operator returning an object of type ConstVectorView. | |
ConstVectorView | operator() (Index b, Index p, Index r, const Range &c) const |
Const index operator returning an object of type ConstVectorView. | |
Numeric | operator() (Index b, Index p, Index r, Index c) const |
Plain const index operator. | |
Numeric | get (Index b, Index p, Index r, Index c) const |
Get element implementation without assertions. | |
ConstIterator4D | begin () const |
Return const iterator to first book. | |
ConstIterator4D | end () const |
Return const iterator behind last book. | |
virtual | ~ConstTensor4View ()=default |
Destructor. | |
ConstTensor4View (const ConstTensor3View &a) | |
Special constructor to make a Tensor4 view of a Tensor3. | |
Static Public Attributes | |
static constexpr bool | matpack_type {true} |
Protected Member Functions | |
ConstTensor4View ()=default | |
ConstTensor4View (Numeric *data, const Range &b, const Range &p, const Range &r, const Range &c) | |
Explicit constructor. | |
ConstTensor4View (Numeric *data, const Range &pb, const Range &pp, const Range &pr, const Range &pc, const Range &nb, const Range &np, const Range &nr, const Range &nc) | |
Recursive constructor. | |
Protected Attributes | |
Range | mbr {0, 0, 1} |
The book range of mdata that is actually used. | |
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 | Tensor4View |
class | ConstIterator5D |
class | ConstTensor5View |
class | ConstTensor6View |
class | ConstTensor7View |
std::ostream & | operator<< (std::ostream &os, const ConstTensor4View &v) |
Output operator. | |
A constant view of a Tensor4.
This, together with the derived class Tensor4View, contains the main implementation of a Tensor4. It defines the concepts of Tensor4View. Plus additionally the recursive subrange operator, which makes it possible to create a Tensor4View from a subrange of a Tensor4View.
The four dimensions of the tensor are called: book, page, row, column.
The class Tensor4 is just a special case of a Tensor4View which also allocates storage.
Definition at line 133 of file matpackIV.h.
|
constexprdefault |
|
constexprdefault |
|
virtualdefault |
Destructor.
ConstTensor4View::ConstTensor4View | ( | const ConstTensor3View & | a | ) |
Special constructor to make a Tensor4 view of a Tensor3.
Definition at line 375 of file matpackIV.cc.
|
protecteddefault |
Referenced by operator()().
|
protected |
Explicit constructor.
This one is used by Tensor4 to initialize its own Tensor4View part. The page range pr must have a stride to account for the length of one page. The book range br must have a stride to account for the length of one book.
Definition at line 388 of file matpackIV.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 404 of file matpackIV.cc.
ConstIterator4D ConstTensor4View::begin | ( | ) | const |
Return const iterator to first book.
Definition at line 361 of file matpackIV.cc.
References mbr, mcr, mdata, mpr, mrr, Range::mstart, and Range::mstride.
Referenced by copy(), max(), min(), Tensor4View::operator*=(), Tensor4View::operator+=(), Tensor4View::operator-=(), Tensor4View::operator/=(), Tensor4View::operator=(), Tensor4::Tensor4(), and transform().
|
inlinenoexcept |
Definition at line 152 of file matpackIV.h.
References size().
Referenced by abs_lines_per_speciesPopulationNlteField(), cloudboxSetAutomatically(), iyIndependentBeamApproximation(), nlte_fieldForSingleSpeciesNonOverlappingLines(), pnd_fieldCalcFromParticleBulkProps(), and x2artsAtmAndSurf().
ConstIterator4D ConstTensor4View::end | ( | ) | const |
Return const iterator behind last book.
Definition at line 367 of file matpackIV.cc.
References mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
Referenced by copy(), max(), min(), Tensor4View::operator=(), Tensor4::Tensor4(), and transform().
Get element implementation without assertions.
Definition at line 230 of file matpackIV.h.
References b, c, mbr, mcr, mdata, mpr, mrr, Range::mstart, and Range::mstride.
Referenced by interp(), and operator()().
|
inlinenoexcept |
Definition at line 143 of file matpackIV.h.
References mbr, and Range::mextent.
Referenced by GasAbsLookup::Adapt(), antenna2d_gridded_dlos(), antenna2d_interp_response(), Append(), atm_fields_compactCleanup(), AtmFieldPRegrid(), AtmFieldsCalc(), AtmFieldsCalcExpand1D(), AtmFieldsExpand1D(), AtmFieldsExtract1D(), AtmFieldsRefinePgrid(), GriddedField4::checksize(), chk_atm_field(), chk_size(), clear_rt_vars_at_gp(), cloud_atm_vars_by_gp(), cloud_fieldsCalc(), cloud_ppath_update1D(), cloud_ppath_update1D_noseq(), cloud_ppath_update1D_planeparallel(), cloud_ppath_update3D(), cloudboxSetAutomatically(), cloudy_rt_vars_at_gp(), describe(), doit_scat_fieldCalc(), doit_scat_fieldCalcLimb(), DoitScatteringDataPrepare(), Extract(), get_paroptprop(), get_ppath_atmvars(), get_ppath_cloudvars(), get_ppath_transmat(), get_refr_index_1d(), get_refr_index_2d(), get_refr_index_3d(), get_stepwise_scattersky_propmat(), GriddedFieldLatLonExpand(), GriddedFieldLatLonRegrid(), GriddedFieldPRegrid(), heating_ratesFromIrradiance(), Interpolation::interp(), interp_cloud_coeff1D(), irradiance_fieldFromRadiance(), is_size(), iyIndependentBeamApproximation(), iyRadarSingleScat(), iySurfaceRtpropAgenda(), iySurfaceRtpropCalc(), MCGeneral(), MCRadar(), nca_def_Tensor4(), nca_put_var(), nca_write_to_file(), PropagationMatrix::OK(), EnergyLevelMap::OK(), Tensor4View::operator*=(), Tensor4View::operator+=(), Tensor4View::operator-=(), Tensor4View::operator/=(), Tensor4::operator=(), opt_prop_1ScatElem(), OptimizeDoitPressureGrid(), particle_fieldCleanup(), pha_mat_sptFromData(), pha_mat_sptFromDataDOITOpt(), pha_mat_sptFromMonoData(), pha_mat_sptFromScat_data(), pnd_fieldCalcFromParticleBulkProps(), pnd_fieldExpand1D(), RadiationFieldSpectralIntegrate(), lm_hitran_2017::readw(), Reduce(), Tensor4::reduce_rank(), ScatSpeciesMerge(), select_dims_by_size(), shape(), size(), StokesVector::StokesVector(), surface_rtpropInterpFreq(), surface_scalar_reflectivityFromGriddedField4(), surface_scalar_reflectivityFromSurface_rmatrix(), SurfaceBlackbody(), surfaceMapToLinearPolarisation(), Tensor3ExtractFromTensor4(), Tensor4::Tensor4(), Tensor4Add(), Tensor4Clip(), Tensor4Multiply(), transform(), x2artsAtmAndSurf(), and xml_write_to_stream().
|
inlinenoexcept |
Definition at line 146 of file matpackIV.h.
References mcr, and Range::mextent.
Referenced by GasAbsLookup::Adapt(), antenna2d_gridded_dlos(), antenna2d_interp_response(), Append(), atm_fields_compactCleanup(), atm_fields_compactExpand(), AtmFieldPRegrid(), AtmFieldsCalc(), GriddedField4::checksize(), chk_atm_field(), chk_size(), cloud_fieldsCalc(), describe(), Extract(), GriddedFieldLatLonExpand(), GriddedFieldPRegrid(), Interpolation::interp(), irradiance_fieldFromRadiance(), is_size(), iySurfaceRtpropAgenda(), iySurfaceRtpropCalc(), nca_def_Tensor4(), nca_put_var(), nca_write_to_file(), PropagationMatrix::OK(), EnergyLevelMap::OK(), Tensor4View::operator*=(), Tensor4View::operator+=(), Tensor4View::operator-=(), Tensor4View::operator/=(), Tensor4::operator=(), EnergyLevelMap::operator[](), opt_prop_1ScatElem(), particle_fieldCleanup(), pha_mat_sptFromDataDOITOpt(), pnd_fieldExpand1D(), PropagationMatrix::PropagationMatrix(), RadiationFieldSpectralIntegrate(), lm_hitran_2017::readw(), Reduce(), Tensor4::reduce_rank(), select_dims_by_size(), shape(), size(), StokesVector::StokesVector(), surface_rtpropInterpFreq(), surface_scalar_reflectivityFromGriddedField4(), SurfaceBlackbody(), Tensor3ExtractFromTensor4(), Tensor4::Tensor4(), Tensor4Add(), Tensor4Multiply(), transform(), x2artsAtmAndSurf(), and xml_write_to_stream().
|
inlinenoexcept |
Definition at line 144 of file matpackIV.h.
References Range::mextent, and mpr.
Referenced by antenna2d_gridded_dlos(), antenna2d_interp_response(), Append(), atm_fields_compactCleanup(), atm_fields_compactExpand(), AtmFieldsCalc(), AtmFieldsExtract1D(), GriddedField4::checksize(), chk_atm_field(), chk_size(), describe(), GasAbsLookup::Extract(), Extract(), GriddedFieldLatLonExpand(), GriddedFieldLatLonRegrid(), heating_ratesFromIrradiance(), Interpolation::interp(), irradiance_fieldFromRadiance(), is_size(), iyIndependentBeamApproximation(), iySurfaceRtpropAgenda(), iySurfaceRtpropCalc(), nca_def_Tensor4(), nca_put_var(), nca_write_to_file(), PropagationMatrix::OK(), EnergyLevelMap::OK(), Tensor4View::operator*=(), Tensor4View::operator+=(), Tensor4View::operator-=(), Tensor4View::operator/=(), Tensor4::operator=(), opt_prop_1ScatElem(), particle_fieldCleanup(), pnd_fieldExpand1D(), RadiationFieldSpectralIntegrate(), lm_hitran_2017::readw(), Reduce(), Tensor4::reduce_rank(), select_dims_by_size(), shape(), size(), StokesVector::StokesVector(), surface_rtpropInterpFreq(), surface_scalar_reflectivityFromGriddedField4(), surface_scalar_reflectivityFromSurface_rmatrix(), SurfaceBlackbody(), Tensor3ExtractFromTensor4(), Tensor4::Tensor4(), Tensor4Add(), Tensor4Multiply(), transform(), x2artsAtmAndSurf(), and xml_write_to_stream().
|
inlinenoexcept |
Definition at line 145 of file matpackIV.h.
References Range::mextent, and mrr.
Referenced by antenna2d_gridded_dlos(), antenna2d_interp_response(), Append(), atm_fields_compactCleanup(), atm_fields_compactExpand(), AtmFieldPRegrid(), AtmFieldsCalc(), GriddedField4::checksize(), chk_atm_field(), chk_size(), describe(), Extract(), GriddedFieldLatLonExpand(), GriddedFieldPRegrid(), heating_ratesFromIrradiance(), Interpolation::interp(), irradiance_fieldFromRadiance(), is_size(), iySurfaceRtpropAgenda(), iySurfaceRtpropCalc(), nca_def_Tensor4(), nca_put_var(), nca_write_to_file(), PropagationMatrix::OK(), EnergyLevelMap::OK(), Tensor4View::operator*=(), Tensor4View::operator+=(), Tensor4View::operator-=(), Tensor4View::operator/=(), Tensor4::operator=(), opt_prop_1ScatElem(), particle_fieldCleanup(), pnd_fieldExpand1D(), RadiationFieldSpectralIntegrate(), lm_hitran_2017::readw(), Reduce(), Tensor4::reduce_rank(), select_dims_by_size(), shape(), size(), StokesVector::StokesVector(), surface_scalar_reflectivityFromGriddedField4(), SurfaceBlackbody(), Tensor3ExtractFromTensor4(), Tensor4::Tensor4(), Tensor4Add(), Tensor4Multiply(), transform(), x2artsAtmAndSurf(), and xml_write_to_stream().
ConstTensor4View ConstTensor4View::operator() | ( | const Range & | b, |
const Range & | p, | ||
const Range & | r, | ||
const Range & | c | ||
) | const |
ConstTensor3View ConstTensor4View::operator() | ( | const Range & | b, |
const Range & | p, | ||
const Range & | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstTensor3View.
(Reducing the dimension by one.)
Definition at line 58 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstTensor3View ConstTensor4View::operator() | ( | const Range & | b, |
const Range & | p, | ||
Index | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstTensor3View.
(Reducing the dimension by one.)
Definition at line 72 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstMatrixView ConstTensor4View::operator() | ( | const Range & | b, |
const Range & | p, | ||
Index | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by two.)
Definition at line 114 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstTensor3View ConstTensor4View::operator() | ( | const Range & | b, |
Index | p, | ||
const Range & | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstTensor3View.
(Reducing the dimension by one.)
Definition at line 86 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstMatrixView ConstTensor4View::operator() | ( | const Range & | b, |
Index | p, | ||
const Range & | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by two.)
Definition at line 134 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstMatrixView ConstTensor4View::operator() | ( | const Range & | b, |
Index | p, | ||
Index | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by two.)
Definition at line 154 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstVectorView ConstTensor4View::operator() | ( | const Range & | b, |
Index | p, | ||
Index | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by three.)
Definition at line 234 of file matpackIV.cc.
ConstTensor3View ConstTensor4View::operator() | ( | Index | b, |
const Range & | p, | ||
const Range & | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstTensor3View.
(Reducing the dimension by one.)
Definition at line 100 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstMatrixView ConstTensor4View::operator() | ( | Index | b, |
const Range & | p, | ||
const Range & | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by two.)
Definition at line 194 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstMatrixView ConstTensor4View::operator() | ( | Index | b, |
const Range & | p, | ||
Index | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by two.)
Definition at line 174 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstVectorView ConstTensor4View::operator() | ( | Index | b, |
const Range & | p, | ||
Index | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by three.)
Definition at line 254 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstMatrixView ConstTensor4View::operator() | ( | Index | b, |
Index | p, | ||
const Range & | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstMatrixView.
(Reducing the dimension by two.)
Definition at line 214 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstVectorView ConstTensor4View::operator() | ( | Index | b, |
Index | p, | ||
const Range & | r, | ||
Index | c | ||
) | const |
Const index operator returning an object of type ConstVectorView.
(Reducing the dimension by three.)
Definition at line 274 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
ConstVectorView ConstTensor4View::operator() | ( | Index | b, |
Index | p, | ||
Index | r, | ||
const Range & | c | ||
) | const |
Const index operator returning an object of type ConstVectorView.
Reducing the dimension by three.)
Definition at line 294 of file matpackIV.cc.
References ARTS_ASSERT, b, c, mbr, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.
Plain const index operator.
Definition at line 213 of file matpackIV.h.
References ARTS_ASSERT, b, c, get(), mbr, 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 155 of file matpackIV.h.
References nbooks(), ncols(), npages(), and nrows().
Referenced by Tensor4::operator=(), and propmat_clearskyAddScaledSpecies().
|
inlinenoexcept |
Definition at line 149 of file matpackIV.h.
References nbooks(), ncols(), npages(), and nrows().
Referenced by empty(), Tensor4View::get_c_array(), Tensor4::reduce_rank(), Tensor5::reduce_rank(), Tensor6::reduce_rank(), Tensor7::reduce_rank(), and Tensor4::transform_elementwise().
|
friend |
Definition at line 245 of file matpackIV.h.
|
friend |
Definition at line 246 of file matpackIV.h.
|
friend |
Definition at line 247 of file matpackIV.h.
|
friend |
Definition at line 248 of file matpackIV.h.
|
friend |
Output operator.
This demonstrates how iterators can be used to traverse the tensor. We use the standard output operator for Tensor to print each book in turn.
Definition at line 420 of file matpackIV.cc.
|
friend |
Definition at line 244 of file matpackIV.h.
|
staticconstexpr |
Definition at line 135 of file matpackIV.h.
Referenced by test_concepts().
|
protected |
The book range of mdata that is actually used.
Definition at line 276 of file matpackIV.h.
Referenced by Tensor4View::begin(), begin(), Tensor4View::end(), end(), get(), Tensor4View::get_c_array(), nbooks(), ConstIterator5D::operator!=(), Iterator5D::operator!=(), Tensor4View::operator()(), operator()(), Tensor4View::operator=(), and Tensor4::resize().
|
protected |
The column range of mdata that is actually used.
Definition at line 282 of file matpackIV.h.
Referenced by Tensor4View::begin(), begin(), Tensor4View::end(), end(), get(), Tensor4View::get_c_array(), ncols(), ConstIterator5D::operator!=(), Iterator5D::operator!=(), Tensor4View::operator()(), operator()(), Tensor4View::operator=(), and Tensor4::resize().
|
protected |
Pointer to the plain C array that holds the data.
Definition at line 284 of file matpackIV.h.
Referenced by Tensor4View::begin(), begin(), Tensor4View::end(), end(), get(), Tensor4View::get_c_array(), ConstIterator5D::operator!=(), Iterator5D::operator!=(), Tensor4View::operator()(), operator()(), Iterator5D::operator++(), ConstIterator5D::operator++(), Tensor4::operator=(), Tensor4::reduce_rank(), Tensor4::resize(), Tensor4::Tensor4(), Tensor4::transform_elementwise(), and Tensor4::~Tensor4().
|
protected |
The page range of mdata that is actually used.
Definition at line 278 of file matpackIV.h.
Referenced by Tensor4View::begin(), begin(), Tensor4View::end(), end(), get(), Tensor4View::get_c_array(), npages(), ConstIterator5D::operator!=(), Iterator5D::operator!=(), Tensor4View::operator()(), operator()(), Tensor4View::operator=(), and Tensor4::resize().
|
protected |
The row range of mdata that is actually used.
Definition at line 280 of file matpackIV.h.
Referenced by Tensor4View::begin(), begin(), Tensor4View::end(), end(), get(), Tensor4View::get_c_array(), nrows(), ConstIterator5D::operator!=(), Iterator5D::operator!=(), Tensor4View::operator()(), operator()(), Tensor4View::operator=(), and Tensor4::resize().