matpackV.h File Reference

#include "matpackIV.h"

Include dependency graph for matpackV.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Iterator5D
 Implementation of Tensors of Rank 5. More...
class  ConstIterator5D
 Const version of Iterator5D. More...
class  ConstTensor5View
 A constant view of a Tensor5. More...
class  Tensor5View
 The Tensor5View class. More...
class  Tensor5
 The Tensor5 class. More...

Functions

void copy (ConstIterator5D origin, const ConstIterator5D &end, Iterator5D target)
 Copy data between begin and end to target.
void copy (Numeric x, Iterator5D target, const Iterator5D &end)
 Copy a scalar to all elements.
void transform (Tensor5View y, double(&my_func)(double), ConstTensor5View x)
 A generic transform function for tensors, which can be used to implement mathematical functions operating on all elements.
Numeric max (const ConstTensor5View &x)
 Max function, tensor version.
Numeric min (const ConstTensor5View &x)
 Min function, tensor version.
ostream & operator<< (ostream &os, const ConstTensor5View &v)
 Output operator.
Numeric debug_tensor5view_get_elem (Tensor5View &tv, Index s, Index b, Index p, Index r, Index c)
 Helper function to access tensor elements.


Function Documentation

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

Copy a scalar to all elements.

Definition at line 2261 of file matpackV.cc.

References copy().

void copy ( ConstIterator5D  origin,
const ConstIterator5D end,
Iterator5D  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 2248 of file matpackV.cc.

References copy().

Numeric debug_tensor5view_get_elem ( Tensor5View tv,
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:
tv TensorView
s Shelf index
b Book index
p Page index
r Row index
c Column index
Author:
Oliver Lemke
Date:
2004-05-10

Definition at line 2547 of file matpackV.cc.

Numeric max ( const ConstTensor5View x  ) 

Max function, tensor version.

Definition at line 2483 of file matpackV.cc.

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

Numeric min ( const ConstTensor5View x  ) 

Min function, tensor version.

Definition at line 2505 of file matpackV.cc.

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

ostream& operator<< ( ostream &  os,
const ConstTensor5View v 
)

Output operator.

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

Definition at line 846 of file matpackV.cc.

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

void transform ( Tensor5View  y,
double(&)(double)  my_func,
ConstTensor5View  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:
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 2460 of file matpackV.cc.

References Tensor5View::begin(), ConstTensor5View::begin(), ConstTensor5View::end(), ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), and transform().


Generated on Mon Mar 23 14:06:45 2009 for ARTS by  doxygen 1.5.6