1 #ifndef OMP_ArrayElement_H 2 #define OMP_ArrayElement_H 44 inline tBoolean operator<(const OMP_ArrayElement<T>& elt)
const {
45 return (mValue<elt.value());
51 inline tBoolean operator<=(const OMP_ArrayElement<T>& elt)
const {
52 return (mValue<=elt.value());
59 return (mValue>elt.
value());
66 return (mValue>=elt.
value());
73 return (fabs(mValue-elt.
value())<CORE_Object::getEpsilon<T>());
80 return (fabs(mValue-elt.
value())>CORE_Object::getEpsilon<T>());
101 inline const size_t&
index()
const {
143 static inline const std::pair<T,tUIndex>&
pmin(
const std::pair<T,tUIndex>& a,
144 const std::pair<T,tUIndex>& b) {
145 return (a.first<b.first) ? a : b;
153 static inline const std::pair<T,tUIndex>&
pmax(
const std::pair<T,tUIndex>& a,
154 const std::pair<T,tUIndex>& b) {
155 return (a.first>b.first) ? a : b;
void setElement(const T &v, const size_t &i)
set the value and index of the element
Definition: OMP_ArrayElement.h:115
OMP_ArrayElement(const OMP_ArrayElement &S)
create a new copy instance of the array element S
Definition: OMP_ArrayElement.h:15
tBoolean operator!=(const OMP_ArrayElement< T > &elt) const
compare 2 elements
Definition: OMP_ArrayElement.h:79
size_t & index()
return the index of the element
Definition: OMP_ArrayElement.h:107
T mValue
Definition: OMP_ArrayElement.h:9
static const std::pair< T, tUIndex > & pmin(const std::pair< T, tUIndex > &a, const std::pair< T, tUIndex > &b)
return the min element of a & b
Definition: OMP_ArrayElement.h:143
#define tBoolean
Definition: types.h:139
size_t mIndex
Definition: OMP_ArrayElement.h:10
tBoolean operator==(const OMP_ArrayElement< T > &elt) const
compare 2 elements
Definition: OMP_ArrayElement.h:72
static const OMP_ArrayElement< T > & max(const OMP_ArrayElement< T > &a, const OMP_ArrayElement< T > &b)
return the max element of a & b
Definition: OMP_ArrayElement.h:134
static const OMP_ArrayElement< T > & min(const OMP_ArrayElement< T > &a, const OMP_ArrayElement< T > &b)
return the min element of a & b
Definition: OMP_ArrayElement.h:125
tBoolean operator>(const OMP_ArrayElement< T > &elt) const
compare 2 elements
Definition: OMP_ArrayElement.h:58
OMP_ArrayElement()
create a default array element
Definition: OMP_ArrayElement.h:29
tBoolean operator>=(const OMP_ArrayElement< T > &elt) const
compare 2 elements
Definition: OMP_ArrayElement.h:65
Definition: OMP_ArrayElement.h:7
const size_t & index() const
return the index of the element
Definition: OMP_ArrayElement.h:101
const T & value() const
return the value of the element
Definition: OMP_ArrayElement.h:87
T & value()
return the value of the element
Definition: OMP_ArrayElement.h:94
OMP_ArrayElement(const T &v, const size_t &i)
create an instance of Array Element with initial value
Definition: OMP_ArrayElement.h:23
~OMP_ArrayElement()
destroy the array element
Definition: OMP_ArrayElement.h:35
static const std::pair< T, tUIndex > & pmax(const std::pair< T, tUIndex > &a, const std::pair< T, tUIndex > &b)
return the max element of a & b
Definition: OMP_ArrayElement.h:153