7 #pragma intrinsic(_InterlockedCompareExchange64) 30 double old_value = *value;
31 while (update_value < old_value)
34 (
volatile int64_t*)value,
35 *(int64_t*)&old_value,
36 *(int64_t*)&update_value);
38 double prev_value = *(
double*)&prev_ivalue;
39 if (prev_value == old_value)
42 old_value = prev_value;
48 double old_value = *value;
49 while (update_value > old_value)
52 (
volatile int64_t*)value,
53 *(int64_t*)&old_value,
54 *(int64_t*)&update_value);
56 double prev_value = *(
double*)&prev_ivalue;
57 if (prev_value == old_value)
60 old_value = prev_value;
67 return __sync_val_compare_and_swap (value, old_value, update_value);
68 #elif defined _MSC_VER 73 return _InterlockedCompareExchange64(value,update_value,old_value);
81 return stream <<
"["<<ival.
lower()<<
".."<<ival.
upper()<<
"]";
86 return stream << ival.
H <<
" x " << ival.
V;
91 return debug <<
"["<<ival.
lower()<<
".."<<ival.
upper()<<
"]";
96 return debug << ival.
H <<
" x " << ival.
V;
static const Interval INVALID
an invalid interval (contains NAN values)
Interval H
horizontal interval
global definitions for all algorithms.
Interval & union_lf(const Interval &that)
lock-free union operator; not used and not tested
double _lower
lower and upper border of the interval
a pair of horizonal / vertical intervals.
std::ostream & operator<<(std::ostream &stream, const frechet::data::Interval &ival)
operator for printing debug info to a std::ostream
Interval V
vertical interval
static void assign_max_lf(volatile double *value, double update_value)
lock-free assigment; not used and not tested
static void assign_min_lf(volatile double *value, double update_value)
lock-free assigment; not used and not tested
static const Interval UNIT
the unit interval [0,1]
static int64_t compare_and_swap(volatile int64_t *value, int64_t old_value, int64_t update_value)
lock-free compare-and-swap; not used and not tested
an interval of two double values.