Galois::GReducible< T, BinFunc > Class Template Reference

GReducible stores per thread values of a variable of type T. More...

#include <Accumulator.h>

List of all members.

Public Member Functions

 GReducible (const BinFunc &f=BinFunc())
void update (const T &rhs)
 Updates the thread local value by applying the reduction operator to current and newly provided value.
T & reduce ()
 Returns the final reduction value.
void reset ()
 reset value

Protected Member Functions

 GReducible (const BinFunc &f, const T &initial)

Protected Attributes

BinFunc m_func
Galois::Runtime::PerThreadStorage
< T > 
m_data
const T m_initial

Detailed Description

template<typename T, typename BinFunc>
class Galois::GReducible< T, BinFunc >

GReducible stores per thread values of a variable of type T.

The final value is obtained by performing a reduction on per thread values using the provided binary functor BinFunc. BinFunc updates values in place and conforms to:

void operator()(T& lhs, const T& rhs)

Assumes that the initial value yields the identity element for binary functor.


Constructor & Destructor Documentation

template<typename T, typename BinFunc>
Galois::GReducible< T, BinFunc >::GReducible ( const BinFunc &  f,
const T &  initial 
) [inline, explicit, protected]
template<typename T, typename BinFunc>
Galois::GReducible< T, BinFunc >::GReducible ( const BinFunc &  f = BinFunc()  )  [inline, explicit]
Parameters:
f the binary functor acting as the reduction operator

Member Function Documentation

template<typename T, typename BinFunc>
T& Galois::GReducible< T, BinFunc >::reduce (  )  [inline]

Returns the final reduction value.

Only valid outside the parallel region.

template<typename T, typename BinFunc>
void Galois::GReducible< T, BinFunc >::reset (  )  [inline]

reset value

template<typename T, typename BinFunc>
void Galois::GReducible< T, BinFunc >::update ( const T &  rhs  )  [inline]

Updates the thread local value by applying the reduction operator to current and newly provided value.


Member Data Documentation

template<typename T, typename BinFunc>
Galois::Runtime::PerThreadStorage<T> Galois::GReducible< T, BinFunc >::m_data [protected]
template<typename T, typename BinFunc>
BinFunc Galois::GReducible< T, BinFunc >::m_func [protected]
template<typename T, typename BinFunc>
const T Galois::GReducible< T, BinFunc >::m_initial [protected]

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

Generated on 2 Nov 2013 for Galois by  doxygen 1.6.1