cartodata 6.0.0
carto::VolumeUtil< T > Class Template Reference

Volume utilities classes. More...

#include <cartodata/volume/volumeutil.h>

Inheritance diagram for carto::VolumeUtil< T >:
Collaboration diagram for carto::VolumeUtil< T >:

Static Public Member Functions

template<class UnaryFunction>
static VolumeRef< T > apply (UnaryFunction f, const VolumeRef< T > &o)
 applies a unary function to each voxel of a volume
 
template<class UnaryFunction>
static void selfApply (UnaryFunction f, VolumeRef< T > &o)
 applies a binary function to each voxel of a pair of volumes
 
template<class BinaryFunction>
static void selfApply (BinaryFunction f, VolumeRef< T > &o1, const VolumeRef< T > &o2)
 same as apply() except that the first input volume is used to store the result
 
template<class BinaryFunction>
static T accumulate (BinaryFunction f, const VolumeRef< T > &o2, T initial)
 Apply a binary function to each voxel of the volume, with a "current" value as second argument.
 
template<class BinaryFunction>
static T accumulate (BinaryFunction f, const Volume< T > &o2, T initial)
 

Detailed Description

template<typename T>
class carto::VolumeUtil< T >

Volume utilities classes.

Definition at line 1655 of file volumeutil.h.

Member Function Documentation

◆ accumulate() [1/2]

template<typename T>
template<class BinaryFunction>
T carto::VolumeUtil< T >::accumulate ( BinaryFunction f,
const Volume< T > & o2,
T initial )
static

◆ accumulate() [2/2]

template<typename T>
template<class BinaryFunction>
static T carto::VolumeUtil< T >::accumulate ( BinaryFunction f,
const VolumeRef< T > & o2,
T initial )
inlinestatic

Apply a binary function to each voxel of the volume, with a "current" value as second argument.

The voxel result is used for other voxels function calls. Useful for min/max for instance: min = VolumeUtil<T>::accumulate( std::min<T>, volume, std::numeric_limits<T>::max() ); max = VolumeUtil::accumulate( std::max<T>, volume, -std::numeric_limits<T>::max() ); May be used also for sum etc.

Definition at line 1685 of file volumeutil.h.

References accumulate().

Referenced by accumulate(), carto::VolumeUtilBase< T, true >::max(), and carto::VolumeUtilBase< T, true >::min().

◆ apply()

◆ selfApply() [1/2]

◆ selfApply() [2/2]

template<typename T>
template<class UnaryFunction>
void carto::VolumeUtil< T >::selfApply ( UnaryFunction f,
VolumeRef< T > & o )
static

applies a binary function to each voxel of a pair of volumes

same as apply() except that the input volume is used to store the result

Definition at line 299 of file volumeutil_d.h.

References carto::VolumeRef< T >::at(), carto::NDIterator_base::ended(), carto::VolumeRef< T >::getSize(), carto::VolumeRef< T >::getStrides(), carto::line_NDIterator< typename T >::inc_line_ptr(), and carto::line_NDIterator< typename T >::line_length().


The documentation for this class was generated from the following files: