ARTS  2.2.66
Tensor5 Class Reference

The Tensor5 class. More...

#include <matpackV.h>

Inheritance diagram for Tensor5:
Collaboration diagram for Tensor5:

Public Member Functions

 Tensor5 ()
 Default constructor. More...
 
 Tensor5 (Index s, Index b, Index p, Index r, Index c)
 Constructor setting size. More...
 
 Tensor5 (Index s, Index b, Index p, Index r, Index c, Numeric fill)
 Constructor setting size and filling with constant value. More...
 
 Tensor5 (const ConstTensor5View &v)
 Copy constructor from Tensor5View. More...
 
 Tensor5 (const Tensor5 &v)
 Copy constructor from Tensor5. More...
 
Tensor5operator= (Tensor5 x)
 Assignment operator from another tensor. More...
 
Tensor5operator= (Numeric x)
 Assignment operator from scalar. More...
 
void resize (Index s, Index b, Index p, Index r, Index c)
 Resize function. More...
 
virtual ~Tensor5 ()
 Destructor for Tensor5. More...
 
- Public Member Functions inherited from Tensor5View
ConstTensor5View operator() (const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const
 Const index operator for subrange. More...
 
ConstTensor4View operator() (const Range &s, const Range &b, const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor4View operator() (const Range &s, const Range &b, const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor4View operator() (const Range &s, const Range &b, Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor4View operator() (const Range &s, Index b, const Range &p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor4View operator() (Index s, const Range &b, const Range &p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor3View operator() (const Range &s, const Range &b, const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, const Range &b, Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, const Range &b, Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, Index b, const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, Index b, const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, Index b, Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (Index s, const Range &b, Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (Index s, const Range &b, const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (Index s, const Range &b, const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (Index s, Index b, const Range &p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstMatrixView operator() (const Range &s, const Range &b, Index p, Index r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (const Range &s, Index b, const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (const Range &s, Index b, Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (const Range &s, Index b, Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, const Range &b, Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, const Range &b, Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, const Range &b, const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, Index b, const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, Index b, const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, Index b, Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstVectorView operator() (const Range &s, Index b, Index p, Index r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index s, const Range &b, Index p, Index r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index s, Index b, const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index s, Index b, Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index s, Index b, Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstVectorView. More...
 
Numeric operator() (Index s, Index b, Index p, Index r, Index c) const
 Plain const index operator. More...
 
Numeric get (Index s, Index b, Index p, Index r, Index c) const
 Get element implementation without assertions. More...
 
Tensor5View operator() (const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
 Index operator for subrange. More...
 
Tensor4View operator() (const Range &s, const Range &b, const Range &p, const Range &r, Index c)
 Index operator returning an object of type Tensor4View. More...
 
Tensor4View operator() (const Range &s, const Range &b, const Range &p, Index r, const Range &c)
 Index operator returning an object of type Tensor4View. More...
 
Tensor4View operator() (const Range &s, const Range &b, Index p, const Range &r, const Range &c)
 Index operator returning an object of type Tensor4View. More...
 
Tensor4View operator() (const Range &s, Index b, const Range &p, const Range &r, const Range &c)
 Index operator returning an object of type Tensor4View. More...
 
Tensor4View operator() (Index s, const Range &b, const Range &p, const Range &r, const Range &c)
 Index operator returning an object of type Tensor4View. More...
 
Tensor3View operator() (const Range &s, const Range &b, const Range &p, Index r, Index c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (const Range &s, const Range &b, Index p, const Range &r, Index c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (const Range &s, const Range &b, Index p, Index r, const Range &c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (const Range &s, Index b, const Range &p, Index r, const Range &c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (const Range &s, Index b, const Range &p, const Range &r, Index c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (const Range &s, Index b, Index p, const Range &r, const Range &c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (Index s, const Range &b, Index p, const Range &r, const Range &c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (Index s, const Range &b, const Range &p, Index r, const Range &c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (Index s, const Range &b, const Range &p, const Range &r, Index c)
 Index operator returning an object of type Tensor3View. More...
 
Tensor3View operator() (Index s, Index b, const Range &p, const Range &r, const Range &c)
 Index operator returning an object of type Tensor3View. More...
 
MatrixView operator() (const Range &s, const Range &b, Index p, Index r, Index c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (const Range &s, Index b, const Range &p, Index r, Index c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (const Range &s, Index b, Index p, const Range &r, Index c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (const Range &s, Index b, Index p, Index r, const Range &c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (Index s, const Range &b, Index p, Index r, const Range &c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (Index s, const Range &b, Index p, const Range &r, Index c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (Index s, const Range &b, const Range &p, Index r, Index c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (Index s, Index b, const Range &p, const Range &r, Index c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (Index s, Index b, const Range &p, Index r, const Range &c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (Index s, Index b, Index p, const Range &r, const Range &c)
 Index operator returning an object of type MatrixView. More...
 
VectorView operator() (const Range &s, Index b, Index p, Index r, Index c)
 Index operator returning an object of type VectorView. More...
 
VectorView operator() (Index s, const Range &b, Index p, Index r, Index c)
 Index operator returning an object of type VectorView. More...
 
VectorView operator() (Index s, Index b, const Range &p, Index r, Index c)
 Index operator returning an object of type VectorView. More...
 
VectorView operator() (Index s, Index b, Index p, const Range &r, Index c)
 Index operator returning an object of type VectorView. More...
 
VectorView operator() (Index s, Index b, Index p, Index r, const Range &c)
 Const index operator returning an object of type ConstVectorView. More...
 
Numericoperator() (Index s, Index b, Index p, Index r, Index c)
 Plain const index operator. More...
 
Numericget (Index s, Index b, Index p, Index r, Index c)
 Get element implementation without assertions. More...
 
const Numericget_c_array () const
 Conversion to plain C-array. More...
 
Numericget_c_array ()
 Conversion to plain C-array. More...
 
ConstIterator5D begin () const
 Return const iterator to first shelf. More...
 
ConstIterator5D end () const
 Return const iterator behind last shelf. More...
 
Iterator5D begin ()
 Return iterator to first shelf. More...
 
Iterator5D end ()
 Return iterator behind last shelf. More...
 
Tensor5Viewoperator= (const ConstTensor5View &v)
 Assignment operator. More...
 
Tensor5Viewoperator= (const Tensor5View &v)
 Assignment from Tensor5View to Tensor5View. More...
 
Tensor5Viewoperator= (const Tensor5 &v)
 Assignment from a Tensor5. More...
 
Tensor5Viewoperator= (Numeric x)
 Assigning a scalar to a Tensor5View will set all elements to this value. More...
 
Tensor5Viewoperator*= (Numeric x)
 Multiplication by scalar. More...
 
Tensor5Viewoperator/= (Numeric x)
 Division by scalar. More...
 
Tensor5Viewoperator+= (Numeric x)
 Addition of scalar. More...
 
Tensor5Viewoperator-= (Numeric x)
 Subtraction of scalar. More...
 
Tensor5Viewoperator*= (const ConstTensor5View &x)
 Element-vise multiplication by another Tensor5. More...
 
Tensor5Viewoperator/= (const ConstTensor5View &x)
 Element-vise division by another Tensor5. More...
 
Tensor5Viewoperator+= (const ConstTensor5View &x)
 Element-vise addition of another Tensor5. More...
 
Tensor5Viewoperator-= (const ConstTensor5View &x)
 Element-vise subtraction of another Tensor5. More...
 
virtual ~Tensor5View ()
 Destructor. More...
 
 Tensor5View (const Tensor4View &a)
 Special constructor to make a Tensor5 view of a Tensor4. More...
 
- Public Member Functions inherited from ConstTensor5View
Index nshelves () const
 Returns the number of shelves. More...
 
Index nbooks () const
 Returns the number of books. 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...
 
ConstTensor5View operator() (const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const
 Const index operator for subrange. More...
 
ConstTensor4View operator() (const Range &s, const Range &b, const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor4View operator() (const Range &s, const Range &b, const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor4View operator() (const Range &s, const Range &b, Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor4View operator() (const Range &s, Index b, const Range &p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor4View operator() (Index s, const Range &b, const Range &p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor4View. More...
 
ConstTensor3View operator() (const Range &s, const Range &b, const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, const Range &b, Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, const Range &b, Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, Index b, const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, Index b, const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (const Range &s, Index b, Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (Index s, const Range &b, Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (Index s, const Range &b, const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (Index s, const Range &b, const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstTensor3View operator() (Index s, Index b, const Range &p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstTensor3View. More...
 
ConstMatrixView operator() (const Range &s, const Range &b, Index p, Index r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (const Range &s, Index b, const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (const Range &s, Index b, Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (const Range &s, Index b, Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, const Range &b, Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, const Range &b, Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, const Range &b, const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, Index b, const Range &p, const Range &r, Index c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, Index b, const Range &p, Index r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstMatrixView operator() (Index s, Index b, Index p, const Range &r, const Range &c) const
 Const index operator returning an object of type ConstMatrixView. More...
 
ConstVectorView operator() (const Range &s, Index b, Index p, Index r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index s, const Range &b, Index p, Index r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index s, Index b, const Range &p, Index r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index s, Index b, Index p, const Range &r, Index c) const
 Const index operator returning an object of type ConstVectorView. More...
 
ConstVectorView operator() (Index s, Index b, Index p, Index r, const Range &c) const
 Const index operator returning an object of type ConstVectorView. More...
 
Numeric operator() (Index s, Index b, Index p, Index r, Index c) const
 Plain const index operator. More...
 
Numeric get (Index s, Index b, Index p, Index r, Index c) const
 Get element implementation without assertions. More...
 
ConstIterator5D begin () const
 Return const iterator to first shelf. More...
 
ConstIterator5D end () const
 Return const iterator behind last shelf. More...
 
virtual ~ConstTensor5View ()
 Destructor. More...
 
 ConstTensor5View (const ConstTensor4View &a)
 Special constructor to make a Tensor5 view of a Tensor4. More...
 

Friends

void swap (Tensor5 &t1, Tensor5 &t2)
 Swaps two objects. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Tensor5View
 Tensor5View ()
 Default constructor. More...
 
 Tensor5View (Numeric *data, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
 Explicit constructor. More...
 
 Tensor5View (Numeric *data, const Range &ps, const Range &pb, const Range &pp, const Range &pr, const Range &pc, const Range &ns, const Range &nb, const Range &np, const Range &nr, const Range &nc)
 Recursive constructor. More...
 
- Protected Member Functions inherited from ConstTensor5View
 ConstTensor5View ()
 Default constructor. More...
 
 ConstTensor5View (Numeric *data, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
 Explicit constructor. More...
 
 ConstTensor5View (Numeric *data, const Range &ps, const Range &pb, const Range &pp, const Range &pr, const Range &pc, const Range &ns, const Range &nb, const Range &np, const Range &nr, const Range &nc)
 Recursive constructor. More...
 
- Protected Attributes inherited from ConstTensor5View
Range msr
 The shelf range of mdata that is actually used. More...
 
Range mbr
 The book range of mdata that is actually used. More...
 
Range mpr
 The page range of mdata that is actually used. More...
 
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...
 

Detailed Description

The Tensor5 class.

This is a Tensor5View that also allocates storage automatically, and deallocates it when it is destroyed. We take all the functionality from Tensor5View. Additionally defined here are:

  1. Constructors and destructor.
  2. Assignment operators.
  3. Resize function.

Definition at line 451 of file matpackV.h.

Constructor & Destructor Documentation

◆ Tensor5() [1/5]

Tensor5::Tensor5 ( )

Default constructor.

Definition at line 2320 of file matpackV.cc.

◆ Tensor5() [2/5]

Tensor5::Tensor5 ( Index  s,
Index  b,
Index  p,
Index  r,
Index  c 
)

Constructor setting size.

This constructor has to set the strides in the shelf, book, page and row ranges correctly!

Definition at line 2331 of file matpackV.cc.

◆ Tensor5() [3/5]

Tensor5::Tensor5 ( Index  s,
Index  b,
Index  p,
Index  r,
Index  c,
Numeric  fill 
)

Constructor setting size and filling with constant value.

Definition at line 2343 of file matpackV.cc.

References ConstTensor5View::mdata.

◆ Tensor5() [4/5]

Tensor5::Tensor5 ( const ConstTensor5View m)

Copy constructor from Tensor5View.

This automatically sets the size and copies the data.

Definition at line 2360 of file matpackV.cc.

References ConstTensor5View::begin(), Tensor5View::begin(), copy(), and ConstTensor5View::end().

◆ Tensor5() [5/5]

Tensor5::Tensor5 ( const Tensor5 m)

Copy constructor from Tensor5.

This automatically sets the size and copies the data.

Definition at line 2373 of file matpackV.cc.

References Tensor5View::begin(), copy(), and Tensor5View::end().

◆ ~Tensor5()

Tensor5::~Tensor5 ( )
virtual

Destructor for Tensor5.

This is important, since Tensor5 uses new to allocate storage.

Definition at line 2484 of file matpackV.cc.

References ConstTensor5View::mdata.

Member Function Documentation

◆ operator=() [1/2]

Tensor5 & Tensor5::operator= ( Tensor5  x)

Assignment operator from another tensor.

While dimensions of views can not be adjusted, dimensions of tensors can be adjusted. Hence, the behavior of the assignment operator is different.

In this case the size of the target is automatically adjusted. This is important, so that structures containing tensors are copied correctly.

This is a deviation from the old ARTS paradigm that sizes must match exactly before copying!

Note: It is sufficient to have only this one version of the assignment (Tensor = Tensor). It implicitly covers the cases Tensor=TensorView, etc, because there is a default constructor for Tensor from TensorView. (See C++ Primer Plus, page 571ff.)

Parameters
mThe other tensor to assign to this one.
Returns
This tensor, by tradition.
Author
Stefan Buehler
Date
2002-12-19

Definition at line 2413 of file matpackV.cc.

References swap.

◆ operator=() [2/2]

Tensor5 & Tensor5::operator= ( Numeric  x)

Assignment operator from scalar.

Assignment operators are not inherited.

Definition at line 2421 of file matpackV.cc.

References Tensor5View::begin(), copy(), and Tensor5View::end().

◆ resize()

void Tensor5::resize ( Index  s,
Index  b,
Index  p,
Index  r,
Index  c 
)

Resize function.

If the size is already correct this function does nothing. All data is lost after resizing! The new tensor is not initialized, so it will contain random values.

Definition at line 2430 of file matpackV.cc.

References ConstTensor5View::mbr, ConstTensor5View::mcr, ConstTensor5View::mdata, Range::mextent, ConstTensor5View::mpr, ConstTensor5View::mrr, ConstTensor5View::msr, Range::mstart, and Range::mstride.

Referenced by calcSingleScatteringDataProperties(), GasAbsLookup::Extract(), get_ppath_abs(), nca_read_from_file(), pha_mat_sptFromData(), Reduce(), ScatteringMergeParticles1D(), Tensor5Scale(), Tensor5SetConstant(), and xml_read_from_stream().

Friends And Related Function Documentation

◆ swap

void swap ( Tensor5 t1,
Tensor5 t2 
)
friend

Swaps two objects.

Definition at line 2471 of file matpackV.cc.

Referenced by operator=().


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