MADNESS 0.10.1
madness::ScalarResultImpl< T > Class Template Reference

helper class for returning the result of a task, which is not a madness Function, but a simple scalar More...

#include <macrotaskq.h>

Inheritance diagram for madness::ScalarResultImpl< T >:
Collaboration diagram for madness::ScalarResultImpl< T >:

Public Types

typedef T value_type
Public Types inherited from madness::WorldObject< ScalarResultImpl< T > >
typedef WorldObject< ScalarResultImpl< T > > objT

Public Member Functions

 ScalarResultImpl (const ScalarResultImpl &other)=delete
 Disable the default copy constructor.
 ScalarResultImpl (World &world)
 ~ScalarResultImpl ()
void gaxpy (const double a, const T &right, double b, const bool fence=true)
 accumulate, optional fence
T get ()
 after completion of the taskq get the final value
T get_local () const
ScalarResultImpl< T > & operator+= (const T &x)
ScalarResultImpl< T > & operator= (const ScalarResultImpl< T > &other)=delete
 disable assignment operator
ScalarResultImpl< T > & operator= (const T &x)
 simple assignment of the scalar value
template<typename Archive>
void serialize (Archive &ar)
Public Member Functions inherited from madness::WorldObject< ScalarResultImpl< T > >
 WorldObject (const WorldObject &other)
virtual ~WorldObject ()
WorldObject & operator= (const WorldObject &)=delete
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn) const
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)().
Public Member Functions inherited from madness::WorldObjectBase
virtual ~WorldObjectBase ()
World & get_world () const
World & get_world_noexcept () const noexcept
 Get the world to which this object belongs, without risking a throw.
const uniqueidT & id () const
 Returns the globally unique object ID.
bool world_is_alive () const noexcept
 Reports whether the world to which this object belongs still exists.

Private Attributes

T value =T()
 the scalar value

Additional Inherited Members

Protected Member Functions inherited from madness::WorldObject< ScalarResultImpl< T > >
void process_pending ()
 To be called from derived constructor to process pending messages.
Protected Member Functions inherited from madness::WorldObjectBase
 WorldObjectBase (const WorldObjectBase &other)
 Copy constructor; produces an unregistered object.
 WorldObjectBase (World &w)
 Construct a new WorldObjectBase.
World & get_world_unchecked () const noexcept
 Unchecked access to the memoized world reference.
template<typename DerivedT>
void register_self (DerivedT *this_ptr)
 Registers this object with its world, making it globally addressable.

Detailed Description

template<typename T>
class madness::ScalarResultImpl< T >

helper class for returning the result of a task, which is not a madness Function, but a simple scalar

the result value is accumulated via gaxpy in universe rank=0, after completion of the taskq the final value can be obtained via get(), which includes a broadcast of the final value to all processes

Member Typedef Documentation

◆ value_type

template<typename T>
typedef T madness::ScalarResultImpl< T >::value_type

Constructor & Destructor Documentation

◆ ScalarResultImpl() [1/2]

◆ ScalarResultImpl() [2/2]

template<typename T>
madness::ScalarResultImpl< T >::ScalarResultImpl ( const ScalarResultImpl< T > & other)
delete

Disable the default copy constructor.

References ScalarResultImpl().

◆ ~ScalarResultImpl()

template<typename T>
madness::ScalarResultImpl< T >::~ScalarResultImpl ( )
inline

Member Function Documentation

◆ gaxpy()

template<typename T>
void madness::ScalarResultImpl< T >::gaxpy ( const double a,
const T & right,
double b,
const bool fence = true )
inline

◆ get()

template<typename T>
T madness::ScalarResultImpl< T >::get ( )
inline

◆ get_local()

template<typename T>
T madness::ScalarResultImpl< T >::get_local ( ) const
inline

get the local value of this rank, which might differ for different ranks for the final value use get()

References value.

◆ operator+=()

template<typename T>
ScalarResultImpl< T > & madness::ScalarResultImpl< T >::operator+= ( const T & x)
inline

References ScalarResultImpl(), and gaxpy().

◆ operator=() [1/2]

template<typename T>
ScalarResultImpl< T > & madness::ScalarResultImpl< T >::operator= ( const ScalarResultImpl< T > & other)
delete

disable assignment operator

References ScalarResultImpl().

◆ operator=() [2/2]

template<typename T>
ScalarResultImpl< T > & madness::ScalarResultImpl< T >::operator= ( const T & x)
inline

simple assignment of the scalar value

References ScalarResultImpl(), and value.

◆ serialize()

template<typename T>
template<typename Archive>
void madness::ScalarResultImpl< T >::serialize ( Archive & ar)
inline

References value.

Member Data Documentation

◆ value

template<typename T>
T madness::ScalarResultImpl< T >::value =T()
private

the scalar value

Referenced by gaxpy(), get(), get_local(), operator=(), and serialize().


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