11 #ifndef __INDEX_HOLDER_H_ 12 #define __INDEX_HOLDER_H_ 53 if (
this != &other ) {
62 os <<
"idx-hldr: " << dt.
value <<
":" << dt.
index << std::endl;
67 bool operator < ( IndexHolder<T>
const &other)
const {
68 if ( value == other.value )
69 return (index < other.index );
71 return ( value < other.value );
75 if ( value == other.
value )
76 return (index > other.
index );
78 return ( value > other.
value );
81 bool operator <= ( IndexHolder<T>
const &other)
const {
82 if ( value == other.value )
83 return (index <= other.index );
85 return ( value <= other.value );
89 if ( value == other.
value )
90 return (index >= other.
index );
92 return ( value >= other.
value );
96 return ( ( value == other.
value ) && (index == other.
index) );
100 return ( ( value != other.
value) || (index != other.
index) );
110 template <
typename T>
113 template <
typename T>
118 static bool first =
true;
119 static MPI_Datatype datatype;
139 MPI_Type_commit(&datatype);
static MPI_Datatype value()
bool operator>(IndexHolder< T > const &other) const
An abstract class used for communicating messages using user-defined datatypes. The user must impleme...
IndexHolder(const IndexHolder< T > &rhs)
static bool lessThan(const IndexHolder< T > &a, const IndexHolder< T > &b)
bool operator!=(IndexHolder< T > const &other) const
IndexHolder(T v, unsigned long i)
bool operator==(IndexHolder< T > const &other) const
IndexHolder< T > & operator=(const IndexHolder< T > &other)
friend std::ostream & operator<<(std::ostream &os, const IndexHolder &dt)
Collection of Generic Parallel Functions: Sorting, Partitioning, Searching,...
A small helper class used while sorting a pair of value and its index in an array/vector.
bool operator>=(IndexHolder< T > const &other) const