ARTS
2.2.66
|
#include "matpackV.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) assert( 0 <= x ); assert( x < m ## x ## r.mextent ) |
Implementation of Tensors of Rank 6. More... | |
#define | OFFSET(x) m ## x ## r.mstart + x * m ## x ## r.mstride |
Functions | |
void | copy (ConstIterator6D origin, const ConstIterator6D &end, Iterator6D target) |
Copy data between begin and end to target. More... | |
void | copy (Numeric x, Iterator6D target, const Iterator6D &end) |
Copy a scalar to all elements. More... | |
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. More... | |
Numeric | max (const ConstTensor6View &x) |
Max function, tensor version. More... | |
Numeric | min (const ConstTensor6View &x) |
Min function, tensor version. More... | |
std::ostream & | operator<< (std::ostream &os, const ConstTensor6View &v) |
Output operator. More... | |
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. More... | |
#define CHECK | ( | x | ) | assert( 0 <= x ); assert( x < m ## x ## r.mextent ) |
Implementation of Tensors of Rank 6.
Dimensions are called: vitrine, shelf, book, page, row, column. or short: v, s, b, p, r, c
Definition at line 33 of file matpackVI.h.
Referenced by ConstTensor6View::operator()(), ConstTensor7View::operator()(), Tensor6View::operator()(), and Tensor7View::operator()().
#define OFFSET | ( | x | ) | m ## x ## r.mstart + x * m ## x ## r.mstride |
Definition at line 34 of file matpackVI.h.
Referenced by ConstTensor6View::get(), ConstTensor7View::get(), Tensor6View::get(), Tensor7View::get(), ConstTensor6View::operator()(), ConstTensor7View::operator()(), Tensor6View::operator()(), and Tensor7View::operator()().
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 2729 of file matpackVI.cc.
References ConstTensor5View::begin(), Tensor5View::begin(), copy(), ConstTensor5View::end(), and Tensor6View::end().
Referenced by copy(), Tensor6View::operator=(), Tensor6::operator=(), and Tensor6::Tensor6().
void copy | ( | Numeric | x, |
Iterator6D | target, | ||
const Iterator6D & | end | ||
) |
Copy a scalar to all elements.
Definition at line 2744 of file matpackVI.cc.
References Tensor5View::begin(), copy(), Tensor5View::end(), and Tensor6View::end().
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.
tv | TensorView |
v | Vitrine index |
s | Shelf index |
b | Book index |
p | Page index |
r | Row index |
c | Column index |
Definition at line 3053 of file matpackVI.cc.
Numeric max | ( | const ConstTensor6View & | x | ) |
Max function, tensor version.
Definition at line 2988 of file matpackVI.cc.
References ConstTensor6View::begin(), ConstTensor6View::end(), and max().
Referenced by max().
Numeric min | ( | const ConstTensor6View & | x | ) |
Min function, tensor version.
Definition at line 3010 of file matpackVI.cc.
References ConstTensor6View::begin(), ConstTensor6View::end(), and min().
Referenced by min().
std::ostream& operator<< | ( | std::ostream & | os, |
const ConstTensor6View & | v | ||
) |
Output operator.
This demonstrates how iterators can be used to traverse the tensor. We use the standard output operator for Tensor5 to print each page in turn.
Definition at line 1007 of file matpackVI.cc.
References ConstTensor6View::begin(), and ConstTensor6View::end().
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.
y | Output: The results of the function acting on each element of x. |
my_func | A function (e.g., sqrt). |
x | A tensor. |
Definition at line 2964 of file matpackVI.cc.
References ConstTensor6View::begin(), Tensor6View::begin(), ConstTensor6View::end(), ConstTensor6View::nbooks(), ConstTensor6View::ncols(), ConstTensor6View::npages(), ConstTensor6View::nrows(), ConstTensor6View::nshelves(), ConstTensor6View::nvitrines(), and transform().
Referenced by transform().