- //Because we use relatively small (dynamic) aspiration window,
- //there happens many fail highs and fail lows in root. And
- //because we don't do researches in those cases, "value" stored
- //here is not necessarily exact. Instead in case of fail high/low
- //we guess what the right value might be and store our guess
- //as "speculated value" and then move on...
-
- class IterationInfoType {
- private:
- Value _value;
- Value _speculatedValue;
- bool _failHigh;
- bool _failLow;
- public:
- IterationInfoType() {
- clear();
- }
-
- inline void clear() {
- set(Value(0));
- }
-
- inline void set(Value v) {
- set(v, v, false, false);
- }
-
- inline void set(Value v, Value specV, bool fHigh, bool fLow) {
- _value = v;
- _speculatedValue = specV;
- _failHigh = fHigh;
- _failLow = fLow;
- }
-
- inline Value value() {
- return _value;
- }
-
- inline Value speculated_value() {
- return _speculatedValue;
- }
-
- inline bool fail_high() {
- return _failHigh;
- }
-
- inline bool fail_low() {
- return _failLow;
- }
+ // Because we use relatively small (dynamic) aspiration window,
+ // there happens many fail highs and fail lows in root. And
+ // because we don't do researches in those cases, "value" stored
+ // here is not necessarily exact. Instead in case of fail high/low
+ // we guess what the right value might be and store our guess
+ // as a "speculated value" and then move on. Speculated values are
+ // used just to calculate aspiration window width, so also if are
+ // not exact is not big a problem.
+
+ struct IterationInfoType {
+
+ IterationInfoType(Value v = Value(0), Value sv = Value(0), bool fh = false, bool fl = false)
+ : value(v), speculatedValue(sv), failHigh(fh), failLow(fl) {}
+
+ Value value, speculatedValue;
+ bool failHigh, failLow;