cartodata  5.1.2
carto::volumeutil Namespace Reference

Classes

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

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. More...
 
std::vector< int > maxSize (const std::vector< int > &s1, const std::vector< int > &s2)
 return the largest dimensions between s1 and s2 More...
 
std::vector< int > minSize (const std::vector< int > &s1, const std::vector< int > &s2)
 return the smallest dimensions between s1 and s2 More...
 
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) More...
 
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) More...
 
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) More...
 
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. More...
 
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 832 of file volumeutil.h.

Referenced by carto::max(), carto::min(), and carto::sum().

◆ 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 814 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< class >::inc_line_ptr(), and carto::const_line_NDIterator< class >::line_length().

Referenced by carto::all(), 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 543 of file volumeutil.h.

References applyTowards().

◆ 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

Definition at line 554 of file volumeutil.h.

References applyTowards(), carto::VolumeProxy< T >::getSize(), and maxSize().

◆ apply() [3/4]

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

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

Definition at line 518 of file volumeutil.h.

References applyTowards().

Referenced by carto::invertMinMax(), carto::operator%(), carto::operator&(), carto::operator*(), carto::operator+(), carto::operator-(), carto::operator/(), carto::operator^(), carto::operator|(), and carto::operator~().

◆ 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

Definition at line 529 of file volumeutil.h.

References applyTowards(), carto::VolumeProxy< T >::getSize(), and maxSize().

◆ 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]

template<typename T , typename U , typename OUTP , typename BinaryFunction >
Volume<OUTP>& carto::volumeutil::applyTowards ( const T &  cst1,
const Volume< U > &  vol2,
Volume< OUTP > &  dst,
BinaryFunction  func 
)
inline

◆ 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

◆ applyTowards() [4/5]

template<typename T , typename U , typename OUTP , typename BinaryFunction >
Volume< OUTP > & carto::volumeutil::applyTowards ( const Volume< T > &  vol1,
const U &  cst2,
Volume< OUTP > &  dst,
BinaryFunction  func 
)
inline

◆ applyTowards() [5/5]

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

◆ 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 479 of file volumeutil.h.

References carto::max().

Referenced by 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 497 of file volumeutil.h.

References carto::min().

Referenced by carto::Volume< T >::allocate(), 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 460 of file volumeutil.h.

Referenced by 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 585 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 593 of file volumeutil.h.

References selfApply().

◆ selfApply() [3/4]

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

◆ 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 575 of file volumeutil.h.

References applyTowards().