ARTS  1.0.222
Public Member Functions | List of all members
Tensor3 Class Reference

The Tensor3 class. More...

#include <matpackIII.h>

Inheritance diagram for Tensor3:
Tensor3View ConstTensor3View

Public Member Functions

 Tensor3 ()
 Default constructor. More...
 
 Tensor3 (Index p, Index r, Index c)
 Constructor setting size. More...
 
 Tensor3 (Index p, Index r, Index c, Numeric fill)
 Constructor setting size and filling with constant value. More...
 
 Tensor3 (const ConstTensor3View &v)
 Copy constructor from Tensor3View. More...
 
 Tensor3 (const Tensor3 &v)
 Copy constructor from Tensor3. More...
 
Tensor3operator= (const Tensor3 &x)
 Assignment operator from another tensor. More...
 
Tensor3operator= (Numeric x)
 Assignment operator from scalar. More...
 
void resize (Index p, Index r, Index c)
 Resize function. More...
 
 ~Tensor3 ()
 Destructor for Tensor3. More...
 
- Public Member Functions inherited from Tensor3View
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...
 
Tensor3View operator() (const Range &p, const Range &r, const Range &c)
 Index operator for subrange. More...
 
MatrixView operator() (const Range &p, const Range &r, Index c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (const Range &p, Index r, const Range &c)
 Index operator returning an object of type MatrixView. More...
 
MatrixView operator() (Index p, const Range &r, const Range &c)
 Index operator returning an object of type MatrixView. More...
 
VectorView operator() (Index p, Index r, const Range &c)
 Index operator returning an object of type VectorView. More...
 
VectorView operator() (Index p, const Range &r, Index c)
 Index operator returning an object of type VectorView. More...
 
VectorView operator() (const Range &p, Index r, Index c)
 Index operator returning an object of type VectorView. More...
 
Numericoperator() (Index p, Index r, Index c)
 Plain non-const index operator. More...
 
ConstIterator3D begin () const
 Return const iterator to first row. More...
 
ConstIterator3D end () const
 Return const iterator behind last row. More...
 
Iterator3D begin ()
 Return iterator to first page. More...
 
Iterator3D end ()
 Return iterator behind last page. More...
 
Tensor3Viewoperator= (const ConstTensor3View &v)
 Assignment operator. More...
 
Tensor3Viewoperator= (const Tensor3View &v)
 Assignment from Tensor3View to Tensor3View. More...
 
Tensor3Viewoperator= (const Tensor3 &v)
 Assignment from a Tensor3. More...
 
Tensor3Viewoperator= (Numeric x)
 Assigning a scalar to a Tensor3View will set all elements to this value. More...
 
Tensor3Viewoperator*= (Numeric x)
 Multiplication by scalar. More...
 
Tensor3Viewoperator/= (Numeric x)
 Division by scalar. More...
 
Tensor3Viewoperator+= (Numeric x)
 Addition of scalar. More...
 
Tensor3Viewoperator-= (Numeric x)
 Subtraction of scalar. More...
 
Tensor3Viewoperator*= (const ConstTensor3View &x)
 Element-vise multiplication by another Tensor3. More...
 
Tensor3Viewoperator/= (const ConstTensor3View &x)
 Element-vise division by another Tensor3. More...
 
Tensor3Viewoperator+= (const ConstTensor3View &x)
 Element-vise addition of another Tensor3. More...
 
Tensor3Viewoperator-= (const ConstTensor3View &x)
 Element-vise subtraction of another Tensor3. More...
 
- Public Member Functions inherited from ConstTensor3View
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...
 
ConstIterator3D begin () const
 Return const iterator to first page. More...
 
ConstIterator3D end () const
 Return const iterator behind last page. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Tensor3View
 Tensor3View ()
 Default constructor. More...
 
 Tensor3View (Numeric *data, const Range &p, const Range &r, const Range &c)
 Explicit constructor. More...
 
 Tensor3View (Numeric *data, const Range &pp, const Range &pr, const Range &pc, const Range &np, const Range &nr, const Range &nc)
 Recursive constructor. More...
 
- Protected Member Functions inherited from ConstTensor3View
 ConstTensor3View ()
 Default constructor. More...
 
 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 inherited from ConstTensor3View
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 Tensor3 class.

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

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

Definition at line 227 of file matpackIII.h.

Constructor & Destructor Documentation

◆ Tensor3() [1/5]

Tensor3::Tensor3 ( )
inline

Default constructor.

Definition at line 1118 of file matpackIII.h.

◆ Tensor3() [2/5]

Tensor3::Tensor3 ( Index  p,
Index  r,
Index  c 
)
inline

Constructor setting size.

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

Definition at line 1129 of file matpackIII.h.

◆ Tensor3() [3/5]

Tensor3::Tensor3 ( Index  p,
Index  r,
Index  c,
Numeric  fill 
)
inline

Constructor setting size and filling with constant value.

Definition at line 1139 of file matpackIII.h.

◆ Tensor3() [4/5]

Tensor3::Tensor3 ( const ConstTensor3View m)
inline

Copy constructor from Tensor3View.

This automatically sets the size and copies the data.

Definition at line 1153 of file matpackIII.h.

◆ Tensor3() [5/5]

Tensor3::Tensor3 ( const Tensor3 m)
inline

Copy constructor from Tensor3.

This automatically sets the size and copies the data.

Definition at line 1164 of file matpackIII.h.

◆ ~Tensor3()

Tensor3::~Tensor3 ( )
inline

Destructor for Tensor3.

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

Definition at line 1252 of file matpackIII.h.

Member Function Documentation

◆ operator=() [1/2]

Tensor3 & Tensor3::operator= ( const Tensor3 m)
inline

Assignment operator from another tensor.

It is important that this operator exists. Otherwise the = operator seems to copy references instead of content in some cases.

The Behavior of this one is a bit special: If the size of the target tensor is 0 then it will be automatically resized to match (this is needed to have the correct initialization for constructed classes that use the assignment operator to initialize their data).

Definition at line 1188 of file matpackIII.h.

◆ operator=() [2/2]

Tensor3 & Tensor3::operator= ( Numeric  x)
inline

Assignment operator from scalar.

Assignment operators are not inherited.

Definition at line 1214 of file matpackIII.h.

◆ resize()

void Tensor3::resize ( Index  p,
Index  r,
Index  c 
)
inline

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


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