ARTS  1.0.222
Classes | Typedefs | Functions
matpackIII.h File Reference
#include <iomanip>
#include "matpackI.h"

Go to the source code of this file.

Classes

class  Iterator3D
 Implementation of Tensors of Rank 3. More...
 
class  ConstIterator3D
 Const version of Iterator3D. More...
 
class  ConstTensor3View
 A constant view of a Tensor3. More...
 
class  Tensor3View
 The Tensor3View class. More...
 
class  Tensor3
 The Tensor3 class. More...
 

Typedefs

typedef Array< Tensor3ArrayOfTensor3
 An array of Tensor3. More...
 

Functions

void copy (ConstIterator3D origin, const ConstIterator3D &end, Iterator3D target)
 Copy data between begin and end to target. More...
 
void copy (Numeric x, Iterator3D target, const Iterator3D &end)
 Copy a scalar to all elements. More...
 
std::ostream & operator<< (std::ostream &os, const ConstTensor3View &v)
 Output operator. More...
 
Numeric add (Numeric x, Numeric y)
 
void transform (Tensor3View y, double(&my_func)(double), ConstTensor3View x)
 A generic transform function for tensors, which can be used to implement mathematical functions operating on all elements. More...
 
Numeric max (const ConstTensor3View &x)
 Max function, tensor version. More...
 
Numeric min (const ConstTensor3View &x)
 Min function, tensor version. More...
 

Typedef Documentation

◆ ArrayOfTensor3

An array of Tensor3.

Definition at line 266 of file matpackIII.h.

Function Documentation

◆ add()

Numeric add ( Numeric  x,
Numeric  y 
)
inline

Definition at line 926 of file matpackIII.h.

◆ copy() [1/2]

void copy ( ConstIterator3D  origin,
const ConstIterator3D end,
Iterator3D  target 
)
inline

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

◆ copy() [2/2]

void copy ( Numeric  x,
Iterator3D  target,
const Iterator3D end 
)
inline

Copy a scalar to all elements.

Definition at line 1101 of file matpackIII.h.

◆ max()

Numeric max ( const ConstTensor3View x)
inline

Max function, tensor version.

Definition at line 1296 of file matpackIII.h.

◆ min()

Numeric min ( const ConstTensor3View x)
inline

Min function, tensor version.

Definition at line 1318 of file matpackIII.h.

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const ConstTensor3View v 
)
inline

Output operator.

This demonstrates how iterators can be used to traverse the tensor. We use the standard output operator for Matrix to print each page in turn.

Definition at line 603 of file matpackIII.h.

◆ transform()

void transform ( Tensor3View  y,
double(&)(double)  my_func,
ConstTensor3View  x 
)
inline

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.

Return values
ythe results of the function acting on each element of x
Parameters
my_funca function (e.g., sqrt)
xa tensor

Definition at line 1275 of file matpackIII.h.