ARTS 2.5.0 (git: 9ee3ac6c)
ConstTensor3View Class Reference

A constant view of a Tensor3. More...

#include <matpackIII.h>

Inheritance diagram for ConstTensor3View:
Tensor3View Tensor3

Public Member Functions

constexpr ConstTensor3View (const ConstTensor3View &)=default
 
constexpr ConstTensor3View (ConstTensor3View &&)=default
 
ConstTensor3Viewoperator= (const ConstTensor3View &)=default
 
ConstTensor3Viewoperator= (ConstTensor3View &&)=default
 
bool empty () const
 Check if variable is empty. More...
 
Index npages () const
 Returns the number of pages. More...
 
Index nrows () const
 Returns the number of rows. More...
 
Index ncols () const
 Returns the number of columns. More...
 
ConstTensor3View operator() (const Range &p, const Range &r, const Range &c) const
 Const index operator for subrange. More...
 
ConstMatrixView operator() (const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstVectorView operator() (Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
Numeric operator() (Index p, Index r, Index c) const
 Plain const index operator. More...
 
Numeric get (Index p, Index r, Index c) const
 Get element implementation without assertions. More...
 
ConstIterator3D begin () const
 Return const iterator to first page. More...
 
ConstIterator3D end () const
 Return const iterator behind last page. More...
 
virtual ~ConstTensor3View ()=default
 Destructor. More...
 
 ConstTensor3View (const ConstMatrixView &a)
 Special constructor to make a Tensor3 view of a matrix. More...
 

Protected Member Functions

 ConstTensor3View ()=default
 
 ConstTensor3View (Numeric *data, const Range &p, const Range &r, const Range &c)
 Explicit constructor. More...
 
 ConstTensor3View (Numeric *data, const Range &pp, const Range &pr, const Range &pc, const Range &np, const Range &nr, const Range &nc)
 Recursive constructor. More...
 

Protected Attributes

Range mpr {0, 0, 1}
 The page range of mdata that is actually used. More...
 
Range mrr {0, 0, 1}
 The row range of mdata that is actually used. More...
 
Range mcr {0, 0, 1}
 The column range of mdata that is actually used. More...
 
Numericmdata {nullptr}
 Pointer to the plain C array that holds the data. More...
 

Friends

class Tensor3View
 
class ConstIterator4D
 
class ConstTensor4View
 
class ConstTensor5View
 
class ConstTensor6View
 
class ConstTensor7View
 

Detailed Description

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 132 of file matpackIII.h.

Constructor & Destructor Documentation

◆ ConstTensor3View() [1/6]

constexpr ConstTensor3View::ConstTensor3View ( const ConstTensor3View )
constexprdefault

◆ ConstTensor3View() [2/6]

constexpr ConstTensor3View::ConstTensor3View ( ConstTensor3View &&  )
constexprdefault

◆ ~ConstTensor3View()

virtual ConstTensor3View::~ConstTensor3View ( )
virtualdefault

Destructor.

◆ ConstTensor3View() [3/6]

ConstTensor3View::ConstTensor3View ( const ConstMatrixView a)

Special constructor to make a Tensor3 view of a matrix.

Definition at line 151 of file matpackIII.cc.

◆ ConstTensor3View() [4/6]

ConstTensor3View::ConstTensor3View ( )
protecteddefault

Referenced by operator()().

◆ ConstTensor3View() [5/6]

ConstTensor3View::ConstTensor3View ( Numeric data,
const Range pr,
const Range rr,
const Range cr 
)
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 163 of file matpackIII.cc.

◆ ConstTensor3View() [6/6]

ConstTensor3View::ConstTensor3View ( Numeric data,
const Range pp,
const Range pr,
const Range pc,
const Range np,
const Range nr,
const Range nc 
)
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 178 of file matpackIII.cc.

Member Function Documentation

◆ begin()

ConstIterator3D ConstTensor3View::begin ( ) const

◆ empty()

bool ConstTensor3View::empty ( ) const

Check if variable is empty.

Parameters
[in]xThe variable to check.
Returns
True if the size of any dimension of x is 0.

Definition at line 36 of file matpackIII.cc.

References ncols(), npages(), and nrows().

Referenced by cloudbox_checkedCalc(), get_variable_value(), iyIndependentBeamApproximation(), iyTransmissionStandard(), pndFromPsd(), and pndFromPsdBasic().

◆ end()

ConstIterator3D ConstTensor3View::end ( ) const

Return const iterator behind last page.

Definition at line 143 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()

Numeric ConstTensor3View::get ( Index  p,
Index  r,
Index  c 
) const
inline

Get element implementation without assertions.

Definition at line 180 of file matpackIII.h.

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

Referenced by interp(), and operator()().

◆ ncols()

◆ npages()

Index ConstTensor3View::npages ( ) const
inline

Returns the number of pages.

Definition at line 144 of file matpackIII.h.

References Range::mextent, and mpr.

Referenced by Append(), apply_iy_unit2(), AtmFieldPRegrid(), atmfields_checkedCalc(), AtmFieldsCalcExpand1D(), AtmFieldsExtract1D(), atmgeom_checkedCalc(), cayley_hamilton_fitted_method_4x4_propmat_to_transmat__eigen(), cayley_hamilton_fitted_method_4x4_propmat_to_transmat__explicit(), GriddedField3::checksize(), chk_atm_field(), chk_scat_species_field(), chk_size(), cloudboxSetManuallyAltitude(), complex_n_interp(), IGRF::compute(), describe(), empty(), Extract(), field_of_propagation(), find_cloudlimits(), flat(), get_pfct(), get_pmom(), get_ppath_atmvars(), get_variable_value(), GriddedFieldLatLonExpand(), GriddedFieldLatLonRegrid(), GriddedFieldZToPRegrid(), Interpolation::interp(), is_size(), iy_transmittance_mult(), iySurfaceFastem(), iySurfaceRtpropAgenda(), iySurfaceRtpropCalc(), MagFieldsCalcExpand1D(), MagFieldsCalcIGRF(), MagFieldsFromAltitudeRawCalc(), matrix_exp_dmatrix_exp(), MatrixExtractFromTensor3(), mult(), nca_write_to_file(), Tensor3View::operator*=(), Tensor3View::operator+=(), Tensor3View::operator-=(), Tensor3View::operator/=(), Tensor3::operator=(), particle_bulkpropRadarOnionPeeling(), pndFromPsd(), pndFromPsdBasic(), ppath_end_3d(), ppath_fieldFromDownUpLimbGeoms(), ppathPlaneParallel(), propmat4x4_to_transmat4x4(), propmat_clearsky_fieldCalc(), Reduce(), Tensor3::reduce_rank(), regrid_atmfield_by_gp_oem(), reshape(), rtmethods_jacobian_finalisation(), Tensor3::size(), special_matrix_exp_and_dmatrix_exp_dx_for_rt(), surface_props_check(), surface_props_interp(), surfaceFlatReflectivity(), Tensor3::Tensor3(), Tensor3Add(), Tensor3Multiply(), test04(), transform(), water_p_eq_fieldMK05(), WindFieldsCalcExpand1D(), WriteMolTau(), and xml_write_to_stream().

◆ nrows()

◆ operator()() [1/8]

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 43 of file matpackIII.cc.

References c, ConstTensor3View(), mcr, mdata, mpr, and mrr.

◆ operator()() [2/8]

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 51 of file matpackIII.cc.

References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.

◆ operator()() [3/8]

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 63 of file matpackIII.cc.

References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.

◆ operator()() [4/8]

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 121 of file matpackIII.cc.

References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.

◆ operator()() [5/8]

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 75 of file matpackIII.cc.

References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.

◆ operator()() [6/8]

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 104 of file matpackIII.cc.

References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.

◆ operator()() [7/8]

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 87 of file matpackIII.cc.

References ARTS_ASSERT, c, mcr, mdata, Range::mextent, mpr, mrr, Range::mstart, and Range::mstride.

◆ operator()() [8/8]

Numeric ConstTensor3View::operator() ( Index  p,
Index  r,
Index  c 
) const
inline

Plain const index operator.

Definition at line 166 of file matpackIII.h.

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

◆ operator=() [1/2]

ConstTensor3View & ConstTensor3View::operator= ( const ConstTensor3View )
default

◆ operator=() [2/2]

ConstTensor3View & ConstTensor3View::operator= ( ConstTensor3View &&  )
default

Friends And Related Function Documentation

◆ ConstIterator4D

friend class ConstIterator4D
friend

Definition at line 194 of file matpackIII.h.

◆ ConstTensor4View

friend class ConstTensor4View
friend

Definition at line 195 of file matpackIII.h.

◆ ConstTensor5View

friend class ConstTensor5View
friend

Definition at line 196 of file matpackIII.h.

◆ ConstTensor6View

friend class ConstTensor6View
friend

Definition at line 197 of file matpackIII.h.

◆ ConstTensor7View

friend class ConstTensor7View
friend

Definition at line 198 of file matpackIII.h.

◆ Tensor3View

friend class Tensor3View
friend

Definition at line 193 of file matpackIII.h.

Member Data Documentation

◆ mcr

◆ mdata

◆ mpr

◆ mrr


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