ARTS 2.5.10 (git: 2f1c442c)
matpackVI.h File Reference
#include <utility>
#include "matpackV.h"
#include "matpack_concepts.h"

Go to the source code of this file.

Classes

class  Iterator6D
 The outermost iterator class for rank 6 tensors. More...
 
class  ConstIterator6D
 Const version of Iterator6D. More...
 
class  ConstTensor6View
 A constant view of a Tensor6. More...
 
class  Tensor6View
 The Tensor6View class. More...
 
class  Tensor6
 The Tensor6 class. More...
 

Macros

#define CHECK(x)
 Implementation of Tensors of Rank 6.
 
#define OFFSET(x)   m##x##r.mstart + x* m##x##r.mstride
 
#define GETFUN(v, s, b, p, r, c)
 

Typedefs

using ArrayOfTensor6 = Array< Tensor6 >
 An array of Tensor6.
 
using ArrayOfArrayOfTensor6 = Array< ArrayOfTensor6 >
 

Functions

void copy (ConstIterator6D origin, const ConstIterator6D &end, Iterator6D target)
 Copy data between begin and end to target.
 
void copy (Numeric x, Iterator6D target, const Iterator6D &end)
 Copy a scalar to all elements.
 
void transform (Tensor6View y, double(&my_func)(double), ConstTensor6View x)
 A generic transform function for tensors, which can be used to implement mathematical functions operating on all elements.
 
Numeric max (const ConstTensor6View &x)
 Max function, tensor version.
 
Numeric min (const ConstTensor6View &x)
 Min function, tensor version.
 
Numeric debug_tensor6view_get_elem (Tensor6View &tv, Index v, Index s, Index b, Index p, Index r, Index c)
 Helper function to access tensor elements.
 

Macro Definition Documentation

◆ CHECK

#define CHECK (   x)
Value:
ARTS_ASSERT(0 <= x); \
ARTS_ASSERT(x < m##x##r.mextent)
#define ARTS_ASSERT(condition,...)
Definition: debug.h:102

Implementation of Tensors of Rank 6.

Dimensions are called: vitrine, shelf, book, page, row, column. or short: v, s, b, p, r, c

Author
Stefan Buehler
Date
2001-11-22

Definition at line 36 of file matpackVI.h.

◆ GETFUN

#define GETFUN (   v,
  s,
  b,
  p,
  r,
  c 
)
Value:
*(mdata + OFFSET(v) + OFFSET(s) + OFFSET(b) + OFFSET(p) + OFFSET(r) + \
OFFSET(c))
#define OFFSET(x)
Definition: matpackVI.h:39
#define v
#define c
#define b

Definition at line 1016 of file matpackVI.h.

◆ OFFSET

#define OFFSET (   x)    m##x##r.mstart + x* m##x##r.mstride

Definition at line 39 of file matpackVI.h.

Typedef Documentation

◆ ArrayOfArrayOfTensor6

Definition at line 1367 of file matpackVI.h.

◆ ArrayOfTensor6

An array of Tensor6.

Definition at line 1365 of file matpackVI.h.

Function Documentation

◆ copy() [1/2]

void copy ( ConstIterator6D  origin,
const ConstIterator6D end,
Iterator6D  target 
)

Copy data between begin and end to target.

Target must be a valid area of memory. Note that the strides in the iterators can be different, so that we can copy data between different kinds of subtensors.

Definition at line 2007 of file matpackVI.cc.

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

Referenced by copy(), Tensor6View::operator=(), and Tensor6::Tensor6().

◆ copy() [2/2]

void copy ( Numeric  x,
Iterator6D  target,
const Iterator6D end 
)

Copy a scalar to all elements.

Definition at line 2018 of file matpackVI.cc.

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

◆ debug_tensor6view_get_elem()

Numeric debug_tensor6view_get_elem ( Tensor6View tv,
Index  v,
Index  s,
Index  b,
Index  p,
Index  r,
Index  c 
)

Helper function to access tensor elements.

Because of function inlining the operator() is not accessible from the debuggger. This function helps to access Tensor elements from within the debugger.

Parameters
tvTensorView
vVitrine index
sShelf index
bBook index
pPage index
rRow index
cColumn index
Author
Oliver Lemke
Date
2004-05-10

Definition at line 2328 of file matpackVI.cc.

References b, c, and v.

◆ max()

Numeric max ( const ConstTensor6View x)

Max function, tensor version.

Definition at line 2270 of file matpackVI.cc.

References ConstTensor6View::begin(), ConstTensor6View::end(), and max().

◆ min()

Numeric min ( const ConstTensor6View x)

Min function, tensor version.

Definition at line 2289 of file matpackVI.cc.

References ConstTensor6View::begin(), ConstTensor6View::end(), and min().

◆ transform()

void transform ( Tensor6View  y,
double(&)(double)  my_func,
ConstTensor6View  x 
)

A generic transform function for tensors, which can be used to implement mathematical functions operating on all elements.

Because we have this, we don't need explicit functions like sqrt for tensors! The type of the mathematical function is double (&my_func)(double). Numeric would not work here, since mathematical functions for float do not exist!

transform(y,sin,x) computes y = sin(x)

The two views may be the same one, in which case the conversion happens in place.

Parameters
yOutput: The results of the function acting on each element of x.
my_funcA function (e.g., sqrt).
xA tensor.

Definition at line 2250 of file matpackVI.cc.

References ARTS_ASSERT, Tensor6View::begin(), ConstTensor6View::begin(), ConstTensor6View::end(), ConstTensor6View::nbooks(), ConstTensor6View::ncols(), ConstTensor6View::npages(), ConstTensor6View::nrows(), ConstTensor6View::nshelves(), ConstTensor6View::nvitrines(), and transform().

Referenced by transform().