classPii::ForEachFunction
#include <PiiMathFunctional.h>
Helper function for algorithms that involve scrolling elements.
Description
Unary functor, takes (matrix) element as argument and the return value is used as second parameter in FuMem. : Binaryfunctor: takes memoryobject and result of FuItem as arguments, and returns memoryobject.
Constructors and destructor
|
(
|
Public member functions
|
FuMemory::result_type
|
(
)
Returns memory object. |
|
void
|
(
Calls unary functor FuItem on (matrix) element, and passes its return value to second argument of binary functor FuMemory, whose return value in turn is set as internal memory. |
|
template<class FuItem, class FuMemory>
ForEachFunction< FuItem, FuMemory >
|
(
Helper function for creating object of type ForEachFunction. |
Function details
-
ForEachFunction
(- FuItem fItem
- FuMemory fMem
- typename FuMemory::result_type initMem
[inline]see createForEachFunction() for creating object of this type more easily.
Parameters
- fItem
Functor 'reads' item and returns value to be handled by memorymodifier functor.
- fMem
Functor that handles internal memory updating.
- initMem
Initial value for memory.
-
FuMemory::result_type operator()
()[inline]Returns memory object.
Returns
Functor 'memory'.
-
void operator()
(- const typename FuItem::argument_type & val
[inline]Calls unary functor FuItem on (matrix) element, and passes its return value to second argument of binary functor FuMemory, whose return value in turn is set as internal memory.
-
template<class FuItem, class FuMemory>
ForEachFunction< FuItem, FuMemory > createForEachFunction
(- FuItem fi
- FuMemory fm
- typename FuMemory::result_type initVal
Helper function for creating object of type ForEachFunction.
Add a note
Not a single note added yet. Be the first, add yours.