MADNESS 0.10.1
Public Types | Public Member Functions | Private Attributes | List of all members
madness::ScalarResult< 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::ScalarResult< T >:
Inheritance graph
[legend]
Collaboration diagram for madness::ScalarResult< T >:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 ScalarResult (const ScalarResult< T > &other)=delete
 Disable the default copy constructor.
 
 ScalarResult (ScalarResult< T > &&)=default
 
 ScalarResult (World &world)
 
 ~ScalarResult ()
 
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
 
ScalarResult< T > & operator+= (const T &x)
 
ScalarResult< T > & operator= (const ScalarResult< T > &other)=delete
 disable assignment operator
 
ScalarResult< T > & operator= (const T &x)
 simple assignment of the scalar value
 
ScalarResult< T > & operator= (ScalarResult< T > &&)=default
 
template<typename Archive >
void serialize (Archive &ar)
 
- Public Member Functions inherited from madness::WorldObject< Derived >
 WorldObject (const WorldObject &other)
 
 WorldObject (World &world)
 Constructor that associates an object (via the derived class) with a globally unique ID.
 
virtual ~WorldObject ()
 
Worldget_world () const
 Returns a reference to the world.
 
const uniqueidTid () const
 Returns the globally unique object ID.
 
WorldObjectoperator= (const WorldObject &)=delete
 
template<typename memfnT >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn) const
 
template<typename memfnT , typename a1T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1) const
 
template<typename memfnT , typename a1T , typename a2T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2) const
 
template<typename memfnT , typename a1T , typename a2T , typename a3T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3) const
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4) const
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5) const
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6) const
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7) const
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8) const
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9) const
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8,a9).
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8).
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7).
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6).
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5).
 
template<typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4).
 
template<typename memfnT , typename a1T , typename a2T , typename a3T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3).
 
template<typename memfnT , typename a1T , typename a2T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2).
 
template<typename memfnT , typename a1T >
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1).
 
template<typename memfnT >
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 ()=default
 

Private Attributes

T value =T()
 the scalar value
 

Additional Inherited Members

- Protected Member Functions inherited from madness::WorldObject< Derived >
void process_pending ()
 To be called from derived constructor to process pending messages.
 

Detailed Description

template<typename T = double>
class madness::ScalarResult< 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 = double>
typedef T madness::ScalarResult< T >::value_type

Constructor & Destructor Documentation

◆ ScalarResult() [1/3]

template<typename T = double>
madness::ScalarResult< T >::ScalarResult ( World world)
inline

◆ ScalarResult() [2/3]

template<typename T = double>
madness::ScalarResult< T >::ScalarResult ( const ScalarResult< T > &  other)
delete

Disable the default copy constructor.

◆ ScalarResult() [3/3]

template<typename T = double>
madness::ScalarResult< T >::ScalarResult ( ScalarResult< T > &&  )
default

◆ ~ScalarResult()

template<typename T = double>
madness::ScalarResult< T >::~ScalarResult ( )
inline

Member Function Documentation

◆ gaxpy()

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

◆ get()

template<typename T = double>
T madness::ScalarResult< T >::get ( )
inline

◆ get_local()

template<typename T = double>
T madness::ScalarResult< 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 madness::ScalarResult< T >::value.

◆ operator+=()

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

◆ operator=() [1/3]

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

disable assignment operator

◆ operator=() [2/3]

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

simple assignment of the scalar value

References madness::ScalarResult< T >::value.

◆ operator=() [3/3]

template<typename T = double>
ScalarResult< T > & madness::ScalarResult< T >::operator= ( ScalarResult< T > &&  )
default

◆ serialize()

template<typename T = double>
template<typename Archive >
void madness::ScalarResult< T >::serialize ( Archive &  ar)
inline

Member Data Documentation

◆ value

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

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