cartodata 6.0.0
carto::volumeutil Namespace Reference

Classes

struct  basic_type_result
 
struct  basic_type_result< int16_t, int16_t >
 
struct  basic_type_result< int16_t, int8_t >
 
struct  basic_type_result< int16_t, uint16_t >
 
struct  basic_type_result< int16_t, uint8_t >
 
struct  basic_type_result< int8_t, int16_t >
 
struct  basic_type_result< int8_t, int8_t >
 
struct  basic_type_result< int8_t, uint16_t >
 
struct  basic_type_result< int8_t, uint8_t >
 
struct  basic_type_result< uint16_t, int16_t >
 
struct  basic_type_result< uint16_t, int8_t >
 
struct  basic_type_result< uint16_t, uint16_t >
 
struct  basic_type_result< uint16_t, uint8_t >
 
struct  basic_type_result< uint8_t, int16_t >
 
struct  basic_type_result< uint8_t, int8_t >
 
struct  basic_type_result< uint8_t, uint16_t >
 
struct  basic_type_result< uint8_t, uint8_t >
 
struct  bitwise_and
 
struct  bitwise_and_result
 
struct  bitwise_and_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  bitwise_and_result< CONTAINER< LEFT >, RIGHT >
 
struct  bitwise_and_result< int16_t, int16_t >
 
struct  bitwise_and_result< int16_t, int8_t >
 
struct  bitwise_and_result< int16_t, uint16_t >
 
struct  bitwise_and_result< int16_t, uint8_t >
 
struct  bitwise_and_result< int8_t, int16_t >
 
struct  bitwise_and_result< int8_t, int8_t >
 
struct  bitwise_and_result< int8_t, uint16_t >
 
struct  bitwise_and_result< int8_t, uint8_t >
 
struct  bitwise_and_result< LEFT, CONTAINER< RIGHT > >
 
struct  bitwise_and_result< uint16_t, int16_t >
 
struct  bitwise_and_result< uint16_t, int8_t >
 
struct  bitwise_and_result< uint16_t, uint16_t >
 
struct  bitwise_and_result< uint16_t, uint8_t >
 
struct  bitwise_and_result< uint8_t, int16_t >
 
struct  bitwise_and_result< uint8_t, int8_t >
 
struct  bitwise_and_result< uint8_t, uint16_t >
 
struct  bitwise_and_result< uint8_t, uint8_t >
 
struct  bitwise_left_shift
 
struct  bitwise_not
 
struct  bitwise_or
 
struct  bitwise_or_result
 
struct  bitwise_or_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  bitwise_or_result< CONTAINER< LEFT >, RIGHT >
 
struct  bitwise_or_result< int16_t, int16_t >
 
struct  bitwise_or_result< int16_t, int8_t >
 
struct  bitwise_or_result< int16_t, uint16_t >
 
struct  bitwise_or_result< int16_t, uint8_t >
 
struct  bitwise_or_result< int8_t, int16_t >
 
struct  bitwise_or_result< int8_t, int8_t >
 
struct  bitwise_or_result< int8_t, uint16_t >
 
struct  bitwise_or_result< int8_t, uint8_t >
 
struct  bitwise_or_result< LEFT, CONTAINER< RIGHT > >
 
struct  bitwise_or_result< uint16_t, int16_t >
 
struct  bitwise_or_result< uint16_t, int8_t >
 
struct  bitwise_or_result< uint16_t, uint16_t >
 
struct  bitwise_or_result< uint16_t, uint8_t >
 
struct  bitwise_or_result< uint8_t, int16_t >
 
struct  bitwise_or_result< uint8_t, int8_t >
 
struct  bitwise_or_result< uint8_t, uint16_t >
 
struct  bitwise_or_result< uint8_t, uint8_t >
 
struct  bitwise_right_shift
 
struct  bitwise_xor
 
struct  bitwise_xor_result
 
struct  bitwise_xor_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  bitwise_xor_result< CONTAINER< LEFT >, RIGHT >
 
struct  bitwise_xor_result< int16_t, int16_t >
 
struct  bitwise_xor_result< int16_t, int8_t >
 
struct  bitwise_xor_result< int16_t, uint16_t >
 
struct  bitwise_xor_result< int16_t, uint8_t >
 
struct  bitwise_xor_result< int8_t, int16_t >
 
struct  bitwise_xor_result< int8_t, int8_t >
 
struct  bitwise_xor_result< int8_t, uint16_t >
 
struct  bitwise_xor_result< int8_t, uint8_t >
 
struct  bitwise_xor_result< LEFT, CONTAINER< RIGHT > >
 
struct  bitwise_xor_result< uint16_t, int16_t >
 
struct  bitwise_xor_result< uint16_t, int8_t >
 
struct  bitwise_xor_result< uint16_t, uint16_t >
 
struct  bitwise_xor_result< uint16_t, uint8_t >
 
struct  bitwise_xor_result< uint8_t, int16_t >
 
struct  bitwise_xor_result< uint8_t, int8_t >
 
struct  bitwise_xor_result< uint8_t, uint16_t >
 
struct  bitwise_xor_result< uint8_t, uint8_t >
 
struct  decrement
 
struct  decrement< bool >
 
struct  divides
 
struct  divides< cdouble, double >
 
struct  divides< cdouble, float >
 
struct  divides< cdouble, long >
 
struct  divides< cfloat, double >
 
struct  divides< cfloat, long >
 
struct  divides_result
 
struct  divides_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  divides_result< CONTAINER< LEFT >, RIGHT >
 
struct  divides_result< int16_t, int16_t >
 
struct  divides_result< int16_t, int8_t >
 
struct  divides_result< int16_t, uint16_t >
 
struct  divides_result< int16_t, uint8_t >
 
struct  divides_result< int8_t, int16_t >
 
struct  divides_result< int8_t, int8_t >
 
struct  divides_result< int8_t, uint16_t >
 
struct  divides_result< int8_t, uint8_t >
 
struct  divides_result< LEFT, CONTAINER< RIGHT > >
 
struct  divides_result< uint16_t, int16_t >
 
struct  divides_result< uint16_t, int8_t >
 
struct  divides_result< uint16_t, uint16_t >
 
struct  divides_result< uint16_t, uint8_t >
 
struct  divides_result< uint8_t, int16_t >
 
struct  divides_result< uint8_t, int8_t >
 
struct  divides_result< uint8_t, uint16_t >
 
struct  divides_result< uint8_t, uint8_t >
 
struct  equal_to
 
struct  greater
 
struct  greater_equal
 
struct  identity
 
struct  increment
 
struct  increment< bool >
 
struct  less
 
struct  less_equal
 
struct  logical_and
 
struct  logical_and< bool, cdouble >
 
struct  logical_and< bool, cfloat >
 
struct  logical_not
 
struct  logical_not< cdouble >
 
struct  logical_not< cfloat >
 
struct  logical_or
 
struct  logical_or< bool, cdouble >
 
struct  logical_or< bool, cfloat >
 
struct  minus
 
struct  minus_result
 
struct  minus_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  minus_result< CONTAINER< LEFT >, RIGHT >
 
struct  minus_result< int16_t, int16_t >
 
struct  minus_result< int16_t, int8_t >
 
struct  minus_result< int16_t, uint16_t >
 
struct  minus_result< int16_t, uint8_t >
 
struct  minus_result< int8_t, int16_t >
 
struct  minus_result< int8_t, int8_t >
 
struct  minus_result< int8_t, uint16_t >
 
struct  minus_result< int8_t, uint8_t >
 
struct  minus_result< LEFT, CONTAINER< RIGHT > >
 
struct  minus_result< uint16_t, int16_t >
 
struct  minus_result< uint16_t, int8_t >
 
struct  minus_result< uint16_t, uint16_t >
 
struct  minus_result< uint16_t, uint8_t >
 
struct  minus_result< uint8_t, int16_t >
 
struct  minus_result< uint8_t, int8_t >
 
struct  minus_result< uint8_t, uint16_t >
 
struct  minus_result< uint8_t, uint8_t >
 
struct  modulus
 
struct  modulus_result
 
struct  modulus_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  modulus_result< CONTAINER< LEFT >, RIGHT >
 
struct  modulus_result< int16_t, int16_t >
 
struct  modulus_result< int16_t, int8_t >
 
struct  modulus_result< int16_t, uint16_t >
 
struct  modulus_result< int16_t, uint8_t >
 
struct  modulus_result< int8_t, int16_t >
 
struct  modulus_result< int8_t, int8_t >
 
struct  modulus_result< int8_t, uint16_t >
 
struct  modulus_result< int8_t, uint8_t >
 
struct  modulus_result< LEFT, CONTAINER< RIGHT > >
 
struct  modulus_result< uint16_t, int16_t >
 
struct  modulus_result< uint16_t, int8_t >
 
struct  modulus_result< uint16_t, uint16_t >
 
struct  modulus_result< uint16_t, uint8_t >
 
struct  modulus_result< uint8_t, int16_t >
 
struct  modulus_result< uint8_t, int8_t >
 
struct  modulus_result< uint8_t, uint16_t >
 
struct  modulus_result< uint8_t, uint8_t >
 
struct  multiplies
 
struct  multiplies< cdouble, float >
 
struct  multiplies< cdouble, long >
 
struct  multiplies< cfloat, double >
 
struct  multiplies< cfloat, long >
 
struct  multiplies_result
 
struct  multiplies_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  multiplies_result< CONTAINER< LEFT >, RIGHT >
 
struct  multiplies_result< int16_t, int16_t >
 
struct  multiplies_result< int16_t, int8_t >
 
struct  multiplies_result< int16_t, uint16_t >
 
struct  multiplies_result< int16_t, uint8_t >
 
struct  multiplies_result< int8_t, int16_t >
 
struct  multiplies_result< int8_t, int8_t >
 
struct  multiplies_result< int8_t, uint16_t >
 
struct  multiplies_result< int8_t, uint8_t >
 
struct  multiplies_result< LEFT, CONTAINER< RIGHT > >
 
struct  multiplies_result< uint16_t, int16_t >
 
struct  multiplies_result< uint16_t, int8_t >
 
struct  multiplies_result< uint16_t, uint16_t >
 
struct  multiplies_result< uint16_t, uint8_t >
 
struct  multiplies_result< uint8_t, int16_t >
 
struct  multiplies_result< uint8_t, int8_t >
 
struct  multiplies_result< uint8_t, uint16_t >
 
struct  multiplies_result< uint8_t, uint8_t >
 
struct  negate
 
struct  negate< VoxelHSV >
 
struct  negate< VoxelRGB >
 
struct  negate< VoxelRGBA >
 
struct  not_equal_to
 
struct  plus
 
struct  plus_result
 
struct  plus_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  plus_result< CONTAINER< LEFT >, RIGHT >
 
struct  plus_result< int16_t, int16_t >
 
struct  plus_result< int16_t, int8_t >
 
struct  plus_result< int16_t, uint16_t >
 
struct  plus_result< int16_t, uint8_t >
 
struct  plus_result< int8_t, int16_t >
 
struct  plus_result< int8_t, int8_t >
 
struct  plus_result< int8_t, uint16_t >
 
struct  plus_result< int8_t, uint8_t >
 
struct  plus_result< LEFT, CONTAINER< RIGHT > >
 
struct  plus_result< uint16_t, int16_t >
 
struct  plus_result< uint16_t, int8_t >
 
struct  plus_result< uint16_t, uint16_t >
 
struct  plus_result< uint16_t, uint8_t >
 
struct  plus_result< uint8_t, int16_t >
 
struct  plus_result< uint8_t, int8_t >
 
struct  plus_result< uint8_t, uint16_t >
 
struct  plus_result< uint8_t, uint8_t >
 
struct  select_left
 
struct  select_max
 
struct  select_min
 
struct  select_result
 
struct  select_result< CONTAINER1< LEFT >, CONTAINER2< RIGHT > >
 
struct  select_result< CONTAINER< LEFT >, RIGHT >
 
struct  select_result< int16_t, int16_t >
 
struct  select_result< int16_t, int8_t >
 
struct  select_result< int16_t, uint16_t >
 
struct  select_result< int16_t, uint8_t >
 
struct  select_result< int8_t, int16_t >
 
struct  select_result< int8_t, int8_t >
 
struct  select_result< int8_t, uint16_t >
 
struct  select_result< int8_t, uint8_t >
 
struct  select_result< LEFT, CONTAINER< RIGHT > >
 
struct  select_result< uint16_t, int16_t >
 
struct  select_result< uint16_t, int8_t >
 
struct  select_result< uint16_t, uint16_t >
 
struct  select_result< uint16_t, uint8_t >
 
struct  select_result< uint8_t, int16_t >
 
struct  select_result< uint8_t, int8_t >
 
struct  select_result< uint8_t, uint16_t >
 
struct  select_result< uint8_t, uint8_t >
 
struct  select_right
 

Functions

bool sameSize (const std::vector< int > &s1, const std::vector< int > &s2)
 Used by the actual Volume and VolumeRef operators It allows to keep the loops in one place and to specialize for non arithmetic types.
 
std::vector< int > maxSize (const std::vector< int > &s1, const std::vector< int > &s2)
 return the largest dimensions between s1 and s2
 
std::vector< int > minSize (const std::vector< int > &s1, const std::vector< int > &s2)
 return the smallest dimensions between s1 and s2
 
template<typename T, typename U, typename OUTP, typename BinaryFunction>
Volume< OUTP > & applyTowards (const T &cst1, const Volume< U > &vol2, Volume< OUTP > &dst, BinaryFunction func)
 
template<typename T, typename UnaryFunction>
Volume< typename UnaryFunction::result_type > apply (const Volume< T > &vol, UnaryFunction func)
 Apply a function to all the elements of a volume (create output version)
 
template<typename T, typename U, typename BinaryFunction>
Volume< typename BinaryFunction::result_type > apply (const Volume< T > &vol1, const Volume< U > &vol2, BinaryFunction func)
 
template<typename T, typename UnaryFunction>
rc_ptr< Volume< typename UnaryFunction::result_type > > apply (const rc_ptr< Volume< T > > &vol, UnaryFunction func)
 
template<typename T, typename U, typename BinaryFunction>
rc_ptr< Volume< typename BinaryFunction::result_type > > apply (const rc_ptr< Volume< T > > &vol1, const Volume< U > &vol2, BinaryFunction func)
 
template<typename T, typename UnaryFunction>
Volume< T > & selfApply (Volume< T > &vol, UnaryFunction func)
 Apply a function to all the elements of a volume (in place version)
 
template<typename T, typename U, typename BinaryFunction>
Volume< T > & selfApply (Volume< T > &vol1, const Volume< U > &vol2, BinaryFunction func)
 
template<typename T, typename UnaryFunction>
rc_ptr< Volume< T > > & selfApply (rc_ptr< Volume< T > > &vol, UnaryFunction func)
 
template<typename T, typename U, typename BinaryFunction>
rc_ptr< Volume< T > > & selfApply (rc_ptr< Volume< T > > &vol1, const Volume< U > &vol2, BinaryFunction func)
 
template<typename T, typename OUTP, typename UnaryFunction>
Volume< OUTP > & applyTowards (const Volume< T > &vol, Volume< OUTP > &dst, UnaryFunction func)
 Apply a function to all the elements of a volume (already allocated output version)
 
template<typename T, typename OUTP, typename UnaryFunction>
Volume< OUTP > & applyTowards (const T &cst, Volume< OUTP > &dst, UnaryFunction func)
 
template<typename T, typename U, typename OUTP, typename BinaryFunction>
Volume< OUTP > & applyTowards (const Volume< T > &vol1, const Volume< U > &vol2, Volume< OUTP > &dst, BinaryFunction func)
 
template<typename T, typename U, typename OUTP, typename BinaryFunction>
Volume< OUTP > & applyTowards (const Volume< T > &vol1, const U &cst2, Volume< OUTP > &dst, BinaryFunction func)
 
template<typename OUTP, typename T, typename BinaryFunction>
OUTP accumulate (const Volume< T > &vol, BinaryFunction func, OUTP initial)
 Accumulation over a volume.
 
template<typename OUTP, typename T, typename BinaryFunction>
OUTP accumulate (const rc_ptr< Volume< T > > &vol, BinaryFunction func, OUTP initial)
 

Function Documentation

◆ accumulate() [1/2]

template<typename OUTP, typename T, typename BinaryFunction>
OUTP carto::volumeutil::accumulate ( const rc_ptr< Volume< T > > & vol,
BinaryFunction func,
OUTP initial )
inline

Definition at line 833 of file volumeutil.h.

References accumulate().

◆ accumulate() [2/2]

template<typename OUTP, typename T, typename BinaryFunction>
OUTP carto::volumeutil::accumulate ( const Volume< T > & vol,
BinaryFunction func,
OUTP initial )
inline

Accumulation over a volume.

The result is equivalent to

for value in vol:
initial = func( initial, value )
return initial

Examples:

  • Calling it with function plus performs a sum over the volume
  • Calling it with function select_min returns its minimum value

Definition at line 815 of file volumeutil.h.

References carto::Volume< T >::at(), carto::NDIterator_base::ended(), carto::VolumeProxy< T >::getSize(), carto::Volume< T >::getStrides(), carto::const_line_NDIterator< typename T >::inc_line_ptr(), and carto::const_line_NDIterator< typename T >::line_length().

Referenced by accumulate(), carto::all(), carto::all(), carto::any(), and carto::any().

◆ apply() [1/4]

template<typename T, typename UnaryFunction>
rc_ptr< Volume< typename UnaryFunction::result_type > > carto::volumeutil::apply ( const rc_ptr< Volume< T > > & vol,
UnaryFunction func )
inline

Definition at line 544 of file volumeutil.h.

References applyTowards(), and carto::deepcopy().

◆ apply() [2/4]

template<typename T, typename U, typename BinaryFunction>
rc_ptr< Volume< typename BinaryFunction::result_type > > carto::volumeutil::apply ( const rc_ptr< Volume< T > > & vol1,
const Volume< U > & vol2,
BinaryFunction func )
inline

◆ apply() [3/4]

template<typename T, typename UnaryFunction>
Volume< typename UnaryFunction::result_type > carto::volumeutil::apply ( const Volume< T > & vol,
UnaryFunction func )
inline

◆ apply() [4/4]

template<typename T, typename U, typename BinaryFunction>
Volume< typename BinaryFunction::result_type > carto::volumeutil::apply ( const Volume< T > & vol1,
const Volume< U > & vol2,
BinaryFunction func )
inline

◆ applyTowards() [1/5]

template<typename T, typename OUTP, typename UnaryFunction>
Volume< OUTP > & carto::volumeutil::applyTowards ( const T & cst,
Volume< OUTP > & dst,
UnaryFunction func )
inline

◆ applyTowards() [2/5]

◆ applyTowards() [3/5]

template<typename T, typename OUTP, typename UnaryFunction>
Volume< OUTP > & carto::volumeutil::applyTowards ( const Volume< T > & vol,
Volume< OUTP > & dst,
UnaryFunction func )
inline

Apply a function to all the elements of a volume (already allocated output version)

Note
Loop usage is restricted to these 2 functions. Maybe a bit of multithreading could be done here ?

Definition at line 604 of file volumeutil.h.

References applyTowards(), carto::Volume< T >::at(), carto::NDIterator_base::ended(), carto::VolumeProxy< T >::getSize(), carto::Volume< T >::getStrides(), carto::const_line_NDIterator< typename T >::inc_line_ptr(), carto::line_NDIterator< typename T >::inc_line_ptr(), carto::const_line_NDIterator< typename T >::line_length(), minSize(), carto::ref< class T >::release(), carto::rc_ptr< typename T >::reset(), and sameSize().

Referenced by apply(), apply(), apply(), apply(), applyTowards(), applyTowards(), applyTowards(), applyTowards(), carto::Position4Di< T >::fillBorder(), carto::operator!(), carto::operator!(), carto::operator!=(), carto::operator!=(), carto::operator!=(), carto::operator!=(), carto::operator!=(), carto::operator!=(), carto::operator!=(), carto::operator&&(), carto::operator&&(), carto::operator&&(), carto::operator&&(), carto::operator&&(), carto::operator&&(), carto::operator<(), carto::operator<(), carto::operator<(), carto::operator<(), carto::operator<(), carto::operator<(), carto::operator<(), carto::operator<=(), carto::operator<=(), carto::operator<=(), carto::operator<=(), carto::operator<=(), carto::operator<=(), carto::operator<=(), carto::operator==(), carto::operator==(), carto::operator==(), carto::operator==(), carto::operator==(), carto::operator==(), carto::operator==(), carto::operator||(), carto::operator||(), carto::operator||(), carto::operator||(), carto::operator||(), carto::operator||(), selfApply(), selfApply(), carto::Position4Di< T >::sum(), carto::transfer(), carto::valuesIn(), carto::valuesIn(), carto::valuesNotIn(), and carto::valuesNotIn().

◆ applyTowards() [4/5]

◆ applyTowards() [5/5]

◆ maxSize()

std::vector< int > carto::volumeutil::maxSize ( const std::vector< int > & s1,
const std::vector< int > & s2 )
inline

return the largest dimensions between s1 and s2

Definition at line 480 of file volumeutil.h.

Referenced by apply(), and apply().

◆ minSize()

std::vector< int > carto::volumeutil::minSize ( const std::vector< int > & s1,
const std::vector< int > & s2 )
inline

return the smallest dimensions between s1 and s2

Definition at line 498 of file volumeutil.h.

Referenced by applyTowards(), applyTowards(), applyTowards(), and applyTowards().

◆ sameSize()

bool carto::volumeutil::sameSize ( const std::vector< int > & s1,
const std::vector< int > & s2 )
inline

Used by the actual Volume and VolumeRef operators It allows to keep the loops in one place and to specialize for non arithmetic types.

test if two volumes sizes vectors actually represent the same size (extending missing dimensions to 1)

Definition at line 461 of file volumeutil.h.

Referenced by applyTowards(), applyTowards(), applyTowards(), and applyTowards().

◆ selfApply() [1/4]

template<typename T, typename UnaryFunction>
rc_ptr< Volume< T > > & carto::volumeutil::selfApply ( rc_ptr< Volume< T > > & vol,
UnaryFunction func )
inline

Definition at line 586 of file volumeutil.h.

References selfApply().

◆ selfApply() [2/4]

template<typename T, typename U, typename BinaryFunction>
rc_ptr< Volume< T > > & carto::volumeutil::selfApply ( rc_ptr< Volume< T > > & vol1,
const Volume< U > & vol2,
BinaryFunction func )
inline

Definition at line 594 of file volumeutil.h.

References selfApply().

◆ selfApply() [3/4]

◆ selfApply() [4/4]

template<typename T, typename U, typename BinaryFunction>
Volume< T > & carto::volumeutil::selfApply ( Volume< T > & vol1,
const Volume< U > & vol2,
BinaryFunction func )
inline

Definition at line 576 of file volumeutil.h.

References applyTowards().