ARTS
2.2.66
|
Go to the source code of this file.
Functions | |
std::ostream & | operator<< (std::ostream &os, const ConstTensor7View &v) |
Output operator. More... | |
void | copy (ConstIterator7D origin, const ConstIterator7D &end, Iterator7D target) |
Copy data between begin and end to target. More... | |
void | copy (Numeric x, Iterator7D target, const Iterator7D &end) |
Copy a scalar to all elements. More... | |
void | swap (Tensor7 &t1, Tensor7 &t2) |
Swaps two objects. More... | |
void | transform (Tensor7View y, double(&my_func)(double), ConstTensor7View x) |
A generic transform function for tensors, which can be used to implement mathematical functions operating on all elements. More... | |
Numeric | max (const ConstTensor7View &x) |
Max function, tensor version. More... | |
Numeric | min (const ConstTensor7View &x) |
Min function, tensor version. More... | |
Numeric | debug_tensor7view_get_elem (Tensor7View &tv, Index l, Index v, Index s, Index b, Index p, Index r, Index c) |
Helper function to access tensor elements. More... | |
Definition in file matpackVII.cc.
void copy | ( | ConstIterator7D | origin, |
const ConstIterator7D & | end, | ||
Iterator7D | 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 5223 of file matpackVII.cc.
References ConstTensor6View::begin(), Tensor6View::begin(), copy(), and ConstTensor6View::end().
Referenced by copy(), Tensor7View::operator=(), Tensor7::operator=(), and Tensor7::Tensor7().
void copy | ( | Numeric | x, |
Iterator7D | target, | ||
const Iterator7D & | end | ||
) |
Copy a scalar to all elements.
Definition at line 5238 of file matpackVII.cc.
References Tensor6View::begin(), copy(), and Tensor6View::end().
Numeric debug_tensor7view_get_elem | ( | Tensor7View & | tv, |
Index | l, | ||
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 |
l | Library index |
v | Vitrine index |
s | Shelf index |
b | Book index |
p | Page index |
r | Row index |
c | Column index |
Definition at line 5563 of file matpackVII.cc.
Numeric max | ( | const ConstTensor7View & | x | ) |
Max function, tensor version.
Definition at line 5497 of file matpackVII.cc.
References ConstTensor7View::begin(), ConstTensor7View::end(), and max().
Referenced by max().
Numeric min | ( | const ConstTensor7View & | x | ) |
Min function, tensor version.
Definition at line 5519 of file matpackVII.cc.
References ConstTensor7View::begin(), ConstTensor7View::end(), and min().
Referenced by min().
std::ostream& operator<< | ( | std::ostream & | os, |
const ConstTensor7View & | v | ||
) |
Output operator.
This demonstrates how iterators can be used to traverse the tensor. We use the standard output operator for Tensor6 to print each page in turn.
Definition at line 1971 of file matpackVII.cc.
References ConstTensor7View::begin(), and ConstTensor7View::end().
Swaps two objects.
Definition at line 5434 of file matpackVII.cc.
References ConstTensor7View::mbr, ConstTensor7View::mcr, ConstTensor7View::mdata, ConstTensor7View::mlr, ConstTensor7View::mpr, ConstTensor7View::mrr, ConstTensor7View::msr, and ConstTensor7View::mvr.
void transform | ( | Tensor7View | y, |
double(&)(double) | my_func, | ||
ConstTensor7View | 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 5472 of file matpackVII.cc.
References ConstTensor7View::begin(), Tensor7View::begin(), ConstTensor7View::end(), ConstTensor7View::nbooks(), ConstTensor7View::ncols(), ConstTensor7View::nlibraries(), ConstTensor7View::npages(), ConstTensor7View::nrows(), ConstTensor7View::nshelves(), ConstTensor7View::nvitrines(), and transform().
Referenced by transform().