From b66ebe96dc5d79dc271471b9f1b599501a8a6c7d Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Mon, 2 Nov 2026 11:44:04 +0100 Subject: [PATCH 1/5] Keep directed rounding sound under compiler optimization Zdev-Change-Id: Z5c93bdc69344351025efb0691a336874ba0c83aa9d6f22ccd43c8899bdd6ce83 --- changelog.in | 18 +++ gecode/float.hh | 40 +++++ gecode/float/arithmetic/pow-nroot.hpp | 4 +- gecode/float/rounding.hpp | 141 +++++++++++++---- test/float/arithmetic.cpp | 212 +++++++++++++++++++++++++- 5 files changed, 379 insertions(+), 36 deletions(-) diff --git a/changelog.in b/changelog.in index 476b6b645e..a5e574017c 100644 --- a/changelog.in +++ b/changelog.in @@ -232,6 +232,24 @@ make the set variables empty. Debug builds aborted with failed assertions. Element over set variables, rel with union or disjoint union and a constant set, and weights also post nothing for empty arrays. +[ENTRY] +Module: float +What: bug +Rank: major +[DESCRIPTION] +Keep directed rounding sound under compiler optimization. Float::Rounding +and FloatVal arithmetic could return a bound on the wrong side of the exact +result: optimizers folded constants in round-to-nearest, shared one square +root or quotient between both bounds, and fused the negated multiplication, +even in Clang Debug builds. Each operand and result now passes through an +optimization barrier, so neither Gecode nor applications need floating-point +compiler flags. +[MORE] +The barrier is an empty volatile asm statement with GCC and Clang, and a +volatile store and reload with other compilers. Integer rounding uses floor +and ceil, which do not depend on the rounding mode. The even-root bounds of +pow and nroot use the same rounding operations. + [ENTRY] Module: search What: bug diff --git a/gecode/float.hh b/gecode/float.hh index c68a9399f9..db5f424016 100644 --- a/gecode/float.hh +++ b/gecode/float.hh @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -139,9 +140,48 @@ namespace Gecode { namespace Float { /** * \brief Floating point rounding operations without state saving * + * Every lower bound is rounded toward \f$-\infty\f$ and every upper bound + * toward \f$+\infty\f$, also when the compiler optimizes and when the + * operands are compile-time constants. + * + * Neither Gecode nor applications need floating-point compiler flags or + * pragmas for this: no `-frounding-math`, `-ffp-model=strict`, + * `/fp:strict`, or `#pragma STDC FENV_ACCESS`. Compilers assume + * round-to-nearest without them, so each operand and each result of the + * arithmetic operations passes through barrier(). With GCC and Clang the + * barrier is an empty `__asm__ __volatile__` statement with the value as a + * floating-point register operand (`"+w"` on AArch64, `"+x"` on x86-64). + * Other compilers, including MSVC, use a volatile store and reload. The + * barrier hides the value from the optimizer, so constants are not + * folded, one result is not shared between the two directions, a negation + * is not fused into the operation, and no operation moves across a + * rounding-mode change. This relies on GCC and Clang keeping volatile + * `asm` statements, and every compiler keeping volatile accesses, in + * order with the opaque calls that change the mode (`fesetround` or + * `_control87`). IEEE binary64 arithmetic in SSE2 or AArch64 registers is + * assumed; x87 arithmetic and `-ffast-math` are not supported. + * + * RoundingControl supplies only mode control (`init()`, `upward()`, + * `downward()`, and the mode access used by save_state) and the median + * behind median(). Its vendored Boost arithmetic is not used, so a + * replacement for the Boost copy needs only these members. Outside + * MSVC with SSE, the mode stays upward between operations. An upper bound + * is computed directly, and a lower bound as the negated upper bound of + * the negated operation; sqrt_down() switches to downward mode and back. + * With MSVC and SSE (`rounded_arith_std` over `_control87`), each + * operation sets its own direction. int_down() and int_up() use + * `std::floor` and `std::ceil`, which do not depend on the mode. + * + * The test Float::Arithmetic::DirectedRounding checks the bounds with + * literal and runtime operands under every caller mode. + * * \ingroup TaskModelFloatVars */ class RoundingBase : public RoundingControl { + private: + /// Return \a x unchanged, hidden from the optimizer (see the class comment) + static FloatNum barrier(FloatNum x); + public: /// \name Arithmetic operations //@{ diff --git a/gecode/float/arithmetic/pow-nroot.hpp b/gecode/float/arithmetic/pow-nroot.hpp index 222d6e6f52..ab24b92d9e 100644 --- a/gecode/float/arithmetic/pow-nroot.hpp +++ b/gecode/float/arithmetic/pow-nroot.hpp @@ -70,9 +70,7 @@ namespace Gecode { namespace Float { namespace Arithmetic { /// Return a downward-rounded positive integer power forceinline FloatNum positive_pow_down(FloatNum x, int n) { - typedef gecode_boost::numeric::interval_lib::rounded_arith_std DirectRoundingBase; - typedef gecode_boost::numeric::interval_lib::save_state DirectRounding; - DirectRounding r; + Rounding r; FloatNum y = 1.0; while (n > 0) { if ((n & 1) != 0) diff --git a/gecode/float/rounding.hpp b/gecode/float/rounding.hpp index c06dc4be4e..085110a723 100644 --- a/gecode/float/rounding.hpp +++ b/gecode/float/rounding.hpp @@ -51,50 +51,131 @@ namespace Gecode { namespace Float { return RoundingControl::median(l, u); } -#define GECODE_ROUND_OP(name) \ - forceinline FloatNum RoundingBase::name##_down(FloatNum x, FloatNum y) { \ - return RoundingControl::name##_down(x, y); \ - } \ - forceinline FloatNum RoundingBase::name##_up(FloatNum x, FloatNum y) { \ - return RoundingControl::name##_up(x, y); \ + forceinline FloatNum + RoundingBase::barrier(FloatNum x) { + // See the RoundingBase class comment for what this relies on. +#if (defined(__GNUC__) || defined(__clang__)) && defined(__aarch64__) + __asm__ __volatile__("" : "+w"(x)); +#elif (defined(__GNUC__) || defined(__clang__)) && defined(__x86_64__) + __asm__ __volatile__("" : "+x"(x)); +#else + volatile FloatNum v = x; + x = v; +#endif + return x; } - GECODE_ROUND_OP(add) - GECODE_ROUND_OP(sub) - GECODE_ROUND_OP(mul) - GECODE_ROUND_OP(div) - -#undef GECODE_ROUND_OP +#if defined(_MSC_VER) && (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP > 0))) -#define GECODE_ROUND_FUN(name) \ - forceinline FloatNum RoundingBase::name##_down(FloatNum x) { \ - return RoundingControl::name##_down(x); \ - } \ - forceinline FloatNum RoundingBase::name##_up(FloatNum x) { \ - return RoundingControl::name##_up(x); \ + // RoundingControl is rounded_arith_std: each operation sets its direction. + forceinline FloatNum + RoundingBase::add_down(FloatNum x, FloatNum y) { + RoundingControl::downward(); + return barrier(barrier(x) + barrier(y)); } - - GECODE_ROUND_FUN(sqrt) - -#if defined(_M_X64) || defined(_M_IA64) - - // Workaround as MSVC on x64 does not have a rint function forceinline FloatNum - RoundingBase::int_down(FloatNum x) { - return floor(x); + RoundingBase::add_up(FloatNum x, FloatNum y) { + RoundingControl::upward(); + return barrier(barrier(x) + barrier(y)); } forceinline FloatNum - RoundingBase::int_up(FloatNum x) { - return ceil(x); + RoundingBase::sub_down(FloatNum x, FloatNum y) { + RoundingControl::downward(); + return barrier(barrier(x) - barrier(y)); + } + forceinline FloatNum + RoundingBase::sub_up(FloatNum x, FloatNum y) { + RoundingControl::upward(); + return barrier(barrier(x) - barrier(y)); + } + forceinline FloatNum + RoundingBase::mul_down(FloatNum x, FloatNum y) { + RoundingControl::downward(); + return barrier(barrier(x) * barrier(y)); + } + forceinline FloatNum + RoundingBase::mul_up(FloatNum x, FloatNum y) { + RoundingControl::upward(); + return barrier(barrier(x) * barrier(y)); + } + forceinline FloatNum + RoundingBase::div_down(FloatNum x, FloatNum y) { + RoundingControl::downward(); + return barrier(barrier(x) / barrier(y)); + } + forceinline FloatNum + RoundingBase::div_up(FloatNum x, FloatNum y) { + RoundingControl::upward(); + return barrier(barrier(x) / barrier(y)); + } + forceinline FloatNum + RoundingBase::sqrt_down(FloatNum x) { + RoundingControl::downward(); + return barrier(std::sqrt(barrier(x))); + } + forceinline FloatNum + RoundingBase::sqrt_up(FloatNum x) { + RoundingControl::upward(); + return barrier(std::sqrt(barrier(x))); } #else - GECODE_ROUND_FUN(int) + // RoundingControl is rounded_arith_opp: the mode stays upward. + forceinline FloatNum + RoundingBase::add_down(FloatNum x, FloatNum y) { + return -barrier(barrier(-x) - barrier(y)); + } + forceinline FloatNum + RoundingBase::add_up(FloatNum x, FloatNum y) { + return barrier(barrier(x) + barrier(y)); + } + forceinline FloatNum + RoundingBase::sub_down(FloatNum x, FloatNum y) { + return -barrier(barrier(y) - barrier(x)); + } + forceinline FloatNum + RoundingBase::sub_up(FloatNum x, FloatNum y) { + return barrier(barrier(x) - barrier(y)); + } + forceinline FloatNum + RoundingBase::mul_down(FloatNum x, FloatNum y) { + return -barrier(barrier(x) * barrier(-y)); + } + forceinline FloatNum + RoundingBase::mul_up(FloatNum x, FloatNum y) { + return barrier(barrier(x) * barrier(y)); + } + forceinline FloatNum + RoundingBase::div_down(FloatNum x, FloatNum y) { + return -barrier(barrier(x) / barrier(-y)); + } + forceinline FloatNum + RoundingBase::div_up(FloatNum x, FloatNum y) { + return barrier(barrier(x) / barrier(y)); + } + forceinline FloatNum + RoundingBase::sqrt_down(FloatNum x) { + RoundingControl::downward(); + const FloatNum r = barrier(std::sqrt(barrier(x))); + RoundingControl::upward(); + return r; + } + forceinline FloatNum + RoundingBase::sqrt_up(FloatNum x) { + return barrier(std::sqrt(barrier(x))); + } #endif -#undef GECODE_ROUND_FUN + forceinline FloatNum + RoundingBase::int_down(FloatNum x) { + return std::floor(x); + } + forceinline FloatNum + RoundingBase::int_up(FloatNum x) { + return std::ceil(x); + } }} // namespace Gecode::Float diff --git a/test/float/arithmetic.cpp b/test/float/arithmetic.cpp index ed779365bc..4272ba1a77 100644 --- a/test/float/arithmetic.cpp +++ b/test/float/arithmetic.cpp @@ -39,7 +39,11 @@ #include #include #include +#include +#include +#include #include +#include namespace Test { namespace Float { @@ -113,8 +117,8 @@ namespace Test { namespace Float { } } rounding_scope; - /// Regression test for downward rounding of negating operations - class DirectedRounding : public Base { + /// Regression test for downward rounding of negating operations on AArch64 + class DirectedRoundingRegression : public Base { protected: /// Space posting an NthRoot constraint on a positive source class RootSpace : public Gecode::Space { @@ -138,7 +142,8 @@ namespace Test { namespace Float { }; public: - DirectedRounding(void) : Base("Float::Arithmetic::DirectedRounding", TestTags::check()) {} + DirectedRoundingRegression(void) + : Base("Float::Arithmetic::DirectedRoundingRegression", TestTags::check()) {} bool run(void) override { bool result = true; @@ -169,6 +174,207 @@ namespace Test { namespace Float { } return result; } + } directed_rounding_regression; + + /// Directed rounding gives exact bounds for literal and runtime operands + class DirectedRounding : public Base { + private: + /// Operation computed with directed rounding + enum class Op { ADD, SUB, MUL, DIV, SQRT, INTEGER }; + /// Operation and operands (\a y is unused by unary operations) + struct Case { + Op op; + Gecode::FloatNum x; + Gecode::FloatNum y; + }; + /// Lower and upper bound + struct Bounds { + Gecode::FloatNum down; + Gecode::FloatNum up; + }; + /// Round-to-nearest result and the sign-carrying rounding error + struct Nearest { + Gecode::FloatNum value; + Gecode::FloatNum error; + }; + /// Bounds observed through both interfaces in one caller mode + struct Observed { + Bounds rounding; + Bounds float_val; + bool mode_kept; + }; + /// Cases whose two directed bounds differ + static constexpr Case cases[] = { + {Op::ADD, 0.1, 0.2}, {Op::ADD, -0.1, -0.2}, {Op::SUB, 0.1, 0.7}, {Op::SUB, -0.1, 0.2}, + {Op::MUL, 0.1, 0.3}, {Op::MUL, -0.1, 0.3}, {Op::DIV, 1.0, 3.0}, {Op::DIV, -1.0, 3.0}, + {Op::SQRT, 2.0, 0.0}, {Op::SQRT, 0.1, 0.0}, {Op::INTEGER, 2.5, 0.0}, {Op::INTEGER, -2.5, 0.0}, + }; + + /// Return \a a + \a b and its exact error (TwoSum) + static Nearest + two_sum(Gecode::FloatNum a, Gecode::FloatNum b) { + const Gecode::FloatNum s = a + b; + const Gecode::FloatNum b_virtual = s - a; + return {s, (a - (s - b_virtual)) + (b - b_virtual)}; + } + /// Return the round-to-nearest result of \a c and its error + static Nearest + nearest(const Case& c) { + switch (c.op) { + case Op::ADD: + return two_sum(c.x, c.y); + case Op::SUB: + return two_sum(c.x, -c.y); + case Op::MUL: { + const Gecode::FloatNum p = c.x * c.y; + return {p, std::fma(c.x, c.y, -p)}; + } + case Op::DIV: { + const Gecode::FloatNum q = c.x / c.y; + return {q, std::fma(-q, c.y, c.x) * (c.y < 0.0 ? -1.0 : 1.0)}; + } + case Op::SQRT: { + const Gecode::FloatNum s = std::sqrt(c.x); + return {s, std::fma(-s, s, c.x)}; + } + case Op::INTEGER: + break; + } + return {c.x, 0.0}; + } + /// Return the exact directed bounds of \a c (in round-to-nearest mode) + static Bounds + expected(const Case& c) { + if (c.op == Op::INTEGER) + return {std::floor(c.x), std::ceil(c.x)}; + const Gecode::FloatNum inf = std::numeric_limits::infinity(); + const Nearest n = nearest(c); + return {n.error < 0.0 ? std::nextafter(n.value, -inf) : n.value, + n.error > 0.0 ? std::nextafter(n.value, inf) : n.value}; + } + + /// Return the bounds computed in one Float::Rounding scope + template + forceinline static Bounds + rounding_bounds(Gecode::FloatNum x, Gecode::FloatNum y) { + Gecode::Float::Rounding r; + if constexpr (op == Op::ADD) + return {r.add_down(x, y), r.add_up(x, y)}; + else if constexpr (op == Op::SUB) + return {r.sub_down(x, y), r.sub_up(x, y)}; + else if constexpr (op == Op::MUL) + return {r.mul_down(x, y), r.mul_up(x, y)}; + else if constexpr (op == Op::DIV) + return {r.div_down(x, y), r.div_up(x, y)}; + else if constexpr (op == Op::SQRT) + return {r.sqrt_down(x), r.sqrt_up(x)}; + else + return {r.int_down(x), r.int_up(x)}; + } + /// Return the bounds of the FloatVal result + template + forceinline static Bounds + float_val_bounds(Gecode::FloatNum x, Gecode::FloatNum y) { + Gecode::FloatVal v; + if constexpr (op == Op::ADD) + v = Gecode::FloatVal(x) + Gecode::FloatVal(y); + else if constexpr (op == Op::SUB) + v = Gecode::FloatVal(x) - Gecode::FloatVal(y); + else if constexpr (op == Op::MUL) + v = Gecode::FloatVal(x) * Gecode::FloatVal(y); + else if constexpr (op == Op::DIV) + v = Gecode::FloatVal(x) / Gecode::FloatVal(y); + else + v = sqrt(Gecode::FloatVal(x)); + return {v.min(), v.max()}; + } + /// Observe both interfaces and whether they keep the caller's mode + template + forceinline static Observed + observe(Gecode::FloatNum x, Gecode::FloatNum y) { + const int mode = std::fegetround(); + Observed o; + o.rounding = rounding_bounds(x, y); + o.mode_kept = std::fegetround() == mode; + // FloatVal has no integer rounding operation. + if constexpr (op == Op::INTEGER) + o.float_val = o.rounding; + else + o.float_val = float_val_bounds(x, y); + o.mode_kept &= std::fegetround() == mode; + return o; + } + /// Observe case \a i with operands the compiler can fold + template + [[gnu::noinline]] static Observed + observe_literal(void) { + // Anything else in this function can stop Clang from folding. + constexpr Case c = cases[i]; + return observe(c.x, c.y); + } + /// Observe case \a i with runtime operands + template + [[gnu::noinline]] static Observed + observe_volatile(void) { + const volatile Gecode::FloatNum x = cases[i].x; + const volatile Gecode::FloatNum y = cases[i].y; + return observe(x, y); + } + + /// Log \a b in hexadecimal floating-point notation + static void + log_bounds(const char* name, const Bounds& b) { + olog << ' ' << name << " [" << std::hexfloat << b.down << ", " << b.up << std::defaultfloat << ']'; + } + /// Test whether \a o matches \a e, and log a mismatch + static bool + matches(int i, const char* kind, int mode, const Bounds& e, const Observed& o) { + const bool rounding_exact = (o.rounding.down == e.down) && (o.rounding.up == e.up); + const bool float_val_exact = (o.float_val.down == e.down) && (o.float_val.up == e.up); + if (o.mode_kept && rounding_exact && float_val_exact) + return true; + olog << "Case " << i << ' ' << kind << " in mode " << mode << ':'; + log_bounds("Rounding", o.rounding); + log_bounds("FloatVal", o.float_val); + log_bounds("expected", e); + olog << (o.mode_kept ? "" : " mode changed") << '\n'; + return false; + } + /// Test case \a i under caller mode \a mode + template + static bool + check_case(int mode) { + std::fesetround(FE_TONEAREST); + const Bounds e = expected(cases[i]); + std::fesetround(mode); + bool result = e.down < e.up; + result &= matches(i, "literal", mode, e, observe_literal()); + result &= matches(i, "volatile", mode, e, observe_volatile()); + return result; + } + /// Test all cases under caller mode \a mode + template + static bool + check_cases(int mode, std::index_sequence) { + return (check_case(mode) & ...); + } + + public: + DirectedRounding(void) : Base("Float::Arithmetic::DirectedRounding", TestTags::check()) {} + bool + run(void) override { + const int previous = std::fegetround(); + const int modes[] = {FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO}; + bool result = true; + for (int mode : modes) { + if (std::fesetround(mode) != 0) + continue; + result &= check_cases(mode, std::make_index_sequence()); + } + if (previous != -1) + std::fesetround(previous); + return result; + } } directed_rounding; /// Median queries preserve the caller's floating-point rounding mode From 9ad57931f8136aecd65046cddb2223c0b021a250 Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Wed, 4 Nov 2026 12:29:50 +0100 Subject: [PATCH 2/5] Add a Gecode-native interval core beside the Boost copy Float::Interval in gecode/float/interval.hpp provides every interval operation FloatVal uses, written in Gecode style from the mathematics of each operation and licensed like the rest of Gecode. Each public operation opens one Float::Rounding and rounds through RoundingBase, so boost-006's barriers still apply. FloatVal does not use it yet. Focused tests cover outward rounding, singleton and empty intervals, and the comparison truth table; a temporary differential test checks that every result matches the vendored Boost interval bit for bit until the copy is removed. Zdev-Change-Id: Zf4ce2c26dcc990c3af6acc8d9e1ef911f4d24d5a52a56ec414b369a1284d1ec7 --- cmake/GecodeSources.cmake | 2 + gecode/float.hh | 1 + gecode/float/interval.hpp | 1369 ++++++++++++++++++++++++++++++++ test/float/interval-oracle.cpp | 581 ++++++++++++++ test/float/interval.cpp | 272 +++++++ 5 files changed, 2225 insertions(+) create mode 100644 gecode/float/interval.hpp create mode 100644 test/float/interval-oracle.cpp create mode 100644 test/float/interval.cpp diff --git a/cmake/GecodeSources.cmake b/cmake/GecodeSources.cmake index 3110260d42..263d6e9b94 100644 --- a/cmake/GecodeSources.cmake +++ b/cmake/GecodeSources.cmake @@ -417,6 +417,8 @@ set(GECODE_TEST_SOURCES test/float/basic.cpp test/float/channel.cpp test/float/dom.cpp + test/float/interval-oracle.cpp + test/float/interval.cpp test/float/linear.cpp test/float/mm-lin.cpp test/float/rel.cpp diff --git a/gecode/float.hh b/gecode/float.hh index db5f424016..291cd9c685 100644 --- a/gecode/float.hh +++ b/gecode/float.hh @@ -308,6 +308,7 @@ namespace Gecode { namespace Float { }} // namespace Gecode::Float #include +#include namespace Gecode { namespace Float { diff --git a/gecode/float/interval.hpp b/gecode/float/interval.hpp new file mode 100644 index 0000000000..1f8f2ddef7 --- /dev/null +++ b/gecode/float/interval.hpp @@ -0,0 +1,1369 @@ +/* + * Main authors: + * Mikael Zayenz Lagerkvist + * + * Copyright: + * Mikael Zayenz Lagerkvist, 2026 + * + * This file is part of Gecode, the generic constraint + * development environment: + * http://www.gecode.dev + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include +#include +#include +#include + +namespace Gecode { namespace Float { + + /** + * \brief Closed interval of floating-point numbers with directed rounding + * + * An interval \f$[l,u]\f$ stands for every real number between its + * bounds. Arithmetic rounds each lower bound toward \f$-\infty\f$ and each + * upper bound toward \f$+\infty\f$, so a result contains the exact result + * of the operation for all members of its operands. + * + * Contract: + * - An interval is never empty. Interval(l,u) and assign() throw + * std::runtime_error unless \f$l\leq u\f$, which also rejects NaN + * bounds. An operation whose exact result is empty throws the same + * exception: division by \f$[0,0]\f$ or by 0, pow() of \f$[0,0]\f$ + * with an exponent of at most 0, sqrt() of an interval without a + * nonnegative member, log() of one without a positive member, an even + * nth_root() of a negative interval, a disjoint intersect(), and + * asin(), acos(), acosh(), and atanh() outside their domains. + * - Interval(v) and unchecked() check nothing. Results keep NaN bounds, + * for example from \f$0\cdot\infty\f$ or \f$\infty-\infty\f$. + * - Each operation that rounds opens one Rounding for its whole + * computation, so the caller's rounding mode is restored afterwards, + * also when the operation throws. + * - There are no comparison operators. FloatVal's relations hold only + * when they hold for all members of both operands, such as + * certainly_less(), while its equality compares bounds, as equal() + * does. Named functions keep the two meanings apart. + * + * \par Design decision + * Gecode implements the interval arithmetic it needs itself, for double + * bounds, with no external dependency. Directed rounding switches the + * floating-point rounding mode through RoundingBase and Rounding. The + * measured alternatives were a script-refreshed copy of Boost 1.92.0's + * interval library, the 2012 copy of Boost 1.47.0 made reproducible, and + * outward rounding with std::nextafter, either always widening or + * widening only by the sign of an error term. The nextafter variants + * loosen bounds, which was not accepted, and an installed Boost was ruled + * out as a dependency. This implementation was chosen because it + * reproduces the Boost copy's bounds, truth values, and search statistics + * bit for bit on arm64 and x86-64. Without the copy, Gecode installs 95 + * fewer headers and no third-party code, exports the same symbols, and + * runs as fast or faster. The interval type is trivially copyable. + * + * \par Acknowledgement + * The operations reproduce the results of the Boost Interval Arithmetic + * Library (Boost.Interval), which Gecode has used since 2012 and which + * served as the reference during development. + * + * \ingroup TaskModelFloatVars + */ + class Interval { + private: + /// Lower bound + FloatNum lb = 0.0; + /// Upper bound + FloatNum ub = 0.0; + + public: + /// \name Construction and access + //@{ + /// Initialize as \f$[0,0]\f$ + Interval(void) = default; + /// Initialize as \f$[v,v]\f$, accepting NaN + explicit Interval(FloatNum v); + /// Initialize as \f$[l,u]\f$, throwing unless \f$l\leq u\f$ + Interval(FloatNum l, FloatNum u); + /// Return \f$[l,u]\f$ without checking the bounds + static Interval unchecked(FloatNum l, FloatNum u); + /// Set to \f$[l,u]\f$, or throw and stay unchanged unless \f$l\leq u\f$ + void assign(FloatNum l, FloatNum u); + /// Return lower bound + FloatNum lower(void) const; + /// Return upper bound + FloatNum upper(void) const; + //@} + + /// \name Constants + //@{ + /// Return enclosure of \f$\pi/2\f$ + static Interval pi_half(void); + /// Return enclosure of \f$\pi\f$ + static Interval pi(void); + /// Return enclosure of \f$2\pi\f$ + static Interval pi_twice(void); + //@} + + /// \name Update operators + //@{ + /// Add \a y + Interval& operator+=(const Interval& y); + /// Subtract \a y + Interval& operator-=(const Interval& y); + /// Multiply by \a y + Interval& operator*=(const Interval& y); + /// Divide by \a y + Interval& operator/=(const Interval& y); + /// Add \a n + Interval& operator+=(FloatNum n); + /// Subtract \a n + Interval& operator-=(FloatNum n); + /// Multiply by \a n + Interval& operator*=(FloatNum n); + /// Divide by \a n + Interval& operator/=(FloatNum n); + //@} + }; + + /// Implementation details of Interval + namespace IntervalDetail { + + /// Throw the exception for an empty result + [[noreturn]] inline void + throw_empty(void) { + throw std::runtime_error("Gecode::Float::Interval: empty interval"); + } + + /// Return \f$[-\infty,+\infty]\f$ + forceinline Interval + whole(void) { + const FloatNum inf = std::numeric_limits::infinity(); + return Interval::unchecked(-inf, inf); + } + + } // namespace IntervalDetail + + /* + * Construction and access + * + */ + + forceinline + Interval::Interval(FloatNum v) + : lb(v), ub(v) {} + + forceinline + Interval::Interval(FloatNum l, FloatNum u) + : lb(l), ub(u) { + if (!(l <= u)) + IntervalDetail::throw_empty(); + } + + forceinline Interval + Interval::unchecked(FloatNum l, FloatNum u) { + Interval x; + x.lb = l; + x.ub = u; + return x; + } + + forceinline void + Interval::assign(FloatNum l, FloatNum u) { + if (!(l <= u)) + IntervalDetail::throw_empty(); + lb = l; + ub = u; + } + + forceinline FloatNum + Interval::lower(void) const { + return lb; + } + forceinline FloatNum + Interval::upper(void) const { + return ub; + } + + forceinline Interval + Interval::pi_half(void) { + return unchecked(pi_half_lower(), pi_half_upper()); + } + forceinline Interval + Interval::pi(void) { + return unchecked(pi_lower(), pi_upper()); + } + forceinline Interval + Interval::pi_twice(void) { + return unchecked(pi_twice_lower(), pi_twice_upper()); + } + + /* + * Queries and set operations, which need no rounding + * + * Where two bounds tie, std::min and std::max return their left argument, + * which decides the sign of a zero and which NaN is kept. + * + */ + + /** + * \brief Test whether \a x has a single member + * \relates Interval + */ + forceinline bool + singleton(const Interval& x) { + return x.lower() == x.upper(); + } + /** + * \brief Test whether \a n is a member of \a x + * \relates Interval + */ + forceinline bool + in(FloatNum n, const Interval& x) { + return (x.lower() <= n) && (n <= x.upper()); + } + /** + * \brief Test whether zero is a member of \a x + * + * Written as the absence of a sign, so that NaN bounds count as + * containing zero. + * \relates Interval + */ + forceinline bool + zero_in(const Interval& x) { + return !((x.lower() > 0.0) || (x.upper() < 0.0)); + } + /** + * \brief Test whether \a x and \a y have the same bounds + * \relates Interval + */ + forceinline bool + equal(const Interval& x, const Interval& y) { + return (x.lower() == y.lower()) && (x.upper() == y.upper()); + } + /** + * \brief Test whether \a x is a subset of \a y + * \relates Interval + */ + forceinline bool + subset(const Interval& x, const Interval& y) { + return (y.lower() <= x.lower()) && (x.upper() <= y.upper()); + } + /** + * \brief Test whether \a x is a proper subset of \a y + * \relates Interval + */ + forceinline bool + proper_subset(const Interval& x, const Interval& y) { + return subset(x, y) && !equal(x, y); + } + /** + * \brief Test whether \a x and \a y have a common member + * \relates Interval + */ + forceinline bool + overlap(const Interval& x, const Interval& y) { + return in(y.lower(), x) || in(x.lower(), y); + } + + /** + * \brief Return the intersection of \a x and \a y, throwing if it is empty + * \relates Interval + */ + forceinline Interval + intersect(const Interval& x, const Interval& y) { + const FloatNum l = std::max(x.lower(), y.lower()); + const FloatNum u = std::min(x.upper(), y.upper()); + if (!(l <= u)) + IntervalDetail::throw_empty(); + return Interval::unchecked(l, u); + } + /** + * \brief Return the smallest interval containing \a x and \a y + * \relates Interval + */ + forceinline Interval + hull(const Interval& x, const Interval& y) { + return Interval::unchecked(std::min(x.lower(), y.lower()), std::max(x.upper(), y.upper())); + } + /** + * \brief Return the smallest interval containing \a x and \a n + * \relates Interval + */ + forceinline Interval + hull(const Interval& x, FloatNum n) { + return Interval::unchecked(std::min(x.lower(), n), std::max(x.upper(), n)); + } + /** + * \brief Return the smallest interval containing \a n and \a x + * \relates Interval + */ + forceinline Interval + hull(FloatNum n, const Interval& x) { + return Interval::unchecked(std::min(n, x.lower()), std::max(n, x.upper())); + } + + /** + * \brief Return the bound-wise maximum of \a x and \a y + * \relates Interval + */ + forceinline Interval + max(const Interval& x, const Interval& y) { + return Interval::unchecked(std::max(x.lower(), y.lower()), std::max(x.upper(), y.upper())); + } + /** + * \brief Return the bound-wise maximum of \a x and \a n + * \relates Interval + */ + forceinline Interval + max(const Interval& x, FloatNum n) { + return Interval::unchecked(std::max(x.lower(), n), std::max(x.upper(), n)); + } + /** + * \brief Return the bound-wise maximum of \a n and \a x + * \relates Interval + */ + forceinline Interval + max(FloatNum n, const Interval& x) { + return Interval::unchecked(std::max(n, x.lower()), std::max(n, x.upper())); + } + /** + * \brief Return the bound-wise minimum of \a x and \a y + * \relates Interval + */ + forceinline Interval + min(const Interval& x, const Interval& y) { + return Interval::unchecked(std::min(x.lower(), y.lower()), std::min(x.upper(), y.upper())); + } + /** + * \brief Return the bound-wise minimum of \a x and \a n + * \relates Interval + */ + forceinline Interval + min(const Interval& x, FloatNum n) { + return Interval::unchecked(std::min(x.lower(), n), std::min(x.upper(), n)); + } + /** + * \brief Return the bound-wise minimum of \a n and \a x + * \relates Interval + */ + forceinline Interval + min(FloatNum n, const Interval& x) { + return Interval::unchecked(std::min(n, x.lower()), std::min(n, x.upper())); + } + + /** + * \brief Return \a x + * \relates Interval + */ + forceinline Interval + operator+(const Interval& x) { + return x; + } + /** + * \brief Return \f$\{-v \mid v\in x\}\f$, keeping the signs of zero bounds + * \relates Interval + */ + forceinline Interval + operator-(const Interval& x) { + return Interval::unchecked(-x.upper(), -x.lower()); + } + /** + * \brief Return \f$\{|v| \mid v\in x\}\f$ + * \relates Interval + */ + inline Interval + abs(const Interval& x) { + if (!(x.lower() < 0.0)) + return x; + if (!(x.upper() > 0.0)) + return -x; + return Interval::unchecked(0.0, std::max(-x.lower(), x.upper())); + } + + /* + * Certain comparisons + * + * A relation between intervals holds certainly when it holds for every + * member of the first and every member of the second interval. Each + * relation compares only the bounds it needs, so a NaN bound makes a + * relation false only when that bound takes part in it. + * + */ + + /** + * \brief Test whether every member of \a x is less than every member of \a y + * \relates Interval + */ + forceinline bool + certainly_less(const Interval& x, const Interval& y) { + return x.upper() < y.lower(); + } + /** + * \brief Test whether every member of \a x is less than \a n + * \relates Interval + */ + forceinline bool + certainly_less(const Interval& x, FloatNum n) { + return x.upper() < n; + } + /** + * \brief Test whether every member of \a x is at most every member of \a y + * \relates Interval + */ + forceinline bool + certainly_less_equal(const Interval& x, const Interval& y) { + return x.upper() <= y.lower(); + } + /** + * \brief Test whether every member of \a x is at most \a n + * \relates Interval + */ + forceinline bool + certainly_less_equal(const Interval& x, FloatNum n) { + return x.upper() <= n; + } + /** + * \brief Test whether every member of \a x is greater than every member of \a y + * \relates Interval + */ + forceinline bool + certainly_greater(const Interval& x, const Interval& y) { + return x.lower() > y.upper(); + } + /** + * \brief Test whether every member of \a x is greater than \a n + * \relates Interval + */ + forceinline bool + certainly_greater(const Interval& x, FloatNum n) { + return x.lower() > n; + } + /** + * \brief Test whether every member of \a x is at least every member of \a y + * \relates Interval + */ + forceinline bool + certainly_greater_equal(const Interval& x, const Interval& y) { + return x.lower() >= y.upper(); + } + /** + * \brief Test whether every member of \a x is at least \a n + * \relates Interval + */ + forceinline bool + certainly_greater_equal(const Interval& x, FloatNum n) { + return x.lower() >= n; + } + /** + * \brief Test whether no member of \a x equals a member of \a y + * \relates Interval + */ + forceinline bool + certainly_unequal(const Interval& x, const Interval& y) { + return certainly_less(x, y) || certainly_greater(x, y); + } + /** + * \brief Test whether no member of \a x equals \a n + * \relates Interval + */ + forceinline bool + certainly_unequal(const Interval& x, FloatNum n) { + return certainly_less(x, n) || certainly_greater(x, n); + } + + namespace IntervalDetail { + + /* + * Rounded operations inside an open rounding scope + * + * The functions below take the scope that the calling operation + * opened and open none themselves, so nested arithmetic runs in the + * caller's scope. Each rounded step is a RoundingBase operation, + * whose operand order decides the sign of a NaN result. + * + */ + + /// Return \a x plus \a y + forceinline Interval + add(RoundingBase& r, const Interval& x, const Interval& y) { + return Interval::unchecked(r.add_down(x.lower(), y.lower()), r.add_up(x.upper(), y.upper())); + } + /// Return \a n plus \a x, for either order of the operands + forceinline Interval + add(RoundingBase& r, FloatNum n, const Interval& x) { + return Interval::unchecked(r.add_down(n, x.lower()), r.add_up(n, x.upper())); + } + /// Return \a x minus \a y + forceinline Interval + sub(RoundingBase& r, const Interval& x, const Interval& y) { + return Interval::unchecked(r.sub_down(x.lower(), y.upper()), r.sub_up(x.upper(), y.lower())); + } + /// Return \a x minus \a n + forceinline Interval + sub(RoundingBase& r, const Interval& x, FloatNum n) { + return Interval::unchecked(r.sub_down(x.lower(), n), r.sub_up(x.upper(), n)); + } + /// Return \a n minus \a x + forceinline Interval + sub(RoundingBase& r, FloatNum n, const Interval& x) { + return Interval::unchecked(r.sub_down(n, x.upper()), r.sub_up(n, x.lower())); + } + + /// Signs of the members of an interval, for multiplication + enum class Sign { + NEGATIVE, ///< Members at most zero, some negative + MIXED, ///< Negative and positive members + POSITIVE, ///< Members at least zero, some positive + ZERO ///< Only zero, or NaN bounds + }; + /// Return the sign class of \a x + forceinline Sign + sign(const Interval& x) { + if (x.lower() < 0.0) + return (x.upper() > 0.0) ? Sign::MIXED : Sign::NEGATIVE; + return (x.upper() > 0.0) ? Sign::POSITIVE : Sign::ZERO; + } + + /** + * \brief Return \a x times \a y + * + * Multiplication is monotone in each factor on each sign class, so + * the bounds are products of endpoints chosen by the signs. Only when + * both factors are mixed are two candidates compared. A zero factor + * gives \f$[0,0]\f$, also against an infinite bound. + */ + inline Interval + mul(RoundingBase& r, const Interval& x, const Interval& y) { + const FloatNum xl = x.lower(); + const FloatNum xu = x.upper(); + const FloatNum yl = y.lower(); + const FloatNum yu = y.upper(); + const Sign y_sign = sign(y); + switch (sign(x)) { + case Sign::ZERO: + return Interval(); + case Sign::POSITIVE: + switch (y_sign) { + case Sign::POSITIVE: + return Interval::unchecked(r.mul_down(xl, yl), r.mul_up(xu, yu)); + case Sign::NEGATIVE: + return Interval::unchecked(r.mul_down(xu, yl), r.mul_up(xl, yu)); + case Sign::MIXED: + return Interval::unchecked(r.mul_down(xu, yl), r.mul_up(xu, yu)); + case Sign::ZERO: + return Interval(); + } + break; + case Sign::NEGATIVE: + switch (y_sign) { + case Sign::POSITIVE: + return Interval::unchecked(r.mul_down(xl, yu), r.mul_up(xu, yl)); + case Sign::NEGATIVE: + return Interval::unchecked(r.mul_down(xu, yu), r.mul_up(xl, yl)); + case Sign::MIXED: + return Interval::unchecked(r.mul_down(xl, yu), r.mul_up(xl, yl)); + case Sign::ZERO: + return Interval(); + } + break; + case Sign::MIXED: + switch (y_sign) { + case Sign::POSITIVE: + return Interval::unchecked(r.mul_down(xl, yu), r.mul_up(xu, yu)); + case Sign::NEGATIVE: + return Interval::unchecked(r.mul_down(xu, yl), r.mul_up(xl, yl)); + case Sign::MIXED: + return Interval::unchecked(std::min(r.mul_down(xl, yu), r.mul_down(xu, yl)), + std::max(r.mul_up(xl, yl), r.mul_up(xu, yu))); + case Sign::ZERO: + return Interval(); + } + break; + } + GECODE_NEVER; + return Interval(); + } + /// Return \a n times \a x, for either order of the operands + forceinline Interval + mul(RoundingBase& r, FloatNum n, const Interval& x) { + if (n < 0.0) + return Interval::unchecked(r.mul_down(n, x.upper()), r.mul_up(n, x.lower())); + if (n == 0.0) + return Interval(); + return Interval::unchecked(r.mul_down(n, x.lower()), r.mul_up(n, x.upper())); + } + + /// Where zero lies in a divisor + enum class ZeroPosition { + OUTSIDE, ///< Not a member, so the divisor has one sign + LOWER_BOUND, ///< Lower bound only, as in \f$[0,u]\f$ + UPPER_BOUND, ///< Upper bound only, as in \f$[l,0]\f$ + BOTH_BOUNDS, ///< The divisor is \f$[0,0]\f$ + INTERIOR ///< Between the bounds, or NaN bounds + }; + /// Return where zero lies in \a y + forceinline ZeroPosition + zero_position(const Interval& y) { + if (!zero_in(y)) + return ZeroPosition::OUTSIDE; + const bool lower_zero = y.lower() == 0.0; + const bool upper_zero = y.upper() == 0.0; + if (lower_zero && upper_zero) + return ZeroPosition::BOTH_BOUNDS; + if (lower_zero) + return ZeroPosition::LOWER_BOUND; + if (upper_zero) + return ZeroPosition::UPPER_BOUND; + return ZeroPosition::INTERIOR; + } + + /** + * \brief Return \a x divided by \a y, where \a y has one sign + * + * Division is monotone in each operand on each sign class, so the + * bounds are quotients of endpoints chosen by the signs. + */ + inline Interval + div_sign_definite(RoundingBase& r, const Interval& x, const Interval& y) { + const FloatNum xl = x.lower(); + const FloatNum xu = x.upper(); + const FloatNum yl = y.lower(); + const FloatNum yu = y.upper(); + const bool y_negative = yu < 0.0; + if (xu < 0.0) + return y_negative ? Interval::unchecked(r.div_down(xu, yl), r.div_up(xl, yu)) + : Interval::unchecked(r.div_down(xl, yl), r.div_up(xu, yu)); + if (xl < 0.0) + return y_negative ? Interval::unchecked(r.div_down(xu, yu), r.div_up(xl, yu)) + : Interval::unchecked(r.div_down(xl, yl), r.div_up(xu, yl)); + return y_negative ? Interval::unchecked(r.div_down(xu, yu), r.div_up(xl, yl)) + : Interval::unchecked(r.div_down(xl, yu), r.div_up(xu, yl)); + } + /** + * \brief Return \a x divided by \a y + * + * A divisor touching zero at one bound sends the quotient to infinity + * on the side given by the dividend's sign, and a divisor with zero + * inside gives the whole line. Over such divisors, a dividend of + * \f$[0,0]\f$ stays itself, keeping the signs of its zeros. + */ + inline Interval + div(RoundingBase& r, const Interval& x, const Interval& y) { + const FloatNum inf = std::numeric_limits::infinity(); + const FloatNum xl = x.lower(); + const FloatNum xu = x.upper(); + const bool x_zero = (xl == 0.0) && (xu == 0.0); + switch (zero_position(y)) { + case ZeroPosition::OUTSIDE: + return div_sign_definite(r, x, y); + case ZeroPosition::BOTH_BOUNDS: + throw_empty(); + case ZeroPosition::LOWER_BOUND: + if (x_zero) + return x; + if (xu < 0.0) + return Interval::unchecked(-inf, r.div_up(xu, y.upper())); + if (xl < 0.0) + return whole(); + return Interval::unchecked(r.div_down(xl, y.upper()), inf); + case ZeroPosition::UPPER_BOUND: + if (x_zero) + return x; + if (xu < 0.0) + return Interval::unchecked(r.div_down(xu, y.lower()), inf); + if (xl < 0.0) + return whole(); + return Interval::unchecked(-inf, r.div_up(xl, y.lower())); + case ZeroPosition::INTERIOR: + return x_zero ? x : whole(); + } + GECODE_NEVER; + return x; + } + /** + * \brief Return \a n divided by \a y + * + * The cases follow the division of intervals, except that a zero + * dividend over a divisor containing zero gives \f$[0,0]\f$. + */ + inline Interval + div(RoundingBase& r, FloatNum n, const Interval& y) { + const FloatNum inf = std::numeric_limits::infinity(); + const FloatNum yl = y.lower(); + const FloatNum yu = y.upper(); + switch (zero_position(y)) { + case ZeroPosition::OUTSIDE: + return (n < 0.0) ? Interval::unchecked(r.div_down(n, yl), r.div_up(n, yu)) + : Interval::unchecked(r.div_down(n, yu), r.div_up(n, yl)); + case ZeroPosition::BOTH_BOUNDS: + throw_empty(); + case ZeroPosition::LOWER_BOUND: + if (n == 0.0) + return Interval(); + return (n < 0.0) ? Interval::unchecked(-inf, r.div_up(n, yu)) + : Interval::unchecked(r.div_down(n, yu), inf); + case ZeroPosition::UPPER_BOUND: + if (n == 0.0) + return Interval(); + return (n < 0.0) ? Interval::unchecked(r.div_down(n, yl), inf) + : Interval::unchecked(-inf, r.div_up(n, yl)); + case ZeroPosition::INTERIOR: + return (n == 0.0) ? Interval() : whole(); + } + GECODE_NEVER; + return whole(); + } + /// Return \a x divided by \a n + forceinline Interval + div(RoundingBase& r, const Interval& x, FloatNum n) { + if (n == 0.0) + throw_empty(); + if (n < 0.0) + return Interval::unchecked(r.div_down(x.upper(), n), r.div_up(x.lower(), n)); + return Interval::unchecked(r.div_down(x.lower(), n), r.div_up(x.upper(), n)); + } + + /** + * \brief Return a lower bound of \f$a^n\f$ for \f$a\geq 0\f$ and \f$n>0\f$ + * + * Binary powering from the least significant bit of \a n: \c b runs + * through \f$a^{2^i}\f$ and \c p collects the factors whose bit is set. + */ + inline FloatNum + pow_down(RoundingBase& r, FloatNum a, unsigned int n) { + FloatNum b = a; + FloatNum p = (n % 2 != 0) ? a : 1.0; + for (n /= 2; n > 0; n /= 2) { + b = r.mul_down(b, b); + if (n % 2 != 0) + p = r.mul_down(b, p); + } + return p; + } + /// Return an upper bound of \f$a^n\f$ for \f$a\geq 0\f$ and \f$n>0\f$ (see pow_down()) + inline FloatNum + pow_up(RoundingBase& r, FloatNum a, unsigned int n) { + FloatNum b = a; + FloatNum p = (n % 2 != 0) ? a : 1.0; + for (n /= 2; n > 0; n /= 2) { + b = r.mul_up(b, b); + if (n % 2 != 0) + p = r.mul_up(b, p); + } + return p; + } + /** + * \brief Return \f$x^n\f$ for \f$n>0\f$ + * + * On nonnegative intervals the power is monotone. A negative interval + * is mirrored to its absolute values, and the result mirrored back for + * odd \a n. An interval with both signs reaches its extremes at the + * bounds, and its even powers start at zero. + */ + inline Interval + positive_pow(RoundingBase& r, const Interval& x, unsigned int n) { + const FloatNum xl = x.lower(); + const FloatNum xu = x.upper(); + const bool odd = n % 2 != 0; + if (xu < 0.0) { + const Interval m = Interval::unchecked(pow_down(r, -xu, n), pow_up(r, -xl, n)); + return odd ? -m : m; + } + if (xl < 0.0) + return odd ? Interval::unchecked(-pow_up(r, -xl, n), pow_up(r, xu, n)) + : Interval::unchecked(0.0, pow_up(r, std::max(-xl, xu), n)); + return Interval::unchecked(pow_down(r, xl, n), pow_up(r, xu, n)); + } + /** + * \brief Return \f$x^n\f$ + * + * A negative exponent divides 1 by the positive power. Its magnitude + * is computed in unsigned arithmetic, so \a n may be \c INT_MIN. + */ + inline Interval + pow(RoundingBase& r, const Interval& x, int n) { + if (n == 0) { + if ((x.lower() == 0.0) && (x.upper() == 0.0)) + throw_empty(); + return Interval(1.0); + } + if (n < 0) + return div(r, 1.0, positive_pow(r, x, 0U - static_cast(n))); + return positive_pow(r, x, static_cast(n)); + } + + /** + * \brief Return an enclosure of \f$a^{1/k}\f$ for \f$a>1\f$ and \f$k>1\f$ + * + * Interval Newton iteration for \f$f(t)=t^k-a\f$ on + * \f$Y_0=[1,a]\f$: \f$Y_{i+1}=Y_i\cap(m-f(m)/f'(Y_i))\f$ with + * \f$m\f$ the median of \f$Y_i\f$ and \f$f'(Y)=kY^{k-1}\f$, until + * the enclosure stops shrinking. An empty intersection throws, which + * ends the iteration for NaN. + */ + inline Interval + newton_root(RoundingBase& r, FloatNum a, int k) { + Interval y = Interval::unchecked(1.0, a); + while (true) { + const FloatNum m = r.median(y.lower(), y.upper()); + const Interval f = sub(r, pow(r, Interval(m), k), a); + const Interval derivative = mul(r, static_cast(k), pow(r, y, k - 1)); + const Interval next = intersect(y, sub(r, m, div(r, f, derivative))); + if (equal(y, next)) + return y; + y = next; + } + } + /** + * \brief Return a lower bound of \f$a^{1/k}\f$ for \f$a>0\f$ and \f$k>1\f$ + * + * Below 1 the root is the reciprocal of the root of \f$1/a\f$. + */ + inline FloatNum + root_down(RoundingBase& r, FloatNum a, int k) { + if (a > 1.0) + return newton_root(r, a, k).lower(); + if (a == 1.0) + return 1.0; + return r.div_down(1.0, newton_root(r, r.div_up(1.0, a), k).upper()); + } + /// Return an upper bound of \f$a^{1/k}\f$ for \f$a>0\f$ and \f$k>1\f$ (see root_down()) + inline FloatNum + root_up(RoundingBase& r, FloatNum a, int k) { + if (a > 1.0) + return newton_root(r, a, k).upper(); + if (a == 1.0) + return 1.0; + return r.div_up(1.0, newton_root(r, r.div_down(1.0, a), k).lower()); + } + + /** + * \brief Return an enclosure of \f$x-qy\f$ for some integer \f$q\f$ + * + * \f$q\f$ is the rounded-down quotient of the lower bound of \a x and + * the bound of \a y that makes it smallest for a positive \a y. The + * result is \a x shifted by whole periods of \a y, not a tight + * remainder. + */ + forceinline Interval + fmod(RoundingBase& r, const Interval& x, const Interval& y) { + const FloatNum period = (x.lower() < 0.0) ? y.lower() : y.upper(); + const FloatNum q = r.int_down(r.div_down(x.lower(), period)); + return sub(r, x, mul(r, q, y)); + } + /// Return an enclosure of \f$x-qn\f$ for some integer \f$q\f$ (see fmod()) + forceinline Interval + fmod(RoundingBase& r, const Interval& x, FloatNum n) { + const FloatNum q = r.int_down(r.div_down(x.lower(), n)); + return sub(r, x, mul(r, q, Interval(n))); + } + /// Return an enclosure of \f$n-qy\f$ for some integer \f$q\f$ (see fmod()) + forceinline Interval + fmod(RoundingBase& r, FloatNum n, const Interval& y) { + const FloatNum period = (n < 0.0) ? y.lower() : y.upper(); + const FloatNum q = r.int_down(r.div_down(n, period)); + return sub(r, n, mul(r, q, y)); + } + + /// Return an upper bound of the width of \a x + forceinline FloatNum + width(RoundingBase& r, const Interval& x) { + return r.sub_up(x.upper(), x.lower()); + } + +#ifdef GECODE_HAS_MPFR + /** + * \brief Return \f$\cos x\f$ + * + * \a x is shifted into \f$[0,2\pi]\f$. Cosine falls on \f$[0,\pi]\f$ + * and rises on \f$[\pi,2\pi]\f$, so an interval in \f$[0,\pi]\f$ maps + * to its reversed bounds, and one that passes \f$\pi\f$ reaches -1 + * and has its maximum at the bound nearer to \f$0\f$ or \f$2\pi\f$. + * An interval starting after \f$\pi\f$ uses + * \f$\cos x=-\cos(x-\pi)\f$. + */ + inline Interval + cos(RoundingBase& r, const Interval& x) { + const Interval range = Interval::unchecked(-1.0, 1.0); + const Interval t = fmod(r, x, Interval::pi_twice()); + if (width(r, t) >= pi_twice_lower()) + return range; + if (t.lower() >= pi_upper()) + return -cos(r, sub(r, t, Interval::pi())); + if (t.upper() <= pi_lower()) + return Interval::unchecked(r.cos_down(t.upper()), r.cos_up(t.lower())); + if (t.upper() <= pi_twice_lower()) + return Interval::unchecked(-1.0, + r.cos_up(std::min(r.sub_down(pi_twice_lower(), t.upper()), t.lower()))); + return range; + } +#endif + + } // namespace IntervalDetail + + /* + * Update operators + * + */ + + forceinline Interval& + Interval::operator+=(const Interval& y) { + Rounding r; + return *this = IntervalDetail::add(r, *this, y); + } + forceinline Interval& + Interval::operator-=(const Interval& y) { + Rounding r; + return *this = IntervalDetail::sub(r, *this, y); + } + forceinline Interval& + Interval::operator*=(const Interval& y) { + Rounding r; + return *this = IntervalDetail::mul(r, *this, y); + } + forceinline Interval& + Interval::operator/=(const Interval& y) { + Rounding r; + return *this = IntervalDetail::div(r, *this, y); + } + forceinline Interval& + Interval::operator+=(FloatNum n) { + // The interval bound is the left operand, unlike in x + n. + Rounding r; + return *this = unchecked(r.add_down(lb, n), r.add_up(ub, n)); + } + forceinline Interval& + Interval::operator-=(FloatNum n) { + Rounding r; + return *this = IntervalDetail::sub(r, *this, n); + } + forceinline Interval& + Interval::operator*=(FloatNum n) { + Rounding r; + return *this = IntervalDetail::mul(r, n, *this); + } + forceinline Interval& + Interval::operator/=(FloatNum n) { + Rounding r; + return *this = IntervalDetail::div(r, *this, n); + } + + /* + * Arithmetic + * + */ + + /** + * \brief Return \a x plus \a y + * \relates Interval + */ + forceinline Interval + operator+(const Interval& x, const Interval& y) { + Rounding r; + return IntervalDetail::add(r, x, y); + } + /** + * \brief Return \a x plus \a n + * \relates Interval + */ + forceinline Interval + operator+(const Interval& x, FloatNum n) { + Rounding r; + return IntervalDetail::add(r, n, x); + } + /** + * \brief Return \a n plus \a x + * \relates Interval + */ + forceinline Interval + operator+(FloatNum n, const Interval& x) { + Rounding r; + return IntervalDetail::add(r, n, x); + } + /** + * \brief Return \a x minus \a y + * \relates Interval + */ + forceinline Interval + operator-(const Interval& x, const Interval& y) { + Rounding r; + return IntervalDetail::sub(r, x, y); + } + /** + * \brief Return \a x minus \a n + * \relates Interval + */ + forceinline Interval + operator-(const Interval& x, FloatNum n) { + Rounding r; + return IntervalDetail::sub(r, x, n); + } + /** + * \brief Return \a n minus \a x + * \relates Interval + */ + forceinline Interval + operator-(FloatNum n, const Interval& x) { + Rounding r; + return IntervalDetail::sub(r, n, x); + } + /** + * \brief Return \a x times \a y + * \relates Interval + */ + forceinline Interval + operator*(const Interval& x, const Interval& y) { + Rounding r; + return IntervalDetail::mul(r, x, y); + } + /** + * \brief Return \a x times \a n + * \relates Interval + */ + forceinline Interval + operator*(const Interval& x, FloatNum n) { + Rounding r; + return IntervalDetail::mul(r, n, x); + } + /** + * \brief Return \a n times \a x + * \relates Interval + */ + forceinline Interval + operator*(FloatNum n, const Interval& x) { + Rounding r; + return IntervalDetail::mul(r, n, x); + } + /** + * \brief Return \a x divided by \a y, throwing if \a y is \f$[0,0]\f$ + * \relates Interval + */ + forceinline Interval + operator/(const Interval& x, const Interval& y) { + Rounding r; + return IntervalDetail::div(r, x, y); + } + /** + * \brief Return \a x divided by \a n, throwing if \a n is 0 + * \relates Interval + */ + forceinline Interval + operator/(const Interval& x, FloatNum n) { + Rounding r; + return IntervalDetail::div(r, x, n); + } + /** + * \brief Return \a n divided by \a y, throwing if \a y is \f$[0,0]\f$ + * \relates Interval + */ + forceinline Interval + operator/(FloatNum n, const Interval& y) { + Rounding r; + return IntervalDetail::div(r, n, y); + } + + /** + * \brief Return an upper bound of the width of \a x + * \relates Interval + */ + forceinline FloatNum + width(const Interval& x) { + Rounding r; + return IntervalDetail::width(r, x); + } + + /** + * \brief Return \f$\sqrt{x}\f$, throwing if \a x has no nonnegative member + * \relates Interval + */ + inline Interval + sqrt(const Interval& x) { + if (x.upper() < 0.0) + IntervalDetail::throw_empty(); + Rounding r; + const FloatNum l = (x.lower() > 0.0) ? r.sqrt_down(x.lower()) : 0.0; + return Interval::unchecked(l, r.sqrt_up(x.upper())); + } + /** + * \brief Return \f$\{v^2 \mid v\in x\}\f$ + * \relates Interval + */ + inline Interval + square(const Interval& x) { + const FloatNum xl = x.lower(); + const FloatNum xu = x.upper(); + Rounding r; + if (xu < 0.0) + return Interval::unchecked(r.mul_down(xu, xu), r.mul_up(xl, xl)); + if (xl > 0.0) + return Interval::unchecked(r.mul_down(xl, xl), r.mul_up(xu, xu)); + return Interval::unchecked(0.0, (-xl > xu) ? r.mul_up(xl, xl) : r.mul_up(xu, xu)); + } + /** + * \brief Return \f$x^n\f$ + * + * Throws for \f$[0,0]\f$ with \f$n\leq 0\f$. Any other interval to the + * power 0 is \f$[1,1]\f$. + * \relates Interval + */ + forceinline Interval + pow(const Interval& x, int n) { + Rounding r; + return IntervalDetail::pow(r, x, n); + } + /** + * \brief Return the real \a k-th roots of the members of \a x, for \a k > 0 + * + * Throws for even \a k when \a x has no nonnegative member. + * \relates Interval + */ + inline Interval + nth_root(const Interval& x, int k) { + assert(k > 0); + if (k == 1) + return x; + Rounding r; + const FloatNum xl = x.lower(); + const FloatNum xu = x.upper(); + const bool odd = k % 2 != 0; + if (!(xu > 0.0)) { + if (xu == 0.0) { + if (!odd || (xl == 0.0)) + return Interval(); + return Interval::unchecked(-IntervalDetail::root_up(r, -xl, k), 0.0); + } + if (!odd) + IntervalDetail::throw_empty(); + return Interval::unchecked(-IntervalDetail::root_up(r, -xl, k), -IntervalDetail::root_down(r, -xu, k)); + } + const FloatNum u = IntervalDetail::root_up(r, xu, k); + if (xl > 0.0) + return Interval::unchecked(IntervalDetail::root_down(r, xl, k), u); + if (odd && (xl != 0.0)) + return Interval::unchecked(-IntervalDetail::root_up(r, -xl, k), u); + return Interval::unchecked(0.0, u); + } + + /** + * \brief Return \a x shifted by a whole multiple of \a y (see IntervalDetail::fmod()) + * \relates Interval + */ + forceinline Interval + fmod(const Interval& x, const Interval& y) { + Rounding r; + return IntervalDetail::fmod(r, x, y); + } + /** + * \brief Return \a x shifted by a whole multiple of \a n (see IntervalDetail::fmod()) + * \relates Interval + */ + forceinline Interval + fmod(const Interval& x, FloatNum n) { + Rounding r; + return IntervalDetail::fmod(r, x, n); + } + /** + * \brief Return \a n shifted by a whole multiple of \a y (see IntervalDetail::fmod()) + * \relates Interval + */ + forceinline Interval + fmod(FloatNum n, const Interval& y) { + Rounding r; + return IntervalDetail::fmod(r, n, y); + } + +#ifdef GECODE_HAS_MPFR + + /* + * Transcendental functions + * + * Monotone functions map the bounds. The others clamp their bounds to the + * function's range at the ends of its domain. + * + */ + + /** + * \brief Return \f$\exp x\f$ + * \relates Interval + */ + forceinline Interval + exp(const Interval& x) { + Rounding r; + return Interval::unchecked(r.exp_down(x.lower()), r.exp_up(x.upper())); + } + /** + * \brief Return \f$\log x\f$, throwing if \a x has no positive member + * \relates Interval + */ + inline Interval + log(const Interval& x) { + if (!(x.upper() > 0.0)) + IntervalDetail::throw_empty(); + Rounding r; + const FloatNum l = (x.lower() > 0.0) ? r.log_down(x.lower()) : -std::numeric_limits::infinity(); + return Interval::unchecked(l, r.log_up(x.upper())); + } + + /** + * \brief Return \f$\cos x\f$ + * \relates Interval + */ + forceinline Interval + cos(const Interval& x) { + Rounding r; + return IntervalDetail::cos(r, x); + } + /** + * \brief Return \f$\sin x\f$, computed as \f$\cos(x-\pi/2)\f$ + * \relates Interval + */ + forceinline Interval + sin(const Interval& x) { + Rounding r; + return IntervalDetail::cos(r, IntervalDetail::sub(r, x, Interval::pi_half())); + } + /** + * \brief Return \f$\tan x\f$ + * + * \a x is shifted into \f$[-\pi/2,\pi/2]\f$, where tangent rises. An + * interval that reaches a pole gives the whole line. + * \relates Interval + */ + inline Interval + tan(const Interval& x) { + Rounding r; + Interval t = IntervalDetail::fmod(r, x, Interval::pi()); + if (t.lower() >= pi_half_lower()) + t = IntervalDetail::sub(r, t, Interval::pi()); + if ((t.lower() <= -pi_half_lower()) || (t.upper() >= pi_half_lower())) + return IntervalDetail::whole(); + return Interval::unchecked(r.tan_down(t.lower()), r.tan_up(t.upper())); + } + /** + * \brief Return \f$\arcsin x\f$, throwing if \a x misses \f$[-1,1]\f$ + * \relates Interval + */ + inline Interval + asin(const Interval& x) { + if ((x.upper() < -1.0) || (x.lower() > 1.0)) + IntervalDetail::throw_empty(); + Rounding r; + const FloatNum l = (x.lower() <= -1.0) ? -pi_half_upper() : r.asin_down(x.lower()); + const FloatNum u = (x.upper() >= 1.0) ? pi_half_upper() : r.asin_up(x.upper()); + return Interval::unchecked(l, u); + } + /** + * \brief Return \f$\arccos x\f$, throwing if \a x misses \f$[-1,1]\f$ + * \relates Interval + */ + inline Interval + acos(const Interval& x) { + if ((x.upper() < -1.0) || (x.lower() > 1.0)) + IntervalDetail::throw_empty(); + Rounding r; + const FloatNum l = (x.upper() >= 1.0) ? 0.0 : r.acos_down(x.upper()); + const FloatNum u = (x.lower() <= -1.0) ? pi_upper() : r.acos_up(x.lower()); + return Interval::unchecked(l, u); + } + /** + * \brief Return \f$\arctan x\f$ + * \relates Interval + */ + forceinline Interval + atan(const Interval& x) { + Rounding r; + return Interval::unchecked(r.atan_down(x.lower()), r.atan_up(x.upper())); + } + + /** + * \brief Return \f$\sinh x\f$ + * \relates Interval + */ + forceinline Interval + sinh(const Interval& x) { + Rounding r; + return Interval::unchecked(r.sinh_down(x.lower()), r.sinh_up(x.upper())); + } + /** + * \brief Return \f$\cosh x\f$, which falls below 0 and rises above + * \relates Interval + */ + inline Interval + cosh(const Interval& x) { + const FloatNum xl = x.lower(); + const FloatNum xu = x.upper(); + Rounding r; + if (xu < 0.0) + return Interval::unchecked(r.cosh_down(xu), r.cosh_up(xl)); + if (!(xl < 0.0)) + return Interval::unchecked(r.cosh_down(xl), r.cosh_up(xu)); + return Interval::unchecked(1.0, r.cosh_up((-xl > xu) ? xl : xu)); + } + /** + * \brief Return \f$\tanh x\f$ + * \relates Interval + */ + forceinline Interval + tanh(const Interval& x) { + Rounding r; + return Interval::unchecked(r.tanh_down(x.lower()), r.tanh_up(x.upper())); + } + /** + * \brief Return \f$\operatorname{arsinh} x\f$ + * \relates Interval + */ + forceinline Interval + asinh(const Interval& x) { + Rounding r; + return Interval::unchecked(r.asinh_down(x.lower()), r.asinh_up(x.upper())); + } + /** + * \brief Return \f$\operatorname{arcosh} x\f$, throwing if \a x misses \f$[1,+\infty]\f$ + * \relates Interval + */ + inline Interval + acosh(const Interval& x) { + if (x.upper() < 1.0) + IntervalDetail::throw_empty(); + Rounding r; + const FloatNum l = (x.lower() <= 1.0) ? 0.0 : r.acosh_down(x.lower()); + return Interval::unchecked(l, r.acosh_up(x.upper())); + } + /** + * \brief Return \f$\operatorname{artanh} x\f$, throwing if \a x misses \f$[-1,1]\f$ + * \relates Interval + */ + inline Interval + atanh(const Interval& x) { + if ((x.upper() < -1.0) || (x.lower() > 1.0)) + IntervalDetail::throw_empty(); + const FloatNum inf = std::numeric_limits::infinity(); + Rounding r; + const FloatNum l = (x.lower() <= -1.0) ? -inf : r.atanh_down(x.lower()); + const FloatNum u = (x.upper() >= 1.0) ? inf : r.atanh_up(x.upper()); + return Interval::unchecked(l, u); + } + +#endif + +}} // namespace Gecode::Float + +// STATISTICS: float-var diff --git a/test/float/interval-oracle.cpp b/test/float/interval-oracle.cpp new file mode 100644 index 0000000000..f0c639a515 --- /dev/null +++ b/test/float/interval-oracle.cpp @@ -0,0 +1,581 @@ +/* + * Main authors: + * Mikael Zayenz Lagerkvist + * + * Copyright: + * Mikael Zayenz Lagerkvist, 2026 + * + * This file is part of Gecode, the generic constraint + * development environment: + * http://www.gecode.dev + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/* + * Temporary differential test: Float::Interval against the vendored Boost + * interval that FloatVal uses today. It is removed together with the Boost + * copy. + * + */ + +#include "test/float.hh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Test { namespace Float { namespace { + + using Gecode::FloatNum; + /// The interval type under test + using Candidate = Gecode::Float::Interval; + /// FloatVal's implementation type, which gives the expected results + using Reference = gecode_boost::numeric::interval< + FloatNum, gecode_boost::numeric::interval_lib::policies< + Gecode::Float::Rounding, gecode_boost::numeric::interval_lib::checking_strict>>; + + namespace candidate = Gecode::Float; + namespace reference = gecode_boost::numeric; + + /// Bounds of an operand interval + struct Bounds { + FloatNum lower; + FloatNum upper; + }; + + /// Return the operand numbers: infinities, extreme normals, + /// denormals, signed zeros, inexact decimals, a 1-ulp neighbour, and NaN + std::vector + grid_numbers(void) { + const FloatNum inf = std::numeric_limits::infinity(); + const FloatNum max_normal = std::numeric_limits::max(); + const FloatNum min_normal = std::numeric_limits::min(); + const FloatNum denorm = std::numeric_limits::denorm_min(); + const FloatNum nan = std::numeric_limits::quiet_NaN(); + return {-inf, -max_normal, -1e5, -3.0, -1.0, + -0.1, -min_normal, -denorm, -0.0, 0.0, + denorm, min_normal, 0.1, 1.0, std::nextafter(1.0, 2.0), + 2.0, 3.0, 7.0, 1e5, max_normal, + inf, nan}; + } + + /// Return the operand intervals: every non-NaN singleton, ranges + /// straddling or touching zero, infinite and extreme bounds, tight + /// intervals, \f$[0,-0]\f$, and the NaN singleton + std::vector + grid_intervals(void) { + const FloatNum inf = std::numeric_limits::infinity(); + const FloatNum max_normal = std::numeric_limits::max(); + const FloatNum min_normal = std::numeric_limits::min(); + const FloatNum denorm = std::numeric_limits::denorm_min(); + const FloatNum nan = std::numeric_limits::quiet_NaN(); + const FloatNum one_up = std::nextafter(1.0, 2.0); + std::vector v; + for (FloatNum n : grid_numbers()) + if (!std::isnan(n)) + v.push_back({n, n}); + const std::vector ranges = {{-inf, inf}, + {-inf, -1.0}, + {-inf, 0.0}, + {-inf, 0.1}, + {0.0, inf}, + {1.0, inf}, + {-max_normal, max_normal}, + {-1.0, 1.0}, + {-0.0, 0.0}, + {0.0, -0.0}, + {-1.0, 0.0}, + {0.0, 1.0}, + {-0.1, 0.1}, + {0.1, 0.3}, + {1.0, one_up}, + {1.0, 2.0}, + {2.0, 3.0}, + {-3.0, -2.0}, + {-3.0, 7.0}, + {-0.1, -0.0}, + {0.0, 0.1}, + {denorm, min_normal}, + {-denorm, denorm}, + {1e5, max_normal}, + {-max_normal, -1e5}, + {0.1, 7.0}, + {3.0, 1e5}, + {-1.0, -0.0}, + {0.5, 1.0}, + {-7.0, -0.1}}; + v.insert(v.end(), ranges.begin(), ranges.end()); + v.push_back({nan, nan}); + return v; + } + + /// What an operation produced + enum class Kind { BOUNDS, TRUTH, THROW }; + + /// Observed result of one operation in one caller mode + struct Outcome { + Kind kind = Kind::BOUNDS; + /// Bit patterns of the bounds, for Kind::BOUNDS + std::uint64_t lower = 0; + std::uint64_t upper = 0; + /// Truth value, for Kind::TRUTH + bool truth = false; + /// Dynamic type of the exception, for Kind::THROW + std::type_index exception = typeid(void); + /// Whether the caller's rounding mode was unchanged afterwards + bool mode_kept = true; + bool operator==(const Outcome&) const = default; + }; + + /// Return the outcome for the bounds \a l and \a u + Outcome + bounds_outcome(FloatNum l, FloatNum u) { + Outcome o; + o.lower = std::bit_cast(l); + o.upper = std::bit_cast(u); + return o; + } + /// Return the outcome for interval \a x + Outcome + outcome_of(const Candidate& x) { + return bounds_outcome(x.lower(), x.upper()); + } + /// Return the outcome for interval \a x + Outcome + outcome_of(const Reference& x) { + return bounds_outcome(x.lower(), x.upper()); + } + /// Return the outcome for number \a n, as the bounds \f$[n,n]\f$ + Outcome + outcome_of(FloatNum n) { + return bounds_outcome(n, n); + } + /// Return the outcome for truth value \a b + Outcome + outcome_of(bool b) { + Outcome o; + o.kind = Kind::TRUTH; + o.truth = b; + return o; + } + + /// Return the outcome of \a operation in caller mode \a mode, and reset the mode + template + Outcome + observe(int mode, Operation operation) { + std::fesetround(mode); + Outcome o; + try { + o = outcome_of(operation()); + } catch (const std::exception& e) { + o.kind = Kind::THROW; + o.exception = typeid(e); + } catch (...) { + o.kind = Kind::THROW; + } + o.mode_kept = std::fegetround() == mode; + std::fesetround(FE_TONEAREST); + return o; + } + + /// Return the result of the Boost comparison \a comparison, with an uncertain result as false (as FloatVal does) + template + bool + certainly(Comparison comparison) { + try { + return comparison(); + } catch (const gecode_boost::numeric::interval_lib::comparison_error&) { + return false; + } + } + + /// Return \a n in hexadecimal floating-point notation + std::string + hex(FloatNum n) { + std::ostringstream s; + s << std::hexfloat << n; + return s.str(); + } + /// Return \a b in hexadecimal floating-point notation + std::string + hex(const Bounds& b) { + return '[' + hex(b.lower) + ',' + hex(b.upper) + ']'; + } + /// Return a readable form of \a o + std::string + text(const Outcome& o) { + std::string s; + switch (o.kind) { + case Kind::BOUNDS: + s = '[' + hex(std::bit_cast(o.lower)) + ',' + hex(std::bit_cast(o.upper)) + ']'; + break; + case Kind::TRUTH: + s = o.truth ? "true" : "false"; + break; + case Kind::THROW: + s = std::string("throw ") + o.exception.name(); + break; + } + return s + (o.mode_kept ? "" : " (mode changed)"); + } + + /// Float::Interval gives the vendored Boost interval's results bit for bit + class MatchesBoost : public Base { + private: + /// Most mismatches to log + static constexpr int max_logged = 20; + /// Caller modes that the platform supports + std::vector modes; + /// Operands of the operations being compared, for the log + std::string operands; + /// Number of mismatches + int mismatches = 0; + + /// Compare \a candidate_op with \a reference_op in every caller mode + template + void + compare(const char* op, CandidateOp candidate_op, ReferenceOp reference_op) { + for (int mode : modes) { + const Outcome c = observe(mode, candidate_op); + const Outcome r = observe(mode, reference_op); + if ((c == r) && c.mode_kept) + continue; + if (mismatches < max_logged) + olog << "Mode " << mode << ' ' << op << ' ' << operands << ": " << text(c) << ", Boost " << text(r) + << '\n'; + mismatches++; + } + } + + /// Compare the default interval and the constants + void + constants(void) { + operands = ""; + compare("default", [] { return Candidate(); }, [] { return Reference(); }); + compare( + "pi_half", [] { return Candidate::pi_half(); }, + [] { return reference::interval_lib::pi_half(); }); + compare("pi", [] { return Candidate::pi(); }, [] { return reference::interval_lib::pi(); }); + compare( + "pi_twice", [] { return Candidate::pi_twice(); }, + [] { return reference::interval_lib::pi_twice(); }); + } + /// Compare construction from \a n + void + from_number(FloatNum n) { + operands = hex(n); + compare("from_number", [&] { return Candidate(n); }, [&] { return Reference(n); }); + compare( + "assign_number", + [&] { + Candidate z(1.0, 2.0); + z = Candidate(n); + return z; + }, + [&] { + Reference z(1.0, 2.0); + z = n; + return z; + }); + } + /// Compare construction from \a l and \a u + void + from_numbers(FloatNum l, FloatNum u) { + operands = hex(l) + ' ' + hex(u); + compare("construct", [&] { return Candidate(l, u); }, [&] { return Reference(l, u); }); + compare( + "assign", + [&] { + Candidate z; + z.assign(l, u); + return z; + }, + [&] { + Reference z; + z.assign(l, u); + return z; + }); + } + /// Compare the operations on one interval \a b + void + unary(const Bounds& b) { + operands = hex(b); + const Candidate cx = candidate_interval(b); + const Reference rx = reference_interval(b); + compare("pos", [&] { return +cx; }, [&] { return +rx; }); + compare("neg", [&] { return -cx; }, [&] { return -rx; }); + compare("abs", [&] { return candidate::abs(cx); }, [&] { return reference::abs(rx); }); + compare("sqrt", [&] { return candidate::sqrt(cx); }, [&] { return reference::sqrt(rx); }); + compare("square", [&] { return candidate::square(cx); }, [&] { return reference::square(rx); }); + for (int n = -3; n <= 5; n++) { + operands = hex(b) + " pow " + std::to_string(n); + compare("pow", [&] { return candidate::pow(cx, n); }, [&] { return reference::pow(rx, n); }); + } + for (int k = 1; k <= 5; k++) { + operands = hex(b) + " root " + std::to_string(k); + compare( + "nth_root", [&] { return candidate::nth_root(cx, k); }, [&] { return reference::nth_root(rx, k); }); + } + operands = hex(b); + compare("width", [&] { return candidate::width(cx); }, [&] { return reference::width(rx); }); + compare("singleton", [&] { return candidate::singleton(cx); }, [&] { return reference::singleton(rx); }); + compare("zero_in", [&] { return candidate::zero_in(cx); }, [&] { return reference::zero_in(rx); }); +#ifdef GECODE_HAS_MPFR + compare("exp", [&] { return candidate::exp(cx); }, [&] { return reference::exp(rx); }); + compare("log", [&] { return candidate::log(cx); }, [&] { return reference::log(rx); }); + compare("sin", [&] { return candidate::sin(cx); }, [&] { return reference::sin(rx); }); + compare("cos", [&] { return candidate::cos(cx); }, [&] { return reference::cos(rx); }); + compare("tan", [&] { return candidate::tan(cx); }, [&] { return reference::tan(rx); }); + compare("asin", [&] { return candidate::asin(cx); }, [&] { return reference::asin(rx); }); + compare("acos", [&] { return candidate::acos(cx); }, [&] { return reference::acos(rx); }); + compare("atan", [&] { return candidate::atan(cx); }, [&] { return reference::atan(rx); }); + compare("sinh", [&] { return candidate::sinh(cx); }, [&] { return reference::sinh(rx); }); + compare("cosh", [&] { return candidate::cosh(cx); }, [&] { return reference::cosh(rx); }); + compare("tanh", [&] { return candidate::tanh(cx); }, [&] { return reference::tanh(rx); }); + compare("asinh", [&] { return candidate::asinh(cx); }, [&] { return reference::asinh(rx); }); + compare("acosh", [&] { return candidate::acosh(cx); }, [&] { return reference::acosh(rx); }); + compare("atanh", [&] { return candidate::atanh(cx); }, [&] { return reference::atanh(rx); }); +#endif + } + /// Compare the operations on the intervals \a a and \a b + void + binary(const Bounds& a, const Bounds& b) { + operands = hex(a) + ' ' + hex(b); + const Candidate cx = candidate_interval(a); + const Candidate cy = candidate_interval(b); + const Reference rx = reference_interval(a); + const Reference ry = reference_interval(b); + compare("add", [&] { return cx + cy; }, [&] { return rx + ry; }); + compare("sub", [&] { return cx - cy; }, [&] { return rx - ry; }); + compare("mul", [&] { return cx * cy; }, [&] { return rx * ry; }); + compare("div", [&] { return cx / cy; }, [&] { return rx / ry; }); + compare( + "add_assign", + [&] { + Candidate z = cx; + return z += cy; + }, + [&] { + Reference z = rx; + return z += ry; + }); + compare( + "sub_assign", + [&] { + Candidate z = cx; + return z -= cy; + }, + [&] { + Reference z = rx; + return z -= ry; + }); + compare( + "mul_assign", + [&] { + Candidate z = cx; + return z *= cy; + }, + [&] { + Reference z = rx; + return z *= ry; + }); + compare( + "div_assign", + [&] { + Candidate z = cx; + return z /= cy; + }, + [&] { + Reference z = rx; + return z /= ry; + }); + compare( + "lt", [&] { return candidate::certainly_less(cx, cy); }, + [&] { return certainly([&] { return rx < ry; }); }); + compare( + "le", [&] { return candidate::certainly_less_equal(cx, cy); }, + [&] { return certainly([&] { return rx <= ry; }); }); + compare( + "gt", [&] { return candidate::certainly_greater(cx, cy); }, + [&] { return certainly([&] { return rx > ry; }); }); + compare( + "ge", [&] { return candidate::certainly_greater_equal(cx, cy); }, + [&] { return certainly([&] { return rx >= ry; }); }); + compare( + "eq", [&] { return candidate::equal(cx, cy); }, [&] { return certainly([&] { return rx == ry; }); }); + compare( + "ne", [&] { return candidate::certainly_unequal(cx, cy); }, + [&] { return certainly([&] { return rx != ry; }); }); + compare("max", [&] { return candidate::max(cx, cy); }, [&] { return reference::max(rx, ry); }); + compare("min", [&] { return candidate::min(cx, cy); }, [&] { return reference::min(rx, ry); }); + compare("subset", [&] { return candidate::subset(cx, cy); }, [&] { return reference::subset(rx, ry); }); + compare( + "proper_subset", [&] { return candidate::proper_subset(cx, cy); }, + [&] { return reference::proper_subset(rx, ry); }); + compare("overlap", [&] { return candidate::overlap(cx, cy); }, [&] { return reference::overlap(rx, ry); }); + compare("equal", [&] { return candidate::equal(cx, cy); }, [&] { return reference::equal(rx, ry); }); + compare( + "intersect", [&] { return candidate::intersect(cx, cy); }, + [&] { return reference::intersect(rx, ry); }); + compare("hull", [&] { return candidate::hull(cx, cy); }, [&] { return reference::hull(rx, ry); }); + compare("fmod", [&] { return candidate::fmod(cx, cy); }, [&] { return reference::fmod(rx, ry); }); + } + /// Compare the operations on the interval \a b and the number \a n + void + mixed(const Bounds& b, FloatNum n) { + operands = hex(b) + ' ' + hex(n); + const Candidate cx = candidate_interval(b); + const Reference rx = reference_interval(b); + compare("add", [&] { return cx + n; }, [&] { return rx + n; }); + compare("add_left", [&] { return n + cx; }, [&] { return n + rx; }); + compare("sub", [&] { return cx - n; }, [&] { return rx - n; }); + compare("sub_left", [&] { return n - cx; }, [&] { return n - rx; }); + compare("mul", [&] { return cx * n; }, [&] { return rx * n; }); + compare("mul_left", [&] { return n * cx; }, [&] { return n * rx; }); + compare("div", [&] { return cx / n; }, [&] { return rx / n; }); + compare("div_left", [&] { return n / cx; }, [&] { return n / rx; }); + compare( + "add_assign", + [&] { + Candidate z = cx; + return z += n; + }, + [&] { + Reference z = rx; + return z += n; + }); + compare( + "sub_assign", + [&] { + Candidate z = cx; + return z -= n; + }, + [&] { + Reference z = rx; + return z -= n; + }); + compare( + "mul_assign", + [&] { + Candidate z = cx; + return z *= n; + }, + [&] { + Reference z = rx; + return z *= n; + }); + compare( + "div_assign", + [&] { + Candidate z = cx; + return z /= n; + }, + [&] { + Reference z = rx; + return z /= n; + }); + compare( + "lt", [&] { return candidate::certainly_less(cx, n); }, + [&] { return certainly([&] { return rx < n; }); }); + compare( + "le", [&] { return candidate::certainly_less_equal(cx, n); }, + [&] { return certainly([&] { return rx <= n; }); }); + compare( + "gt", [&] { return candidate::certainly_greater(cx, n); }, + [&] { return certainly([&] { return rx > n; }); }); + compare( + "ge", [&] { return candidate::certainly_greater_equal(cx, n); }, + [&] { return certainly([&] { return rx >= n; }); }); + compare( + "ne", [&] { return candidate::certainly_unequal(cx, n); }, + [&] { return certainly([&] { return rx != n; }); }); + compare("max", [&] { return candidate::max(cx, n); }, [&] { return reference::max(rx, n); }); + compare("max_left", [&] { return candidate::max(n, cx); }, [&] { return reference::max(n, rx); }); + compare("min", [&] { return candidate::min(cx, n); }, [&] { return reference::min(rx, n); }); + compare("min_left", [&] { return candidate::min(n, cx); }, [&] { return reference::min(n, rx); }); + compare("hull", [&] { return candidate::hull(cx, n); }, [&] { return reference::hull(rx, n); }); + compare("hull_left", [&] { return candidate::hull(n, cx); }, [&] { return reference::hull(n, rx); }); + compare("in", [&] { return candidate::in(n, cx); }, [&] { return reference::in(n, rx); }); + compare("fmod", [&] { return candidate::fmod(cx, n); }, [&] { return reference::fmod(rx, n); }); + compare("fmod_left", [&] { return candidate::fmod(n, cx); }, [&] { return reference::fmod(n, rx); }); + } + + /// Return the candidate interval with bounds \a b + static Candidate + candidate_interval(const Bounds& b) { + return std::isnan(b.lower) ? Candidate(b.lower) : Candidate(b.lower, b.upper); + } + /// Return the reference interval with bounds \a b + static Reference + reference_interval(const Bounds& b) { + return std::isnan(b.lower) ? Reference(b.lower) : Reference(b.lower, b.upper); + } + + public: + MatchesBoost(void) : Base("Float::Interval::MatchesBoost", TestTags::standard()) {} + bool + run(void) override { + const int previous = std::fegetround(); + modes.clear(); + for (int mode : {FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO}) + if (std::fesetround(mode) == 0) + modes.push_back(mode); + std::fesetround(FE_TONEAREST); + mismatches = 0; + + const std::vector numbers = grid_numbers(); + const std::vector intervals = grid_intervals(); + constants(); + for (FloatNum n : numbers) + from_number(n); + for (FloatNum l : numbers) + for (FloatNum u : numbers) + from_numbers(l, u); + for (const Bounds& b : intervals) + unary(b); + for (const Bounds& a : intervals) + for (const Bounds& b : intervals) + binary(a, b); + for (const Bounds& b : intervals) + for (FloatNum n : numbers) + mixed(b, n); + + if (previous != -1) + std::fesetround(previous); + if (mismatches > 0) + olog << mismatches << " mismatches\n"; + return mismatches == 0; + } + } matches_boost; + +}}} // namespace Test::Float + +// STATISTICS: test-float diff --git a/test/float/interval.cpp b/test/float/interval.cpp new file mode 100644 index 0000000000..eae06c1fb6 --- /dev/null +++ b/test/float/interval.cpp @@ -0,0 +1,272 @@ +/* + * Main authors: + * Mikael Zayenz Lagerkvist + * + * Copyright: + * Mikael Zayenz Lagerkvist, 2026 + * + * This file is part of Gecode, the generic constraint + * development environment: + * http://www.gecode.dev + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "test/float.hh" + +#include +#include +#include +#include +#include +#include + +namespace Test { namespace Float { + + /// %Tests for the interval type behind float values + namespace IntervalCore { + + using Gecode::FloatNum; + using Gecode::Float::Interval; + + static_assert(std::is_trivially_copyable_v); + + /** + * \defgroup TaskTestFloatInterval Interval arithmetic + * \ingroup TaskTestFloat + */ + //@{ + + /// Caller modes under which the interval operations are tested + const int caller_modes[] = {FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO}; + + /// Test whether \a x has the bounds \a l and \a u, and log a mismatch + bool + has_bounds(const char* name, const Interval& x, FloatNum l, FloatNum u) { + if ((x.lower() == l) && (x.upper() == u)) + return true; + olog << name << ": [" << std::hexfloat << x.lower() << ", " << x.upper() << "], expected [" << l << ", " + << u << ']' << std::defaultfloat << '\n'; + return false; + } + + /// Arithmetic rounds each bound outward and keeps the caller's mode + class OutwardRounding : public Base { + private: + /// Test whether \a x has the bounds \a l and \a u in caller mode \a mode + static bool + check(int mode, const char* name, const Interval& x, FloatNum l, FloatNum u) { + bool result = has_bounds(name, x, l, u); + if (std::fegetround() != mode) { + olog << name << " changed caller mode " << mode << '\n'; + result = false; + } + return result; + } + + public: + OutwardRounding(void) : Base("Float::Interval::OutwardRounding", TestTags::check()) {} + bool + run(void) override { + const int previous = std::fegetround(); + bool result = true; + // Each expected bound is a floating-point neighbour of the + // exact result, computed with rational arithmetic. + for (int mode : caller_modes) { + if (std::fesetround(mode) != 0) + continue; + result &= check(mode, "[0.1,0.1]+[0.2,0.2]", Interval(0.1) + Interval(0.2), 0x1.3333333333333p-2, + 0x1.3333333333334p-2); + result &= + check(mode, "0.1-[0.7,0.7]", 0.1 - Interval(0.7), -0x1.3333333333333p-1, -0x1.3333333333332p-1); + result &= check(mode, "[-0.1,0.3]*[0.3,0.7]", Interval(-0.1, 0.3) * Interval(0.3, 0.7), + -0x1.1eb851eb851ecp-4, 0x1.ae147ae147ae1p-3); + result &= check(mode, "[1,1]/[3,3]", Interval(1.0) / Interval(3.0), 0x1.5555555555555p-2, + 0x1.5555555555556p-2); + result &= check(mode, "[-1,2]/[3,7]", Interval(-1.0, 2.0) / Interval(3.0, 7.0), + -0x1.5555555555556p-2, 0x1.5555555555556p-1); + result &= + check(mode, "sqrt [2,2]", sqrt(Interval(2.0)), 0x1.6a09e667f3bccp+0, 0x1.6a09e667f3bcdp+0); + result &= + check(mode, "sqrt [0.1,0.1]", sqrt(Interval(0.1)), 0x1.43d136248490fp-2, 0x1.43d1362484910p-2); + } + if (previous != -1) + std::fesetround(previous); + return result; + } + } outward_rounding; + + /// Singletons stay exact, and empty intervals are never created + class SingletonAndEmpty : public Base { + private: + /// Test whether \a operation throws std::runtime_error, and log otherwise + template + static bool + throws_empty(const char* name, Operation operation) { + try { + (void)operation(); + } catch (const std::runtime_error&) { + return true; + } + olog << name << " did not throw\n"; + return false; + } + + public: + SingletonAndEmpty(void) : Base("Float::Interval::SingletonAndEmpty", TestTags::standard()) {} + bool + run(void) override { + const FloatNum nan = std::numeric_limits::quiet_NaN(); + bool result = true; + + const Interval zero; + result &= + has_bounds("default", zero, 0.0, 0.0) && !std::signbit(zero.lower()) && !std::signbit(zero.upper()); + result &= has_bounds("[0.1,0.1]", Interval(0.1), 0.1, 0.1); + result &= singleton(Interval(0.1)) && (width(Interval(0.1)) == 0.0); + result &= has_bounds("[2,2]*[3,3]", Interval(2.0) * Interval(3.0), 6.0, 6.0); + result &= has_bounds("sqrt [4,4]", sqrt(Interval(4.0)), 2.0, 2.0); + const int min_exponent = std::numeric_limits::min(); + result &= has_bounds("pow([1,1],INT_MIN)", pow(Interval(1.0), min_exponent), 1.0, 1.0); + result &= has_bounds("pow([-1,-1],INT_MIN)", pow(Interval(-1.0), min_exponent), 1.0, 1.0); + const Interval not_a_number(nan); + result &= std::isnan(not_a_number.lower()) && std::isnan(not_a_number.upper()); + + result &= throws_empty("Interval(2,1)", [] { return Interval(2.0, 1.0); }); + result &= throws_empty("Interval(NaN,1)", [&] { return Interval(nan, 1.0); }); + result &= throws_empty("Interval(1,NaN)", [&] { return Interval(1.0, nan); }); + Interval assigned(1.0, 2.0); + result &= throws_empty("assign(2,1)", [&] { + assigned.assign(2.0, 1.0); + return assigned; + }); + result &= has_bounds("after assign(2,1)", assigned, 1.0, 2.0); + + const Interval x(1.0, 2.0); + result &= throws_empty("[1,2]/[0,0]", [&] { return x / Interval(); }); + result &= throws_empty("[1,2]/0", [&] { return x / 0.0; }); + result &= throws_empty("sqrt [-2,-1]", [] { return sqrt(Interval(-2.0, -1.0)); }); + result &= throws_empty("pow([0,0],0)", [] { return pow(Interval(), 0); }); + result &= throws_empty("pow([0,0],-1)", [] { return pow(Interval(), -1); }); + result &= throws_empty("nth_root([-2,-1],2)", [] { return nth_root(Interval(-2.0, -1.0), 2); }); + result &= throws_empty("intersect([1,2],[3,4])", [&] { return intersect(x, Interval(3.0, 4.0)); }); +#ifdef GECODE_HAS_MPFR + result &= throws_empty("log [-1,0]", [] { return log(Interval(-1.0, 0.0)); }); + result &= throws_empty("asin [2,3]", [] { return asin(Interval(2.0, 3.0)); }); + result &= throws_empty("acosh [0,0.5]", [] { return acosh(Interval(0.0, 0.5)); }); +#endif + return result; + } + } singleton_and_empty; + + /// Comparisons hold only when they hold for all members + class Comparison : public Base { + private: + /// Truth values of the relations between two intervals + struct IntervalRelations { + bool less; + bool less_equal; + bool greater; + bool greater_equal; + bool equal; + bool unequal; + bool operator==(const IntervalRelations&) const = default; + }; + /// Truth values of the relations between an interval and a number + struct NumberRelations { + bool less; + bool less_equal; + bool greater; + bool greater_equal; + bool unequal; + bool operator==(const NumberRelations&) const = default; + }; + + /// Test the relations between \a x and \a y against \a expected + static bool + check(const Interval& x, const Interval& y, const IntervalRelations& expected) { + const IntervalRelations actual = {certainly_less(x, y), + certainly_less_equal(x, y), + certainly_greater(x, y), + certainly_greater_equal(x, y), + equal(x, y), + certainly_unequal(x, y)}; + if (actual == expected) + return true; + olog << "Relations of [" << x.lower() << ',' << x.upper() << "] and [" << y.lower() << ',' << y.upper() + << "] differ\n"; + return false; + } + /// Test the relations between \a x and \a n against \a expected + static bool + check(const Interval& x, FloatNum n, const NumberRelations& expected) { + const NumberRelations actual = {certainly_less(x, n), certainly_less_equal(x, n), + certainly_greater(x, n), certainly_greater_equal(x, n), + certainly_unequal(x, n)}; + if (actual == expected) + return true; + olog << "Relations of [" << x.lower() << ',' << x.upper() << "] and " << n << " differ\n"; + return false; + } + + public: + Comparison(void) : Base("Float::Interval::Comparison", TestTags::standard()) {} + bool + run(void) override { + const bool t = true; + const bool f = false; + const FloatNum one_up = std::nextafter(1.0, 2.0); + const Interval x(1.0, 2.0); + const Interval one(1.0); + const Interval tight(1.0, one_up); + bool result = true; + // Columns: < <= > >= == != + result &= check(x, Interval(3.0, 4.0), {t, t, f, f, f, t}); + result &= check(x, Interval(2.0, 3.0), {f, t, f, f, f, f}); + result &= check(x, Interval(1.5, 3.0), {f, f, f, f, f, f}); + result &= check(x, Interval(1.0, 2.0), {f, f, f, f, t, f}); + result &= check(x, Interval(1.2, 1.8), {f, f, f, f, f, f}); + result &= check(x, Interval(0.0, 1.0), {f, f, f, t, f, f}); + result &= check(x, Interval(-1.0, 0.0), {f, f, t, t, f, t}); + result &= check(one, one, {f, t, f, t, t, f}); + result &= check(one, Interval(2.0), {t, t, f, f, f, t}); + result &= check(one, x, {f, t, f, f, f, f}); + result &= check(tight, tight, {f, f, f, f, t, f}); + // Columns: < <= > >= != + result &= check(x, 0.5, {f, f, t, t, t}); + result &= check(x, 1.0, {f, f, f, t, f}); + result &= check(x, 1.5, {f, f, f, f, f}); + result &= check(x, 2.0, {f, t, f, f, f}); + result &= check(x, 3.0, {t, t, f, f, t}); + result &= check(one, 1.0, {f, t, f, t, f}); + result &= check(tight, 1.0, {f, f, f, t, f}); + result &= check(tight, one_up, {f, t, f, f, f}); + return result; + } + } comparison; + + //@} + + } // namespace IntervalCore + +}} // namespace Test::Float + +// STATISTICS: test-float From 0381cbaa3925ecb8f63dd43467a9349a63c42873 Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Wed, 4 Nov 2026 14:39:49 +0100 Subject: [PATCH 3/5] Switch FloatVal and the rounding layer to the native interval FloatVal now stores Float::Interval, and Float::RoundingBase and Float::Rounding are Gecode classes. The rounding mode is read and set with , or with _control87 for MSVC on x86 and x64. Rounding is a scope that saves the caller's mode and restores it, and it cannot be copied. FloatVal's public operations are unchanged, its comparisons call the native certainly-relations, and it is now trivially copyable. No float header includes Boost any more; the Boost copy stays only for the temporary differential test, which now checks FloatVal against it. Zdev-Change-Id: Zb0421a288f748b79528fe4e547c738571dac5eb690ffaa00dc5b799f9c222a1c --- gecode/float.hh | 110 ++++++++---- gecode/float/num.hpp | 17 +- gecode/float/rounding.hpp | 135 ++++++++++++-- gecode/float/val.hpp | 119 +++++------- test/array.cpp | 5 + test/float/arithmetic.cpp | 34 ++-- test/float/interval-oracle.cpp | 319 +++++++++++++++++++-------------- 7 files changed, 453 insertions(+), 286 deletions(-) diff --git a/gecode/float.hh b/gecode/float.hh index 291cd9c685..5f372f150a 100644 --- a/gecode/float.hh +++ b/gecode/float.hh @@ -37,10 +37,12 @@ #ifndef GECODE_FLOAT_HH #define GECODE_FLOAT_HH +#include #include #include #include #include +#include #include @@ -69,8 +71,21 @@ #endif -// Include interval implementation -#include +/* + * Configure rounding control + * + */ + +// cl.exe on x86 and x64 sets the rounding mode with _control87. clang-cl +// defines __x86_64__ and uses like every other compiler. +#if defined(_MSC_VER) && !defined(__x86_64__) && (defined(_M_X64) || defined(_M_IX86)) +#define GECODE_FLOAT_MODE_CONTROL87 +#include +#endif +// MSVC on x64, or on x86 with SSE, sets the direction in every operation. +#if defined(_MSC_VER) && (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP > 0))) +#define GECODE_FLOAT_DIRECTED_PER_OPERATION +#endif /** * \namespace Gecode::Float @@ -128,15 +143,6 @@ namespace Gecode { namespace Gecode { namespace Float { - /* - * All compilers, MSVC included, keep upward mode between calls. The - * downward operations negate an operand, which negate_opaque in - * rounded_arith.hpp keeps from being folded into the rounded operation. - * - */ - /// Rounding operations that keep upward mode between calls - typedef gecode_boost::numeric::interval_lib::rounded_arith_opp RoundingControl; - /** * \brief Floating point rounding operations without state saving * @@ -161,26 +167,54 @@ namespace Gecode { namespace Float { * `_control87`). IEEE binary64 arithmetic in SSE2 or AArch64 registers is * assumed; x87 arithmetic and `-ffast-math` are not supported. * - * RoundingControl supplies only mode control (`init()`, `upward()`, - * `downward()`, and the mode access used by save_state) and the median - * behind median(). Its vendored Boost arithmetic is not used, so a - * replacement for the Boost copy needs only these members. Outside - * MSVC with SSE, the mode stays upward between operations. An upper bound - * is computed directly, and a lower bound as the negated upper bound of - * the negated operation; sqrt_down() switches to downward mode and back. - * With MSVC and SSE (`rounded_arith_std` over `_control87`), each - * operation sets its own direction. int_down() and int_up() use - * `std::floor` and `std::ceil`, which do not depend on the mode. + * The rounding mode is read and set with `std::fegetround` and + * `std::fesetround`. Under GECODE_FLOAT_MODE_CONTROL87 (cl.exe on x86 and + * x64) it is read and set with `_control87`, which also masks all + * floating-point exceptions while Gecode sets a mode and, on x86, selects + * 64-bit precision and affine infinity; restoring a mode writes back the + * caller's bits. Without GECODE_FLOAT_DIRECTED_PER_OPERATION, the mode + * stays upward between operations. An upper bound is computed directly, + * and a lower bound as the negated upper bound of the negated operation; + * sqrt_down() and median() switch the mode and switch back to upward. + * With it (MSVC on x64, or on x86 with SSE), each operation sets its own + * direction. int_down() and int_up() use `std::floor` and `std::ceil`, + * which do not depend on the mode. * * The test Float::Arithmetic::DirectedRounding checks the bounds with * literal and runtime operands under every caller mode. * * \ingroup TaskModelFloatVars */ - class RoundingBase : public RoundingControl { + class RoundingBase { + protected: + /// \name Rounding mode control + //@{ +#ifdef GECODE_FLOAT_MODE_CONTROL87 + /// Floating-point control word, as returned by `_control87` + typedef unsigned int Mode; +#else + /// Rounding mode, one of the `FE_*` values of `` + typedef int Mode; +#endif + /// Return the current rounding mode + static Mode current_mode(void); + /// Restore mode \a m, as returned by current_mode() + static void restore_mode(Mode m); + /// Round toward \f$+\infty\f$ + static void upward(void); + /// Round toward \f$-\infty\f$ + static void downward(void); + /// Round to nearest + static void to_nearest(void); + /// Set the mode that the arithmetic operations expect between calls + static void init(void); + //@} + private: /// Return \a x unchanged, hidden from the optimizer (see the class comment) static FloatNum barrier(FloatNum x); + /// Return the midpoint of \a x and \a y, rounded to nearest + static FloatNum nearest_median(FloatNum x, FloatNum y); public: /// \name Arithmetic operations @@ -297,13 +331,30 @@ namespace Gecode { namespace Float { }; /** - * \brief Floating point rounding policy that restores the caller's mode + * \brief Scope of floating point rounding operations * - * Saves the mode before initializing rounding operations and restores it - * on destruction. Nested policies restore the enclosing policy's mode. + * Saves the caller's rounding mode and initializes the rounding + * operations on construction, and restores the saved mode on destruction, + * also when an operation throws. Nested scopes restore the enclosing + * scope's mode. A copy would restore the mode a second time, so a scope + * cannot be copied. * \ingroup TaskModelFloatVars */ - class Rounding : public gecode_boost::numeric::interval_lib::save_state {}; + class Rounding : public RoundingBase { + private: + /// The caller's rounding mode + Mode saved; + + public: + /// Save the caller's mode and initialize the rounding operations + Rounding(void); + /// Restore the caller's mode + ~Rounding(void); + /// A scope cannot be copied + Rounding(const Rounding&) = delete; + /// A scope cannot be assigned + Rounding& operator=(const Rounding&) = delete; + }; }} // namespace Gecode::Float @@ -444,13 +495,8 @@ namespace Gecode { friend FloatVal Float::hull(const FloatNum& x, const FloatNum& y); protected: - /// Used rounding policies - typedef Float::Rounding R; - /// Used checking policy - typedef gecode_boost::numeric::interval_lib::checking_strict P; /// Implementation type for float value - typedef gecode_boost::numeric::interval> - FloatValImpType; + typedef Float::Interval FloatValImpType; /// Implementation of float value FloatValImpType x; /// Initialize from implementation \a i diff --git a/gecode/float/num.hpp b/gecode/float/num.hpp index 41b6ba4eb8..d3ac156cb1 100644 --- a/gecode/float/num.hpp +++ b/gecode/float/num.hpp @@ -32,29 +32,34 @@ namespace Gecode { + /* + * The binary64 neighbours of pi, and their exact halves and doubles + * + */ + forceinline FloatNum pi_half_lower(void) { - return gecode_boost::numeric::interval_lib::constants::pi_half_lower(); + return 0x1.921fb54442d18p+0; } forceinline FloatNum pi_half_upper(void) { - return gecode_boost::numeric::interval_lib::constants::pi_half_upper(); + return 0x1.921fb54442d19p+0; } forceinline FloatNum pi_lower(void) { - return gecode_boost::numeric::interval_lib::constants::pi_lower(); + return 0x1.921fb54442d18p+1; } forceinline FloatNum pi_upper(void) { - return gecode_boost::numeric::interval_lib::constants::pi_upper(); + return 0x1.921fb54442d19p+1; } forceinline FloatNum pi_twice_lower(void) { - return gecode_boost::numeric::interval_lib::constants::pi_twice_lower(); + return 0x1.921fb54442d18p+2; } forceinline FloatNum pi_twice_upper(void) { - return gecode_boost::numeric::interval_lib::constants::pi_twice_upper(); + return 0x1.921fb54442d19p+2; } } // namespace Gecode diff --git a/gecode/float/rounding.hpp b/gecode/float/rounding.hpp index 085110a723..0a102b1d27 100644 --- a/gecode/float/rounding.hpp +++ b/gecode/float/rounding.hpp @@ -32,6 +32,107 @@ namespace Gecode { namespace Float { + /* + * Rounding mode control + * + */ + +#ifdef GECODE_FLOAT_MODE_CONTROL87 + + /** + * \brief Control word settings that RoundingBase writes with `_control87` + * + * Gecode writes the exception masks and the rounding control, and on x86 + * also the precision and infinity control, which x64 does not support. + * Besides the rounding direction, it masks all exceptions and, on x86, + * selects 64-bit precision and affine infinity. + */ + namespace Control87 { +#ifdef _M_IX86 + /// Fields that Gecode writes + constexpr unsigned int fields = _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC; + /// Settings of those fields besides the rounding direction + constexpr unsigned int base_settings = _MCW_EM | _PC_64 | _IC_AFFINE; +#else + /// Fields that Gecode writes + constexpr unsigned int fields = _MCW_EM | _MCW_RC; + /// Settings of those fields besides the rounding direction + constexpr unsigned int base_settings = _MCW_EM; +#endif + } // namespace Control87 + + forceinline RoundingBase::Mode + RoundingBase::current_mode(void) { + return _control87(0, 0); + } + forceinline void + RoundingBase::restore_mode(Mode m) { + _control87(m, Control87::fields); + } + forceinline void + RoundingBase::upward(void) { + _control87(Control87::base_settings | _RC_UP, Control87::fields); + } + forceinline void + RoundingBase::downward(void) { + _control87(Control87::base_settings | _RC_DOWN, Control87::fields); + } + forceinline void + RoundingBase::to_nearest(void) { + _control87(Control87::base_settings | _RC_NEAR, Control87::fields); + } + +#else + + forceinline RoundingBase::Mode + RoundingBase::current_mode(void) { + return std::fegetround(); + } + forceinline void + RoundingBase::restore_mode(Mode m) { + std::fesetround(m); + } + forceinline void + RoundingBase::upward(void) { + std::fesetround(FE_UPWARD); + } + forceinline void + RoundingBase::downward(void) { + std::fesetround(FE_DOWNWARD); + } + forceinline void + RoundingBase::to_nearest(void) { + std::fesetround(FE_TONEAREST); + } + +#endif + + forceinline void + RoundingBase::init(void) { +#ifndef GECODE_FLOAT_DIRECTED_PER_OPERATION + upward(); +#endif + } + + forceinline + Rounding::Rounding(void) + : saved(current_mode()) { + init(); + } + forceinline Rounding::~Rounding(void) { + restore_mode(saved); + } + + forceinline FloatNum + RoundingBase::nearest_median(FloatNum x, FloatNum y) { + to_nearest(); + const FloatNum m = barrier((barrier(x) + barrier(y)) / 2.0); +#ifndef GECODE_FLOAT_DIRECTED_PER_OPERATION + upward(); +#endif + return m; + } + forceinline FloatNum RoundingBase::median(FloatNum l, FloatNum u) { const FloatNum inf = std::numeric_limits::infinity(); @@ -47,8 +148,8 @@ namespace Gecode { namespace Float { const FloatNum h = max / 2.0; if ((u > h) || (l < -h)) - return std::ldexp(RoundingControl::median(l / 2.0, u / 2.0), 1); - return RoundingControl::median(l, u); + return std::ldexp(nearest_median(l / 2.0, u / 2.0), 1); + return nearest_median(l, u); } forceinline FloatNum @@ -65,63 +166,63 @@ namespace Gecode { namespace Float { return x; } -#if defined(_MSC_VER) && (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP > 0))) +#ifdef GECODE_FLOAT_DIRECTED_PER_OPERATION - // RoundingControl is rounded_arith_std: each operation sets its direction. + // Each operation sets its direction. forceinline FloatNum RoundingBase::add_down(FloatNum x, FloatNum y) { - RoundingControl::downward(); + downward(); return barrier(barrier(x) + barrier(y)); } forceinline FloatNum RoundingBase::add_up(FloatNum x, FloatNum y) { - RoundingControl::upward(); + upward(); return barrier(barrier(x) + barrier(y)); } forceinline FloatNum RoundingBase::sub_down(FloatNum x, FloatNum y) { - RoundingControl::downward(); + downward(); return barrier(barrier(x) - barrier(y)); } forceinline FloatNum RoundingBase::sub_up(FloatNum x, FloatNum y) { - RoundingControl::upward(); + upward(); return barrier(barrier(x) - barrier(y)); } forceinline FloatNum RoundingBase::mul_down(FloatNum x, FloatNum y) { - RoundingControl::downward(); + downward(); return barrier(barrier(x) * barrier(y)); } forceinline FloatNum RoundingBase::mul_up(FloatNum x, FloatNum y) { - RoundingControl::upward(); + upward(); return barrier(barrier(x) * barrier(y)); } forceinline FloatNum RoundingBase::div_down(FloatNum x, FloatNum y) { - RoundingControl::downward(); + downward(); return barrier(barrier(x) / barrier(y)); } forceinline FloatNum RoundingBase::div_up(FloatNum x, FloatNum y) { - RoundingControl::upward(); + upward(); return barrier(barrier(x) / barrier(y)); } forceinline FloatNum RoundingBase::sqrt_down(FloatNum x) { - RoundingControl::downward(); + downward(); return barrier(std::sqrt(barrier(x))); } forceinline FloatNum RoundingBase::sqrt_up(FloatNum x) { - RoundingControl::upward(); + upward(); return barrier(std::sqrt(barrier(x))); } #else - // RoundingControl is rounded_arith_opp: the mode stays upward. + // The mode stays upward. forceinline FloatNum RoundingBase::add_down(FloatNum x, FloatNum y) { return -barrier(barrier(-x) - barrier(y)); @@ -156,9 +257,9 @@ namespace Gecode { namespace Float { } forceinline FloatNum RoundingBase::sqrt_down(FloatNum x) { - RoundingControl::downward(); + downward(); const FloatNum r = barrier(std::sqrt(barrier(x))); - RoundingControl::upward(); + upward(); return r; } forceinline FloatNum diff --git a/gecode/float/val.hpp b/gecode/float/val.hpp index 0c726098de..a92108f0e2 100644 --- a/gecode/float/val.hpp +++ b/gecode/float/val.hpp @@ -52,7 +52,7 @@ namespace Gecode { forceinline FloatVal& FloatVal::operator=(const FloatNum& n) { - x = n; + x = Float::Interval(n); return *this; } @@ -71,7 +71,7 @@ namespace Gecode { } forceinline FloatNum FloatVal::size(void) const { - return gecode_boost::numeric::width(x); + return Float::width(x); } forceinline FloatNum FloatVal::med(void) const { @@ -81,19 +81,19 @@ namespace Gecode { forceinline bool FloatVal::tight(void) const { - return (gecode_boost::numeric::singleton(x) || (nextafter(x.lower(), x.upper()) == x.upper())); + return (Float::singleton(x) || (nextafter(x.lower(), x.upper()) == x.upper())); } forceinline bool FloatVal::singleton(void) const { - return gecode_boost::numeric::singleton(x); + return Float::singleton(x); } forceinline bool FloatVal::in(FloatNum n) const { - return gecode_boost::numeric::in(n, x); + return Float::in(n, x); } forceinline bool FloatVal::zero_in(void) const { - return gecode_boost::numeric::zero_in(x); + return Float::zero_in(x); } forceinline FloatVal @@ -103,17 +103,17 @@ namespace Gecode { } forceinline FloatVal FloatVal::pi_half(void) { - FloatVal p(gecode_boost::numeric::interval_lib::pi_half()); + FloatVal p(FloatValImpType::pi_half()); return p; } forceinline FloatVal FloatVal::pi(void) { - FloatVal p(gecode_boost::numeric::interval_lib::pi()); + FloatVal p(FloatValImpType::pi()); return p; } forceinline FloatVal FloatVal::pi_twice(void) { - FloatVal p(gecode_boost::numeric::interval_lib::pi_twice()); + FloatVal p(FloatValImpType::pi_twice()); return p; } @@ -226,109 +226,70 @@ namespace Gecode { return FloatVal(x / y.x); } - inline bool + /* + * The relations hold only if they hold for every pair of members of + * their operands ("certainly"). Equality of two values is equality of + * their bounds. + * + */ + + forceinline bool operator<(const FloatVal& x, const FloatVal& y) { - try { - return x.x < y.x; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_less(x.x, y.x); } - inline bool + forceinline bool operator<(const FloatVal& x, const FloatNum& y) { - try { - return x.x < y; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_less(x.x, y); } - inline bool + forceinline bool operator<=(const FloatVal& x, const FloatVal& y) { - try { - return x.x <= y.x; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_less_equal(x.x, y.x); } - inline bool + forceinline bool operator<=(const FloatVal& x, const FloatNum& y) { - try { - return x.x <= y; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_less_equal(x.x, y); } - inline bool + forceinline bool operator>(const FloatVal& x, const FloatVal& y) { - try { - return x.x > y.x; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_greater(x.x, y.x); } - inline bool + forceinline bool operator>(const FloatVal& x, const FloatNum& y) { - try { - return x.x > y; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_greater(x.x, y); } - inline bool + forceinline bool operator>=(const FloatVal& x, const FloatVal& y) { - try { - return x.x >= y.x; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_greater_equal(x.x, y.x); } - inline bool + forceinline bool operator>=(const FloatVal& x, const FloatNum& y) { - try { - return x.x >= y; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_greater_equal(x.x, y); } - inline bool + forceinline bool operator==(const FloatVal& x, const FloatVal& y) { - try { - return x.x == y.x; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::equal(x.x, y.x); } inline bool operator==(const FloatVal& x, const FloatNum& y) { - if (!gecode_boost::numeric::interval_lib::checking_strict::is_empty(x.x.lower(), x.x.upper())) { - if ((x.x.lower() == y) && (x.x.upper() == y)) - return true; - } + if ((x.x.lower() == y) && (x.x.upper() == y)) + return true; if (((x.x.lower() == y) && (nextafter(x.x.lower(), x.x.upper()) == x.x.upper())) || ((x.x.upper() == y) && (nextafter(x.x.upper(), x.x.lower()) == x.x.lower()))) return true; return false; } - inline bool + forceinline bool operator!=(const FloatVal& x, const FloatVal& y) { - try { - return x.x != y.x; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_unequal(x.x, y.x); } - inline bool + forceinline bool operator!=(const FloatVal& x, const FloatNum& y) { - try { - return x.x != y; - } catch (gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } + return Float::certainly_unequal(x.x, y); } forceinline bool diff --git a/test/array.cpp b/test/array.cpp index 963947d0b1..439910ff1e 100644 --- a/test/array.cpp +++ b/test/array.cpp @@ -103,6 +103,11 @@ namespace Test { static_assert(std::is_trivially_copyable_v>); #endif +#ifdef GECODE_HAS_FLOAT_VARS + // A float value is two bounds and stays trivially copyable. + static_assert(std::is_trivially_copyable_v); +#endif + /* * A home never changes its space, and a space is copied only by * cloning, so neither is assignable. diff --git a/test/float/arithmetic.cpp b/test/float/arithmetic.cpp index 4272ba1a77..09310c53f2 100644 --- a/test/float/arithmetic.cpp +++ b/test/float/arithmetic.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include namespace Test { namespace Float { @@ -55,24 +56,24 @@ namespace Test { namespace Float { * \ingroup TaskTestFloat */ //@{ - /// Rounding scopes and Boost wrappers restore the enclosing mode + // A copied scope would restore the caller's mode a second time. + static_assert(!std::is_copy_constructible_v && + !std::is_copy_assignable_v); + + /// Rounding scopes and interval operations restore the enclosing mode class RoundingScope : public Base { private: - template + /// Test interval operations that open their own rounding scope static bool - boost_operations(void) { - typedef gecode_boost::numeric::interval< - Gecode::FloatNum, - gecode_boost::numeric::interval_lib::policies< - Policy, gecode_boost::numeric::interval_lib::checking_strict>> - Interval; + interval_operations(void) { + using Gecode::Float::Interval; const int mode = std::fegetround(); - // Boost fmod uses its unprotected policy for nested arithmetic. - const Interval remainder = gecode_boost::numeric::fmod(Interval(5.0, 5.0), Interval(3.0, 3.0)); + // fmod runs its nested arithmetic in its own scope. + const Interval remainder = Gecode::Float::fmod(Interval(5.0, 5.0), Interval(3.0, 3.0)); bool result = (remainder.lower() == 2.0) && (remainder.upper() == 2.0) && (std::fegetround() == mode); #ifdef GECODE_HAS_MPFR - // Unprotected policies must retain Gecode's MPFR operations. - const Interval sine = gecode_boost::numeric::sin(Interval(0.5)); + // Nested operations must retain Gecode's MPFR operations. + const Interval sine = Gecode::Float::sin(Interval(0.5)); result &= (sine.lower() <= 0.479425538604203) && (sine.upper() >= 0.479425538604203) && (std::fegetround() == mode); #endif @@ -102,9 +103,12 @@ namespace Test { namespace Float { result &= inner.median(1.0, 3.0) == 2.0; } result &= std::fegetround() == enclosing; - result &= boost_operations(); - result &= boost_operations< - gecode_boost::numeric::interval_lib::save_state>(); + result &= interval_operations(); + { + Gecode::Float::Rounding nested; + result &= interval_operations(); + } + result &= std::fegetround() == enclosing; } if (std::fegetround() != mode) { olog << "Rounding scope changed caller mode " << mode << '\n'; diff --git a/test/float/interval-oracle.cpp b/test/float/interval-oracle.cpp index f0c639a515..dcb522e744 100644 --- a/test/float/interval-oracle.cpp +++ b/test/float/interval-oracle.cpp @@ -31,14 +31,16 @@ */ /* - * Temporary differential test: Float::Interval against the vendored Boost - * interval that FloatVal uses today. It is removed together with the Boost - * copy. + * Temporary differential test: FloatVal, and Float::Interval where FloatVal + * does not forward to it, against the vendored Boost interval that FloatVal + * used before. It is removed together with the Boost copy. * */ #include "test/float.hh" +#include + #include #include #include @@ -55,14 +57,34 @@ namespace Test { namespace Float { namespace { using Gecode::FloatNum; - /// The interval type under test - using Candidate = Gecode::Float::Interval; - /// FloatVal's implementation type, which gives the expected results - using Reference = gecode_boost::numeric::interval< - FloatNum, gecode_boost::numeric::interval_lib::policies< - Gecode::Float::Rounding, gecode_boost::numeric::interval_lib::checking_strict>>; + using Gecode::FloatVal; + using Gecode::Float::Interval; + + /// Boost's rounding interface over Gecode's rounding operations and mode control + class ReferenceRounding : public Gecode::Float::RoundingBase { + public: + /// Rounding mode, as Boost's save_state stores it + typedef Mode rounding_mode; + /// Store the current rounding mode in \a m + static void + get_rounding_mode(rounding_mode& m) { + m = current_mode(); + } + /// Restore rounding mode \a m + static void + set_rounding_mode(rounding_mode m) { + restore_mode(m); + } + using RoundingBase::init; + }; + + /// FloatVal's former implementation type, which gives the expected results + using Reference = + gecode_boost::numeric::interval, + gecode_boost::numeric::interval_lib::checking_strict>>; - namespace candidate = Gecode::Float; namespace reference = gecode_boost::numeric; /// Bounds of an operand interval @@ -143,7 +165,7 @@ namespace Test { namespace Float { namespace { /// Observed result of one operation in one caller mode struct Outcome { Kind kind = Kind::BOUNDS; - /// Bit patterns of the bounds, for Kind::BOUNDS + /// Bit patterns of the bounds, as bound_bits() gives them, for Kind::BOUNDS std::uint64_t lower = 0; std::uint64_t upper = 0; /// Truth value, for Kind::TRUTH @@ -155,17 +177,34 @@ namespace Test { namespace Float { namespace { bool operator==(const Outcome&) const = default; }; + /** + * \brief Return the bit pattern of bound \a b, without the sign of a NaN + * + * IEEE 754 leaves the sign of a NaN result unspecified. On x86-64 it + * depends on the operand order that the compiler picks, so GCC and Clang + * builds of the same code differ in it. All other bits of a NaN, its + * payload and its quiet bit, are compared. + */ + std::uint64_t + bound_bits(FloatNum b) { + return std::bit_cast(std::isnan(b) ? std::fabs(b) : b); + } /// Return the outcome for the bounds \a l and \a u Outcome bounds_outcome(FloatNum l, FloatNum u) { Outcome o; - o.lower = std::bit_cast(l); - o.upper = std::bit_cast(u); + o.lower = bound_bits(l); + o.upper = bound_bits(u); return o; } + /// Return the outcome for value \a x + Outcome + outcome_of(const FloatVal& x) { + return bounds_outcome(x.min(), x.max()); + } /// Return the outcome for interval \a x Outcome - outcome_of(const Candidate& x) { + outcome_of(const Interval& x) { return bounds_outcome(x.lower(), x.upper()); } /// Return the outcome for interval \a x @@ -247,7 +286,7 @@ namespace Test { namespace Float { namespace { return s + (o.mode_kept ? "" : " (mode changed)"); } - /// Float::Interval gives the vendored Boost interval's results bit for bit + /// FloatVal and Float::Interval give the vendored Boost interval's results bit for bit class MatchesBoost : public Base { private: /// Most mismatches to log @@ -275,29 +314,29 @@ namespace Test { namespace Float { namespace { } } - /// Compare the default interval and the constants + /// Compare the default value and the constants void constants(void) { operands = ""; - compare("default", [] { return Candidate(); }, [] { return Reference(); }); + compare("default", [] { return FloatVal(); }, [] { return Reference(); }); compare( - "pi_half", [] { return Candidate::pi_half(); }, + "pi_half", [] { return FloatVal::pi_half(); }, [] { return reference::interval_lib::pi_half(); }); - compare("pi", [] { return Candidate::pi(); }, [] { return reference::interval_lib::pi(); }); + compare("pi", [] { return FloatVal::pi(); }, [] { return reference::interval_lib::pi(); }); compare( - "pi_twice", [] { return Candidate::pi_twice(); }, + "pi_twice", [] { return FloatVal::pi_twice(); }, [] { return reference::interval_lib::pi_twice(); }); } /// Compare construction from \a n void from_number(FloatNum n) { operands = hex(n); - compare("from_number", [&] { return Candidate(n); }, [&] { return Reference(n); }); + compare("from_number", [&] { return FloatVal(n); }, [&] { return Reference(n); }); compare( "assign_number", [&] { - Candidate z(1.0, 2.0); - z = Candidate(n); + FloatVal z(1.0, 2.0); + z = n; return z; }, [&] { @@ -310,11 +349,11 @@ namespace Test { namespace Float { namespace { void from_numbers(FloatNum l, FloatNum u) { operands = hex(l) + ' ' + hex(u); - compare("construct", [&] { return Candidate(l, u); }, [&] { return Reference(l, u); }); + compare("construct", [&] { return FloatVal(l, u); }, [&] { return Reference(l, u); }); compare( "assign", [&] { - Candidate z; + FloatVal z; z.assign(l, u); return z; }, @@ -328,60 +367,61 @@ namespace Test { namespace Float { namespace { void unary(const Bounds& b) { operands = hex(b); - const Candidate cx = candidate_interval(b); - const Reference rx = reference_interval(b); - compare("pos", [&] { return +cx; }, [&] { return +rx; }); - compare("neg", [&] { return -cx; }, [&] { return -rx; }); - compare("abs", [&] { return candidate::abs(cx); }, [&] { return reference::abs(rx); }); - compare("sqrt", [&] { return candidate::sqrt(cx); }, [&] { return reference::sqrt(rx); }); - compare("square", [&] { return candidate::square(cx); }, [&] { return reference::square(rx); }); + const FloatVal x = value_of(b); + const Reference rx = reference_of(b); + compare("pos", [&] { return +x; }, [&] { return +rx; }); + // FloatVal's negation makes zero bounds positive and was never Boost's. + const Interval ix = interval_of(b); + compare("neg", [&] { return -ix; }, [&] { return -rx; }); + compare("abs", [&] { return Gecode::abs(x); }, [&] { return reference::abs(rx); }); + compare("sqrt", [&] { return Gecode::sqrt(x); }, [&] { return reference::sqrt(rx); }); + compare("sqr", [&] { return Gecode::sqr(x); }, [&] { return reference::square(rx); }); for (int n = -3; n <= 5; n++) { operands = hex(b) + " pow " + std::to_string(n); - compare("pow", [&] { return candidate::pow(cx, n); }, [&] { return reference::pow(rx, n); }); + compare("pow", [&] { return Gecode::pow(x, n); }, [&] { return reference::pow(rx, n); }); } for (int k = 1; k <= 5; k++) { operands = hex(b) + " root " + std::to_string(k); - compare( - "nth_root", [&] { return candidate::nth_root(cx, k); }, [&] { return reference::nth_root(rx, k); }); + compare("nroot", [&] { return Gecode::nroot(x, k); }, [&] { return reference::nth_root(rx, k); }); } operands = hex(b); - compare("width", [&] { return candidate::width(cx); }, [&] { return reference::width(rx); }); - compare("singleton", [&] { return candidate::singleton(cx); }, [&] { return reference::singleton(rx); }); - compare("zero_in", [&] { return candidate::zero_in(cx); }, [&] { return reference::zero_in(rx); }); + compare("size", [&] { return x.size(); }, [&] { return reference::width(rx); }); + compare("singleton", [&] { return x.singleton(); }, [&] { return reference::singleton(rx); }); + compare("zero_in", [&] { return x.zero_in(); }, [&] { return reference::zero_in(rx); }); #ifdef GECODE_HAS_MPFR - compare("exp", [&] { return candidate::exp(cx); }, [&] { return reference::exp(rx); }); - compare("log", [&] { return candidate::log(cx); }, [&] { return reference::log(rx); }); - compare("sin", [&] { return candidate::sin(cx); }, [&] { return reference::sin(rx); }); - compare("cos", [&] { return candidate::cos(cx); }, [&] { return reference::cos(rx); }); - compare("tan", [&] { return candidate::tan(cx); }, [&] { return reference::tan(rx); }); - compare("asin", [&] { return candidate::asin(cx); }, [&] { return reference::asin(rx); }); - compare("acos", [&] { return candidate::acos(cx); }, [&] { return reference::acos(rx); }); - compare("atan", [&] { return candidate::atan(cx); }, [&] { return reference::atan(rx); }); - compare("sinh", [&] { return candidate::sinh(cx); }, [&] { return reference::sinh(rx); }); - compare("cosh", [&] { return candidate::cosh(cx); }, [&] { return reference::cosh(rx); }); - compare("tanh", [&] { return candidate::tanh(cx); }, [&] { return reference::tanh(rx); }); - compare("asinh", [&] { return candidate::asinh(cx); }, [&] { return reference::asinh(rx); }); - compare("acosh", [&] { return candidate::acosh(cx); }, [&] { return reference::acosh(rx); }); - compare("atanh", [&] { return candidate::atanh(cx); }, [&] { return reference::atanh(rx); }); + compare("exp", [&] { return Gecode::exp(x); }, [&] { return reference::exp(rx); }); + compare("log", [&] { return Gecode::log(x); }, [&] { return reference::log(rx); }); + compare("sin", [&] { return Gecode::sin(x); }, [&] { return reference::sin(rx); }); + compare("cos", [&] { return Gecode::cos(x); }, [&] { return reference::cos(rx); }); + compare("tan", [&] { return Gecode::tan(x); }, [&] { return reference::tan(rx); }); + compare("asin", [&] { return Gecode::asin(x); }, [&] { return reference::asin(rx); }); + compare("acos", [&] { return Gecode::acos(x); }, [&] { return reference::acos(rx); }); + compare("atan", [&] { return Gecode::atan(x); }, [&] { return reference::atan(rx); }); + compare("sinh", [&] { return Gecode::sinh(x); }, [&] { return reference::sinh(rx); }); + compare("cosh", [&] { return Gecode::cosh(x); }, [&] { return reference::cosh(rx); }); + compare("tanh", [&] { return Gecode::tanh(x); }, [&] { return reference::tanh(rx); }); + compare("asinh", [&] { return Gecode::asinh(x); }, [&] { return reference::asinh(rx); }); + compare("acosh", [&] { return Gecode::acosh(x); }, [&] { return reference::acosh(rx); }); + compare("atanh", [&] { return Gecode::atanh(x); }, [&] { return reference::atanh(rx); }); #endif } /// Compare the operations on the intervals \a a and \a b void binary(const Bounds& a, const Bounds& b) { operands = hex(a) + ' ' + hex(b); - const Candidate cx = candidate_interval(a); - const Candidate cy = candidate_interval(b); - const Reference rx = reference_interval(a); - const Reference ry = reference_interval(b); - compare("add", [&] { return cx + cy; }, [&] { return rx + ry; }); - compare("sub", [&] { return cx - cy; }, [&] { return rx - ry; }); - compare("mul", [&] { return cx * cy; }, [&] { return rx * ry; }); - compare("div", [&] { return cx / cy; }, [&] { return rx / ry; }); + const FloatVal x = value_of(a); + const FloatVal y = value_of(b); + const Reference rx = reference_of(a); + const Reference ry = reference_of(b); + compare("add", [&] { return x + y; }, [&] { return rx + ry; }); + compare("sub", [&] { return x - y; }, [&] { return rx - ry; }); + compare("mul", [&] { return x * y; }, [&] { return rx * ry; }); + compare("div", [&] { return x / y; }, [&] { return rx / ry; }); compare( "add_assign", [&] { - Candidate z = cx; - return z += cy; + FloatVal z = x; + return z += y; }, [&] { Reference z = rx; @@ -390,8 +430,8 @@ namespace Test { namespace Float { namespace { compare( "sub_assign", [&] { - Candidate z = cx; - return z -= cy; + FloatVal z = x; + return z -= y; }, [&] { Reference z = rx; @@ -400,8 +440,8 @@ namespace Test { namespace Float { namespace { compare( "mul_assign", [&] { - Candidate z = cx; - return z *= cy; + FloatVal z = x; + return z *= y; }, [&] { Reference z = rx; @@ -410,62 +450,59 @@ namespace Test { namespace Float { namespace { compare( "div_assign", [&] { - Candidate z = cx; - return z /= cy; + FloatVal z = x; + return z /= y; }, [&] { Reference z = rx; return z /= ry; }); + compare("lt", [&] { return x < y; }, [&] { return certainly([&] { return rx < ry; }); }); + compare("le", [&] { return x <= y; }, [&] { return certainly([&] { return rx <= ry; }); }); + compare("gt", [&] { return x > y; }, [&] { return certainly([&] { return rx > ry; }); }); + compare("ge", [&] { return x >= y; }, [&] { return certainly([&] { return rx >= ry; }); }); + compare("eq", [&] { return x == y; }, [&] { return certainly([&] { return rx == ry; }); }); + compare("ne", [&] { return x != y; }, [&] { return certainly([&] { return rx != ry; }); }); + compare("equal", [&] { return x == y; }, [&] { return reference::equal(rx, ry); }); + compare("max", [&] { return Gecode::max(x, y); }, [&] { return reference::max(rx, ry); }); + compare("min", [&] { return Gecode::min(x, y); }, [&] { return reference::min(rx, ry); }); + compare("subset", [&] { return Gecode::Float::subset(x, y); }, [&] { return reference::subset(rx, ry); }); compare( - "lt", [&] { return candidate::certainly_less(cx, cy); }, - [&] { return certainly([&] { return rx < ry; }); }); - compare( - "le", [&] { return candidate::certainly_less_equal(cx, cy); }, - [&] { return certainly([&] { return rx <= ry; }); }); - compare( - "gt", [&] { return candidate::certainly_greater(cx, cy); }, - [&] { return certainly([&] { return rx > ry; }); }); - compare( - "ge", [&] { return candidate::certainly_greater_equal(cx, cy); }, - [&] { return certainly([&] { return rx >= ry; }); }); - compare( - "eq", [&] { return candidate::equal(cx, cy); }, [&] { return certainly([&] { return rx == ry; }); }); - compare( - "ne", [&] { return candidate::certainly_unequal(cx, cy); }, - [&] { return certainly([&] { return rx != ry; }); }); - compare("max", [&] { return candidate::max(cx, cy); }, [&] { return reference::max(rx, ry); }); - compare("min", [&] { return candidate::min(cx, cy); }, [&] { return reference::min(rx, ry); }); - compare("subset", [&] { return candidate::subset(cx, cy); }, [&] { return reference::subset(rx, ry); }); - compare( - "proper_subset", [&] { return candidate::proper_subset(cx, cy); }, + "proper_subset", [&] { return Gecode::Float::proper_subset(x, y); }, [&] { return reference::proper_subset(rx, ry); }); - compare("overlap", [&] { return candidate::overlap(cx, cy); }, [&] { return reference::overlap(rx, ry); }); - compare("equal", [&] { return candidate::equal(cx, cy); }, [&] { return reference::equal(rx, ry); }); compare( - "intersect", [&] { return candidate::intersect(cx, cy); }, + "overlap", [&] { return Gecode::Float::overlap(x, y); }, [&] { return reference::overlap(rx, ry); }); + compare( + "intersect", [&] { return Gecode::Float::intersect(x, y); }, [&] { return reference::intersect(rx, ry); }); - compare("hull", [&] { return candidate::hull(cx, cy); }, [&] { return reference::hull(rx, ry); }); - compare("fmod", [&] { return candidate::fmod(cx, cy); }, [&] { return reference::fmod(rx, ry); }); + compare("hull", [&] { return Gecode::Float::hull(x, y); }, [&] { return reference::hull(rx, ry); }); +#ifdef GECODE_HAS_MPFR + compare("fmod", [&] { return Gecode::fmod(x, y); }, [&] { return reference::fmod(rx, ry); }); +#else + // FloatVal has fmod only with MPFR. + const Interval ix = interval_of(a); + const Interval iy = interval_of(b); + compare("fmod", [&] { return Gecode::Float::fmod(ix, iy); }, [&] { return reference::fmod(rx, ry); }); +#endif } /// Compare the operations on the interval \a b and the number \a n void mixed(const Bounds& b, FloatNum n) { operands = hex(b) + ' ' + hex(n); - const Candidate cx = candidate_interval(b); - const Reference rx = reference_interval(b); - compare("add", [&] { return cx + n; }, [&] { return rx + n; }); - compare("add_left", [&] { return n + cx; }, [&] { return n + rx; }); - compare("sub", [&] { return cx - n; }, [&] { return rx - n; }); - compare("sub_left", [&] { return n - cx; }, [&] { return n - rx; }); - compare("mul", [&] { return cx * n; }, [&] { return rx * n; }); - compare("mul_left", [&] { return n * cx; }, [&] { return n * rx; }); - compare("div", [&] { return cx / n; }, [&] { return rx / n; }); - compare("div_left", [&] { return n / cx; }, [&] { return n / rx; }); + const FloatVal x = value_of(b); + const Reference rx = reference_of(b); + compare("add", [&] { return x + n; }, [&] { return rx + n; }); + compare("add_left", [&] { return n + x; }, [&] { return n + rx; }); + compare("sub", [&] { return x - n; }, [&] { return rx - n; }); + compare("sub_left", [&] { return n - x; }, [&] { return n - rx; }); + compare("mul", [&] { return x * n; }, [&] { return rx * n; }); + compare("mul_left", [&] { return n * x; }, [&] { return n * rx; }); + compare("div", [&] { return x / n; }, [&] { return rx / n; }); + compare("div_left", [&] { return n / x; }, [&] { return n / rx; }); compare( "add_assign", [&] { - Candidate z = cx; + FloatVal z = x; return z += n; }, [&] { @@ -475,7 +512,7 @@ namespace Test { namespace Float { namespace { compare( "sub_assign", [&] { - Candidate z = cx; + FloatVal z = x; return z -= n; }, [&] { @@ -485,7 +522,7 @@ namespace Test { namespace Float { namespace { compare( "mul_assign", [&] { - Candidate z = cx; + FloatVal z = x; return z *= n; }, [&] { @@ -495,47 +532,55 @@ namespace Test { namespace Float { namespace { compare( "div_assign", [&] { - Candidate z = cx; + FloatVal z = x; return z /= n; }, [&] { Reference z = rx; return z /= n; }); - compare( - "lt", [&] { return candidate::certainly_less(cx, n); }, - [&] { return certainly([&] { return rx < n; }); }); - compare( - "le", [&] { return candidate::certainly_less_equal(cx, n); }, - [&] { return certainly([&] { return rx <= n; }); }); - compare( - "gt", [&] { return candidate::certainly_greater(cx, n); }, - [&] { return certainly([&] { return rx > n; }); }); - compare( - "ge", [&] { return candidate::certainly_greater_equal(cx, n); }, - [&] { return certainly([&] { return rx >= n; }); }); - compare( - "ne", [&] { return candidate::certainly_unequal(cx, n); }, - [&] { return certainly([&] { return rx != n; }); }); - compare("max", [&] { return candidate::max(cx, n); }, [&] { return reference::max(rx, n); }); - compare("max_left", [&] { return candidate::max(n, cx); }, [&] { return reference::max(n, rx); }); - compare("min", [&] { return candidate::min(cx, n); }, [&] { return reference::min(rx, n); }); - compare("min_left", [&] { return candidate::min(n, cx); }, [&] { return reference::min(n, rx); }); - compare("hull", [&] { return candidate::hull(cx, n); }, [&] { return reference::hull(rx, n); }); - compare("hull_left", [&] { return candidate::hull(n, cx); }, [&] { return reference::hull(n, rx); }); - compare("in", [&] { return candidate::in(n, cx); }, [&] { return reference::in(n, rx); }); - compare("fmod", [&] { return candidate::fmod(cx, n); }, [&] { return reference::fmod(rx, n); }); - compare("fmod_left", [&] { return candidate::fmod(n, cx); }, [&] { return reference::fmod(n, rx); }); + compare("lt", [&] { return x < n; }, [&] { return certainly([&] { return rx < n; }); }); + compare("le", [&] { return x <= n; }, [&] { return certainly([&] { return rx <= n; }); }); + compare("gt", [&] { return x > n; }, [&] { return certainly([&] { return rx > n; }); }); + compare("ge", [&] { return x >= n; }, [&] { return certainly([&] { return rx >= n; }); }); + compare("ne", [&] { return x != n; }, [&] { return certainly([&] { return rx != n; }); }); + // Boost has no comparisons with the number on the left; FloatVal mirrors them. + compare("lt_left", [&] { return n < x; }, [&] { return certainly([&] { return rx > n; }); }); + compare("le_left", [&] { return n <= x; }, [&] { return certainly([&] { return rx >= n; }); }); + compare("gt_left", [&] { return n > x; }, [&] { return certainly([&] { return rx < n; }); }); + compare("ge_left", [&] { return n >= x; }, [&] { return certainly([&] { return rx <= n; }); }); + compare("ne_left", [&] { return n != x; }, [&] { return certainly([&] { return rx != n; }); }); + compare("max", [&] { return Gecode::max(x, n); }, [&] { return reference::max(rx, n); }); + compare("max_left", [&] { return Gecode::max(n, x); }, [&] { return reference::max(n, rx); }); + compare("min", [&] { return Gecode::min(x, n); }, [&] { return reference::min(rx, n); }); + compare("min_left", [&] { return Gecode::min(n, x); }, [&] { return reference::min(n, rx); }); + compare("hull", [&] { return Gecode::Float::hull(x, n); }, [&] { return reference::hull(rx, n); }); + compare("hull_left", [&] { return Gecode::Float::hull(n, x); }, [&] { return reference::hull(n, rx); }); + compare("in", [&] { return x.in(n); }, [&] { return reference::in(n, rx); }); +#ifdef GECODE_HAS_MPFR + compare("fmod", [&] { return Gecode::fmod(x, n); }, [&] { return reference::fmod(rx, n); }); + compare("fmod_left", [&] { return Gecode::fmod(n, x); }, [&] { return reference::fmod(n, rx); }); +#else + // FloatVal has fmod only with MPFR. + const Interval ix = interval_of(b); + compare("fmod", [&] { return Gecode::Float::fmod(ix, n); }, [&] { return reference::fmod(rx, n); }); + compare("fmod_left", [&] { return Gecode::Float::fmod(n, ix); }, [&] { return reference::fmod(n, rx); }); +#endif } - /// Return the candidate interval with bounds \a b - static Candidate - candidate_interval(const Bounds& b) { - return std::isnan(b.lower) ? Candidate(b.lower) : Candidate(b.lower, b.upper); + /// Return the value with bounds \a b + static FloatVal + value_of(const Bounds& b) { + return std::isnan(b.lower) ? FloatVal(b.lower) : FloatVal(b.lower, b.upper); + } + /// Return the interval with bounds \a b + static Interval + interval_of(const Bounds& b) { + return std::isnan(b.lower) ? Interval(b.lower) : Interval(b.lower, b.upper); } /// Return the reference interval with bounds \a b static Reference - reference_interval(const Bounds& b) { + reference_of(const Bounds& b) { return std::isnan(b.lower) ? Reference(b.lower) : Reference(b.lower, b.upper); } From f4f8eca4dc60c3bc456538a0354da5a593566335 Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Wed, 4 Nov 2026 15:28:17 +0100 Subject: [PATCH 4/5] Remove the vendored Boost copy gecode/third-party and the temporary differential test are gone, together with every reference in the build, checks, Doxygen configuration, and documentation. Gecode no longer installs Boost headers or LICENSE_1_0.txt. Float::ScaleView is now trivially copyable like FloatVal, so the value-parameter check needs no allowed types; FloatVal is still passed by const& by convention. Zdev-Change-Id: Z93535760ded6e8a1ccd7d757347f7ece740feaa173116d8fc9850bde12deb770 --- .clang-tidy | 5 +- CMakeLists.txt | 3 +- cmake/GecodeSources.cmake | 1 - docs/code-style.md | 10 +- doxygen/doxygen.conf.in | 1 - gecode/third-party/boost/LICENSE_1_0.txt | 23 - gecode/third-party/boost/config.hpp | 70 -- .../boost/config/abi/borland_prefix.hpp | 27 - .../boost/config/abi/borland_suffix.hpp | 12 - .../boost/config/abi/msvc_prefix.hpp | 22 - .../boost/config/abi/msvc_suffix.hpp | 8 - .../third-party/boost/config/abi_prefix.hpp | 25 - .../third-party/boost/config/abi_suffix.hpp | 27 - .../boost/config/compiler/borland.hpp | 284 -------- .../boost/config/compiler/clang.hpp | 85 --- .../boost/config/compiler/codegear.hpp | 178 ----- .../boost/config/compiler/comeau.hpp | 59 -- .../boost/config/compiler/common_edg.hpp | 100 --- .../boost/config/compiler/compaq_cxx.hpp | 19 - .../boost/config/compiler/digitalmars.hpp | 100 --- .../third-party/boost/config/compiler/gcc.hpp | 248 ------- .../boost/config/compiler/gcc_xml.hpp | 58 -- .../boost/config/compiler/greenhills.hpp | 28 - .../boost/config/compiler/hp_acc.hpp | 137 ---- .../boost/config/compiler/intel.hpp | 243 ------- .../third-party/boost/config/compiler/kai.hpp | 33 - .../boost/config/compiler/metrowerks.hpp | 141 ---- .../third-party/boost/config/compiler/mpw.hpp | 83 --- .../boost/config/compiler/nvcc.hpp | 28 - .../boost/config/compiler/pathscale.hpp | 79 --- .../third-party/boost/config/compiler/pgi.hpp | 79 --- .../boost/config/compiler/sgi_mipspro.hpp | 29 - .../boost/config/compiler/sunpro_cc.hpp | 146 ---- .../boost/config/compiler/vacpp.hpp | 119 ---- .../boost/config/compiler/visualc.hpp | 283 -------- .../third-party/boost/config/no_tr1/cmath.hpp | 28 - .../boost/config/no_tr1/utility.hpp | 28 - .../third-party/boost/config/platform/aix.hpp | 33 - .../boost/config/platform/amigaos.hpp | 15 - .../boost/config/platform/beos.hpp | 26 - .../third-party/boost/config/platform/bsd.hpp | 86 --- .../boost/config/platform/cygwin.hpp | 58 -- .../boost/config/platform/hpux.hpp | 87 --- .../boost/config/platform/irix.hpp | 31 - .../boost/config/platform/linux.hpp | 103 --- .../boost/config/platform/macos.hpp | 87 --- .../boost/config/platform/qnxnto.hpp | 31 - .../boost/config/platform/solaris.hpp | 28 - .../boost/config/platform/symbian.hpp | 97 --- .../third-party/boost/config/platform/vms.hpp | 25 - .../boost/config/platform/vxworks.hpp | 31 - .../boost/config/platform/win32.hpp | 69 -- .../boost/config/posix_features.hpp | 95 --- .../boost/config/select_compiler_config.hpp | 108 --- .../boost/config/select_platform_config.hpp | 101 --- .../boost/config/select_stdlib_config.hpp | 85 --- .../boost/config/stdlib/dinkumware.hpp | 145 ---- .../boost/config/stdlib/libcomo.hpp | 69 -- .../boost/config/stdlib/libcpp.hpp | 36 - .../boost/config/stdlib/libstdcpp3.hpp | 155 ---- .../boost/config/stdlib/modena.hpp | 53 -- .../third-party/boost/config/stdlib/msl.hpp | 81 --- .../boost/config/stdlib/roguewave.hpp | 183 ----- .../third-party/boost/config/stdlib/sgi.hpp | 145 ---- .../boost/config/stdlib/stlport.hpp | 244 ------- .../third-party/boost/config/stdlib/vacpp.hpp | 51 -- gecode/third-party/boost/config/suffix.hpp | 671 ------------------ gecode/third-party/boost/config/user.hpp | 124 ---- gecode/third-party/boost/detail/endian.hpp | 78 -- gecode/third-party/boost/detail/limits.hpp | 449 ------------ gecode/third-party/boost/extract.py | 93 --- gecode/third-party/boost/limits.hpp | 146 ---- gecode/third-party/boost/non_type.hpp | 27 - gecode/third-party/boost/numeric/interval.hpp | 32 - .../boost/numeric/interval/arith.hpp | 305 -------- .../boost/numeric/interval/arith2.hpp | 305 -------- .../boost/numeric/interval/arith3.hpp | 69 -- .../boost/numeric/interval/checking.hpp | 130 ---- .../boost/numeric/interval/compare.hpp | 19 - .../numeric/interval/compare/certain.hpp | 113 --- .../numeric/interval/compare/explicit.hpp | 248 ------- .../interval/compare/lexicographic.hpp | 122 ---- .../numeric/interval/compare/possible.hpp | 113 --- .../boost/numeric/interval/compare/set.hpp | 107 --- .../boost/numeric/interval/constants.hpp | 85 --- .../detail/alpha_rounding_control.hpp | 113 --- .../interval/detail/bcc_rounding_control.hpp | 57 -- .../boost/numeric/interval/detail/bugs.hpp | 79 --- .../interval/detail/c99_rounding_control.hpp | 50 -- .../detail/c99sub_rounding_control.hpp | 43 -- .../numeric/interval/detail/division.hpp | 194 ----- .../interval/detail/ia64_rounding_control.hpp | 83 --- .../interval/detail/interval_prototype.hpp | 41 -- .../interval/detail/msvc_rounding_control.hpp | 104 --- .../detail/msvc_rounding_control.hpp.orig | 100 --- .../interval/detail/ppc_rounding_control.hpp | 107 --- .../detail/sparc_rounding_control.hpp | 112 --- .../numeric/interval/detail/test_input.hpp | 76 -- .../interval/detail/x86_rounding_control.hpp | 108 --- .../detail/x86gcc_rounding_control.hpp | 51 -- .../boost/numeric/interval/hw_rounding.hpp | 78 -- .../boost/numeric/interval/interval.hpp | 451 ------------ .../boost/numeric/interval/policies.hpp | 75 -- .../boost/numeric/interval/rounded_arith.hpp | 146 ---- .../boost/numeric/interval/rounded_transc.hpp | 140 ---- .../boost/numeric/interval/rounding.hpp | 101 --- .../boost/numeric/interval/transc.hpp | 232 ------ .../boost/numeric/interval/utility.hpp | 336 --------- gecode/third-party/boost/patch.txt | 16 - gecode/third-party/boost/type.hpp | 18 - misc/check.py | 6 +- test/array.cpp | 1 + test/float/interval-oracle.cpp | 626 ---------------- 113 files changed, 9 insertions(+), 11978 deletions(-) delete mode 100644 gecode/third-party/boost/LICENSE_1_0.txt delete mode 100644 gecode/third-party/boost/config.hpp delete mode 100644 gecode/third-party/boost/config/abi/borland_prefix.hpp delete mode 100644 gecode/third-party/boost/config/abi/borland_suffix.hpp delete mode 100644 gecode/third-party/boost/config/abi/msvc_prefix.hpp delete mode 100644 gecode/third-party/boost/config/abi/msvc_suffix.hpp delete mode 100644 gecode/third-party/boost/config/abi_prefix.hpp delete mode 100644 gecode/third-party/boost/config/abi_suffix.hpp delete mode 100644 gecode/third-party/boost/config/compiler/borland.hpp delete mode 100644 gecode/third-party/boost/config/compiler/clang.hpp delete mode 100644 gecode/third-party/boost/config/compiler/codegear.hpp delete mode 100644 gecode/third-party/boost/config/compiler/comeau.hpp delete mode 100644 gecode/third-party/boost/config/compiler/common_edg.hpp delete mode 100644 gecode/third-party/boost/config/compiler/compaq_cxx.hpp delete mode 100644 gecode/third-party/boost/config/compiler/digitalmars.hpp delete mode 100644 gecode/third-party/boost/config/compiler/gcc.hpp delete mode 100644 gecode/third-party/boost/config/compiler/gcc_xml.hpp delete mode 100644 gecode/third-party/boost/config/compiler/greenhills.hpp delete mode 100644 gecode/third-party/boost/config/compiler/hp_acc.hpp delete mode 100644 gecode/third-party/boost/config/compiler/intel.hpp delete mode 100644 gecode/third-party/boost/config/compiler/kai.hpp delete mode 100644 gecode/third-party/boost/config/compiler/metrowerks.hpp delete mode 100644 gecode/third-party/boost/config/compiler/mpw.hpp delete mode 100644 gecode/third-party/boost/config/compiler/nvcc.hpp delete mode 100644 gecode/third-party/boost/config/compiler/pathscale.hpp delete mode 100644 gecode/third-party/boost/config/compiler/pgi.hpp delete mode 100644 gecode/third-party/boost/config/compiler/sgi_mipspro.hpp delete mode 100644 gecode/third-party/boost/config/compiler/sunpro_cc.hpp delete mode 100644 gecode/third-party/boost/config/compiler/vacpp.hpp delete mode 100644 gecode/third-party/boost/config/compiler/visualc.hpp delete mode 100644 gecode/third-party/boost/config/no_tr1/cmath.hpp delete mode 100644 gecode/third-party/boost/config/no_tr1/utility.hpp delete mode 100644 gecode/third-party/boost/config/platform/aix.hpp delete mode 100644 gecode/third-party/boost/config/platform/amigaos.hpp delete mode 100644 gecode/third-party/boost/config/platform/beos.hpp delete mode 100644 gecode/third-party/boost/config/platform/bsd.hpp delete mode 100644 gecode/third-party/boost/config/platform/cygwin.hpp delete mode 100644 gecode/third-party/boost/config/platform/hpux.hpp delete mode 100644 gecode/third-party/boost/config/platform/irix.hpp delete mode 100644 gecode/third-party/boost/config/platform/linux.hpp delete mode 100644 gecode/third-party/boost/config/platform/macos.hpp delete mode 100644 gecode/third-party/boost/config/platform/qnxnto.hpp delete mode 100644 gecode/third-party/boost/config/platform/solaris.hpp delete mode 100644 gecode/third-party/boost/config/platform/symbian.hpp delete mode 100644 gecode/third-party/boost/config/platform/vms.hpp delete mode 100644 gecode/third-party/boost/config/platform/vxworks.hpp delete mode 100644 gecode/third-party/boost/config/platform/win32.hpp delete mode 100644 gecode/third-party/boost/config/posix_features.hpp delete mode 100644 gecode/third-party/boost/config/select_compiler_config.hpp delete mode 100644 gecode/third-party/boost/config/select_platform_config.hpp delete mode 100644 gecode/third-party/boost/config/select_stdlib_config.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/dinkumware.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/libcomo.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/libcpp.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/libstdcpp3.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/modena.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/msl.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/roguewave.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/sgi.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/stlport.hpp delete mode 100644 gecode/third-party/boost/config/stdlib/vacpp.hpp delete mode 100644 gecode/third-party/boost/config/suffix.hpp delete mode 100644 gecode/third-party/boost/config/user.hpp delete mode 100644 gecode/third-party/boost/detail/endian.hpp delete mode 100644 gecode/third-party/boost/detail/limits.hpp delete mode 100755 gecode/third-party/boost/extract.py delete mode 100644 gecode/third-party/boost/limits.hpp delete mode 100644 gecode/third-party/boost/non_type.hpp delete mode 100644 gecode/third-party/boost/numeric/interval.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/arith.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/arith2.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/arith3.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/checking.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/compare.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/compare/certain.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/compare/explicit.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/compare/lexicographic.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/compare/possible.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/compare/set.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/constants.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/alpha_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/bcc_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/bugs.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/c99_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/c99sub_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/division.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/ia64_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/interval_prototype.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/msvc_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/msvc_rounding_control.hpp.orig delete mode 100644 gecode/third-party/boost/numeric/interval/detail/ppc_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/sparc_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/test_input.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/x86_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/detail/x86gcc_rounding_control.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/hw_rounding.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/interval.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/policies.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/rounded_arith.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/rounded_transc.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/rounding.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/transc.hpp delete mode 100644 gecode/third-party/boost/numeric/interval/utility.hpp delete mode 100644 gecode/third-party/boost/patch.txt delete mode 100644 gecode/third-party/boost/type.hpp delete mode 100644 test/float/interval-oracle.cpp diff --git a/.clang-tidy b/.clang-tidy index 011f00661b..edfd5bc727 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -36,15 +36,12 @@ Checks: >- readability-identifier-naming WarningsAsErrors: '*' HeaderFilterRegex: '(gecode|test|examples|tools)/' -ExcludeHeaderFilterRegex: 'gecode/third-party/|gecode/flatzinc/(parser\.tab\.(cpp|hpp)|lexer\.yy\.cpp)$' +ExcludeHeaderFilterRegex: 'gecode/flatzinc/(parser\.tab\.(cpp|hpp)|lexer\.yy\.cpp)$' FormatStyle: file CheckOptions: # Explicit discards document intentional ownership handoffs. bugprone-unused-return-value.AllowCastToVoid: true - # Shallow handles stay passed by value: a copy duplicates a few pointers or - # ids, with no reference count or allocation. See docs/code-style.md. - performance-unnecessary-value-param.AllowedTypes: '^Gecode::Float::ScaleView$' readability-identifier-naming.FunctionCase: lower_case readability-identifier-naming.MethodCase: lower_case readability-identifier-naming.VariableCase: lower_case diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f023b91ce..8f2ab8eb16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -920,7 +920,7 @@ foreach(input ${GECODE_DOC_SOURCE_INPUTS}) endif() endforeach() list(APPEND GECODE_DOC_HELPER_INPUTS ${GECODE_VAR_TYPE_HPP} ${GECODE_VAR_IMP_HPP}) -list(FILTER GECODE_DOC_HELPER_INPUTS EXCLUDE REGEX "/gecode/(third-party|gist/standalone-example|flatzinc/exampleplugin)/") +list(FILTER GECODE_DOC_HELPER_INPUTS EXCLUDE REGEX "/gecode/(gist/standalone-example|flatzinc/exampleplugin)/") list(FILTER GECODE_DOC_HELPER_INPUTS EXCLUDE REGEX "/gecode/flatzinc/(parser\\.tab|lexer\\.)") list(REMOVE_DUPLICATES GECODE_DOC_HELPER_INPUTS) @@ -1650,7 +1650,6 @@ if(GECODE_INSTALL) FILES_MATCHING PATTERN "**.hh" PATTERN "**.hpp" - PATTERN "LICENSE_1_0.txt" PATTERN "mznlib" EXCLUDE PATTERN "flatzinc/registry-internal.hh" EXCLUDE PATTERN "flatzinc/blackbox.hh" EXCLUDE diff --git a/cmake/GecodeSources.cmake b/cmake/GecodeSources.cmake index 263d6e9b94..8b87e07b39 100644 --- a/cmake/GecodeSources.cmake +++ b/cmake/GecodeSources.cmake @@ -417,7 +417,6 @@ set(GECODE_TEST_SOURCES test/float/basic.cpp test/float/channel.cpp test/float/dom.cpp - test/float/interval-oracle.cpp test/float/interval.cpp test/float/linear.cpp test/float/mm-lin.cpp diff --git a/docs/code-style.md b/docs/code-style.md index 50989b51d2..8b42664503 100644 --- a/docs/code-style.md +++ b/docs/code-style.md @@ -2,7 +2,7 @@ Use clang-format **22** for first-party C and C++ sources. `.clang-format` defines the exact formatting; `.editorconfig` supplies the matching editor -defaults. Keep upstream third-party files in their original style. +defaults. ## Formatting @@ -130,14 +130,12 @@ on), the variable arrays and `ViewArray`, the open variable and view lists, with no reference count or allocation, and Gecode code relies on their value semantics. Keep them so: define no copy member, move member, or destructor for a handle that only copies its members, or default it on its first -declaration. `test/array.cpp` asserts the property. The check's -`AllowedTypes` lists only `Float::ScaleView`, a view that is not trivially -copyable because its `FloatVal` member is not. Owned and reference-counted +declaration. `test/array.cpp` asserts the property. Owned and reference-counted types are not exempt: `SharedHandle` types such as `IntSet`, `TupleSet`, `DFA`, `Rnd`, `Action`, and `CHB`, `SharedArray`, the `*Args` arrays, `REG`, strings, and callbacks. Their copies touch a reference count or allocate, so -they follow the rule above. `FloatVal` is not exempt either: it is two -doubles, not a handle. +they follow the rule above. `FloatVal` is trivially copyable, so the check +does not report it, but it is two doubles, not a handle: pass it by `const&`. Special members follow the rule of zero: a class whose members copy, move, and destroy themselves declares no copy member, move member, or destructor. diff --git a/doxygen/doxygen.conf.in b/doxygen/doxygen.conf.in index b56fa58274..ee0dacfc01 100755 --- a/doxygen/doxygen.conf.in +++ b/doxygen/doxygen.conf.in @@ -520,7 +520,6 @@ EXCLUDE_PATTERNS = \ *.svn/* \ *moc_* \ *gecode/gist/standalone-example/* \ - *gecode/third-party/* \ *gecode/flatzinc/exampleplugin/* \ *gecode/flatzinc/parser.tab.* *gecode/flatzinc/lexer.* diff --git a/gecode/third-party/boost/LICENSE_1_0.txt b/gecode/third-party/boost/LICENSE_1_0.txt deleted file mode 100644 index 36b7cd93cd..0000000000 --- a/gecode/third-party/boost/LICENSE_1_0.txt +++ /dev/null @@ -1,23 +0,0 @@ -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/gecode/third-party/boost/config.hpp b/gecode/third-party/boost/config.hpp deleted file mode 100644 index 517d2d440b..0000000000 --- a/gecode/third-party/boost/config.hpp +++ /dev/null @@ -1,70 +0,0 @@ -// Boost config.hpp configuration header file ------------------------------// - -// (C) Copyright John Maddock 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org/libs/config for most recent version. - -// Boost config.hpp policy and rationale documentation has been moved to -// http://www.boost.org/libs/config -// -// CAUTION: This file is intended to be completely stable - -// DO NOT MODIFY THIS FILE! -// - -#ifndef GECODE_BOOST_CONFIG_HPP -#define GECODE_BOOST_CONFIG_HPP - -// if we don't have a user config, then use the default location: -#if !defined(GECODE_BOOST_USER_CONFIG) && !defined(GECODE_BOOST_NO_USER_CONFIG) -# define GECODE_BOOST_USER_CONFIG -#endif -// include it first: -#ifdef GECODE_BOOST_USER_CONFIG -# include GECODE_BOOST_USER_CONFIG -#endif - -// if we don't have a compiler config set, try and find one: -#if !defined(GECODE_BOOST_COMPILER_CONFIG) && !defined(GECODE_BOOST_NO_COMPILER_CONFIG) && !defined(GECODE_BOOST_NO_CONFIG) -# include -#endif -// if we have a compiler config, include it now: -#ifdef GECODE_BOOST_COMPILER_CONFIG -# include GECODE_BOOST_COMPILER_CONFIG -#endif - -// if we don't have a std library config set, try and find one: -#if !defined(GECODE_BOOST_STDLIB_CONFIG) && !defined(GECODE_BOOST_NO_STDLIB_CONFIG) && !defined(GECODE_BOOST_NO_CONFIG) && defined(__cplusplus) -# include -#endif -// if we have a std library config, include it now: -#ifdef GECODE_BOOST_STDLIB_CONFIG -# include GECODE_BOOST_STDLIB_CONFIG -#endif - -// if we don't have a platform config set, try and find one: -#if !defined(GECODE_BOOST_PLATFORM_CONFIG) && !defined(GECODE_BOOST_NO_PLATFORM_CONFIG) && !defined(GECODE_BOOST_NO_CONFIG) -# include -#endif -// if we have a platform config, include it now: -#ifdef GECODE_BOOST_PLATFORM_CONFIG -# include GECODE_BOOST_PLATFORM_CONFIG -#endif - -// get config suffix code: -#include - -#endif // GECODE_BOOST_CONFIG_HPP - - - - - - - - - - - diff --git a/gecode/third-party/boost/config/abi/borland_prefix.hpp b/gecode/third-party/boost/config/abi/borland_prefix.hpp deleted file mode 100644 index 3a0e5ae2d7..0000000000 --- a/gecode/third-party/boost/config/abi/borland_prefix.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// (C) Copyright John Maddock 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// for C++ Builder the following options effect the ABI: -// -// -b (on or off - effect emum sizes) -// -Vx (on or off - empty members) -// -Ve (on or off - empty base classes) -// -aX (alignment - 5 options). -// -pX (Calling convention - 4 options) -// -VmX (member pointer size and layout - 5 options) -// -VC (on or off, changes name mangling) -// -Vl (on or off, changes struct layout). - -// In addition the following warnings are sufficiently annoying (and -// unfixable) to have them turned off by default: -// -// 8027 - functions containing [for|while] loops are not expanded inline -// 8026 - functions taking class by value arguments are not expanded inline - -#pragma nopushoptwarn -# pragma option push -a8 -Vx- -Ve- -b- -pc -Vmv -VC- -Vl- -w-8027 -w-8026 - - - diff --git a/gecode/third-party/boost/config/abi/borland_suffix.hpp b/gecode/third-party/boost/config/abi/borland_suffix.hpp deleted file mode 100644 index 940535f381..0000000000 --- a/gecode/third-party/boost/config/abi/borland_suffix.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// (C) Copyright John Maddock 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -# pragma option pop -#pragma nopushoptwarn - - - - - diff --git a/gecode/third-party/boost/config/abi/msvc_prefix.hpp b/gecode/third-party/boost/config/abi/msvc_prefix.hpp deleted file mode 100644 index 97f06cdc0c..0000000000 --- a/gecode/third-party/boost/config/abi/msvc_prefix.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// (C) Copyright John Maddock 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// -// Boost binaries are built with the compiler's default ABI settings, -// if the user changes their default alignment in the VS IDE then their -// code will no longer be binary compatible with the bjam built binaries -// unless this header is included to force Boost code into a consistent ABI. -// -// Note that inclusion of this header is only necessary for libraries with -// separate source, header only libraries DO NOT need this as long as all -// translation units are built with the same options. -// -#if defined(_M_X64) -# pragma pack(push,16) -#else -# pragma pack(push,8) -#endif - - diff --git a/gecode/third-party/boost/config/abi/msvc_suffix.hpp b/gecode/third-party/boost/config/abi/msvc_suffix.hpp deleted file mode 100644 index a64d783eb0..0000000000 --- a/gecode/third-party/boost/config/abi/msvc_suffix.hpp +++ /dev/null @@ -1,8 +0,0 @@ -// (C) Copyright John Maddock 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#pragma pack(pop) - - diff --git a/gecode/third-party/boost/config/abi_prefix.hpp b/gecode/third-party/boost/config/abi_prefix.hpp deleted file mode 100644 index 85303ef99f..0000000000 --- a/gecode/third-party/boost/config/abi_prefix.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// abi_prefix header -------------------------------------------------------// - -// (c) Copyright John Maddock 2003 - -// Use, modification and distribution are subject to the Boost Software License, -// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt). - -#ifndef GECODE_BOOST_CONFIG_ABI_PREFIX_HPP -# define GECODE_BOOST_CONFIG_ABI_PREFIX_HPP -#else -# error double inclusion of header boost/config/abi_prefix.hpp is an error -#endif - -#include - -// this must occur after all other includes and before any code appears: -#ifdef GECODE_BOOST_HAS_ABI_HEADERS -# include GECODE_BOOST_ABI_PREFIX -#endif - -#if defined( __BORLANDC__ ) -#pragma nopushoptwarn -#endif - diff --git a/gecode/third-party/boost/config/abi_suffix.hpp b/gecode/third-party/boost/config/abi_suffix.hpp deleted file mode 100644 index f9d88a635a..0000000000 --- a/gecode/third-party/boost/config/abi_suffix.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// abi_sufffix header -------------------------------------------------------// - -// (c) Copyright John Maddock 2003 - -// Use, modification and distribution are subject to the Boost Software License, -// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt). - -// This header should be #included AFTER code that was preceded by a #include -// . - -#ifndef GECODE_BOOST_CONFIG_ABI_PREFIX_HPP -# error Header boost/config/abi_suffix.hpp must only be used after boost/config/abi_prefix.hpp -#else -# undef GECODE_BOOST_CONFIG_ABI_PREFIX_HPP -#endif - -// the suffix header occurs after all of our code: -#ifdef GECODE_BOOST_HAS_ABI_HEADERS -# include GECODE_BOOST_ABI_SUFFIX -#endif - -#if defined( __BORLANDC__ ) -#pragma nopushoptwarn -#endif - - diff --git a/gecode/third-party/boost/config/compiler/borland.hpp b/gecode/third-party/boost/config/compiler/borland.hpp deleted file mode 100644 index ad57f0f364..0000000000 --- a/gecode/third-party/boost/config/compiler/borland.hpp +++ /dev/null @@ -1,284 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Aleksey Gurtovoy 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Borland C++ compiler setup: - -// -// versions check: -// we don't support Borland prior to version 5.4: -#if __BORLANDC__ < 0x540 -# error "Compiler not supported or configured - please reconfigure" -#endif - -// last known compiler version: -#if (__BORLANDC__ > 0x613) -//# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -//# else -//# pragma message( "Unknown compiler version - please run the configure tests and report the results") -//# endif -#elif (__BORLANDC__ == 0x600) -# error "CBuilderX preview compiler is no longer supported" -#endif - -// -// Support macros to help with standard library detection -#if (__BORLANDC__ < 0x560) || defined(_USE_OLD_RW_STL) -# define GECODE_BOOST_BCB_WITH_ROGUE_WAVE -#elif __BORLANDC__ < 0x570 -# define GECODE_BOOST_BCB_WITH_STLPORT -#else -# define GECODE_BOOST_BCB_WITH_DINKUMWARE -#endif - -// -// Version 5.0 and below: -# if __BORLANDC__ <= 0x0550 -// Borland C++Builder 4 and 5: -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -# if __BORLANDC__ == 0x0550 -// Borland C++Builder 5, command-line compiler 5.5: -# define GECODE_BOOST_NO_OPERATORS_IN_NAMESPACE -# endif -// Variadic macros do not exist for C++ Builder versions 5 and below -#define GECODE_BOOST_NO_VARIADIC_MACROS -# endif - -// Version 5.51 and below: -#if (__BORLANDC__ <= 0x551) -# define GECODE_BOOST_NO_CV_SPECIALIZATIONS -# define GECODE_BOOST_NO_CV_VOID_SPECIALIZATIONS -# define GECODE_BOOST_NO_DEDUCED_TYPENAME -// workaround for missing WCHAR_MAX/WCHAR_MIN: -#ifdef __cplusplus -#include -#include -#else -#include -#include -#endif // __cplusplus -#ifndef WCHAR_MAX -# define WCHAR_MAX 0xffff -#endif -#ifndef WCHAR_MIN -# define WCHAR_MIN 0 -#endif -#endif - -// Borland C++ Builder 6 and below: -#if (__BORLANDC__ <= 0x564) - -# if defined(NDEBUG) && defined(__cplusplus) - // fix broken so that Boost.test works: -# include -# undef strcmp -# endif - // fix broken errno declaration: -# include -# ifndef errno -# define errno errno -# endif - -#endif - -// -// new bug in 5.61: -#if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x580) - // this seems to be needed by the command line compiler, but not the IDE: -# define GECODE_BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS -#endif - -// Borland C++ Builder 2006 Update 2 and below: -#if (__BORLANDC__ <= 0x582) -# define GECODE_BOOST_NO_SFINAE -# define GECODE_BOOST_BCB_PARTIAL_SPECIALIZATION_BUG -# define GECODE_BOOST_NO_TEMPLATE_TEMPLATES - -# define GECODE_BOOST_NO_PRIVATE_IN_AGGREGATE - -# ifdef _WIN32 -# define GECODE_BOOST_NO_SWPRINTF -# elif defined(linux) || defined(__linux__) || defined(__linux) - // we should really be able to do without this - // but the wcs* functions aren't imported into std:: -# define GECODE_BOOST_NO_STDC_NAMESPACE - // _CPPUNWIND doesn't get automatically set for some reason: -# pragma defineonoption GECODE_BOOST_CPPUNWIND -x -# endif -#endif - -#if (__BORLANDC__ <= 0x613) // Beman has asked Alisdair for more info - // we shouldn't really need this - but too many things choke - // without it, this needs more investigation: -# define GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -# define GECODE_BOOST_NO_IS_ABSTRACT -# define GECODE_BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS -# define GECODE_BOOST_NO_USING_TEMPLATE -# define GECODE_BOOST_SP_NO_SP_CONVERTIBLE - -// Temporary workaround -#define GECODE_BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS -#endif - -// Borland C++ Builder 2008 and below: -# define GECODE_BOOST_NO_INTEGRAL_INT64_T -# define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -# define GECODE_BOOST_NO_DEPENDENT_NESTED_DERIVATIONS -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -# define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -# define GECODE_BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE -# define GECODE_BOOST_NO_NESTED_FRIENDSHIP -# define GECODE_BOOST_NO_TYPENAME_WITH_CTOR -#if (__BORLANDC__ < 0x600) -# define GECODE_BOOST_ILLEGAL_CV_REFERENCES -#endif - -// -// Positive Feature detection -// -// Borland C++ Builder 2008 and below: -#if (__BORLANDC__ >= 0x599) -# pragma defineonoption GECODE_BOOST_CODEGEAR_0X_SUPPORT -Ax -#endif -// -// C++0x Macros: -// -#if !defined( GECODE_BOOST_CODEGEAR_0X_SUPPORT ) || (__BORLANDC__ < 0x610) -# define GECODE_BOOST_NO_CHAR16_T -# define GECODE_BOOST_NO_CHAR32_T -# define GECODE_BOOST_NO_DECLTYPE -# define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -# define GECODE_BOOST_NO_EXTERN_TEMPLATE -# define GECODE_BOOST_NO_RVALUE_REFERENCES -# define GECODE_BOOST_NO_SCOPED_ENUMS -# define GECODE_BOOST_NO_STATIC_ASSERT -#else -# define GECODE_BOOST_HAS_ALIGNOF -# define GECODE_BOOST_HAS_CHAR16_T -# define GECODE_BOOST_HAS_CHAR32_T -# define GECODE_BOOST_HAS_DECLTYPE -# define GECODE_BOOST_HAS_EXPLICIT_CONVERSION_OPS -# define GECODE_BOOST_HAS_REF_QUALIFIER -# define GECODE_BOOST_HAS_RVALUE_REFS -# define GECODE_BOOST_HAS_STATIC_ASSERT -#endif - -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS // UTF-8 still not supported -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -#if __BORLANDC__ >= 0x590 -# define GECODE_BOOST_HAS_TR1_HASH - -# define GECODE_BOOST_HAS_MACRO_USE_FACET -#endif - -// -// Post 0x561 we have long long and stdint.h: -#if __BORLANDC__ >= 0x561 -# ifndef __NO_LONG_LONG -# define GECODE_BOOST_HAS_LONG_LONG -# else -# define GECODE_BOOST_NO_LONG_LONG -# endif - // On non-Win32 platforms let the platform config figure this out: -# ifdef _WIN32 -# define GECODE_BOOST_HAS_STDINT_H -# endif -#endif - -// Borland C++Builder 6 defaults to using STLPort. If _USE_OLD_RW_STL is -// defined, then we have 0x560 or greater with the Rogue Wave implementation -// which presumably has the std::DBL_MAX bug. -#if defined( GECODE_BOOST_BCB_WITH_ROGUE_WAVE ) -// is partly broken, some macros define symbols that are really in -// namespace std, so you end up having to use illegal constructs like -// std::DBL_MAX, as a fix we'll just include float.h and have done with: -#include -#endif -// -// __int64: -// -#if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__) -# define GECODE_BOOST_HAS_MS_INT64 -#endif -// -// check for exception handling support: -// -#if !defined(_CPPUNWIND) && !defined(GECODE_BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -# define GECODE_BOOST_NO_EXCEPTIONS -#endif -// -// all versions have a : -// -#ifndef __STRICT_ANSI__ -# define GECODE_BOOST_HAS_DIRENT_H -#endif -// -// all versions support __declspec: -// -#if defined(__STRICT_ANSI__) -// config/platform/win32.hpp will define GECODE_BOOST_SYMBOL_EXPORT, etc., unless already defined -# define GECODE_BOOST_SYMBOL_EXPORT -#endif -// -// ABI fixing headers: -// -#if __BORLANDC__ != 0x600 // not implemented for version 6 compiler yet -#ifndef GECODE_BOOST_ABI_PREFIX -# define GECODE_BOOST_ABI_PREFIX "gecode/third-party/boost/config/abi/borland_prefix.hpp" -#endif -#ifndef GECODE_BOOST_ABI_SUFFIX -# define GECODE_BOOST_ABI_SUFFIX "gecode/third-party/boost/config/abi/borland_suffix.hpp" -#endif -#endif -// -// Disable Win32 support in ANSI mode: -// -#if __BORLANDC__ < 0x600 -# pragma defineonoption GECODE_BOOST_DISABLE_WIN32 -A -#elif defined(__STRICT_ANSI__) -# define GECODE_BOOST_DISABLE_WIN32 -#endif -// -// MSVC compatibility mode does some nasty things: -// TODO: look up if this doesn't apply to the whole 12xx range -// -#if defined(_MSC_VER) && (_MSC_VER <= 1200) -# define GECODE_BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -# define GECODE_BOOST_NO_VOID_RETURNS -#endif - -// Borland did not implement value-initialization completely, as I reported -// in 2007, Borland Report 51854, "Value-initialization: POD struct should be -// zero-initialized", http://qc.embarcadero.com/wc/qcmain.aspx?d=51854 -// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues -// (Niels Dekker, LKEB, April 2010) -#define GECODE_BOOST_NO_COMPLETE_VALUE_INITIALIZATION - -#define GECODE_BOOST_COMPILER "Borland C++ version " GECODE_BOOST_STRINGIZE(__BORLANDC__) - - - - diff --git a/gecode/third-party/boost/config/compiler/clang.hpp b/gecode/third-party/boost/config/compiler/clang.hpp deleted file mode 100644 index 2cf6347851..0000000000 --- a/gecode/third-party/boost/config/compiler/clang.hpp +++ /dev/null @@ -1,85 +0,0 @@ -// (C) Copyright Douglas Gregor 2010 -// -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Clang compiler setup. - -#if __has_feature(cxx_exceptions) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -#else -# define GECODE_BOOST_NO_EXCEPTIONS -#endif - -#if !__has_feature(cxx_rtti) -# define GECODE_BOOST_NO_RTTI -#endif - -#if defined(__int64) -# define GECODE_BOOST_HAS_MS_INT64 -#endif - -#define GECODE_BOOST_HAS_NRVO - -// Clang supports "long long" in all compilation modes. - -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR - -#if !__has_feature(cxx_decltype) -# define GECODE_BOOST_NO_DECLTYPE -#endif - -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS - -#if !__has_feature(cxx_deleted_functions) -# define GECODE_BOOST_NO_DELETED_FUNCTIONS -#endif - -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS - -#if !__has_feature(cxx_default_function_template_args) - #define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#endif - -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -#if !__has_feature(cxx_rvalue_references) -# define GECODE_BOOST_NO_RVALUE_REFERENCES -#endif - -#if !__has_feature(cxx_strong_enums) -# define GECODE_BOOST_NO_SCOPED_ENUMS -#endif - -#if !__has_feature(cxx_static_assert) -# define GECODE_BOOST_NO_STATIC_ASSERT -#endif - -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS - -#if !__has_feature(cxx_variadic_templates) -# define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#endif - -// Clang always supports variadic macros -// Clang always supports extern templates - -#ifndef GECODE_BOOST_COMPILER -# define GECODE_BOOST_COMPILER "Clang version " __clang_version__ -#endif - -// Macro used to identify the Clang compiler. -#define GECODE_BOOST_CLANG 1 - diff --git a/gecode/third-party/boost/config/compiler/codegear.hpp b/gecode/third-party/boost/config/compiler/codegear.hpp deleted file mode 100644 index a7f533dfdf..0000000000 --- a/gecode/third-party/boost/config/compiler/codegear.hpp +++ /dev/null @@ -1,178 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Aleksey Gurtovoy 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// CodeGear C++ compiler setup: - -#if !defined( GECODE_BOOST_WITH_CODEGEAR_WARNINGS ) -// these warnings occur frequently in optimized template code -# pragma warn -8004 // var assigned value, but never used -# pragma warn -8008 // condition always true/false -# pragma warn -8066 // dead code can never execute -# pragma warn -8104 // static members with ctors not threadsafe -# pragma warn -8105 // reference member in class without ctors -#endif -// -// versions check: -// last known and checked version is 0x621 -#if (__CODEGEARC__ > 0x621) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# else -# pragma message( "Unknown compiler version - please run the configure tests and report the results") -# endif -#endif - -// CodeGear C++ Builder 2009 -#if (__CODEGEARC__ <= 0x613) -# define GECODE_BOOST_NO_INTEGRAL_INT64_T -# define GECODE_BOOST_NO_DEPENDENT_NESTED_DERIVATIONS -# define GECODE_BOOST_NO_PRIVATE_IN_AGGREGATE -# define GECODE_BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE - // we shouldn't really need this - but too many things choke - // without it, this needs more investigation: -# define GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -# define GECODE_BOOST_SP_NO_SP_CONVERTIBLE -#endif - -// CodeGear C++ Builder 2010 -#if (__CODEGEARC__ <= 0x621) -# define GECODE_BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type -# define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -# define GECODE_BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member -# define GECODE_BOOST_NO_USING_TEMPLATE -# define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -// Temporary hack, until specific MPL preprocessed headers are generated -# define GECODE_BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS - -// CodeGear has not yet completely implemented value-initialization, for -// example for array types, as I reported in 2010: Embarcadero Report 83751, -// "Value-initialization: arrays should have each element value-initialized", -// http://qc.embarcadero.com/wc/qcmain.aspx?d=83751 -// Last checked version: Embarcadero C++ 6.21 -// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues -// (Niels Dekker, LKEB, April 2010) -# define GECODE_BOOST_NO_COMPLETE_VALUE_INITIALIZATION - -# if defined(NDEBUG) && defined(__cplusplus) - // fix broken so that Boost.test works: -# include -# undef strcmp -# endif - // fix broken errno declaration: -# include -# ifndef errno -# define errno errno -# endif - -#endif -// -// C++0x macros: -// -#if (__CODEGEARC__ <= 0x620) -#define GECODE_BOOST_NO_STATIC_ASSERT -#else -#define GECODE_BOOST_HAS_STATIC_ASSERT -#endif -#define GECODE_BOOST_HAS_CHAR16_T -#define GECODE_BOOST_HAS_CHAR32_T -#define GECODE_BOOST_HAS_LONG_LONG -// #define GECODE_BOOST_HAS_ALIGNOF -#define GECODE_BOOST_HAS_DECLTYPE -#define GECODE_BOOST_HAS_EXPLICIT_CONVERSION_OPS -// #define GECODE_BOOST_HAS_RVALUE_REFS -#define GECODE_BOOST_HAS_SCOPED_ENUM -// #define GECODE_BOOST_HAS_STATIC_ASSERT -#define GECODE_BOOST_HAS_STD_TYPE_TRAITS - -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXTERN_TEMPLATE -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -// -// TR1 macros: -// -#define GECODE_BOOST_HAS_TR1_HASH -#define GECODE_BOOST_HAS_TR1_TYPE_TRAITS -#define GECODE_BOOST_HAS_TR1_UNORDERED_MAP -#define GECODE_BOOST_HAS_TR1_UNORDERED_SET - -#define GECODE_BOOST_HAS_MACRO_USE_FACET - -#define GECODE_BOOST_NO_INITIALIZER_LISTS - -// On non-Win32 platforms let the platform config figure this out: -#ifdef _WIN32 -# define GECODE_BOOST_HAS_STDINT_H -#endif - -// -// __int64: -// -#if !defined(__STRICT_ANSI__) -# define GECODE_BOOST_HAS_MS_INT64 -#endif -// -// check for exception handling support: -// -#if !defined(_CPPUNWIND) && !defined(GECODE_BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -# define GECODE_BOOST_NO_EXCEPTIONS -#endif -// -// all versions have a : -// -#if !defined(__STRICT_ANSI__) -# define GECODE_BOOST_HAS_DIRENT_H -#endif -// -// all versions support __declspec: -// -#if defined(__STRICT_ANSI__) -// config/platform/win32.hpp will define GECODE_BOOST_SYMBOL_EXPORT, etc., unless already defined -# define GECODE_BOOST_SYMBOL_EXPORT -#endif -// -// ABI fixing headers: -// -#ifndef GECODE_BOOST_ABI_PREFIX -# define GECODE_BOOST_ABI_PREFIX "gecode/third-party/boost/config/abi/borland_prefix.hpp" -#endif -#ifndef GECODE_BOOST_ABI_SUFFIX -# define GECODE_BOOST_ABI_SUFFIX "gecode/third-party/boost/config/abi/borland_suffix.hpp" -#endif -// -// Disable Win32 support in ANSI mode: -// -# pragma defineonoption GECODE_BOOST_DISABLE_WIN32 -A -// -// MSVC compatibility mode does some nasty things: -// TODO: look up if this doesn't apply to the whole 12xx range -// -#if defined(_MSC_VER) && (_MSC_VER <= 1200) -# define GECODE_BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -# define GECODE_BOOST_NO_VOID_RETURNS -#endif - -#define GECODE_BOOST_COMPILER "CodeGear C++ version " GECODE_BOOST_STRINGIZE(__CODEGEARC__) - diff --git a/gecode/third-party/boost/config/compiler/comeau.hpp b/gecode/third-party/boost/config/compiler/comeau.hpp deleted file mode 100644 index cbd73e1240..0000000000 --- a/gecode/third-party/boost/config/compiler/comeau.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// (C) Copyright John Maddock 2001. -// (C) Copyright Douglas Gregor 2001. -// (C) Copyright Peter Dimov 2001. -// (C) Copyright Aleksey Gurtovoy 2003. -// (C) Copyright Beman Dawes 2003. -// (C) Copyright Jens Maurer 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Comeau C++ compiler setup: - -#include "gecode/third-party/boost/config/compiler/common_edg.hpp" - -#if (__COMO_VERSION__ <= 4245) - -# if defined(_MSC_VER) && _MSC_VER <= 1300 -# if _MSC_VER > 100 - // only set this in non-strict mode: -# define GECODE_BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -# endif -# endif - -// Void returns don't work when emulating VC 6 (Peter Dimov) -// TODO: look up if this doesn't apply to the whole 12xx range -# if defined(_MSC_VER) && (_MSC_VER < 1300) -# define GECODE_BOOST_NO_VOID_RETURNS -# endif - -#endif // version 4245 - -// -// enable __int64 support in VC emulation mode -// -# if defined(_MSC_VER) && (_MSC_VER >= 1200) -# define GECODE_BOOST_HAS_MS_INT64 -# endif - -#define GECODE_BOOST_COMPILER "Comeau compiler version " GECODE_BOOST_STRINGIZE(__COMO_VERSION__) - -// -// versions check: -// we don't know Comeau prior to version 4245: -#if __COMO_VERSION__ < 4245 -# error "Compiler not configured - please reconfigure" -#endif -// -// last known and checked version is 4245: -#if (__COMO_VERSION__ > 4245) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif - - - - diff --git a/gecode/third-party/boost/config/compiler/common_edg.hpp b/gecode/third-party/boost/config/compiler/common_edg.hpp deleted file mode 100644 index e12c0837de..0000000000 --- a/gecode/third-party/boost/config/compiler/common_edg.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2002. -// (C) Copyright Jens Maurer 2001. -// (C) Copyright David Abrahams 2002. -// (C) Copyright Aleksey Gurtovoy 2002. -// (C) Copyright Markus Schoepflin 2005. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// -// Options common to all edg based compilers. -// -// This is included from within the individual compiler mini-configs. - -#ifndef __EDG_VERSION__ -# error This file requires that __EDG_VERSION__ be defined. -#endif - -#if (__EDG_VERSION__ <= 238) -# define GECODE_BOOST_NO_INTEGRAL_INT64_T -# define GECODE_BOOST_NO_SFINAE -#endif - -#if (__EDG_VERSION__ <= 240) -# define GECODE_BOOST_NO_VOID_RETURNS -#endif - -#if (__EDG_VERSION__ <= 241) && !defined(GECODE_BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) -# define GECODE_BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -#endif - -#if (__EDG_VERSION__ <= 244) && !defined(GECODE_BOOST_NO_TEMPLATE_TEMPLATES) -# define GECODE_BOOST_NO_TEMPLATE_TEMPLATES -#endif - -#if (__EDG_VERSION__ < 300) && !defined(GECODE_BOOST_NO_IS_ABSTRACT) -# define GECODE_BOOST_NO_IS_ABSTRACT -#endif - -#if (__EDG_VERSION__ <= 303) && !defined(GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) -# define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -#endif - -// See also kai.hpp which checks a Kai-specific symbol for EH -# if !defined(__KCC) && !defined(__EXCEPTIONS) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -# define GECODE_BOOST_NO_EXCEPTIONS -# endif - -# if !defined(__NO_LONG_LONG) -# define GECODE_BOOST_HAS_LONG_LONG -# else -# define GECODE_BOOST_NO_LONG_LONG -# endif - -// -// C++0x features -// -// See above for GECODE_BOOST_NO_LONG_LONG -// -#if (__EDG_VERSION__ < 310) -# define GECODE_BOOST_NO_EXTERN_TEMPLATE -#endif -#if (__EDG_VERSION__ <= 310) -// No support for initializer lists -# define GECODE_BOOST_NO_INITIALIZER_LISTS -#endif -#if (__EDG_VERSION__ < 400) -# define GECODE_BOOST_NO_VARIADIC_MACROS -#endif - -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DECLTYPE -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_STATIC_ASSERT -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -#ifdef c_plusplus -// EDG has "long long" in non-strict mode -// However, some libraries have insufficient "long long" support -// #define GECODE_BOOST_HAS_LONG_LONG -#endif diff --git a/gecode/third-party/boost/config/compiler/compaq_cxx.hpp b/gecode/third-party/boost/config/compiler/compaq_cxx.hpp deleted file mode 100644 index 9821b3d51f..0000000000 --- a/gecode/third-party/boost/config/compiler/compaq_cxx.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Tru64 C++ compiler setup (now HP): - -#define GECODE_BOOST_COMPILER "HP Tru64 C++ " GECODE_BOOST_STRINGIZE(__DECCXX_VER) - -#include "gecode/third-party/boost/config/compiler/common_edg.hpp" - -// -// versions check: -// Nothing to do here? - - - diff --git a/gecode/third-party/boost/config/compiler/digitalmars.hpp b/gecode/third-party/boost/config/compiler/digitalmars.hpp deleted file mode 100644 index aacb1e02db..0000000000 --- a/gecode/third-party/boost/config/compiler/digitalmars.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (C) Christof Meerwald 2003 -// Copyright (C) Dan Watkins 2003 -// -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// Digital Mars C++ compiler setup: -#define GECODE_BOOST_COMPILER __DMC_VERSION_STRING__ - -#define GECODE_BOOST_HAS_LONG_LONG -#define GECODE_BOOST_HAS_PRAGMA_ONCE - -#if (__DMC__ <= 0x833) -#define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -#define GECODE_BOOST_NO_TEMPLATE_TEMPLATES -#define GECODE_BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING -#define GECODE_BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS -#define GECODE_BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS -#endif -#if (__DMC__ <= 0x840) || !defined(GECODE_BOOST_STRICT_CONFIG) -#define GECODE_BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS -#define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -#define GECODE_BOOST_NO_OPERATORS_IN_NAMESPACE -#define GECODE_BOOST_NO_UNREACHABLE_RETURN_DETECTION -#define GECODE_BOOST_NO_SFINAE -#define GECODE_BOOST_NO_USING_TEMPLATE -#define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -#endif - -// -// has macros: -#if (__DMC__ >= 0x840) -#define GECODE_BOOST_HAS_DIRENT_H -#define GECODE_BOOST_HAS_STDINT_H -#define GECODE_BOOST_HAS_WINTHREADS -#endif - -#if (__DMC__ >= 0x847) -#define GECODE_BOOST_HAS_EXPM1 -#define GECODE_BOOST_HAS_LOG1P -#endif - -// -// Is this really the best way to detect whether the std lib is in namespace std? -// -#ifdef __cplusplus -#include -#endif -#if !defined(__STL_IMPORT_VENDOR_CSTD) && !defined(_STLP_IMPORT_VENDOR_CSTD) -# define GECODE_BOOST_NO_STDC_NAMESPACE -#endif - - -// check for exception handling support: -#if !defined(_CPPUNWIND) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -# define GECODE_BOOST_NO_EXCEPTIONS -#endif - -// -// C++0x features -// -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DECLTYPE -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define GECODE_BOOST_NO_EXTERN_TEMPLATE -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_STATIC_ASSERT -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -#if (__DMC__ < 0x812) -#define GECODE_BOOST_NO_VARIADIC_MACROS -#endif - -#if __DMC__ < 0x800 -#error "Compiler not supported or configured - please reconfigure" -#endif -// -// last known and checked version is ...: -#if (__DMC__ > 0x848) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif diff --git a/gecode/third-party/boost/config/compiler/gcc.hpp b/gecode/third-party/boost/config/compiler/gcc.hpp deleted file mode 100644 index 229b95ae40..0000000000 --- a/gecode/third-party/boost/config/compiler/gcc.hpp +++ /dev/null @@ -1,248 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Darin Adler 2001 - 2002. -// (C) Copyright Jens Maurer 2001 - 2002. -// (C) Copyright Beman Dawes 2001 - 2003. -// (C) Copyright Douglas Gregor 2002. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Synge Todo 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// GNU C++ compiler setup: - -#if __GNUC__ < 3 -# if __GNUC_MINOR__ == 91 - // egcs 1.1 won't parse shared_ptr.hpp without this: -# define GECODE_BOOST_NO_AUTO_PTR -# endif -# if __GNUC_MINOR__ < 95 - // - // Prior to gcc 2.95 member templates only partly - // work - define GECODE_BOOST_MSVC6_MEMBER_TEMPLATES - // instead since inline member templates mostly work. - // -# define GECODE_BOOST_NO_MEMBER_TEMPLATES -# if __GNUC_MINOR__ >= 9 -# define GECODE_BOOST_MSVC6_MEMBER_TEMPLATES -# endif -# endif - -# if __GNUC_MINOR__ < 96 -# define GECODE_BOOST_NO_SFINAE -# endif - -# if __GNUC_MINOR__ <= 97 -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -# define GECODE_BOOST_NO_OPERATORS_IN_NAMESPACE -# endif - -# define GECODE_BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE -# define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -# define GECODE_BOOST_NO_IS_ABSTRACT -# define GECODE_BOOST_NO_EXTERN_TEMPLATE -// Variadic macros do not exist for gcc versions before 3.0 -# define GECODE_BOOST_NO_VARIADIC_MACROS -#elif __GNUC__ == 3 -# if defined (__PATHSCALE__) -# define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -# define GECODE_BOOST_NO_IS_ABSTRACT -# endif - // - // gcc-3.x problems: - // - // Bug specific to gcc 3.1 and 3.2: - // -# if ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2)) -# define GECODE_BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS -# endif -# if __GNUC_MINOR__ < 4 -# define GECODE_BOOST_NO_IS_ABSTRACT -# endif -# define GECODE_BOOST_NO_EXTERN_TEMPLATE -#endif -#if __GNUC__ < 4 -// -// All problems to gcc-3.x and earlier here: -// -#define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -# ifdef __OPEN64__ -# define GECODE_BOOST_NO_IS_ABSTRACT -# endif -#endif - -#if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 ) -// Previous versions of GCC did not completely implement value-initialization: -// GCC Bug 30111, "Value-initialization of POD base class doesn't initialize -// members", reported by Jonathan Wakely in 2006, -// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4) -// GCC Bug 33916, "Default constructor fails to initialize array members", -// reported by Michael Elizabeth Chastain in 2007, -// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 (fixed for GCC 4.2.4) -// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues -#define GECODE_BOOST_NO_COMPLETE_VALUE_INITIALIZATION -#endif - -#if !defined(__EXCEPTIONS) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -# define GECODE_BOOST_NO_EXCEPTIONS -#endif - - -// -// Threading support: Turn this on unconditionally here (except for -// those platforms where we can know for sure). It will get turned off again -// later if no threading API is detected. -// -#if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__) -# define GECODE_BOOST_HAS_THREADS -#endif - -// -// gcc has "long long" -// -#define GECODE_BOOST_HAS_LONG_LONG - -// -// gcc implements the named return value optimization since version 3.1 -// -#if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) -#define GECODE_BOOST_HAS_NRVO -#endif - -// -// Dynamic shared object (DSO) and dynamic-link library (DLL) support -// -#if __GNUC__ >= 4 -# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__) - // All Win32 development environments, including 64-bit Windows and MinGW, define - // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment, - // so does not define _WIN32 or its variants. -# define GECODE_BOOST_HAS_DECLSPEC -# define GECODE_BOOST_SYMBOL_EXPORT __attribute__((dllexport)) -# define GECODE_BOOST_SYMBOL_IMPORT __attribute__((dllimport)) -# else -# define GECODE_BOOST_SYMBOL_EXPORT __attribute__((visibility("default"))) -# define GECODE_BOOST_SYMBOL_IMPORT -# endif -# define GECODE_BOOST_SYMBOL_VISIBLE __attribute__((visibility("default"))) -#else -// config/platform/win32.hpp will define GECODE_BOOST_SYMBOL_EXPORT, etc., unless already defined -# define GECODE_BOOST_SYMBOL_EXPORT -#endif - -// -// RTTI and typeinfo detection is possible post gcc-4.3: -// -#if __GNUC__ * 100 + __GNUC_MINOR__ >= 403 -# ifndef __GXX_RTTI -# ifndef GECODE_BOOST_NO_TYPEID -# define GECODE_BOOST_NO_TYPEID -# endif -# ifndef GECODE_BOOST_NO_RTTI -# define GECODE_BOOST_NO_RTTI -# endif -# endif -#endif - -// C++0x features not implemented in any GCC version -// -#define GECODE_BOOST_NO_TEMPLATE_ALIASES - -// C++0x features in 4.3.n and later -// -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__) -// C++0x features are only enabled when -std=c++0x or -std=gnu++0x are -// passed on the command line, which in turn defines -// __GXX_EXPERIMENTAL_CXX0X__. -# define GECODE_BOOST_HAS_DECLTYPE -# define GECODE_BOOST_HAS_RVALUE_REFS -# define GECODE_BOOST_HAS_STATIC_ASSERT -# define GECODE_BOOST_HAS_VARIADIC_TMPL -#else -# define GECODE_BOOST_NO_DECLTYPE -# define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -# define GECODE_BOOST_NO_RVALUE_REFERENCES -# define GECODE_BOOST_NO_STATIC_ASSERT - -// Variadic templates compiler: -// http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html -# if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__)) -# define GECODE_BOOST_HAS_VARIADIC_TMPL -# else -# define GECODE_BOOST_NO_VARIADIC_TEMPLATES -# endif -#endif - -// C++0x features in 4.4.n and later -// -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GECODE_BOOST_NO_AUTO_DECLARATIONS -# define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -# define GECODE_BOOST_NO_CHAR16_T -# define GECODE_BOOST_NO_CHAR32_T -# define GECODE_BOOST_NO_INITIALIZER_LISTS -# define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -# define GECODE_BOOST_NO_DELETED_FUNCTIONS -#endif - -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) -# define GECODE_BOOST_NO_SFINAE_EXPR -#endif - -// C++0x features in 4.5.0 and later -// -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -# define GECODE_BOOST_NO_LAMBDAS -# define GECODE_BOOST_NO_RAW_LITERALS -# define GECODE_BOOST_NO_UNICODE_LITERALS -#endif - -// C++0x features in 4.5.1 and later -// -#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40501) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -// scoped enums have a serious bug in 4.4.0, so define GECODE_BOOST_NO_SCOPED_ENUMS before 4.5.1 -// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064 -# define GECODE_BOOST_NO_SCOPED_ENUMS -#endif - -// C++0x features in 4.6.n and later -// -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX -#endif - -#ifndef GECODE_BOOST_COMPILER -# define GECODE_BOOST_COMPILER "GNU C++ version " __VERSION__ -#endif - -// ConceptGCC compiler: -// http://www.generic-programming.org/software/ConceptGCC/ -#ifdef __GXX_CONCEPTS__ -# define GECODE_BOOST_HAS_CONCEPTS -# define GECODE_BOOST_COMPILER "ConceptGCC version " __VERSION__ -#endif - -// versions check: -// we don't know gcc prior to version 2.90: -#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90) -# error "Compiler not configured - please reconfigure" -#endif -// -// last known and checked version is 4.6 (Pre-release): -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6)) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# else -// we don't emit warnings here anymore since there are no defect macros defined for -// gcc post 3.4, so any failures are gcc regressions... -//# warning "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif - - diff --git a/gecode/third-party/boost/config/compiler/gcc_xml.hpp b/gecode/third-party/boost/config/compiler/gcc_xml.hpp deleted file mode 100644 index 3d0b65dfda..0000000000 --- a/gecode/third-party/boost/config/compiler/gcc_xml.hpp +++ /dev/null @@ -1,58 +0,0 @@ -// (C) Copyright John Maddock 2006. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// GCC-XML C++ compiler setup: - -# if !defined(__GCCXML_GNUC__) || ((__GCCXML_GNUC__ <= 3) && (__GCCXML_GNUC_MINOR__ <= 3)) -# define GECODE_BOOST_NO_IS_ABSTRACT -# endif - -// -// Threading support: Turn this on unconditionally here (except for -// those platforms where we can know for sure). It will get turned off again -// later if no threading API is detected. -// -#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(linux) && !defined(__linux) && !defined(__linux__) -# define GECODE_BOOST_HAS_THREADS -#endif - -// -// gcc has "long long" -// -#define GECODE_BOOST_HAS_LONG_LONG - -// C++0x features: -// -# define GECODE_BOOST_NO_CONSTEXPR -# define GECODE_BOOST_NO_NULLPTR -# define GECODE_BOOST_NO_TEMPLATE_ALIASES -# define GECODE_BOOST_NO_DECLTYPE -# define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -# define GECODE_BOOST_NO_RVALUE_REFERENCES -# define GECODE_BOOST_NO_STATIC_ASSERT -# define GECODE_BOOST_NO_VARIADIC_TEMPLATES -# define GECODE_BOOST_NO_VARIADIC_MACROS -# define GECODE_BOOST_NO_AUTO_DECLARATIONS -# define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -# define GECODE_BOOST_NO_CHAR16_T -# define GECODE_BOOST_NO_CHAR32_T -# define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -# define GECODE_BOOST_NO_DELETED_FUNCTIONS -# define GECODE_BOOST_NO_INITIALIZER_LISTS -# define GECODE_BOOST_NO_SCOPED_ENUMS -# define GECODE_BOOST_NO_SFINAE_EXPR -# define GECODE_BOOST_NO_SCOPED_ENUMS -# define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -# define GECODE_BOOST_NO_LAMBDAS -# define GECODE_BOOST_NO_RAW_LITERALS -# define GECODE_BOOST_NO_UNICODE_LITERALS -# define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -#define GECODE_BOOST_COMPILER "GCC-XML C++ version " __GCCXML__ - - diff --git a/gecode/third-party/boost/config/compiler/greenhills.hpp b/gecode/third-party/boost/config/compiler/greenhills.hpp deleted file mode 100644 index cc945c6e79..0000000000 --- a/gecode/third-party/boost/config/compiler/greenhills.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// (C) Copyright John Maddock 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Greenhills C++ compiler setup: - -#define GECODE_BOOST_COMPILER "Greenhills C++ version " GECODE_BOOST_STRINGIZE(__ghs) - -#include "gecode/third-party/boost/config/compiler/common_edg.hpp" - -// -// versions check: -// we don't support Greenhills prior to version 0: -#if __ghs < 0 -# error "Compiler not supported or configured - please reconfigure" -#endif -// -// last known and checked version is 0: -#if (__ghs > 0) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif - - diff --git a/gecode/third-party/boost/config/compiler/hp_acc.hpp b/gecode/third-party/boost/config/compiler/hp_acc.hpp deleted file mode 100644 index d9f5136230..0000000000 --- a/gecode/third-party/boost/config/compiler/hp_acc.hpp +++ /dev/null @@ -1,137 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001 - 2003. -// (C) Copyright Aleksey Gurtovoy 2002. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Toon Knapen 2003. -// (C) Copyright Boris Gubenko 2006 - 2007. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// HP aCC C++ compiler setup: - -#if defined(__EDG__) -#include "gecode/third-party/boost/config/compiler/common_edg.hpp" -#endif - -#if (__HP_aCC <= 33100) -# define GECODE_BOOST_NO_INTEGRAL_INT64_T -# define GECODE_BOOST_NO_OPERATORS_IN_NAMESPACE -# if !defined(_NAMESPACE_STD) -# define GECODE_BOOST_NO_STD_LOCALE -# define GECODE_BOOST_NO_STRINGSTREAM -# endif -#endif - -#if (__HP_aCC <= 33300) -// member templates are sufficiently broken that we disable them for now -# define GECODE_BOOST_NO_MEMBER_TEMPLATES -# define GECODE_BOOST_NO_DEPENDENT_NESTED_DERIVATIONS -# define GECODE_BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE -#endif - -#if (__HP_aCC <= 38000) -# define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#endif - -#if (__HP_aCC > 50000) && (__HP_aCC < 60000) -# define GECODE_BOOST_NO_UNREACHABLE_RETURN_DETECTION -# define GECODE_BOOST_NO_TEMPLATE_TEMPLATES -# define GECODE_BOOST_NO_SWPRINTF -# define GECODE_BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS -# define GECODE_BOOST_NO_IS_ABSTRACT -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -#endif - -// optional features rather than defects: -#if (__HP_aCC >= 33900) -# define GECODE_BOOST_HAS_LONG_LONG -# define GECODE_BOOST_HAS_PARTIAL_STD_ALLOCATOR -#endif - -#if (__HP_aCC >= 50000 ) && (__HP_aCC <= 53800 ) || (__HP_aCC < 31300 ) -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_KEYWORD -#endif - -// This macro should not be defined when compiling in strict ansi -// mode, but, currently, we don't have the ability to determine -// what standard mode we are compiling with. Some future version -// of aCC6 compiler will provide predefined macros reflecting the -// compilation options, including the standard mode. -#if (__HP_aCC >= 60000) || ((__HP_aCC > 38000) && defined(__hpxstd98)) -# define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#endif - -#define GECODE_BOOST_COMPILER "HP aCC version " GECODE_BOOST_STRINGIZE(__HP_aCC) - -// -// versions check: -// we don't support HP aCC prior to version 33000: -#if __HP_aCC < 33000 -# error "Compiler not supported or configured - please reconfigure" -#endif - -// -// Extended checks for supporting aCC on PA-RISC -#if __HP_aCC > 30000 && __HP_aCC < 50000 -# if __HP_aCC < 38000 - // versions prior to version A.03.80 not supported -# error "Compiler version not supported - version A.03.80 or higher is required" -# elif !defined(__hpxstd98) - // must compile using the option +hpxstd98 with version A.03.80 and above -# error "Compiler option '+hpxstd98' is required for proper support" -# endif //PA-RISC -#endif - -// -// C++0x features -// -// See boost\config\suffix.hpp for GECODE_BOOST_NO_LONG_LONG -// -#if !defined(__EDG__) - -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DECLTYPE -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define GECODE_BOOST_NO_EXTERN_TEMPLATE -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_STATIC_ASSERT -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES - -/* - See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and - https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443436 -*/ - -#if (__HP_aCC < 62500) || !defined(HP_CXX0x_SOURCE) - #define GECODE_BOOST_NO_VARIADIC_MACROS -#endif - -#endif - -// -// last known and checked version for HP-UX/ia64 is 61300 -// last known and checked version for PA-RISC is 38000 -#if ((__HP_aCC > 61300) || ((__HP_aCC > 38000) && defined(__hpxstd98))) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif diff --git a/gecode/third-party/boost/config/compiler/intel.hpp b/gecode/third-party/boost/config/compiler/intel.hpp deleted file mode 100644 index 0ecd404442..0000000000 --- a/gecode/third-party/boost/config/compiler/intel.hpp +++ /dev/null @@ -1,243 +0,0 @@ -// (C) Copyright John Maddock 2001-8. -// (C) Copyright Peter Dimov 2001. -// (C) Copyright Jens Maurer 2001. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Aleksey Gurtovoy 2002 - 2003. -// (C) Copyright Guillaume Melquiond 2002 - 2003. -// (C) Copyright Beman Dawes 2003. -// (C) Copyright Martin Wille 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Intel compiler setup: - -#include "gecode/third-party/boost/config/compiler/common_edg.hpp" - -#if defined(__INTEL_COMPILER) -# define GECODE_BOOST_INTEL_CXX_VERSION __INTEL_COMPILER -#elif defined(__ICL) -# define GECODE_BOOST_INTEL_CXX_VERSION __ICL -#elif defined(__ICC) -# define GECODE_BOOST_INTEL_CXX_VERSION __ICC -#elif defined(__ECC) -# define GECODE_BOOST_INTEL_CXX_VERSION __ECC -#endif - -// Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x' -#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && __STDC_HOSTED__) || defined(__GXX_EXPERIMENTAL_CPP0X__) -# define GECODE_BOOST_INTEL_STDCXX0X -#endif -#if defined(_MSC_VER) && (_MSC_VER >= 1600) -# define GECODE_BOOST_INTEL_STDCXX0X -#endif - -#ifdef GECODE_BOOST_INTEL_STDCXX0X -#define GECODE_BOOST_COMPILER "Intel C++ C++0x mode version " GECODE_BOOST_STRINGIZE(GECODE_BOOST_INTEL_CXX_VERSION) -#else -#define GECODE_BOOST_COMPILER "Intel C++ version " GECODE_BOOST_STRINGIZE(GECODE_BOOST_INTEL_CXX_VERSION) -#endif -#define GECODE_BOOST_INTEL GECODE_BOOST_INTEL_CXX_VERSION - -#if defined(_WIN32) || defined(_WIN64) -# define GECODE_BOOST_INTEL_WIN GECODE_BOOST_INTEL -#else -# define GECODE_BOOST_INTEL_LINUX GECODE_BOOST_INTEL -#endif - -#if (GECODE_BOOST_INTEL_CXX_VERSION <= 500) && defined(_MSC_VER) -# define GECODE_BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS -# define GECODE_BOOST_NO_TEMPLATE_TEMPLATES -#endif - -#if (GECODE_BOOST_INTEL_CXX_VERSION <= 600) - -# if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov) - -// Boost libraries assume strong standard conformance unless otherwise -// indicated by a config macro. As configured by Intel, the EDG front-end -// requires certain compiler options be set to achieve that strong conformance. -// Particularly /Qoption,c,--arg_dep_lookup (reported by Kirk Klobe & Thomas Witt) -// and /Zc:wchar_t,forScope. See boost-root/tools/build/intel-win32-tools.jam for -// details as they apply to particular versions of the compiler. When the -// compiler does not predefine a macro indicating if an option has been set, -// this config file simply assumes the option has been set. -// Thus GECODE_BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP will not be defined, even if -// the compiler option is not enabled. - -# define GECODE_BOOST_NO_SWPRINTF -# endif - -// Void returns, 64 bit integrals don't work when emulating VC 6 (Peter Dimov) - -# if defined(_MSC_VER) && (_MSC_VER <= 1200) -# define GECODE_BOOST_NO_VOID_RETURNS -# define GECODE_BOOST_NO_INTEGRAL_INT64_T -# endif - -#endif - -#if (GECODE_BOOST_INTEL_CXX_VERSION <= 710) && defined(_WIN32) -# define GECODE_BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS -#endif - -// See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864 -#if GECODE_BOOST_INTEL_CXX_VERSION < 600 -# define GECODE_BOOST_NO_INTRINSIC_WCHAR_T -#else -// We should test the macro _WCHAR_T_DEFINED to check if the compiler -// supports wchar_t natively. *BUT* there is a problem here: the standard -// headers define this macro if they typedef wchar_t. Anyway, we're lucky -// because they define it without a value, while Intel C++ defines it -// to 1. So we can check its value to see if the macro was defined natively -// or not. -// Under UNIX, the situation is exactly the same, but the macro _WCHAR_T -// is used instead. -# if ((_WCHAR_T_DEFINED + 0) == 0) && ((_WCHAR_T + 0) == 0) -# define GECODE_BOOST_NO_INTRINSIC_WCHAR_T -# endif -#endif - -#if defined(__GNUC__) && !defined(GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) -// -// Figure out when Intel is emulating this gcc bug -// (All Intel versions prior to 9.0.26, and versions -// later than that if they are set up to emulate gcc 3.2 -// or earlier): -// -# if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (GECODE_BOOST_INTEL < 900) || (__INTEL_COMPILER_BUILD_DATE < 20050912) -# define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -# endif -#endif -#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (GECODE_BOOST_INTEL_CXX_VERSION <= 1200) -// GCC or VC emulation: -#define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#endif -// -// Verify that we have actually got GECODE_BOOST_NO_INTRINSIC_WCHAR_T -// set correctly, if we don't do this now, we will get errors later -// in type_traits code among other things, getting this correct -// for the Intel compiler is actually remarkably fragile and tricky: -// -#ifdef __cplusplus -#if defined(GECODE_BOOST_NO_INTRINSIC_WCHAR_T) -#include -template< typename T > struct assert_no_intrinsic_wchar_t; -template<> struct assert_no_intrinsic_wchar_t { typedef void type; }; -// if you see an error here then you need to unset GECODE_BOOST_NO_INTRINSIC_WCHAR_T -// where it is defined above: -typedef assert_no_intrinsic_wchar_t::type assert_no_intrinsic_wchar_t_; -#else -template< typename T > struct assert_intrinsic_wchar_t; -template<> struct assert_intrinsic_wchar_t {}; -// if you see an error here then define GECODE_BOOST_NO_INTRINSIC_WCHAR_T on the command line: -template<> struct assert_intrinsic_wchar_t {}; -#endif -#endif - -#if defined(_MSC_VER) && (_MSC_VER+0 >= 1000) -# if _MSC_VER >= 1200 -# define GECODE_BOOST_HAS_MS_INT64 -# endif -# define GECODE_BOOST_NO_SWPRINTF -# define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#elif defined(_WIN32) -# define GECODE_BOOST_DISABLE_WIN32 -#endif - -// I checked version 6.0 build 020312Z, it implements the NRVO. -// Correct this as you find out which version of the compiler -// implemented the NRVO first. (Daniel Frey) -#if (GECODE_BOOST_INTEL_CXX_VERSION >= 600) -# define GECODE_BOOST_HAS_NRVO -#endif - -// -// versions check: -// we don't support Intel prior to version 5.0: -#if GECODE_BOOST_INTEL_CXX_VERSION < 500 -# error "Compiler not supported or configured - please reconfigure" -#endif - -// Intel on MacOS requires -#if defined(__APPLE__) && defined(__INTEL_COMPILER) -# define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#endif - -// Intel on Altix Itanium -#if defined(__itanium__) && defined(__INTEL_COMPILER) -# define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#endif - -// -// An attempt to value-initialize a pointer-to-member may trigger an -// internal error on Intel <= 11.1 (last checked version), as was -// reported by John Maddock, Intel support issue 589832, May 2010. -// Moreover, according to test results from Huang-Vista-x86_32_intel, -// intel-vc9-win-11.1 may leave a non-POD array uninitialized, in some -// cases when it should be value-initialized. -// (Niels Dekker, LKEB, May 2010) -#if defined(__INTEL_COMPILER) -# if __INTEL_COMPILER <= 1110 -# define GECODE_BOOST_NO_COMPLETE_VALUE_INITIALIZATION -# endif -#endif - -// -// Dynamic shared object (DSO) and dynamic-link library (DLL) support -// -#if defined(__GNUC__) && (__GNUC__ >= 4) -# define GECODE_BOOST_SYMBOL_EXPORT __attribute__((visibility("default"))) -# define GECODE_BOOST_SYMBOL_IMPORT -# define GECODE_BOOST_SYMBOL_VISIBLE __attribute__((visibility("default"))) -#endif -// -// C++0x features -// - ICC added static_assert in 11.0 (first version with C++0x support) -// -#if defined(GECODE_BOOST_INTEL_STDCXX0X) -# undef GECODE_BOOST_NO_STATIC_ASSERT -// -// These pass our test cases, but aren't officially supported according to: -// http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/ -// -//# undef GECODE_BOOST_NO_LAMBDAS -//# undef GECODE_BOOST_NO_DECLTYPE -//# undef GECODE_BOOST_NO_AUTO_DECLARATIONS -//# undef GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#endif - -#if defined(GECODE_BOOST_INTEL_STDCXX0X) && (GECODE_BOOST_INTEL_CXX_VERSION >= 1200) -# undef GECODE_BOOST_NO_RVALUE_REFERENCES -//# undef GECODE_BOOST_NO_SCOPED_ENUMS // doesn't really work!! -# undef GECODE_BOOST_NO_DELETED_FUNCTIONS -# undef GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -# undef GECODE_BOOST_NO_LAMBDAS -# undef GECODE_BOOST_NO_DECLTYPE -# undef GECODE_BOOST_NO_AUTO_DECLARATIONS -# undef GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#endif - -#if (GECODE_BOOST_INTEL_CXX_VERSION < 1200) -// -// fenv.h appears not to work with Intel prior to 12.0: -// -# define GECODE_BOOST_NO_FENV_H -#endif - -// -// last known and checked version: -#if (GECODE_BOOST_INTEL_CXX_VERSION > 1200) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# elif defined(_MSC_VER) -// -// We don't emit this warning any more, since we have so few -// defect macros set anyway (just the one). -// -//# pragma message("Unknown compiler version - please run the configure tests and report the results") -# endif -#endif - diff --git a/gecode/third-party/boost/config/compiler/kai.hpp b/gecode/third-party/boost/config/compiler/kai.hpp deleted file mode 100644 index 45c2cc9339..0000000000 --- a/gecode/third-party/boost/config/compiler/kai.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// (C) Copyright John Maddock 2001. -// (C) Copyright David Abrahams 2002. -// (C) Copyright Aleksey Gurtovoy 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Kai C++ compiler setup: - -#include "gecode/third-party/boost/config/compiler/common_edg.hpp" - -# if (__KCC_VERSION <= 4001) || !defined(GECODE_BOOST_STRICT_CONFIG) - // at least on Sun, the contents of is not in namespace std -# define GECODE_BOOST_NO_STDC_NAMESPACE -# endif - -// see also common_edg.hpp which needs a special check for __KCC -# if !defined(_EXCEPTIONS) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -# define GECODE_BOOST_NO_EXCEPTIONS -# endif - -// -// last known and checked version is 4001: -#if (__KCC_VERSION > 4001) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif - - - diff --git a/gecode/third-party/boost/config/compiler/metrowerks.hpp b/gecode/third-party/boost/config/compiler/metrowerks.hpp deleted file mode 100644 index 97881e1429..0000000000 --- a/gecode/third-party/boost/config/compiler/metrowerks.hpp +++ /dev/null @@ -1,141 +0,0 @@ -// (C) Copyright John Maddock 2001. -// (C) Copyright Darin Adler 2001. -// (C) Copyright Peter Dimov 2001. -// (C) Copyright David Abrahams 2001 - 2002. -// (C) Copyright Beman Dawes 2001 - 2003. -// (C) Copyright Stefan Slapeta 2004. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Metrowerks C++ compiler setup: - -// locale support is disabled when linking with the dynamic runtime -# ifdef _MSL_NO_LOCALE -# define GECODE_BOOST_NO_STD_LOCALE -# endif - -# if __MWERKS__ <= 0x2301 // 5.3 -# define GECODE_BOOST_NO_FUNCTION_TEMPLATE_ORDERING -# define GECODE_BOOST_NO_POINTER_TO_MEMBER_CONST -# define GECODE_BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_KEYWORD -# endif - -# if __MWERKS__ <= 0x2401 // 6.2 -//# define GECODE_BOOST_NO_FUNCTION_TEMPLATE_ORDERING -# endif - -# if(__MWERKS__ <= 0x2407) // 7.x -# define GECODE_BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS -# define GECODE_BOOST_NO_UNREACHABLE_RETURN_DETECTION -# endif - -# if(__MWERKS__ <= 0x3003) // 8.x -# define GECODE_BOOST_NO_SFINAE -# endif - -// the "|| !defined(GECODE_BOOST_STRICT_CONFIG)" part should apply to the last -// tested version *only*: -# if(__MWERKS__ <= 0x3207) || !defined(GECODE_BOOST_STRICT_CONFIG) // 9.6 -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -# define GECODE_BOOST_NO_IS_ABSTRACT -# endif - -#if !__option(wchar_type) -# define GECODE_BOOST_NO_INTRINSIC_WCHAR_T -#endif - -#if !__option(exceptions) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -# define GECODE_BOOST_NO_EXCEPTIONS -#endif - -#if (__INTEL__ && _WIN32) || (__POWERPC__ && macintosh) -# if __MWERKS__ == 0x3000 -# define GECODE_BOOST_COMPILER_VERSION 8.0 -# elif __MWERKS__ == 0x3001 -# define GECODE_BOOST_COMPILER_VERSION 8.1 -# elif __MWERKS__ == 0x3002 -# define GECODE_BOOST_COMPILER_VERSION 8.2 -# elif __MWERKS__ == 0x3003 -# define GECODE_BOOST_COMPILER_VERSION 8.3 -# elif __MWERKS__ == 0x3200 -# define GECODE_BOOST_COMPILER_VERSION 9.0 -# elif __MWERKS__ == 0x3201 -# define GECODE_BOOST_COMPILER_VERSION 9.1 -# elif __MWERKS__ == 0x3202 -# define GECODE_BOOST_COMPILER_VERSION 9.2 -# elif __MWERKS__ == 0x3204 -# define GECODE_BOOST_COMPILER_VERSION 9.3 -# elif __MWERKS__ == 0x3205 -# define GECODE_BOOST_COMPILER_VERSION 9.4 -# elif __MWERKS__ == 0x3206 -# define GECODE_BOOST_COMPILER_VERSION 9.5 -# elif __MWERKS__ == 0x3207 -# define GECODE_BOOST_COMPILER_VERSION 9.6 -# else -# define GECODE_BOOST_COMPILER_VERSION __MWERKS__ -# endif -#else -# define GECODE_BOOST_COMPILER_VERSION __MWERKS__ -#endif - -// -// C++0x features -// -// See boost\config\suffix.hpp for GECODE_BOOST_NO_LONG_LONG -// -#if __MWERKS__ > 0x3206 && __option(rvalue_refs) -# define GECODE_BOOST_HAS_RVALUE_REFS -#else -# define GECODE_BOOST_NO_RVALUE_REFERENCES -#endif -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DECLTYPE -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define GECODE_BOOST_NO_EXTERN_TEMPLATE -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_STATIC_ASSERT -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_VARIADIC_MACROS -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -#define GECODE_BOOST_COMPILER "Metrowerks CodeWarrior C++ version " GECODE_BOOST_STRINGIZE(GECODE_BOOST_COMPILER_VERSION) - -// -// versions check: -// we don't support Metrowerks prior to version 5.3: -#if __MWERKS__ < 0x2301 -# error "Compiler not supported or configured - please reconfigure" -#endif -// -// last known and checked version: -#if (__MWERKS__ > 0x3205) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif - - - - - - - diff --git a/gecode/third-party/boost/config/compiler/mpw.hpp b/gecode/third-party/boost/config/compiler/mpw.hpp deleted file mode 100644 index cd121ef239..0000000000 --- a/gecode/third-party/boost/config/compiler/mpw.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2002. -// (C) Copyright Aleksey Gurtovoy 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// MPW C++ compilers setup: - -# if defined(__SC__) -# define GECODE_BOOST_COMPILER "MPW SCpp version " GECODE_BOOST_STRINGIZE(__SC__) -# elif defined(__MRC__) -# define GECODE_BOOST_COMPILER "MPW MrCpp version " GECODE_BOOST_STRINGIZE(__MRC__) -# else -# error "Using MPW compiler configuration by mistake. Please update." -# endif - -// -// MPW 8.90: -// -#if (MPW_CPLUS <= 0x890) || !defined(GECODE_BOOST_STRICT_CONFIG) -# define GECODE_BOOST_NO_CV_SPECIALIZATIONS -# define GECODE_BOOST_NO_DEPENDENT_NESTED_DERIVATIONS -# define GECODE_BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS -# define GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION -# define GECODE_BOOST_NO_INTRINSIC_WCHAR_T -# define GECODE_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -# define GECODE_BOOST_NO_USING_TEMPLATE - -# define GECODE_BOOST_NO_CWCHAR -# define GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS - -# define GECODE_BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */ - -#endif - -// -// C++0x features -// -// See boost\config\suffix.hpp for GECODE_BOOST_NO_LONG_LONG -// -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DECLTYPE -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define GECODE_BOOST_NO_EXTERN_TEMPLATE -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_STATIC_ASSERT -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_VARIADIC_MACROS -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -// -// versions check: -// we don't support MPW prior to version 8.9: -#if MPW_CPLUS < 0x890 -# error "Compiler not supported or configured - please reconfigure" -#endif -// -// last known and checked version is 0x890: -#if (MPW_CPLUS > 0x890) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif - - diff --git a/gecode/third-party/boost/config/compiler/nvcc.hpp b/gecode/third-party/boost/config/compiler/nvcc.hpp deleted file mode 100644 index c16cb0ed1e..0000000000 --- a/gecode/third-party/boost/config/compiler/nvcc.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// (C) Copyright Eric Jourdanneau, Joel Falcou 2010 -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// NVIDIA CUDA C++ compiler setup - -#ifndef GECODE_BOOST_COMPILER -# define GECODE_BOOST_COMPILER "NVIDIA CUDA C++ Compiler" -#endif - -// NVIDIA Specific support -// GECODE_BOOST_GPU_ENABLED : Flag a function or a method as being enabled on the host and device -#define GECODE_BOOST_GPU_ENABLED __host__ __device__ - -// Boost support macro for NVCC -// NVCC Basically behaves like some flavor of MSVC6 + some specific quirks -#ifdef __GNUC__ - -#include - -#elif defined(_MSC_VER) - -#include - -#endif diff --git a/gecode/third-party/boost/config/compiler/pathscale.hpp b/gecode/third-party/boost/config/compiler/pathscale.hpp deleted file mode 100644 index 2f75288433..0000000000 --- a/gecode/third-party/boost/config/compiler/pathscale.hpp +++ /dev/null @@ -1,79 +0,0 @@ -// (C) Copyright Bryce Lelbach 2011 - -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// PathScale EKOPath C++ Compiler - -#ifndef GECODE_BOOST_COMPILER -# define GECODE_BOOST_COMPILER "PathScale EKOPath C++ Compiler version " __PATHSCALE__ -#endif - -#if __PATHCC__ >= 4 -# define GECODE_BOOST_MSVC6_MEMBER_TEMPLATES -# define GECODE_BOOST_HAS_UNISTD_H -# define GECODE_BOOST_HAS_STDINT_H -# define GECODE_BOOST_HAS_SIGACTION -# define GECODE_BOOST_HAS_SCHED_YIELD -# define GECODE_BOOST_HAS_THREADS -# define GECODE_BOOST_HAS_PTHREADS -# define GECODE_BOOST_HAS_PTHREAD_YIELD -# define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# define GECODE_BOOST_HAS_PARTIAL_STD_ALLOCATOR -# define GECODE_BOOST_HAS_NRVO -# define GECODE_BOOST_HAS_NL_TYPES_H -# define GECODE_BOOST_HAS_NANOSLEEP -# define GECODE_BOOST_HAS_LONG_LONG -# define GECODE_BOOST_HAS_LOG1P -# define GECODE_BOOST_HAS_GETTIMEOFDAY -# define GECODE_BOOST_HAS_EXPM1 -# define GECODE_BOOST_HAS_DIRENT_H -# define GECODE_BOOST_HAS_CLOCK_GETTIME -# define GECODE_BOOST_NO_VARIADIC_TEMPLATES -# define GECODE_BOOST_NO_UNICODE_LITERALS -# define GECODE_BOOST_NO_TEMPLATE_ALIASES -# define GECODE_BOOST_NO_STD_UNORDERED -# define GECODE_BOOST_NO_STATIC_ASSERT -# define GECODE_BOOST_NO_SFINAE_EXPR -# define GECODE_BOOST_NO_SCOPED_ENUMS -# define GECODE_BOOST_NO_RVALUE_REFERENCES -# define GECODE_BOOST_NO_RAW_LITERALS -# define GECODE_BOOST_NO_NULLPTR -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST -# define GECODE_BOOST_NO_NOEXCEPT -# define GECODE_BOOST_NO_LAMBDAS -# define GECODE_BOOST_NO_INITIALIZER_LISTS -# define GECODE_BOOST_NO_MS_INT64_NUMERIC_LIMITS -# define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -# define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -# define GECODE_BOOST_NO_DELETED_FUNCTIONS -# define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -# define GECODE_BOOST_NO_DECLTYPE -# define GECODE_BOOST_NO_CONSTEXPR -# define GECODE_BOOST_NO_COMPLETE_VALUE_INITIALIZATION -# define GECODE_BOOST_NO_CHAR32_T -# define GECODE_BOOST_NO_CHAR16_T -# define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -# define GECODE_BOOST_NO_AUTO_DECLARATIONS -# define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_CHRONO -#endif - diff --git a/gecode/third-party/boost/config/compiler/pgi.hpp b/gecode/third-party/boost/config/compiler/pgi.hpp deleted file mode 100644 index 7e548663af..0000000000 --- a/gecode/third-party/boost/config/compiler/pgi.hpp +++ /dev/null @@ -1,79 +0,0 @@ -// (C) Copyright Noel Belcourt 2007. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// PGI C++ compiler setup: - -#define GECODE_BOOST_COMPILER_VERSION __PGIC__##__PGIC_MINOR__ -#define GECODE_BOOST_COMPILER "PGI compiler version " GECODE_BOOST_STRINGIZE(_COMPILER_VERSION) - -// -// Threading support: -// Turn this on unconditionally here, it will get turned off again later -// if no threading API is detected. -// - -// PGI 10.x doesn't seem to define __PGIC__ - -// versions earlier than 10.x do define __PGIC__ -#if __PGIC__ >= 10 - -// options requested by configure --enable-test -#define GECODE_BOOST_HAS_PTHREADS -#define GECODE_BOOST_HAS_NRVO -#define GECODE_BOOST_HAS_LONG_LONG - -// options --enable-test wants undefined -#undef GECODE_BOOST_NO_STDC_NAMESPACE -#undef GECODE_BOOST_NO_EXCEPTION_STD_NAMESPACE -#undef GECODE_BOOST_DEDUCED_TYPENAME - -#elif __PGIC__ >= 7 - -#define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -#define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#define GECODE_BOOST_NO_SWPRINTF -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_AUTO_DECLARATIONS - -#else - -# error "Pgi compiler not configured - please reconfigure" - -#endif -// -// C++0x features -// -// See boost\config\suffix.hpp for GECODE_BOOST_NO_LONG_LONG -// -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DECLTYPE -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define GECODE_BOOST_NO_EXTERN_TEMPLATE -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_STATIC_ASSERT -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_VARIADIC_MACROS -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -// -// version check: -// probably nothing to do here? - diff --git a/gecode/third-party/boost/config/compiler/sgi_mipspro.hpp b/gecode/third-party/boost/config/compiler/sgi_mipspro.hpp deleted file mode 100644 index 1d2c4039c7..0000000000 --- a/gecode/third-party/boost/config/compiler/sgi_mipspro.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// SGI C++ compiler setup: - -#define GECODE_BOOST_COMPILER "SGI Irix compiler version " GECODE_BOOST_STRINGIZE(_COMPILER_VERSION) - -#include "gecode/third-party/boost/config/compiler/common_edg.hpp" - -// -// Threading support: -// Turn this on unconditionally here, it will get turned off again later -// if no threading API is detected. -// -#define GECODE_BOOST_HAS_THREADS -#define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP - -#undef GECODE_BOOST_NO_SWPRINTF -#undef GECODE_BOOST_DEDUCED_TYPENAME - -// -// version check: -// probably nothing to do here? - - diff --git a/gecode/third-party/boost/config/compiler/sunpro_cc.hpp b/gecode/third-party/boost/config/compiler/sunpro_cc.hpp deleted file mode 100644 index a6528dda8c..0000000000 --- a/gecode/third-party/boost/config/compiler/sunpro_cc.hpp +++ /dev/null @@ -1,146 +0,0 @@ -// (C) Copyright John Maddock 2001. -// (C) Copyright Jens Maurer 2001 - 2003. -// (C) Copyright Peter Dimov 2002. -// (C) Copyright Aleksey Gurtovoy 2002 - 2003. -// (C) Copyright David Abrahams 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Sun C++ compiler setup: - -# if __SUNPRO_CC <= 0x500 -# define GECODE_BOOST_NO_MEMBER_TEMPLATES -# define GECODE_BOOST_NO_FUNCTION_TEMPLATE_ORDERING -# endif - -# if (__SUNPRO_CC <= 0x520) - // - // Sunpro 5.2 and earler: - // - // although sunpro 5.2 supports the syntax for - // inline initialization it often gets the value - // wrong, especially where the value is computed - // from other constants (J Maddock 6th May 2001) -# define GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION - - // Although sunpro 5.2 supports the syntax for - // partial specialization, it often seems to - // bind to the wrong specialization. Better - // to disable it until suppport becomes more stable - // (J Maddock 6th May 2001). -# define GECODE_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -# endif - -# if (__SUNPRO_CC <= 0x530) - // Requesting debug info (-g) with Boost.Python results - // in an internal compiler error for "static const" - // initialized in-class. - // >> Assertion: (../links/dbg_cstabs.cc, line 611) - // while processing ../test.cpp at line 0. - // (Jens Maurer according to Gottfried Ganssauge 04 Mar 2002) -# define GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION - - // SunPro 5.3 has better support for partial specialization, - // but breaks when compiling std::less > - // (Jens Maurer 4 Nov 2001). - - // std::less specialization fixed as reported by George - // Heintzelman; partial specialization re-enabled - // (Peter Dimov 17 Jan 2002) - -//# define GECODE_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - // integral constant expressions with 64 bit numbers fail -# define GECODE_BOOST_NO_INTEGRAL_INT64_T -# endif - -# if (__SUNPRO_CC < 0x570) -# define GECODE_BOOST_NO_TEMPLATE_TEMPLATES - // see http://lists.boost.org/MailArchives/boost/msg47184.php - // and http://lists.boost.org/MailArchives/boost/msg47220.php -# define GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION -# define GECODE_BOOST_NO_SFINAE -# define GECODE_BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS -# endif -# if (__SUNPRO_CC <= 0x580) -# define GECODE_BOOST_NO_IS_ABSTRACT -# endif - -# if (__SUNPRO_CC <= 0x5100) - // Sun 5.10 may not correctly value-initialize objects of - // some user defined types, as was reported in April 2010 - // (CR 6947016), and confirmed by Steve Clamage. - // (Niels Dekker, LKEB, May 2010). -# define GECODE_BOOST_NO_COMPLETE_VALUE_INITIALIZATION -# endif - -// -// Dynamic shared object (DSO) and dynamic-link library (DLL) support -// -#if __SUNPRO_CC > 0x500 -# define GECODE_BOOST_SYMBOL_EXPORT __global -# define GECODE_BOOST_SYMBOL_IMPORT __global -# define GECODE_BOOST_SYMBOL_VISIBLE __global -#endif - - - -// -// Issues that effect all known versions: -// -#define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#define GECODE_BOOST_NO_ADL_BARRIER - -// -// C++0x features -// -# define GECODE_BOOST_HAS_LONG_LONG - -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DECLTYPE -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define GECODE_BOOST_NO_EXTERN_TEMPLATE -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_STATIC_ASSERT -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_VARIADIC_MACROS -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX - -// -// Version -// - -#define GECODE_BOOST_COMPILER "Sun compiler version " GECODE_BOOST_STRINGIZE(__SUNPRO_CC) - -// -// versions check: -// we don't support sunpro prior to version 4: -#if __SUNPRO_CC < 0x400 -#error "Compiler not supported or configured - please reconfigure" -#endif -// -// last known and checked version is 0x590: -#if (__SUNPRO_CC > 0x590) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif diff --git a/gecode/third-party/boost/config/compiler/vacpp.hpp b/gecode/third-party/boost/config/compiler/vacpp.hpp deleted file mode 100644 index e685eead95..0000000000 --- a/gecode/third-party/boost/config/compiler/vacpp.hpp +++ /dev/null @@ -1,119 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Toon Knapen 2001 - 2003. -// (C) Copyright Lie-Quan Lee 2001. -// (C) Copyright Markus Schoepflin 2002 - 2003. -// (C) Copyright Beman Dawes 2002 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Visual Age (IBM) C++ compiler setup: - -#if __IBMCPP__ <= 501 -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -# define GECODE_BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS -#endif - -#if (__IBMCPP__ <= 502) -// Actually the compiler supports inclass member initialization but it -// requires a definition for the class member and it doesn't recognize -// it as an integral constant expression when used as a template argument. -# define GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION -# define GECODE_BOOST_NO_INTEGRAL_INT64_T -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_KEYWORD -#endif - -#if (__IBMCPP__ <= 600) || !defined(GECODE_BOOST_STRICT_CONFIG) -# define GECODE_BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS -#endif - -#if (__IBMCPP__ <= 1110) -// XL C++ V11.1 and earlier versions may not always value-initialize -// a temporary object T(), when T is a non-POD aggregate class type. -// Michael Wong (IBM Canada Ltd) has confirmed this issue and gave it -// high priority. -- Niels Dekker (LKEB), May 2010. -# define GECODE_BOOST_NO_COMPLETE_VALUE_INITIALIZATION -#endif - -// -// On AIX thread support seems to be indicated by _THREAD_SAFE: -// -#ifdef _THREAD_SAFE -# define GECODE_BOOST_HAS_THREADS -#endif - -#define GECODE_BOOST_COMPILER "IBM Visual Age version " GECODE_BOOST_STRINGIZE(__IBMCPP__) - -// -// versions check: -// we don't support Visual age prior to version 5: -#if __IBMCPP__ < 500 -#error "Compiler not supported or configured - please reconfigure" -#endif -// -// last known and checked version is 1110: -#if (__IBMCPP__ > 1110) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# endif -#endif - -// Some versions of the compiler have issues with default arguments on partial specializations -#if __IBMCPP__ <= 1010 -#define GECODE_BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS -#endif - -// -// C++0x features -// -// See boost\config\suffix.hpp for GECODE_BOOST_NO_LONG_LONG -// -#if ! __IBMCPP_AUTO_TYPEDEDUCTION -# define GECODE_BOOST_NO_AUTO_DECLARATIONS -# define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#endif -#if ! __IBMCPP_UTF_LITERAL__ -# define GECODE_BOOST_NO_CHAR16_T -# define GECODE_BOOST_NO_CHAR32_T -#endif -#define GECODE_BOOST_NO_CONSTEXPR -#if ! __IBMCPP_DECLTYPE -# define GECODE_BOOST_NO_DECLTYPE -#else -# define GECODE_BOOST_HAS_DECLTYPE -#endif -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#if ! __IBMCPP_EXTERN_TEMPLATE -# define GECODE_BOOST_NO_EXTERN_TEMPLATE -#endif -#if ! __IBMCPP_VARIADIC_TEMPLATES -// not enabled separately at this time -# define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#endif -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX -#if ! __IBMCPP_STATIC_ASSERT -# define GECODE_BOOST_NO_STATIC_ASSERT -#endif -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#if ! __IBMCPP_VARIADIC_TEMPLATES -# define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#endif -#if ! __C99_MACRO_WITH_VA_ARGS -# define GECODE_BOOST_NO_VARIADIC_MACROS -#endif - - - diff --git a/gecode/third-party/boost/config/compiler/visualc.hpp b/gecode/third-party/boost/config/compiler/visualc.hpp deleted file mode 100644 index 9c9acd6df9..0000000000 --- a/gecode/third-party/boost/config/compiler/visualc.hpp +++ /dev/null @@ -1,283 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Darin Adler 2001 - 2002. -// (C) Copyright Peter Dimov 2001. -// (C) Copyright Aleksey Gurtovoy 2002. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Beman Dawes 2002 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Microsoft Visual C++ compiler setup: - -#define GECODE_BOOST_MSVC _MSC_VER - -#if _MSC_FULL_VER > 100000000 -# define GECODE_BOOST_MSVC_FULL_VER _MSC_FULL_VER -#else -# define GECODE_BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10) -#endif - -// turn off the warnings before we #include anything -#pragma warning( disable : 4503 ) // warning: decorated name length exceeded - -#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4 -# pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info -# define GECODE_BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS -# define GECODE_BOOST_NO_VOID_RETURNS -# define GECODE_BOOST_NO_EXCEPTION_STD_NAMESPACE - -# if GECODE_BOOST_MSVC == 1202 -# define GECODE_BOOST_NO_STD_TYPEINFO -# endif - - // disable min/max macro defines on vc6: - // -#endif - -/// Visual Studio has no fenv.h -#define GECODE_BOOST_NO_FENV_H - -#if (_MSC_VER <= 1300) // 1300 == VC++ 7.0 - -# if !defined(_MSC_EXTENSIONS) && !defined(GECODE_BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za -# define GECODE_BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS -# endif - -# define GECODE_BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS -# define GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION -# define GECODE_BOOST_NO_PRIVATE_IN_AGGREGATE -# define GECODE_BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -# define GECODE_BOOST_NO_INTEGRAL_INT64_T -# define GECODE_BOOST_NO_DEDUCED_TYPENAME -# define GECODE_BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE - -// VC++ 6/7 has member templates but they have numerous problems including -// cases of silent failure, so for safety we define: -# define GECODE_BOOST_NO_MEMBER_TEMPLATES -// For VC++ experts wishing to attempt workarounds, we define: -# define GECODE_BOOST_MSVC6_MEMBER_TEMPLATES - -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -# define GECODE_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -# define GECODE_BOOST_NO_CV_VOID_SPECIALIZATIONS -# define GECODE_BOOST_NO_FUNCTION_TEMPLATE_ORDERING -# define GECODE_BOOST_NO_USING_TEMPLATE -# define GECODE_BOOST_NO_SWPRINTF -# define GECODE_BOOST_NO_TEMPLATE_TEMPLATES -# define GECODE_BOOST_NO_SFINAE -# define GECODE_BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS -# define GECODE_BOOST_NO_IS_ABSTRACT -# define GECODE_BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS -// TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)? -# if (_MSC_VER > 1200) -# define GECODE_BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS -# endif - -#endif - -#if _MSC_VER < 1400 -// although a conforming signature for swprint exists in VC7.1 -// it appears not to actually work: -# define GECODE_BOOST_NO_SWPRINTF -// Our extern template tests also fail for this compiler: -# define GECODE_BOOST_NO_EXTERN_TEMPLATE -// Variadic macros do not exist for VC7.1 and lower -# define GECODE_BOOST_NO_VARIADIC_MACROS -#endif - -#if defined(UNDER_CE) -// Windows CE does not have a conforming signature for swprintf -# define GECODE_BOOST_NO_SWPRINTF -#endif - -#if _MSC_VER <= 1400 // 1400 == VC++ 8.0 -# define GECODE_BOOST_NO_MEMBER_TEMPLATE_FRIENDS -#endif - -#if _MSC_VER == 1500 // 1500 == VC++ 9.0 - // A bug in VC9: -# define GECODE_BOOST_NO_ADL_BARRIER -#endif - - -#if (_MSC_VER <= 1600) -// MSVC (including the latest checked version) has not yet completely -// implemented value-initialization, as is reported: -// "VC++ does not value-initialize members of derived classes without -// user-declared constructor", reported in 2009 by Sylvester Hesp: -// https://connect.microsoft.com/VisualStudio/feedback/details/484295 -// "Presence of copy constructor breaks member class initialization", -// reported in 2009 by Alex Vakulenko: -// https://connect.microsoft.com/VisualStudio/feedback/details/499606 -// "Value-initialization in new-expression", reported in 2005 by -// Pavel Kuznetsov (MetaCommunications Engineering): -// https://connect.microsoft.com/VisualStudio/feedback/details/100744 -// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues -// (Niels Dekker, LKEB, May 2010) -#define GECODE_BOOST_NO_COMPLETE_VALUE_INITIALIZATION -#endif - -#if _MSC_VER <= 1500 || !defined(GECODE_BOOST_STRICT_CONFIG) // 1500 == VC++ 9.0 -# define GECODE_BOOST_NO_INITIALIZER_LISTS -#endif - -#ifndef _NATIVE_WCHAR_T_DEFINED -# define GECODE_BOOST_NO_INTRINSIC_WCHAR_T -#endif - -#if defined(_WIN32_WCE) || defined(UNDER_CE) -# define GECODE_BOOST_NO_SWPRINTF -#endif - -// we have ThreadEx or GetSystemTimeAsFileTime unless we're running WindowsCE -#if !defined(_WIN32_WCE) && !defined(UNDER_CE) -# define GECODE_BOOST_HAS_THREADEX -# define GECODE_BOOST_HAS_GETSYSTEMTIMEASFILETIME -#endif - -// -// check for exception handling support: -#if !defined(_CPPUNWIND) && !defined(GECODE_BOOST_NO_EXCEPTIONS) -# define GECODE_BOOST_NO_EXCEPTIONS -#endif - -// -// __int64 support: -// -#if (_MSC_VER >= 1200) -# define GECODE_BOOST_HAS_MS_INT64 -#endif -#if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400)) -# define GECODE_BOOST_HAS_LONG_LONG -#else -# define GECODE_BOOST_NO_LONG_LONG -#endif -#if (_MSC_VER >= 1400) && !defined(_DEBUG) -# define GECODE_BOOST_HAS_NRVO -#endif -// -// disable Win32 API's if compiler extentions are -// turned off: -// -#if !defined(_MSC_EXTENSIONS) && !defined(GECODE_BOOST_DISABLE_WIN32) -# define GECODE_BOOST_DISABLE_WIN32 -#endif -#if !defined(_CPPRTTI) && !defined(GECODE_BOOST_NO_RTTI) -# define GECODE_BOOST_NO_RTTI -#endif - -// -// C++0x features -// -// See above for GECODE_BOOST_NO_LONG_LONG - -// C++ features supported by VC++ 10 (aka 2010) -// -#if _MSC_VER < 1600 -#define GECODE_BOOST_NO_AUTO_DECLARATIONS -#define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS -#define GECODE_BOOST_NO_LAMBDAS -#define GECODE_BOOST_NO_RVALUE_REFERENCES -#define GECODE_BOOST_NO_STATIC_ASSERT -#define GECODE_BOOST_NO_NULLPTR -#define GECODE_BOOST_NO_DECLTYPE -#endif // _MSC_VER < 1600 - -#if _MSC_VER >= 1600 -#define GECODE_BOOST_HAS_STDINT_H -#endif - -// C++0x features not supported by any versions -#define GECODE_BOOST_NO_CHAR16_T -#define GECODE_BOOST_NO_CHAR32_T -#define GECODE_BOOST_NO_CONSTEXPR -#define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS -#define GECODE_BOOST_NO_DELETED_FUNCTIONS -#define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define GECODE_BOOST_NO_INITIALIZER_LISTS -#define GECODE_BOOST_NO_NOEXCEPT -#define GECODE_BOOST_NO_RAW_LITERALS -#define GECODE_BOOST_NO_SCOPED_ENUMS -#define GECODE_BOOST_NO_TEMPLATE_ALIASES -#define GECODE_BOOST_NO_UNICODE_LITERALS -#define GECODE_BOOST_NO_VARIADIC_TEMPLATES -#define GECODE_BOOST_NO_SFINAE_EXPR -#define GECODE_BOOST_NO_TWO_PHASE_NAME_LOOKUP -#define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX -// -// prefix and suffix headers: -// -#ifndef GECODE_BOOST_ABI_PREFIX -# define GECODE_BOOST_ABI_PREFIX "gecode/third-party/boost/config/abi/msvc_prefix.hpp" -#endif -#ifndef GECODE_BOOST_ABI_SUFFIX -# define GECODE_BOOST_ABI_SUFFIX "gecode/third-party/boost/config/abi/msvc_suffix.hpp" -#endif - -// TODO: -// these things are mostly bogus. 1200 means version 12.0 of the compiler. The -// artificial versions assigned to them only refer to the versions of some IDE -// these compilers have been shipped with, and even that is not all of it. Some -// were shipped with freely downloadable SDKs, others as crosscompilers in eVC. -// IOW, you can't use these 'versions' in any sensible way. Sorry. -# if defined(UNDER_CE) -# if _MSC_VER < 1200 - // Note: these are so far off, they are not really supported -# elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202 -# define GECODE_BOOST_COMPILER_VERSION evc4.0 -# elif _MSC_VER == 1400 -# define GECODE_BOOST_COMPILER_VERSION evc8 -# elif _MSC_VER == 1500 -# define GECODE_BOOST_COMPILER_VERSION evc9 -# elif _MSC_VER == 1600 -# define GECODE_BOOST_COMPILER_VERSION evc10 -# else -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown EVC++ compiler version - please run the configure tests and report the results" -# else -# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results") -# endif -# endif -# else -# if _MSC_VER < 1200 - // Note: these are so far off, they are not really supported -# define GECODE_BOOST_COMPILER_VERSION 5.0 -# elif _MSC_VER < 1300 -# define GECODE_BOOST_COMPILER_VERSION 6.0 -# elif _MSC_VER == 1300 -# define GECODE_BOOST_COMPILER_VERSION 7.0 -# elif _MSC_VER == 1310 -# define GECODE_BOOST_COMPILER_VERSION 7.1 -# elif _MSC_VER == 1400 -# define GECODE_BOOST_COMPILER_VERSION 8.0 -# elif _MSC_VER == 1500 -# define GECODE_BOOST_COMPILER_VERSION 9.0 -# elif _MSC_VER == 1600 -# define GECODE_BOOST_COMPILER_VERSION 10.0 -# else -# define GECODE_BOOST_COMPILER_VERSION _MSC_VER -# endif -# endif - -#define GECODE_BOOST_COMPILER "Microsoft Visual C++ version " GECODE_BOOST_STRINGIZE(GECODE_BOOST_COMPILER_VERSION) - -// -// versions check: -// we don't support Visual C++ prior to version 6: -#if _MSC_VER < 1200 -#error "Compiler not supported or configured - please reconfigure" -#endif -// -// last known and checked version is 1600 (VC10, aka 2010): -// Changed to VC15, aka 2017 -#if (_MSC_VER > 2000) -# if defined(GECODE_BOOST_ASSERT_CONFIG) -# error "Unknown compiler version - please run the configure tests and report the results" -# else -# pragma message("Unknown compiler version - please run the configure tests and report the results") -# endif -#endif diff --git a/gecode/third-party/boost/config/no_tr1/cmath.hpp b/gecode/third-party/boost/config/no_tr1/cmath.hpp deleted file mode 100644 index e778d78c48..0000000000 --- a/gecode/third-party/boost/config/no_tr1/cmath.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// (C) Copyright John Maddock 2008. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// The aim of this header is just to include but to do -// so in a way that does not result in recursive inclusion of -// the Boost TR1 components if boost/tr1/tr1/cmath is in the -// include search path. We have to do this to avoid circular -// dependencies: -// - -#ifndef GECODE_BOOST_CONFIG_CMATH -# define GECODE_BOOST_CONFIG_CMATH - -# ifndef GECODE_BOOST_TR1_NO_RECURSION -# define GECODE_BOOST_TR1_NO_RECURSION -# define GECODE_BOOST_CONFIG_NO_CMATH_RECURSION -# endif - -# include - -# ifdef GECODE_BOOST_CONFIG_NO_CMATH_RECURSION -# undef GECODE_BOOST_TR1_NO_RECURSION -# undef GECODE_BOOST_CONFIG_NO_CMATH_RECURSION -# endif - -#endif diff --git a/gecode/third-party/boost/config/no_tr1/utility.hpp b/gecode/third-party/boost/config/no_tr1/utility.hpp deleted file mode 100644 index 7407f1596f..0000000000 --- a/gecode/third-party/boost/config/no_tr1/utility.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// (C) Copyright John Maddock 2005. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// The aim of this header is just to include but to do -// so in a way that does not result in recursive inclusion of -// the Boost TR1 components if boost/tr1/tr1/utility is in the -// include search path. We have to do this to avoid circular -// dependencies: -// - -#ifndef GECODE_BOOST_CONFIG_UTILITY -# define GECODE_BOOST_CONFIG_UTILITY - -# ifndef GECODE_BOOST_TR1_NO_RECURSION -# define GECODE_BOOST_TR1_NO_RECURSION -# define GECODE_BOOST_CONFIG_NO_UTILITY_RECURSION -# endif - -# include - -# ifdef GECODE_BOOST_CONFIG_NO_UTILITY_RECURSION -# undef GECODE_BOOST_TR1_NO_RECURSION -# undef GECODE_BOOST_CONFIG_NO_UTILITY_RECURSION -# endif - -#endif diff --git a/gecode/third-party/boost/config/platform/aix.hpp b/gecode/third-party/boost/config/platform/aix.hpp deleted file mode 100644 index bb055d7047..0000000000 --- a/gecode/third-party/boost/config/platform/aix.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// IBM/Aix specific config options: - -#define GECODE_BOOST_PLATFORM "IBM Aix" - -#define GECODE_BOOST_HAS_UNISTD_H -#define GECODE_BOOST_HAS_NL_TYPES_H -#define GECODE_BOOST_HAS_NANOSLEEP -#define GECODE_BOOST_HAS_CLOCK_GETTIME - -// This needs support in "gecode/third-party/boost/cstdint.hpp" exactly like FreeBSD. -// This platform has header named which includes all -// the things needed. -#define GECODE_BOOST_HAS_STDINT_H - -// Threading API's: -#define GECODE_BOOST_HAS_PTHREADS -#define GECODE_BOOST_HAS_PTHREAD_DELAY_NP -#define GECODE_BOOST_HAS_SCHED_YIELD -//#define GECODE_BOOST_HAS_PTHREAD_YIELD - -// boilerplate code: -#include - - - - diff --git a/gecode/third-party/boost/config/platform/amigaos.hpp b/gecode/third-party/boost/config/platform/amigaos.hpp deleted file mode 100644 index 80aa7d8f71..0000000000 --- a/gecode/third-party/boost/config/platform/amigaos.hpp +++ /dev/null @@ -1,15 +0,0 @@ -// (C) Copyright John Maddock 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -#define GECODE_BOOST_PLATFORM "AmigaOS" - -#define GECODE_BOOST_DISABLE_THREADS -#define GECODE_BOOST_NO_CWCHAR -#define GECODE_BOOST_NO_STD_WSTRING -#define GECODE_BOOST_NO_INTRINSIC_WCHAR_T - - diff --git a/gecode/third-party/boost/config/platform/beos.hpp b/gecode/third-party/boost/config/platform/beos.hpp deleted file mode 100644 index fb9457be1c..0000000000 --- a/gecode/third-party/boost/config/platform/beos.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// (C) Copyright John Maddock 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// BeOS specific config options: - -#define GECODE_BOOST_PLATFORM "BeOS" - -#define GECODE_BOOST_NO_CWCHAR -#define GECODE_BOOST_NO_CWCTYPE -#define GECODE_BOOST_HAS_UNISTD_H - -#define GECODE_BOOST_HAS_BETHREADS - -#ifndef GECODE_BOOST_DISABLE_THREADS -# define GECODE_BOOST_HAS_THREADS -#endif - -// boilerplate code: -#include - - - diff --git a/gecode/third-party/boost/config/platform/bsd.hpp b/gecode/third-party/boost/config/platform/bsd.hpp deleted file mode 100644 index 5475652e3b..0000000000 --- a/gecode/third-party/boost/config/platform/bsd.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Darin Adler 2001. -// (C) Copyright Douglas Gregor 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// generic BSD config options: - -#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) -#error "This platform is not BSD" -#endif - -#ifdef __FreeBSD__ -#define GECODE_BOOST_PLATFORM "FreeBSD " GECODE_BOOST_STRINGIZE(__FreeBSD__) -#elif defined(__NetBSD__) -#define GECODE_BOOST_PLATFORM "NetBSD " GECODE_BOOST_STRINGIZE(__NetBSD__) -#elif defined(__OpenBSD__) -#define GECODE_BOOST_PLATFORM "OpenBSD " GECODE_BOOST_STRINGIZE(__OpenBSD__) -#elif defined(__DragonFly__) -#define GECODE_BOOST_PLATFORM "DragonFly " GECODE_BOOST_STRINGIZE(__DragonFly__) -#endif - -// -// is this the correct version check? -// FreeBSD has but does not -// advertise the fact in : -// -#if (defined(__FreeBSD__) && (__FreeBSD__ >= 3)) || defined(__DragonFly__) -# define GECODE_BOOST_HAS_NL_TYPES_H -#endif - -// -// FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in -// and not in -// -#if (defined(__FreeBSD__) && (__FreeBSD__ <= 3))\ - || defined(__OpenBSD__) || defined(__DragonFly__) -# define GECODE_BOOST_HAS_PTHREADS -#endif - -// -// No wide character support in the BSD header files: -// -#if defined(__NetBSD__) -#define __NetBSD_GCC__ (__GNUC__ * 1000000 \ - + __GNUC_MINOR__ * 1000 \ - + __GNUC_PATCHLEVEL__) -// XXX - the following is required until c++config.h -// defines _GLIBCXX_HAVE_SWPRINTF and friends -// or the preprocessor conditionals are removed -// from the cwchar header. -#define _GLIBCXX_HAVE_SWPRINTF 1 -#endif - -#if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \ - || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) || defined(__DragonFly__)) -# define GECODE_BOOST_NO_CWCHAR -#endif -// -// The BSD has macros only, no functions: -// -#if !defined(__OpenBSD__) || defined(__DragonFly__) -# define GECODE_BOOST_NO_CTYPE_FUNCTIONS -#endif - -// -// thread API's not auto detected: -// -#define GECODE_BOOST_HAS_SCHED_YIELD -#define GECODE_BOOST_HAS_NANOSLEEP -#define GECODE_BOOST_HAS_GETTIMEOFDAY -#define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -#define GECODE_BOOST_HAS_SIGACTION - -// boilerplate code: -#define GECODE_BOOST_HAS_UNISTD_H -#include - - - - - - diff --git a/gecode/third-party/boost/config/platform/cygwin.hpp b/gecode/third-party/boost/config/platform/cygwin.hpp deleted file mode 100644 index bb32923168..0000000000 --- a/gecode/third-party/boost/config/platform/cygwin.hpp +++ /dev/null @@ -1,58 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// cygwin specific config options: - -#define GECODE_BOOST_PLATFORM "Cygwin" -#define GECODE_BOOST_HAS_DIRENT_H -#define GECODE_BOOST_HAS_LOG1P -#define GECODE_BOOST_HAS_EXPM1 - -// -// Threading API: -// See if we have POSIX threads, if we do use them, otherwise -// revert to native Win threads. -#define GECODE_BOOST_HAS_UNISTD_H -#include -#if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(GECODE_BOOST_HAS_WINTHREADS) -# define GECODE_BOOST_HAS_PTHREADS -# define GECODE_BOOST_HAS_SCHED_YIELD -# define GECODE_BOOST_HAS_GETTIMEOFDAY -# define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# define GECODE_BOOST_HAS_SIGACTION -#else -# if !defined(GECODE_BOOST_HAS_WINTHREADS) -# define GECODE_BOOST_HAS_WINTHREADS -# endif -# define GECODE_BOOST_HAS_FTIME -#endif - -// -// find out if we have a stdint.h, there should be a better way to do this: -// -#include -#ifdef _STDINT_H -#define GECODE_BOOST_HAS_STDINT_H -#endif - -/// Cygwin has no fenv.h -#define GECODE_BOOST_NO_FENV_H - -// boilerplate code: -#include - -// -// Cygwin lies about XSI conformance, there is no nl_types.h: -// -#ifdef GECODE_BOOST_HAS_NL_TYPES_H -# undef GECODE_BOOST_HAS_NL_TYPES_H -#endif - - - - - diff --git a/gecode/third-party/boost/config/platform/hpux.hpp b/gecode/third-party/boost/config/platform/hpux.hpp deleted file mode 100644 index aa8fc100ac..0000000000 --- a/gecode/third-party/boost/config/platform/hpux.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001 - 2003. -// (C) Copyright David Abrahams 2002. -// (C) Copyright Toon Knapen 2003. -// (C) Copyright Boris Gubenko 2006 - 2007. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// hpux specific config options: - -#define GECODE_BOOST_PLATFORM "HP-UX" - -// In principle, HP-UX has a nice under the name -// However, it has the following problem: -// Use of UINT32_C(0) results in "0u l" for the preprocessed source -// (verifyable with gcc 2.95.3) -#if (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__HP_aCC) -# define GECODE_BOOST_HAS_STDINT_H -#endif - -#if !(defined(__HP_aCC) || !defined(_INCLUDE__STDC_A1_SOURCE)) -# define GECODE_BOOST_NO_SWPRINTF -#endif -#if defined(__HP_aCC) && !defined(_INCLUDE__STDC_A1_SOURCE) -# define GECODE_BOOST_NO_CWCTYPE -#endif - -#if defined(__GNUC__) -# if (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3)) - // GNU C on HP-UX does not support threads (checked up to gcc 3.3) -# define GECODE_BOOST_DISABLE_THREADS -# elif !defined(GECODE_BOOST_DISABLE_THREADS) - // threads supported from gcc-3.3 onwards: -# define GECODE_BOOST_HAS_THREADS -# define GECODE_BOOST_HAS_PTHREADS -# endif -#elif defined(__HP_aCC) && !defined(GECODE_BOOST_DISABLE_THREADS) -# define GECODE_BOOST_HAS_PTHREADS -#endif - -// boilerplate code: -#define GECODE_BOOST_HAS_UNISTD_H -#include - -// the following are always available: -#ifndef GECODE_BOOST_HAS_GETTIMEOFDAY -# define GECODE_BOOST_HAS_GETTIMEOFDAY -#endif -#ifndef GECODE_BOOST_HAS_SCHED_YIELD -# define GECODE_BOOST_HAS_SCHED_YIELD -#endif -#ifndef GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -#endif -#ifndef GECODE_BOOST_HAS_NL_TYPES_H -# define GECODE_BOOST_HAS_NL_TYPES_H -#endif -#ifndef GECODE_BOOST_HAS_NANOSLEEP -# define GECODE_BOOST_HAS_NANOSLEEP -#endif -#ifndef GECODE_BOOST_HAS_GETTIMEOFDAY -# define GECODE_BOOST_HAS_GETTIMEOFDAY -#endif -#ifndef GECODE_BOOST_HAS_DIRENT_H -# define GECODE_BOOST_HAS_DIRENT_H -#endif -#ifndef GECODE_BOOST_HAS_CLOCK_GETTIME -# define GECODE_BOOST_HAS_CLOCK_GETTIME -#endif -#ifndef GECODE_BOOST_HAS_SIGACTION -# define GECODE_BOOST_HAS_SIGACTION -#endif -#ifndef GECODE_BOOST_HAS_NRVO -# ifndef __parisc -# define GECODE_BOOST_HAS_NRVO -# endif -#endif -#ifndef GECODE_BOOST_HAS_LOG1P -# define GECODE_BOOST_HAS_LOG1P -#endif -#ifndef GECODE_BOOST_HAS_EXPM1 -# define GECODE_BOOST_HAS_EXPM1 -#endif - diff --git a/gecode/third-party/boost/config/platform/irix.hpp b/gecode/third-party/boost/config/platform/irix.hpp deleted file mode 100644 index 2471f7735a..0000000000 --- a/gecode/third-party/boost/config/platform/irix.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - - -// See http://www.boost.org for most recent version. - -// SGI Irix specific config options: - -#define GECODE_BOOST_PLATFORM "SGI Irix" - -#define GECODE_BOOST_NO_SWPRINTF -// -// these are not auto detected by POSIX feature tests: -// -#define GECODE_BOOST_HAS_GETTIMEOFDAY -#define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE - -#ifdef __GNUC__ - // GNU C on IRIX does not support threads (checked up to gcc 3.3) -# define GECODE_BOOST_DISABLE_THREADS -#endif - -// boilerplate code: -#define GECODE_BOOST_HAS_UNISTD_H -#include - - - diff --git a/gecode/third-party/boost/config/platform/linux.hpp b/gecode/third-party/boost/config/platform/linux.hpp deleted file mode 100644 index 72f2f9e5aa..0000000000 --- a/gecode/third-party/boost/config/platform/linux.hpp +++ /dev/null @@ -1,103 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// linux specific config options: - -#define GECODE_BOOST_PLATFORM "linux" - -// make sure we have __GLIBC_PREREQ if available at all -#ifdef __cplusplus -#include -#else -#include -#endif - -// -// added to glibc 2.1.1 -// We can only test for 2.1 though: -// -#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1))) - // defines int64_t unconditionally, but defines - // int64_t only if __GNUC__. Thus, assume a fully usable - // only when using GCC. -# if defined __GNUC__ -# define GECODE_BOOST_HAS_STDINT_H -# endif -#endif - -#if defined(__LIBCOMO__) - // - // como on linux doesn't have std:: c functions: - // NOTE: versions of libcomo prior to beta28 have octal version numbering, - // e.g. version 25 is 21 (dec) - // -# if __LIBCOMO_VERSION__ <= 20 -# define GECODE_BOOST_NO_STDC_NAMESPACE -# endif - -# if __LIBCOMO_VERSION__ <= 21 -# define GECODE_BOOST_NO_SWPRINTF -# endif - -#endif - -// -// If glibc is past version 2 then we definitely have -// gettimeofday, earlier versions may or may not have it: -// -#if defined(__GLIBC__) && (__GLIBC__ >= 2) -# define GECODE_BOOST_HAS_GETTIMEOFDAY -#endif - -#ifdef __USE_POSIX199309 -# define GECODE_BOOST_HAS_NANOSLEEP -#endif - -#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) -// __GLIBC_PREREQ is available since 2.1.2 - - // swprintf is available since glibc 2.2.0 -# if !__GLIBC_PREREQ(2,2) || (!defined(__USE_ISOC99) && !defined(__USE_UNIX98)) -# define GECODE_BOOST_NO_SWPRINTF -# endif -#else -# define GECODE_BOOST_NO_SWPRINTF -#endif - -// boilerplate code: -#define GECODE_BOOST_HAS_UNISTD_H -#include -#define GECODE_BOOST_HAS_PTHREAD_YIELD - -#ifndef __GNUC__ -// -// if the compiler is not gcc we still need to be able to parse -// the GNU system headers, some of which (mainly ) -// use GNU specific extensions: -// -# ifndef __extension__ -# define __extension__ -# endif -# ifndef __const__ -# define __const__ const -# endif -# ifndef __volatile__ -# define __volatile__ volatile -# endif -# ifndef __signed__ -# define __signed__ signed -# endif -# ifndef __typeof__ -# define __typeof__ typeof -# endif -# ifndef __inline__ -# define __inline__ inline -# endif -#endif - - diff --git a/gecode/third-party/boost/config/platform/macos.hpp b/gecode/third-party/boost/config/platform/macos.hpp deleted file mode 100644 index 5bb37ca6cb..0000000000 --- a/gecode/third-party/boost/config/platform/macos.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Darin Adler 2001 - 2002. -// (C) Copyright Bill Kempf 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Mac OS specific config options: - -#define GECODE_BOOST_PLATFORM "Mac OS" - -#if __MACH__ && !defined(_MSL_USING_MSL_C) - -// Using the Mac OS X system BSD-style C library. - -# ifndef GECODE_BOOST_HAS_UNISTD_H -# define GECODE_BOOST_HAS_UNISTD_H -# endif -// -// Begin by including our boilerplate code for POSIX -// feature detection, this is safe even when using -// the MSL as Metrowerks supply their own -// to replace the platform-native BSD one. G++ users -// should also always be able to do this on MaxOS X. -// -# include -# ifndef GECODE_BOOST_HAS_STDINT_H -# define GECODE_BOOST_HAS_STDINT_H -# endif - -// -// BSD runtime has pthreads, sigaction, sched_yield and gettimeofday, -// of these only pthreads are advertised in , so set the -// other options explicitly: -// -# define GECODE_BOOST_HAS_SCHED_YIELD -# define GECODE_BOOST_HAS_GETTIMEOFDAY -# define GECODE_BOOST_HAS_SIGACTION - -# if (__GNUC__ < 3) && !defined( __APPLE_CC__) - -// GCC strange "ignore std" mode works better if you pretend everything -// is in the std namespace, for the most part. - -# define GECODE_BOOST_NO_STDC_NAMESPACE -# endif - -# if (__GNUC__ == 4) - -// Both gcc and intel require these. -# define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# define GECODE_BOOST_HAS_NANOSLEEP - -# endif - -#else - -// Using the MSL C library. - -// We will eventually support threads in non-Carbon builds, but we do -// not support this yet. -# if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON ) - -# if !defined(GECODE_BOOST_HAS_PTHREADS) -// MPTasks support is deprecated/removed from Boost: -//# define GECODE_BOOST_HAS_MPTASKS -# elif ( __dest_os == __mac_os_x ) -// We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the -// gettimeofday and no posix. -# define GECODE_BOOST_HAS_GETTIMEOFDAY -# endif - -#ifdef GECODE_BOOST_HAS_PTHREADS -# define GECODE_BOOST_HAS_THREADS -#endif - -// The remote call manager depends on this. -# define GECODE_BOOST_BIND_ENABLE_PASCAL - -# endif - -#endif - - - diff --git a/gecode/third-party/boost/config/platform/qnxnto.hpp b/gecode/third-party/boost/config/platform/qnxnto.hpp deleted file mode 100644 index ea3908501c..0000000000 --- a/gecode/third-party/boost/config/platform/qnxnto.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// (C) Copyright Jim Douglas 2005. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// QNX specific config options: - -#define GECODE_BOOST_PLATFORM "QNX" - -#define GECODE_BOOST_HAS_UNISTD_H -#include - -// QNX claims XOpen version 5 compatibility, but doesn't have an nl_types.h -// or log1p and expm1: -#undef GECODE_BOOST_HAS_NL_TYPES_H -#undef GECODE_BOOST_HAS_LOG1P -#undef GECODE_BOOST_HAS_EXPM1 - -#define GECODE_BOOST_HAS_PTHREADS -#define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE - -#define GECODE_BOOST_HAS_GETTIMEOFDAY -#define GECODE_BOOST_HAS_CLOCK_GETTIME -#define GECODE_BOOST_HAS_NANOSLEEP - - - - - diff --git a/gecode/third-party/boost/config/platform/solaris.hpp b/gecode/third-party/boost/config/platform/solaris.hpp deleted file mode 100644 index 18bc4a11f1..0000000000 --- a/gecode/third-party/boost/config/platform/solaris.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// sun specific config options: - -#define GECODE_BOOST_PLATFORM "Sun Solaris" - -#define GECODE_BOOST_HAS_GETTIMEOFDAY - -// boilerplate code: -#define GECODE_BOOST_HAS_UNISTD_H -#include - -// -// pthreads don't actually work with gcc unless _PTHREADS is defined: -// -#if defined(__GNUC__) && defined(_POSIX_THREADS) && !defined(_PTHREADS) -# undef GECODE_BOOST_HAS_PTHREADS -#endif - - - - diff --git a/gecode/third-party/boost/config/platform/symbian.hpp b/gecode/third-party/boost/config/platform/symbian.hpp deleted file mode 100644 index f7b586e9cd..0000000000 --- a/gecode/third-party/boost/config/platform/symbian.hpp +++ /dev/null @@ -1,97 +0,0 @@ -// (C) Copyright Yuriy Krasnoschek 2009. -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// symbian specific config options: - - -#define GECODE_BOOST_PLATFORM "Symbian" -#define GECODE_BOOST_SYMBIAN 1 - - -#if defined(__S60_3X__) -// Open C / C++ plugin was introdused in this SDK, earlier versions don't have CRT / STL -# define GECODE_BOOST_S60_3rd_EDITION_FP2_OR_LATER_SDK -// make sure we have __GLIBC_PREREQ if available at all -#ifdef __cplusplus -#include -#else -#include -#endif// boilerplate code: -# define GECODE_BOOST_HAS_UNISTD_H -# include -// S60 SDK defines _POSIX_VERSION as POSIX.1 -# ifndef GECODE_BOOST_HAS_STDINT_H -# define GECODE_BOOST_HAS_STDINT_H -# endif -# ifndef GECODE_BOOST_HAS_GETTIMEOFDAY -# define GECODE_BOOST_HAS_GETTIMEOFDAY -# endif -# ifndef GECODE_BOOST_HAS_DIRENT_H -# define GECODE_BOOST_HAS_DIRENT_H -# endif -# ifndef GECODE_BOOST_HAS_SIGACTION -# define GECODE_BOOST_HAS_SIGACTION -# endif -# ifndef GECODE_BOOST_HAS_PTHREADS -# define GECODE_BOOST_HAS_PTHREADS -# endif -# ifndef GECODE_BOOST_HAS_NANOSLEEP -# define GECODE_BOOST_HAS_NANOSLEEP -# endif -# ifndef GECODE_BOOST_HAS_SCHED_YIELD -# define GECODE_BOOST_HAS_SCHED_YIELD -# endif -# ifndef GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# endif -# ifndef GECODE_BOOST_HAS_LOG1P -# define GECODE_BOOST_HAS_LOG1P -# endif -# ifndef GECODE_BOOST_HAS_EXPM1 -# define GECODE_BOOST_HAS_EXPM1 -# endif -# ifndef GECODE_BOOST_POSIX_API -# define GECODE_BOOST_POSIX_API -# endif -// endianess support -# include -// Symbian SDK provides _BYTE_ORDER instead of __BYTE_ORDER -# ifndef __LITTLE_ENDIAN -# ifdef _LITTLE_ENDIAN -# define __LITTLE_ENDIAN _LITTLE_ENDIAN -# else -# define __LITTLE_ENDIAN 1234 -# endif -# endif -# ifndef __BIG_ENDIAN -# ifdef _BIG_ENDIAN -# define __BIG_ENDIAN _BIG_ENDIAN -# else -# define __BIG_ENDIAN 4321 -# endif -# endif -# ifndef __BYTE_ORDER -# define __BYTE_ORDER __LITTLE_ENDIAN // Symbian is LE -# endif -// Known limitations -# define GECODE_BOOST_ASIO_DISABLE_SERIAL_PORT -# define GECODE_BOOST_DATE_TIME_NO_LOCALE -# define GECODE_BOOST_NO_STD_WSTRING -# define GECODE_BOOST_EXCEPTION_DISABLE -# define GECODE_BOOST_NO_EXCEPTIONS - -#else // TODO: More platform support e.g. UIQ -# error "Unsuppoted Symbian SDK" -#endif - -#if defined(__WINSCW__) && !defined(GECODE_BOOST_DISABLE_WIN32) -# define GECODE_BOOST_DISABLE_WIN32 // winscw defines WIN32 macro -#endif - - diff --git a/gecode/third-party/boost/config/platform/vms.hpp b/gecode/third-party/boost/config/platform/vms.hpp deleted file mode 100644 index 70287478af..0000000000 --- a/gecode/third-party/boost/config/platform/vms.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// (C) Copyright Artyom Beilis 2010. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef GECODE_BOOST_CONFIG_PLATFORM_VMS_HPP -#define GECODE_BOOST_CONFIG_PLATFORM_VMS_HPP - -#define GECODE_BOOST_PLATFORM "OpenVMS" - -#undef GECODE_BOOST_HAS_STDINT_H -#define GECODE_BOOST_HAS_UNISTD_H -#define GECODE_BOOST_HAS_NL_TYPES_H -#define GECODE_BOOST_HAS_GETTIMEOFDAY -#define GECODE_BOOST_HAS_DIRENT_H -#define GECODE_BOOST_HAS_PTHREADS -#define GECODE_BOOST_HAS_NANOSLEEP -#define GECODE_BOOST_HAS_CLOCK_GETTIME -#define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -#define GECODE_BOOST_HAS_LOG1P -#define GECODE_BOOST_HAS_EXPM1 -#define GECODE_BOOST_HAS_THREADS -#undef GECODE_BOOST_HAS_SCHED_YIELD - -#endif diff --git a/gecode/third-party/boost/config/platform/vxworks.hpp b/gecode/third-party/boost/config/platform/vxworks.hpp deleted file mode 100644 index 67258215c4..0000000000 --- a/gecode/third-party/boost/config/platform/vxworks.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// (C) Copyright Dustin Spicuzza 2009. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// vxWorks specific config options: - -#define GECODE_BOOST_PLATFORM "vxWorks" - -#define GECODE_BOOST_NO_CWCHAR -#define GECODE_BOOST_NO_INTRINSIC_WCHAR_T - -#if defined(__GNUC__) && defined(__STRICT_ANSI__) -#define GECODE_BOOST_NO_INT64_T -#endif - -#define GECODE_BOOST_HAS_UNISTD_H - -// these allow posix_features to work, since vxWorks doesn't -// define them itself -#define _POSIX_TIMERS 1 -#define _POSIX_THREADS 1 - -// vxworks doesn't work with asio serial ports -#define GECODE_BOOST_ASIO_DISABLE_SERIAL_PORT - -// boilerplate code: -#include - diff --git a/gecode/third-party/boost/config/platform/win32.hpp b/gecode/third-party/boost/config/platform/win32.hpp deleted file mode 100644 index 7c2c0bfd0b..0000000000 --- a/gecode/third-party/boost/config/platform/win32.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Bill Kempf 2001. -// (C) Copyright Aleksey Gurtovoy 2003. -// (C) Copyright Rene Rivera 2005. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Win32 specific config options: - -#define GECODE_BOOST_PLATFORM "Win32" - -// Get the information about the MinGW runtime, i.e. __MINGW32_*VERSION. -#if defined(__MINGW32__) -# include <_mingw.h> -#endif - -#if defined(__GNUC__) && !defined(GECODE_BOOST_NO_SWPRINTF) -# define GECODE_BOOST_NO_SWPRINTF -#endif - -// Default defines for GECODE_BOOST_SYMBOL_EXPORT and GECODE_BOOST_SYMBOL_IMPORT -// If a compiler doesn't support __declspec(dllexport)/__declspec(dllimport), -// its boost/config/compiler/ file must define GECODE_BOOST_SYMBOL_EXPORT and -// GECODE_BOOST_SYMBOL_IMPORT -#ifndef GECODE_BOOST_SYMBOL_EXPORT -# define GECODE_BOOST_HAS_DECLSPEC -# define GECODE_BOOST_SYMBOL_EXPORT __declspec(dllexport) -# define GECODE_BOOST_SYMBOL_IMPORT __declspec(dllimport) -#endif - -#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0))) -# define GECODE_BOOST_HAS_STDINT_H -# define __STDC_LIMIT_MACROS -# define GECODE_BOOST_HAS_DIRENT_H -# define GECODE_BOOST_HAS_UNISTD_H -#endif - -#if defined(__MINGW32__) && (__GNUC__ >= 4) -# define GECODE_BOOST_HAS_EXPM1 -# define GECODE_BOOST_HAS_LOG1P -# define GECODE_BOOST_HAS_GETTIMEOFDAY -#endif -// -// Win32 will normally be using native Win32 threads, -// but there is a pthread library avaliable as an option, -// we used to disable this when GECODE_BOOST_DISABLE_WIN32 was -// defined but no longer - this should allow some -// files to be compiled in strict mode - while maintaining -// a consistent setting of GECODE_BOOST_HAS_THREADS across -// all translation units (needed for shared_ptr etc). -// - -#ifdef _WIN32_WCE -# define GECODE_BOOST_NO_ANSI_APIS -#endif - -#ifndef GECODE_BOOST_HAS_PTHREADS -# define GECODE_BOOST_HAS_WINTHREADS -#endif - -#ifndef GECODE_BOOST_DISABLE_WIN32 -// WEK: Added -#define GECODE_BOOST_HAS_FTIME -#define GECODE_BOOST_WINDOWS 1 - -#endif diff --git a/gecode/third-party/boost/config/posix_features.hpp b/gecode/third-party/boost/config/posix_features.hpp deleted file mode 100644 index c7e375b377..0000000000 --- a/gecode/third-party/boost/config/posix_features.hpp +++ /dev/null @@ -1,95 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - - -// See http://www.boost.org for most recent version. - -// All POSIX feature tests go in this file, -// Note that we test _POSIX_C_SOURCE and _XOPEN_SOURCE as well -// _POSIX_VERSION and _XOPEN_VERSION: on some systems POSIX API's -// may be present but none-functional unless _POSIX_C_SOURCE and -// _XOPEN_SOURCE have been defined to the right value (it's up -// to the user to do this *before* including any header, although -// in most cases the compiler will do this for you). - -# if defined(GECODE_BOOST_HAS_UNISTD_H) -# include - - // XOpen has , but is this the correct version check? -# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 3) -# define GECODE_BOOST_HAS_NL_TYPES_H -# endif - - // POSIX version 6 requires -# if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100) -# define GECODE_BOOST_HAS_STDINT_H -# endif - - // POSIX version 2 requires -# if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199009L) -# define GECODE_BOOST_HAS_DIRENT_H -# endif - - // POSIX version 3 requires to have sigaction: -# if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199506L) -# define GECODE_BOOST_HAS_SIGACTION -# endif - // POSIX defines _POSIX_THREADS > 0 for pthread support, - // however some platforms define _POSIX_THREADS without - // a value, hence the (_POSIX_THREADS+0 >= 0) check. - // Strictly speaking this may catch platforms with a - // non-functioning stub , but such occurrences should - // occur very rarely if at all. -# if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(GECODE_BOOST_HAS_WINTHREADS) && !defined(GECODE_BOOST_HAS_MPTASKS) -# define GECODE_BOOST_HAS_PTHREADS -# endif - - // GECODE_BOOST_HAS_NANOSLEEP: - // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME: -# if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \ - || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0)) -# define GECODE_BOOST_HAS_NANOSLEEP -# endif - - // GECODE_BOOST_HAS_CLOCK_GETTIME: - // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME - // but at least one platform - linux - defines that flag without - // defining clock_gettime): -# if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) -# define GECODE_BOOST_HAS_CLOCK_GETTIME -# endif - - // GECODE_BOOST_HAS_SCHED_YIELD: - // This is predicated on _POSIX_PRIORITY_SCHEDULING or - // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME. -# if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\ - || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\ - || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0)) -# define GECODE_BOOST_HAS_SCHED_YIELD -# endif - - // GECODE_BOOST_HAS_GETTIMEOFDAY: - // GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE: - // These are predicated on _XOPEN_VERSION, and appears to be first released - // in issue 4, version 2 (_XOPEN_VERSION > 500). - // Likewise for the functions log1p and expm1. -# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500) -# define GECODE_BOOST_HAS_GETTIMEOFDAY -# if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500) -# define GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# endif -# ifndef GECODE_BOOST_HAS_LOG1P -# define GECODE_BOOST_HAS_LOG1P -# endif -# ifndef GECODE_BOOST_HAS_EXPM1 -# define GECODE_BOOST_HAS_EXPM1 -# endif -# endif - -# endif - - - - diff --git a/gecode/third-party/boost/config/select_compiler_config.hpp b/gecode/third-party/boost/config/select_compiler_config.hpp deleted file mode 100644 index 8c4df95afe..0000000000 --- a/gecode/third-party/boost/config/select_compiler_config.hpp +++ /dev/null @@ -1,108 +0,0 @@ -// Boost compiler configuration selection header file - -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Martin Wille 2003. -// (C) Copyright Guillaume Melquiond 2003. -// -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org/ for most recent version. - -// locate which compiler we are using and define -// GECODE_BOOST_COMPILER_CONFIG as needed: - -#if defined(__GCCXML__) -// GCC-XML emulates other compilers, it has to appear first here! -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/gcc_xml.hpp" - -#elif defined __CUDACC__ -// NVIDIA CUDA C++ compiler for GPU -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/nvcc.hpp" - -#elif defined __COMO__ -// Comeau C++ -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/comeau.hpp" - -#elif defined(__PATHSCALE__) && (__PATHCC__ >= 4) -// PathScale EKOPath compiler (has to come before clang and gcc) -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/pathscale.hpp" - -#elif defined __clang__ -// Clang C++ emulates GCC, so it has to appear early. -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/clang.hpp" - -#elif defined __DMC__ -// Digital Mars C++ -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/digitalmars.hpp" - -#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC) -// Intel -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/intel.hpp" - -# elif defined __GNUC__ -// GNU C++: -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/gcc.hpp" - -#elif defined __KCC -// Kai C++ -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/kai.hpp" - -#elif defined __sgi -// SGI MIPSpro C++ -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/sgi_mipspro.hpp" - -#elif defined __DECCXX -// Compaq Tru64 Unix cxx -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/compaq_cxx.hpp" - -#elif defined __ghs -// Greenhills C++ -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/greenhills.hpp" - -#elif defined __CODEGEARC__ -// CodeGear - must be checked for before Borland -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/codegear.hpp" - -#elif defined __BORLANDC__ -// Borland -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/borland.hpp" - -#elif defined __MWERKS__ -// Metrowerks CodeWarrior -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/metrowerks.hpp" - -#elif defined __SUNPRO_CC -// Sun Workshop Compiler C++ -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/sunpro_cc.hpp" - -#elif defined __HP_aCC -// HP aCC -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/hp_acc.hpp" - -#elif defined(__MRC__) || defined(__SC__) -// MPW MrCpp or SCpp -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/mpw.hpp" - -#elif defined(__IBMCPP__) -// IBM Visual Age -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/vacpp.hpp" - -#elif defined(__PGI) -// Portland Group Inc. -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/pgi.hpp" - -#elif defined _MSC_VER -// Microsoft Visual C++ -// -// Must remain the last #elif since some other vendors (Metrowerks, for -// example) also #define _MSC_VER -# define GECODE_BOOST_COMPILER_CONFIG "gecode/third-party/boost/config/compiler/visualc.hpp" - -#elif defined (GECODE_BOOST_ASSERT_CONFIG) -// this must come last - generate an error if we don't -// recognise the compiler: -# error "Unknown compiler - please configure (http://www.boost.org/libs/config/config.htm#configuring) and report the results to the main boost mailing list (http://www.boost.org/more/mailing_lists.htm#main)" - -#endif diff --git a/gecode/third-party/boost/config/select_platform_config.hpp b/gecode/third-party/boost/config/select_platform_config.hpp deleted file mode 100644 index eda6e1a7c5..0000000000 --- a/gecode/third-party/boost/config/select_platform_config.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// Boost compiler configuration selection header file - -// (C) Copyright John Maddock 2001 - 2002. -// (C) Copyright Jens Maurer 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// locate which platform we are on and define GECODE_BOOST_PLATFORM_CONFIG as needed. -// Note that we define the headers to include using "header_name" not -// in order to prevent macro expansion within the header -// name (for example "linux" is a macro on linux systems). - -#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) -// linux, also other platforms (Hurd etc) that use GLIBC, should these really have their own config headers though? -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/linux.hpp" - -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) -// BSD: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/bsd.hpp" - -#elif defined(sun) || defined(__sun) -// solaris: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/solaris.hpp" - -#elif defined(__sgi) -// SGI Irix: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/irix.hpp" - -#elif defined(__hpux) -// hp unix: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/hpux.hpp" - -#elif defined(__CYGWIN__) -// cygwin is not win32: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/cygwin.hpp" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -// win32: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/win32.hpp" - -#elif defined(__BEOS__) -// BeOS -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/beos.hpp" - -#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) -// MacOS -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/macos.hpp" - -#elif defined(__IBMCPP__) || defined(_AIX) -// IBM -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/aix.hpp" - -#elif defined(__amigaos__) -// AmigaOS -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/amigaos.hpp" - -#elif defined(__QNXNTO__) -// QNX: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/qnxnto.hpp" - -#elif defined(__VXWORKS__) -// vxWorks: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/vxworks.hpp" - -#elif defined(__SYMBIAN32__) -// Symbian: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/symbian.hpp" - -#elif defined(__VMS) -// VMS: -# define GECODE_BOOST_PLATFORM_CONFIG "gecode/third-party/boost/config/platform/vms.hpp" -#else - -# if defined(unix) \ - || defined(__unix) \ - || defined(_XOPEN_SOURCE) \ - || defined(_POSIX_SOURCE) - - // generic unix platform: - -# ifndef GECODE_BOOST_HAS_UNISTD_H -# define GECODE_BOOST_HAS_UNISTD_H -# endif - -# include - -# endif - -# if defined (GECODE_BOOST_ASSERT_CONFIG) - // this must come last - generate an error if we don't - // recognise the platform: -# error "Unknown platform - please configure and report the results to boost.org" -# endif - -#endif - - - diff --git a/gecode/third-party/boost/config/select_stdlib_config.hpp b/gecode/third-party/boost/config/select_stdlib_config.hpp deleted file mode 100644 index 098e38691c..0000000000 --- a/gecode/third-party/boost/config/select_stdlib_config.hpp +++ /dev/null @@ -1,85 +0,0 @@ -// Boost compiler configuration selection header file - -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001 - 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - - -// See http://www.boost.org for most recent version. - -// locate which std lib we are using and define GECODE_BOOST_STDLIB_CONFIG as needed: - -// First include to determine if some version of STLport is in use as the std lib -// (do not rely on this header being included since users can short-circuit this header -// if they know whose std lib they are using.) -#ifdef __cplusplus -# include -#else -# include -#endif - -#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) -// STLPort library; this _must_ come first, otherwise since -// STLport typically sits on top of some other library, we -// can end up detecting that first rather than STLport: -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/stlport.hpp" - -#else - -// If our std lib was not some version of STLport, then include as it is about -// the smallest of the std lib headers that includes real C++ stuff. (Some std libs do not -// include their C++-related macros in so this additional include makes sure -// we get those definitions) -// (again do not rely on this header being included since users can short-circuit this -// header if they know whose std lib they are using.) -#include - -#if defined(__LIBCOMO__) -// Comeau STL: -#define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/libcomo.hpp" - -#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) -// Rogue Wave library: -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/roguewave.hpp" - -#elif defined(_LIBCPP_VERSION) -// libc++ -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/libcpp.hpp" - -#elif defined(__GLIBCPP__) || defined(__GLIBCXX__) -// GNU libstdc++ 3 -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/libstdcpp3.hpp" - -#elif defined(__STL_CONFIG_H) -// generic SGI STL -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/sgi.hpp" - -#elif defined(__MSL_CPP__) -// MSL standard lib: -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/msl.hpp" - -#elif defined(__IBMCPP__) -// take the default VACPP std lib -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/vacpp.hpp" - -#elif defined(MSIPL_COMPILE_H) -// Modena C++ standard library -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/modena.hpp" - -#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) -// Dinkumware Library (this has to appear after any possible replacement libraries): -# define GECODE_BOOST_STDLIB_CONFIG "gecode/third-party/boost/config/stdlib/dinkumware.hpp" - -#elif defined (GECODE_BOOST_ASSERT_CONFIG) -// this must come last - generate an error if we don't -// recognise the library: -# error "Unknown standard library - please configure and report the results to boost.org" - -#endif - -#endif - - - diff --git a/gecode/third-party/boost/config/stdlib/dinkumware.hpp b/gecode/third-party/boost/config/stdlib/dinkumware.hpp deleted file mode 100644 index b2a5e87e6d..0000000000 --- a/gecode/third-party/boost/config/stdlib/dinkumware.hpp +++ /dev/null @@ -1,145 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001. -// (C) Copyright Peter Dimov 2001. -// (C) Copyright David Abrahams 2002. -// (C) Copyright Guillaume Melquiond 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Dinkumware standard library config: - -#if !defined(_YVALS) && !defined(_CPPLIB_VER) -#include -#if !defined(_YVALS) && !defined(_CPPLIB_VER) -#error This is not the Dinkumware lib! -#endif -#endif - - -#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306) - // full dinkumware 3.06 and above - // fully conforming provided the compiler supports it: -# if !(defined(_GLOBAL_USING) && (_GLOBAL_USING+0 > 0)) && !defined(__BORLANDC__) && !defined(_STD) && !(defined(__ICC) && (__ICC >= 700)) // can be defined in yvals.h -# define GECODE_BOOST_NO_STDC_NAMESPACE -# endif -# if !(defined(_HAS_MEMBER_TEMPLATES_REBIND) && (_HAS_MEMBER_TEMPLATES_REBIND+0 > 0)) && !(defined(_MSC_VER) && (_MSC_VER > 1300)) && defined(GECODE_BOOST_MSVC) -# define GECODE_BOOST_NO_STD_ALLOCATOR -# endif -# define GECODE_BOOST_HAS_PARTIAL_STD_ALLOCATOR -# if defined(GECODE_BOOST_MSVC) && (GECODE_BOOST_MSVC < 1300) - // if this lib version is set up for vc6 then there is no std::use_facet: -# define GECODE_BOOST_NO_STD_USE_FACET -# define GECODE_BOOST_HAS_TWO_ARG_USE_FACET - // C lib functions aren't in namespace std either: -# define GECODE_BOOST_NO_STDC_NAMESPACE - // and nor is -# define GECODE_BOOST_NO_EXCEPTION_STD_NAMESPACE -# endif -// There's no numeric_limits support unless _LONGLONG is defined: -# if !defined(_LONGLONG) && (_CPPLIB_VER <= 310) -# define GECODE_BOOST_NO_MS_INT64_NUMERIC_LIMITS -# endif -// 3.06 appears to have (non-sgi versions of) & , -// and no at all -#else -# define GECODE_BOOST_MSVC_STD_ITERATOR 1 -# define GECODE_BOOST_NO_STD_ITERATOR -# define GECODE_BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS -# define GECODE_BOOST_NO_STD_ALLOCATOR -# define GECODE_BOOST_NO_STDC_NAMESPACE -# define GECODE_BOOST_NO_STD_USE_FACET -# define GECODE_BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN -# define GECODE_BOOST_HAS_MACRO_USE_FACET -# ifndef _CPPLIB_VER - // Updated Dinkum library defines this, and provides - // its own min and max definitions, as does MTA version. -# ifndef __MTA__ -# define GECODE_BOOST_NO_STD_MIN_MAX -# endif -# define GECODE_BOOST_NO_MS_INT64_NUMERIC_LIMITS -# endif -#endif - -// -// std extension namespace is stdext for vc7.1 and later, -// the same applies to other compilers that sit on top -// of vc7.1 (Intel and Comeau): -// -#if defined(_MSC_VER) && (_MSC_VER >= 1310) && !defined(__BORLANDC__) -# define GECODE_BOOST_STD_EXTENSION_NAMESPACE stdext -#endif - - -#if (defined(_MSC_VER) && (_MSC_VER <= 1300) && !defined(__BORLANDC__)) || !defined(_CPPLIB_VER) || (_CPPLIB_VER < 306) - // if we're using a dinkum lib that's - // been configured for VC6/7 then there is - // no iterator traits (true even for icl) -# define GECODE_BOOST_NO_STD_ITERATOR_TRAITS -#endif - -#if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310) -// Intel C++ chokes over any non-trivial use of -// this may be an overly restrictive define, but regex fails without it: -# define GECODE_BOOST_NO_STD_LOCALE -#endif - -#include -#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) -# define GECODE_BOOST_NO_STD_TYPEINFO -#endif - -// C++0x headers implemented in 520 (as shipped by Microsoft) -// -#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520 -# define GECODE_BOOST_NO_0X_HDR_ARRAY -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST -#endif - -#if !defined(_HAS_TR1_IMPORTS) && !defined(GECODE_BOOST_NO_0X_HDR_TUPLE) -# define GECODE_BOOST_NO_0X_HDR_TUPLE -#endif -// -// C++0x headers not yet (fully) implemented: -// -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_THREAD - -#ifdef _CPPLIB_VER -# define GECODE_BOOST_DINKUMWARE_STDLIB _CPPLIB_VER -#else -# define GECODE_BOOST_DINKUMWARE_STDLIB 1 -#endif - -#ifdef _CPPLIB_VER -# define GECODE_BOOST_STDLIB "Dinkumware standard library version " GECODE_BOOST_STRINGIZE(_CPPLIB_VER) -#else -# define GECODE_BOOST_STDLIB "Dinkumware standard library version 1.x" -#endif - - - - - - - - - diff --git a/gecode/third-party/boost/config/stdlib/libcomo.hpp b/gecode/third-party/boost/config/stdlib/libcomo.hpp deleted file mode 100644 index bcd14a0068..0000000000 --- a/gecode/third-party/boost/config/stdlib/libcomo.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// (C) Copyright John Maddock 2002 - 2003. -// (C) Copyright Jens Maurer 2002 - 2003. -// (C) Copyright Beman Dawes 2002 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Comeau STL: - -#if !defined(__LIBCOMO__) -# include -# if !defined(__LIBCOMO__) -# error "This is not the Comeau STL!" -# endif -#endif - -// -// std::streambuf is non-standard -// NOTE: versions of libcomo prior to beta28 have octal version numbering, -// e.g. version 25 is 21 (dec) -#if __LIBCOMO_VERSION__ <= 22 -# define GECODE_BOOST_NO_STD_WSTREAMBUF -#endif - -#if (__LIBCOMO_VERSION__ <= 31) && defined(_WIN32) -#define GECODE_BOOST_NO_SWPRINTF -#endif - -#if __LIBCOMO_VERSION__ >= 31 -# define GECODE_BOOST_HAS_HASH -# define GECODE_BOOST_HAS_SLIST -#endif - -// C++0x headers not yet implemented -// -# define GECODE_BOOST_NO_0X_HDR_ARRAY -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST - -// -// Intrinsic type_traits support. -// The SGI STL has it's own __type_traits class, which -// has intrinsic compiler support with SGI's compilers. -// Whatever map SGI style type traits to boost equivalents: -// -#define GECODE_BOOST_HAS_SGI_TYPE_TRAITS - -#define GECODE_BOOST_STDLIB "Comeau standard library " GECODE_BOOST_STRINGIZE(__LIBCOMO_VERSION__) - - diff --git a/gecode/third-party/boost/config/stdlib/libcpp.hpp b/gecode/third-party/boost/config/stdlib/libcpp.hpp deleted file mode 100644 index 4aadc4e7e6..0000000000 --- a/gecode/third-party/boost/config/stdlib/libcpp.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// (C) Copyright Christopher Jefferson 2011. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// config for libc++ -// Might need more in here later. - -#if !defined(_LIBCPP_VERSION) -# include -# if !defined(_LIBCPP_VERSION) -# error "This is not libc++!" -# endif -#endif - -#define GECODE_BOOST_STDLIB "libc++ version " GECODE_BOOST_STRINGIZE(_LIBCPP_VERSION) - -#define GECODE_BOOST_HAS_THREADS - -#ifdef _LIBCPP_HAS_NO_VARIADICS -# define GECODE_BOOST_NO_0X_HDR_TUPLE -#endif - -// -// These appear to be unusable/incomplete so far: -// -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS - -// libc++ uses a non-standard messages_base -#define GECODE_BOOST_NO_STD_MESSAGES - -// --- end --- diff --git a/gecode/third-party/boost/config/stdlib/libstdcpp3.hpp b/gecode/third-party/boost/config/stdlib/libstdcpp3.hpp deleted file mode 100644 index 71eab0bbaf..0000000000 --- a/gecode/third-party/boost/config/stdlib/libstdcpp3.hpp +++ /dev/null @@ -1,155 +0,0 @@ -// (C) Copyright John Maddock 2001. -// (C) Copyright Jens Maurer 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// config for libstdc++ v3 -// not much to go in here: - -#define GECODE_BOOST_GNU_STDLIB 1 - -#ifdef __GLIBCXX__ -#define GECODE_BOOST_STDLIB "GNU libstdc++ version " GECODE_BOOST_STRINGIZE(__GLIBCXX__) -#else -#define GECODE_BOOST_STDLIB "GNU libstdc++ version " GECODE_BOOST_STRINGIZE(__GLIBCPP__) -#endif - -#if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T) -# define GECODE_BOOST_NO_CWCHAR -# define GECODE_BOOST_NO_CWCTYPE -# define GECODE_BOOST_NO_STD_WSTRING -# define GECODE_BOOST_NO_STD_WSTREAMBUF -#endif - -#if defined(__osf__) && !defined(_REENTRANT) \ - && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) ) -// GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header -// file is included, therefore for consistency we define it here as well. -# define _REENTRANT -#endif - -#ifdef __GLIBCXX__ // gcc 3.4 and greater: -# if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ - || defined(_GLIBCXX__PTHREADS) \ - || defined(_GLIBCXX_HAS_GTHREADS) \ - || defined(_WIN32) - // - // If the std lib has thread support turned on, then turn it on in Boost - // as well. We do this because some gcc-3.4 std lib headers define _REENTANT - // while others do not... - // -# define GECODE_BOOST_HAS_THREADS -# else -# define GECODE_BOOST_DISABLE_THREADS -# endif -#elif defined(__GLIBCPP__) \ - && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \ - && !defined(_GLIBCPP__PTHREADS) - // disable thread support if the std lib was built single threaded: -# define GECODE_BOOST_DISABLE_THREADS -#endif - -#if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT) -// linux on arm apparently doesn't define _REENTRANT -// so just turn on threading support whenever the std lib is thread safe: -# define GECODE_BOOST_HAS_THREADS -#endif - -#if !defined(_GLIBCPP_USE_LONG_LONG) \ - && !defined(_GLIBCXX_USE_LONG_LONG)\ - && defined(GECODE_BOOST_HAS_LONG_LONG) -// May have been set by compiler/*.hpp, but "long long" without library -// support is useless. -# undef GECODE_BOOST_HAS_LONG_LONG -#endif - -// Apple doesn't seem to reliably defined a *unix* macro -#if !defined(CYGWIN) && ( defined(__unix__) \ - || defined(__unix) \ - || defined(unix) \ - || defined(__APPLE__) \ - || defined(__APPLE) \ - || defined(APPLE)) -# include -#endif - -#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0 -# define GECODE_BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx -# define GECODE_BOOST_HAS_SLIST -# define GECODE_BOOST_HAS_HASH -# define GECODE_BOOST_SLIST_HEADER -# if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) -# define GECODE_BOOST_HASH_SET_HEADER -# define GECODE_BOOST_HASH_MAP_HEADER -# else -# define GECODE_BOOST_HASH_SET_HEADER -# define GECODE_BOOST_HASH_MAP_HEADER -# endif -#endif - -// stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly -// __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++ -// developers. He also commented: -// -// "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in -// GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305. -// Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support -// than any release in the 4.2 series." -// -// Another resource for understanding stdlibc++ features is: -// http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x - -// C++0x headers in GCC 4.3.0 and later -// -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GECODE_BOOST_NO_0X_HDR_ARRAY -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -#endif - -// C++0x headers in GCC 4.4.0 and later -// -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -#else -# define GECODE_BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG -# define GECODE_BOOST_HAS_TR1_COMPLEX_OVERLOADS -#endif - -#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE) || !defined(GECODE_BOOST_NO_0X_HDR_MUTEX)) -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_MUTEX -#endif - -// C++0x features in GCC 4.5.0 and later -// -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_RANDOM -#endif - -// C++0x features in GCC 4.5.0 and later -// -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -#endif -// C++0x headers not yet (fully!) implemented -// -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -# define GECODE_BOOST_NO_0X_HDR_CODECVT - -// --- end --- diff --git a/gecode/third-party/boost/config/stdlib/modena.hpp b/gecode/third-party/boost/config/stdlib/modena.hpp deleted file mode 100644 index 376bdf6097..0000000000 --- a/gecode/third-party/boost/config/stdlib/modena.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// (C) Copyright Jens Maurer 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Modena C++ standard library (comes with KAI C++) - -#if !defined(MSIPL_COMPILE_H) -# include -# if !defined(__MSIPL_COMPILE_H) -# error "This is not the Modena C++ library!" -# endif -#endif - -#ifndef MSIPL_NL_TYPES -#define GECODE_BOOST_NO_STD_MESSAGES -#endif - -#ifndef MSIPL_WCHART -#define GECODE_BOOST_NO_STD_WSTRING -#endif - -// C++0x headers not yet implemented -// -# define GECODE_BOOST_NO_0X_HDR_ARRAY -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST - -#define GECODE_BOOST_STDLIB "Modena C++ standard library" - - - - - diff --git a/gecode/third-party/boost/config/stdlib/msl.hpp b/gecode/third-party/boost/config/stdlib/msl.hpp deleted file mode 100644 index b842c9aa27..0000000000 --- a/gecode/third-party/boost/config/stdlib/msl.hpp +++ /dev/null @@ -1,81 +0,0 @@ -// (C) Copyright John Maddock 2001. -// (C) Copyright Darin Adler 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Metrowerks standard library: - -#ifndef __MSL_CPP__ -# include -# ifndef __MSL_CPP__ -# error This is not the MSL standard library! -# endif -#endif - -#if __MSL_CPP__ >= 0x6000 // Pro 6 -# define GECODE_BOOST_HAS_HASH -# define GECODE_BOOST_STD_EXTENSION_NAMESPACE Metrowerks -#endif -#define GECODE_BOOST_HAS_SLIST - -#if __MSL_CPP__ < 0x6209 -# define GECODE_BOOST_NO_STD_MESSAGES -#endif - -// check C lib version for -#include - -#if defined(__MSL__) && (__MSL__ >= 0x5000) -# define GECODE_BOOST_HAS_STDINT_H -# if !defined(__PALMOS_TRAPS__) -# define GECODE_BOOST_HAS_UNISTD_H -# endif - // boilerplate code: -# include -#endif - -#if defined(_MWMT) || _MSL_THREADSAFE -# define GECODE_BOOST_HAS_THREADS -#endif - -#ifdef _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG -# define GECODE_BOOST_NO_STD_USE_FACET -# define GECODE_BOOST_HAS_TWO_ARG_USE_FACET -#endif - -// C++0x headers not yet implemented -// -# define GECODE_BOOST_NO_0X_HDR_ARRAY -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST - -#define GECODE_BOOST_STDLIB "Metrowerks Standard Library version " GECODE_BOOST_STRINGIZE(__MSL_CPP__) - - - - - - - - - diff --git a/gecode/third-party/boost/config/stdlib/roguewave.hpp b/gecode/third-party/boost/config/stdlib/roguewave.hpp deleted file mode 100644 index 6ed05bca26..0000000000 --- a/gecode/third-party/boost/config/stdlib/roguewave.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001. -// (C) Copyright David Abrahams 2003. -// (C) Copyright Boris Gubenko 2007. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// Rogue Wave std lib: - -#define GECODE_BOOST_RW_STDLIB 1 - -#if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) -# include -# if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) -# error This is not the Rogue Wave standard library -# endif -#endif -// -// figure out a consistent version number: -// -#ifndef _RWSTD_VER -# define GECODE_BOOST_RWSTD_VER 0x010000 -#elif _RWSTD_VER < 0x010000 -# define GECODE_BOOST_RWSTD_VER (_RWSTD_VER << 8) -#else -# define GECODE_BOOST_RWSTD_VER _RWSTD_VER -#endif - -#ifndef _RWSTD_VER -# define GECODE_BOOST_STDLIB "Rogue Wave standard library version (Unknown version)" -#elif _RWSTD_VER < 0x04010200 - # define GECODE_BOOST_STDLIB "Rogue Wave standard library version " GECODE_BOOST_STRINGIZE(_RWSTD_VER) -#else -# ifdef _RWSTD_VER_STR -# define GECODE_BOOST_STDLIB "Apache STDCXX standard library version " _RWSTD_VER_STR -# else -# define GECODE_BOOST_STDLIB "Apache STDCXX standard library version " GECODE_BOOST_STRINGIZE(_RWSTD_VER) -# endif -#endif - -// -// Prior to version 2.2.0 the primary template for std::numeric_limits -// does not have compile time constants, even though specializations of that -// template do: -// -#if GECODE_BOOST_RWSTD_VER < 0x020200 -# define GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -#endif - -// Sun CC 5.5 patch 113817-07 adds long long specialization, but does not change the -// library version number (http://sunsolve6.sun.com/search/document.do?assetkey=1-21-113817): -#if GECODE_BOOST_RWSTD_VER <= 0x020101 && (!defined(__SUNPRO_CC) || (__SUNPRO_CC < 0x550)) -# define GECODE_BOOST_NO_LONG_LONG_NUMERIC_LIMITS -# endif - -// -// Borland version of numeric_limits lacks __int64 specialisation: -// -#ifdef __BORLANDC__ -# define GECODE_BOOST_NO_MS_INT64_NUMERIC_LIMITS -#endif - -// -// No std::iterator if it can't figure out default template args: -// -#if defined(_RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) || defined(RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) || (GECODE_BOOST_RWSTD_VER < 0x020000) -# define GECODE_BOOST_NO_STD_ITERATOR -#endif - -// -// No iterator traits without partial specialization: -// -#if defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) || defined(RWSTD_NO_CLASS_PARTIAL_SPEC) -# define GECODE_BOOST_NO_STD_ITERATOR_TRAITS -#endif - -// -// Prior to version 2.0, std::auto_ptr was buggy, and there were no -// new-style iostreams, and no conformant std::allocator: -// -#if (GECODE_BOOST_RWSTD_VER < 0x020000) -# define GECODE_BOOST_NO_AUTO_PTR -# define GECODE_BOOST_NO_STRINGSTREAM -# define GECODE_BOOST_NO_STD_ALLOCATOR -# define GECODE_BOOST_NO_STD_LOCALE -#endif - -// -// No template iterator constructors without member template support: -// -#if defined(RWSTD_NO_MEMBER_TEMPLATES) || defined(_RWSTD_NO_MEMBER_TEMPLATES) -# define GECODE_BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS -#endif - -// -// RW defines _RWSTD_ALLOCATOR if the allocator is conformant and in use -// (the or _HPACC_ part is a hack - the library seems to define _RWSTD_ALLOCATOR -// on HP aCC systems even though the allocator is in fact broken): -// -#if !defined(_RWSTD_ALLOCATOR) || (defined(__HP_aCC) && __HP_aCC <= 33100) -# define GECODE_BOOST_NO_STD_ALLOCATOR -#endif - -// -// If we have a std::locale, we still may not have std::use_facet: -// -#if defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE) && !defined(GECODE_BOOST_NO_STD_LOCALE) -# define GECODE_BOOST_NO_STD_USE_FACET -# define GECODE_BOOST_HAS_TWO_ARG_USE_FACET -#endif - -// -// There's no std::distance prior to version 2, or without -// partial specialization support: -// -#if (GECODE_BOOST_RWSTD_VER < 0x020000) || defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - #define GECODE_BOOST_NO_STD_DISTANCE -#endif - -// -// Some versions of the rogue wave library don't have assignable -// OutputIterators: -// -#if GECODE_BOOST_RWSTD_VER < 0x020100 -# define GECODE_BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN -#endif - -// -// Disable GECODE_BOOST_HAS_LONG_LONG when the library has no support for it. -// -#if !defined(_RWSTD_LONG_LONG) && defined(GECODE_BOOST_HAS_LONG_LONG) -# undef GECODE_BOOST_HAS_LONG_LONG -#endif - -// -// check that on HP-UX, the proper RW library is used -// -#if defined(__HP_aCC) && !defined(_HP_NAMESPACE_STD) -# error "Boost requires Standard RW library. Please compile and link with -AA" -#endif - -// -// Define macros specific to RW V2.2 on HP-UX -// -#if defined(__HP_aCC) && (GECODE_BOOST_RWSTD_VER == 0x02020100) -# ifndef __HP_TC1_MAKE_PAIR -# define __HP_TC1_MAKE_PAIR -# endif -# ifndef _HP_INSTANTIATE_STD2_VL -# define _HP_INSTANTIATE_STD2_VL -# endif -#endif - -#if _RWSTD_VER < 0x05000000 -# define GECODE_BOOST_NO_0X_HDR_ARRAY -#endif -// type_traits header is incomplete: -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -// -// C++0x headers not yet implemented -// -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST - diff --git a/gecode/third-party/boost/config/stdlib/sgi.hpp b/gecode/third-party/boost/config/stdlib/sgi.hpp deleted file mode 100644 index e9422d4b08..0000000000 --- a/gecode/third-party/boost/config/stdlib/sgi.hpp +++ /dev/null @@ -1,145 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Darin Adler 2001. -// (C) Copyright Jens Maurer 2001 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// generic SGI STL: - -#if !defined(__STL_CONFIG_H) -# include -# if !defined(__STL_CONFIG_H) -# error "This is not the SGI STL!" -# endif -#endif - -// -// No std::iterator traits without partial specialisation: -// -#if !defined(__STL_CLASS_PARTIAL_SPECIALIZATION) -# define GECODE_BOOST_NO_STD_ITERATOR_TRAITS -#endif - -// -// No std::stringstream with gcc < 3 -// -#if defined(__GNUC__) && (__GNUC__ < 3) && \ - ((__GNUC_MINOR__ < 95) || (__GNUC_MINOR__ == 96)) && \ - !defined(__STL_USE_NEW_IOSTREAMS) || \ - defined(__APPLE_CC__) - // Note that we only set this for GNU C++ prior to 2.95 since the - // latest patches for that release do contain a minimal - // If you are running a 2.95 release prior to 2.95.3 then this will need - // setting, but there is no way to detect that automatically (other - // than by running the configure script). - // Also, the unofficial GNU C++ 2.96 included in RedHat 7.1 doesn't - // have . -# define GECODE_BOOST_NO_STRINGSTREAM -#endif - -// Apple doesn't seem to reliably defined a *unix* macro -#if !defined(CYGWIN) && ( defined(__unix__) \ - || defined(__unix) \ - || defined(unix) \ - || defined(__APPLE__) \ - || defined(__APPLE) \ - || defined(APPLE)) -# include -#endif - - -// -// Assume no std::locale without own iostreams (this may be an -// incorrect assumption in some cases): -// -#if !defined(__SGI_STL_OWN_IOSTREAMS) && !defined(__STL_USE_NEW_IOSTREAMS) -# define GECODE_BOOST_NO_STD_LOCALE -#endif - -// -// Original native SGI streams have non-standard std::messages facet: -// -#if defined(__sgi) && (_COMPILER_VERSION <= 650) && !defined(__SGI_STL_OWN_IOSTREAMS) -# define GECODE_BOOST_NO_STD_LOCALE -#endif - -// -// SGI's new iostreams have missing "const" in messages<>::open -// -#if defined(__sgi) && (_COMPILER_VERSION <= 740) && defined(__STL_USE_NEW_IOSTREAMS) -# define GECODE_BOOST_NO_STD_MESSAGES -#endif - -// -// No template iterator constructors, or std::allocator -// without member templates: -// -#if !defined(__STL_MEMBER_TEMPLATES) -# define GECODE_BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS -# define GECODE_BOOST_NO_STD_ALLOCATOR -#endif - -// -// We always have SGI style hash_set, hash_map, and slist: -// -#define GECODE_BOOST_HAS_HASH -#define GECODE_BOOST_HAS_SLIST - -// -// If this is GNU libstdc++2, then no and no std::wstring: -// -#if (defined(__GNUC__) && (__GNUC__ < 3)) -# include -# if defined(__BASTRING__) -# define GECODE_BOOST_NO_LIMITS -// Note: will provide compile-time constants -# undef GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -# define GECODE_BOOST_NO_STD_WSTRING -# endif -#endif - -// -// There is no standard iterator unless we have namespace support: -// -#if !defined(__STL_USE_NAMESPACES) -# define GECODE_BOOST_NO_STD_ITERATOR -#endif - -// -// Intrinsic type_traits support. -// The SGI STL has it's own __type_traits class, which -// has intrinsic compiler support with SGI's compilers. -// Whatever map SGI style type traits to boost equivalents: -// -#define GECODE_BOOST_HAS_SGI_TYPE_TRAITS - -// C++0x headers not yet implemented -// -# define GECODE_BOOST_NO_0X_HDR_ARRAY -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST - -#define GECODE_BOOST_STDLIB "SGI standard library" - - - diff --git a/gecode/third-party/boost/config/stdlib/stlport.hpp b/gecode/third-party/boost/config/stdlib/stlport.hpp deleted file mode 100644 index da3ec4405d..0000000000 --- a/gecode/third-party/boost/config/stdlib/stlport.hpp +++ /dev/null @@ -1,244 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2002. -// (C) Copyright Darin Adler 2001. -// (C) Copyright Jens Maurer 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -// STLPort standard library config: - -#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) -# include -# if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) -# error "This is not STLPort!" -# endif -#endif - -// Apple doesn't seem to reliably defined a *unix* macro -#if !defined(CYGWIN) && ( defined(__unix__) \ - || defined(__unix) \ - || defined(unix) \ - || defined(__APPLE__) \ - || defined(__APPLE) \ - || defined(APPLE)) -# include -#endif - -// -// __STL_STATIC_CONST_INIT_BUG implies GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -// for versions prior to 4.1(beta) -// -#if (defined(__STL_STATIC_CONST_INIT_BUG) || defined(_STLP_STATIC_CONST_INIT_BUG)) && (__SGI_STL_PORT <= 0x400) -# define GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -#endif - -// -// If STLport thinks that there is no partial specialisation, then there is no -// std::iterator traits: -// -#if !(defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) || defined(__STL_CLASS_PARTIAL_SPECIALIZATION)) -# define GECODE_BOOST_NO_STD_ITERATOR_TRAITS -#endif - -// -// No new style iostreams on GCC without STLport's iostreams enabled: -// -#if (defined(__GNUC__) && (__GNUC__ < 3)) && !(defined(__SGI_STL_OWN_IOSTREAMS) || defined(_STLP_OWN_IOSTREAMS)) -# define GECODE_BOOST_NO_STRINGSTREAM -#endif - -// -// No new iostreams implies no std::locale, and no std::stringstream: -// -#if defined(__STL_NO_IOSTREAMS) || defined(__STL_NO_NEW_IOSTREAMS) || defined(_STLP_NO_IOSTREAMS) || defined(_STLP_NO_NEW_IOSTREAMS) -# define GECODE_BOOST_NO_STD_LOCALE -# define GECODE_BOOST_NO_STRINGSTREAM -#endif - -// -// If the streams are not native, and we have a "using ::x" compiler bug -// then the io stream facets are not available in namespace std:: -// -#ifdef _STLPORT_VERSION -# if !(_STLPORT_VERSION >= 0x500) && !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(GECODE_BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__) -# define GECODE_BOOST_NO_STD_LOCALE -# endif -#else -# if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_NAMESPACES) && defined(GECODE_BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__) -# define GECODE_BOOST_NO_STD_LOCALE -# endif -#endif - -#if defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x500) || (_STLPORT_VERSION >= 0x520)) -# define GECODE_BOOST_NO_STD_UNORDERED -#endif - -#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION >= 0x520) -# define GECODE_BOOST_HAS_TR1_UNORDERED_SET -# define GECODE_BOOST_HAS_TR1_UNORDERED_MAP -#endif -// -// Without member template support enabled, their are no template -// iterate constructors, and no std::allocator: -// -#if !(defined(__STL_MEMBER_TEMPLATES) || defined(_STLP_MEMBER_TEMPLATES)) -# define GECODE_BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS -# define GECODE_BOOST_NO_STD_ALLOCATOR -#endif -// -// however we always have at least a partial allocator: -// -#define GECODE_BOOST_HAS_PARTIAL_STD_ALLOCATOR - -#if !defined(_STLP_MEMBER_TEMPLATE_CLASSES) || defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE) -# define GECODE_BOOST_NO_STD_ALLOCATOR -#endif - -#if defined(_STLP_NO_MEMBER_TEMPLATE_KEYWORD) && defined(GECODE_BOOST_MSVC) && (GECODE_BOOST_MSVC <= 1300) -# define GECODE_BOOST_NO_STD_ALLOCATOR -#endif - -// -// If STLport thinks there is no wchar_t at all, then we have to disable -// the support for the relevant specilazations of std:: templates. -// -#if !defined(_STLP_HAS_WCHAR_T) && !defined(_STLP_WCHAR_T_IS_USHORT) -# ifndef GECODE_BOOST_NO_STD_WSTRING -# define GECODE_BOOST_NO_STD_WSTRING -# endif -# ifndef GECODE_BOOST_NO_STD_WSTREAMBUF -# define GECODE_BOOST_NO_STD_WSTREAMBUF -# endif -#endif - -// -// We always have SGI style hash_set, hash_map, and slist: -// -#ifndef _STLP_NO_EXTENSIONS -#define GECODE_BOOST_HAS_HASH -#define GECODE_BOOST_HAS_SLIST -#endif - -// -// STLport does a good job of importing names into namespace std::, -// but doesn't always get them all, define GECODE_BOOST_NO_STDC_NAMESPACE, since our -// workaround does not conflict with STLports: -// -// -// Harold Howe says: -// Borland switched to STLport in BCB6. Defining GECODE_BOOST_NO_STDC_NAMESPACE with -// BCB6 does cause problems. If we detect C++ Builder, then don't define -// GECODE_BOOST_NO_STDC_NAMESPACE -// -#if !defined(__BORLANDC__) && !defined(__DMC__) -// -// If STLport is using it's own namespace, and the real names are in -// the global namespace, then we duplicate STLport's using declarations -// (by defining GECODE_BOOST_NO_STDC_NAMESPACE), we do this because STLport doesn't -// necessarily import all the names we need into namespace std:: -// -# if (defined(__STL_IMPORT_VENDOR_CSTD) \ - || defined(__STL_USE_OWN_NAMESPACE) \ - || defined(_STLP_IMPORT_VENDOR_CSTD) \ - || defined(_STLP_USE_OWN_NAMESPACE)) \ - && (defined(__STL_VENDOR_GLOBAL_CSTD) || defined (_STLP_VENDOR_GLOBAL_CSTD)) -# define GECODE_BOOST_NO_STDC_NAMESPACE -# define GECODE_BOOST_NO_EXCEPTION_STD_NAMESPACE -# endif -#elif defined(__BORLANDC__) && __BORLANDC__ < 0x560 -// STLport doesn't import std::abs correctly: -#include -namespace std { using ::abs; } -// and strcmp/strcpy don't get imported either ('cos they are macros) -#include -#ifdef strcpy -# undef strcpy -#endif -#ifdef strcmp -# undef strcmp -#endif -#ifdef _STLP_VENDOR_CSTD -namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; } -#endif -#endif - -// -// std::use_facet may be non-standard, uses a class instead: -// -#if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) || defined(_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS) -# define GECODE_BOOST_NO_STD_USE_FACET -# define GECODE_BOOST_HAS_STLP_USE_FACET -#endif - -// -// If STLport thinks there are no wide functions, etc. is not working; but -// only if GECODE_BOOST_NO_STDC_NAMESPACE is not defined (if it is then we do the import -// into std:: ourselves). -// -#if defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(GECODE_BOOST_NO_STDC_NAMESPACE) -# define GECODE_BOOST_NO_CWCHAR -# define GECODE_BOOST_NO_CWCTYPE -#endif - -// -// If STLport for some reason was configured so that it thinks that wchar_t -// is not an intrinsic type, then we have to disable the support for it as -// well (we would be missing required specializations otherwise). -// -#if !defined( _STLP_HAS_WCHAR_T) || defined(_STLP_WCHAR_T_IS_USHORT) -# undef GECODE_BOOST_NO_INTRINSIC_WCHAR_T -# define GECODE_BOOST_NO_INTRINSIC_WCHAR_T -#endif - -// -// Borland ships a version of STLport with C++ Builder 6 that lacks -// hashtables and the like: -// -#if defined(__BORLANDC__) && (__BORLANDC__ == 0x560) -# undef GECODE_BOOST_HAS_HASH -#endif - -// -// gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max -// -#if defined(__GNUC__) && (__GNUC__ < 3) -# include // for std::min and std::max -# define GECODE_BOOST_USING_STD_MIN() ((void)0) -# define GECODE_BOOST_USING_STD_MAX() ((void)0) -namespace gecode_boost { using std::min; using std::max; } -#endif - -// C++0x headers not yet implemented -// -# define GECODE_BOOST_NO_0X_HDR_ARRAY -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST - -#define GECODE_BOOST_STDLIB "STLPort standard library version " GECODE_BOOST_STRINGIZE(__SGI_STL_PORT) - - - - - - - - diff --git a/gecode/third-party/boost/config/stdlib/vacpp.hpp b/gecode/third-party/boost/config/stdlib/vacpp.hpp deleted file mode 100644 index 0c3af03801..0000000000 --- a/gecode/third-party/boost/config/stdlib/vacpp.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// (C) Copyright John Maddock 2001 - 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for most recent version. - -#if __IBMCPP__ <= 501 -# define GECODE_BOOST_NO_STD_ALLOCATOR -#endif - -#define GECODE_BOOST_HAS_MACRO_USE_FACET -#define GECODE_BOOST_NO_STD_MESSAGES - -// Apple doesn't seem to reliably defined a *unix* macro -#if !defined(CYGWIN) && ( defined(__unix__) \ - || defined(__unix) \ - || defined(unix) \ - || defined(__APPLE__) \ - || defined(__APPLE) \ - || defined(APPLE)) -# include -#endif - -// C++0x headers not yet implemented -// -# define GECODE_BOOST_NO_0X_HDR_ARRAY -# define GECODE_BOOST_NO_0X_HDR_CHRONO -# define GECODE_BOOST_NO_0X_HDR_CODECVT -# define GECODE_BOOST_NO_0X_HDR_CONDITION_VARIABLE -# define GECODE_BOOST_NO_0X_HDR_FORWARD_LIST -# define GECODE_BOOST_NO_0X_HDR_FUTURE -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -# define GECODE_BOOST_NO_0X_HDR_MUTEX -# define GECODE_BOOST_NO_0X_HDR_RANDOM -# define GECODE_BOOST_NO_0X_HDR_RATIO -# define GECODE_BOOST_NO_0X_HDR_REGEX -# define GECODE_BOOST_NO_0X_HDR_SYSTEM_ERROR -# define GECODE_BOOST_NO_0X_HDR_THREAD -# define GECODE_BOOST_NO_0X_HDR_TUPLE -# define GECODE_BOOST_NO_0X_HDR_TYPE_TRAITS -# define GECODE_BOOST_NO_0X_HDR_TYPEINDEX -# define GECODE_BOOST_NO_STD_UNORDERED // deprecated; see following -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_MAP -# define GECODE_BOOST_NO_0X_HDR_UNORDERED_SET -# define GECODE_BOOST_NO_NUMERIC_LIMITS_LOWEST - -#define GECODE_BOOST_STDLIB "Visual Age default standard library" - - - diff --git a/gecode/third-party/boost/config/suffix.hpp b/gecode/third-party/boost/config/suffix.hpp deleted file mode 100644 index ce15c73ae1..0000000000 --- a/gecode/third-party/boost/config/suffix.hpp +++ /dev/null @@ -1,671 +0,0 @@ -// Boost config.hpp configuration header file ------------------------------// - -// Copyright (c) 2001-2003 John Maddock -// Copyright (c) 2001 Darin Adler -// Copyright (c) 2001 Peter Dimov -// Copyright (c) 2002 Bill Kempf -// Copyright (c) 2002 Jens Maurer -// Copyright (c) 2002-2003 David Abrahams -// Copyright (c) 2003 Gennaro Prota -// Copyright (c) 2003 Eric Friedman -// Copyright (c) 2010 Eric Jourdanneau, Joel Falcou -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org/ for most recent version. - -// Boost config.hpp policy and rationale documentation has been moved to -// http://www.boost.org/libs/config/ -// -// This file is intended to be stable, and relatively unchanging. -// It should contain boilerplate code only - no compiler specific -// code unless it is unavoidable - no changes unless unavoidable. - -#ifndef GECODE_BOOST_CONFIG_SUFFIX_HPP -#define GECODE_BOOST_CONFIG_SUFFIX_HPP - -#if defined(__GNUC__) && (__GNUC__ >= 4) -// -// Some GCC-4.x versions issue warnings even when __extension__ is used, -// so use this as a workaround: -// -#pragma GCC system_header -#endif - -// -// ensure that visibility macros are always defined, thus symplifying use -// -#ifndef GECODE_BOOST_SYMBOL_EXPORT -# define GECODE_BOOST_SYMBOL_EXPORT -#endif -#ifndef GECODE_BOOST_SYMBOL_IMPORT -# define GECODE_BOOST_SYMBOL_IMPORT -#endif -#ifndef GECODE_BOOST_SYMBOL_VISIBLE -# define GECODE_BOOST_SYMBOL_VISIBLE -#endif - -// -// look for long long by looking for the appropriate macros in . -// Note that we use limits.h rather than climits for maximal portability, -// remember that since these just declare a bunch of macros, there should be -// no namespace issues from this. -// -#if !defined(GECODE_BOOST_HAS_LONG_LONG) && !defined(GECODE_BOOST_NO_LONG_LONG) \ - && !defined(GECODE_BOOST_MSVC) && !defined(__BORLANDC__) -# include -# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) -# define GECODE_BOOST_HAS_LONG_LONG -# else -# define GECODE_BOOST_NO_LONG_LONG -# endif -#endif - -// GCC 3.x will clean up all of those nasty macro definitions that -// GECODE_BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine -// it under GCC 3.x. -#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(GECODE_BOOST_NO_CTYPE_FUNCTIONS) -# undef GECODE_BOOST_NO_CTYPE_FUNCTIONS -#endif - -// -// Assume any extensions are in namespace std:: unless stated otherwise: -// -# ifndef GECODE_BOOST_STD_EXTENSION_NAMESPACE -# define GECODE_BOOST_STD_EXTENSION_NAMESPACE std -# endif - -// -// If cv-qualified specializations are not allowed, then neither are cv-void ones: -// -# if defined(GECODE_BOOST_NO_CV_SPECIALIZATIONS) \ - && !defined(GECODE_BOOST_NO_CV_VOID_SPECIALIZATIONS) -# define GECODE_BOOST_NO_CV_VOID_SPECIALIZATIONS -# endif - -// -// If there is no numeric_limits template, then it can't have any compile time -// constants either! -// -# if defined(GECODE_BOOST_NO_LIMITS) \ - && !defined(GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) -# define GECODE_BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -# define GECODE_BOOST_NO_MS_INT64_NUMERIC_LIMITS -# define GECODE_BOOST_NO_LONG_LONG_NUMERIC_LIMITS -# endif - -// -// if there is no long long then there is no specialisation -// for numeric_limits either: -// -#if !defined(GECODE_BOOST_HAS_LONG_LONG) && !defined(GECODE_BOOST_NO_LONG_LONG_NUMERIC_LIMITS) -# define GECODE_BOOST_NO_LONG_LONG_NUMERIC_LIMITS -#endif - -// -// Normalize GECODE_BOOST_NO_STATIC_ASSERT and (depricated) GECODE_BOOST_HAS_STATIC_ASSERT: -// -#if !defined(GECODE_BOOST_NO_STATIC_ASSERT) && !defined(GECODE_BOOST_HAS_STATIC_ASSERT) -# define GECODE_BOOST_HAS_STATIC_ASSERT -#endif - -// -// if there is no __int64 then there is no specialisation -// for numeric_limits<__int64> either: -// -#if !defined(GECODE_BOOST_HAS_MS_INT64) && !defined(GECODE_BOOST_NO_MS_INT64_NUMERIC_LIMITS) -# define GECODE_BOOST_NO_MS_INT64_NUMERIC_LIMITS -#endif - -// -// if member templates are supported then so is the -// VC6 subset of member templates: -// -# if !defined(GECODE_BOOST_NO_MEMBER_TEMPLATES) \ - && !defined(GECODE_BOOST_MSVC6_MEMBER_TEMPLATES) -# define GECODE_BOOST_MSVC6_MEMBER_TEMPLATES -# endif - -// -// Without partial specialization, can't test for partial specialisation bugs: -// -# if defined(GECODE_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - && !defined(GECODE_BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) -# define GECODE_BOOST_BCB_PARTIAL_SPECIALIZATION_BUG -# endif - -// -// Without partial specialization, we can't have array-type partial specialisations: -// -# if defined(GECODE_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - && !defined(GECODE_BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -# define GECODE_BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS -# endif - -// -// Without partial specialization, std::iterator_traits can't work: -// -# if defined(GECODE_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - && !defined(GECODE_BOOST_NO_STD_ITERATOR_TRAITS) -# define GECODE_BOOST_NO_STD_ITERATOR_TRAITS -# endif - -// -// Without partial specialization, partial -// specialization with default args won't work either: -// -# if defined(GECODE_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - && !defined(GECODE_BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) -# define GECODE_BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS -# endif - -// -// Without member template support, we can't have template constructors -// in the standard library either: -// -# if defined(GECODE_BOOST_NO_MEMBER_TEMPLATES) \ - && !defined(GECODE_BOOST_MSVC6_MEMBER_TEMPLATES) \ - && !defined(GECODE_BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) -# define GECODE_BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS -# endif - -// -// Without member template support, we can't have a conforming -// std::allocator template either: -// -# if defined(GECODE_BOOST_NO_MEMBER_TEMPLATES) \ - && !defined(GECODE_BOOST_MSVC6_MEMBER_TEMPLATES) \ - && !defined(GECODE_BOOST_NO_STD_ALLOCATOR) -# define GECODE_BOOST_NO_STD_ALLOCATOR -# endif - -// -// without ADL support then using declarations will break ADL as well: -// -#if defined(GECODE_BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) && !defined(GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) -# define GECODE_BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -#endif - -// -// Without typeid support we have no dynamic RTTI either: -// -#if defined(GECODE_BOOST_NO_TYPEID) && !defined(GECODE_BOOST_NO_RTTI) -# define GECODE_BOOST_NO_RTTI -#endif - -// -// If we have a standard allocator, then we have a partial one as well: -// -#if !defined(GECODE_BOOST_NO_STD_ALLOCATOR) -# define GECODE_BOOST_HAS_PARTIAL_STD_ALLOCATOR -#endif - -// -// We can't have a working std::use_facet if there is no std::locale: -// -# if defined(GECODE_BOOST_NO_STD_LOCALE) && !defined(GECODE_BOOST_NO_STD_USE_FACET) -# define GECODE_BOOST_NO_STD_USE_FACET -# endif - -// -// We can't have a std::messages facet if there is no std::locale: -// -# if defined(GECODE_BOOST_NO_STD_LOCALE) && !defined(GECODE_BOOST_NO_STD_MESSAGES) -# define GECODE_BOOST_NO_STD_MESSAGES -# endif - -// -// We can't have a working std::wstreambuf if there is no std::locale: -// -# if defined(GECODE_BOOST_NO_STD_LOCALE) && !defined(GECODE_BOOST_NO_STD_WSTREAMBUF) -# define GECODE_BOOST_NO_STD_WSTREAMBUF -# endif - -// -// We can't have a if there is no : -// -# if defined(GECODE_BOOST_NO_CWCHAR) && !defined(GECODE_BOOST_NO_CWCTYPE) -# define GECODE_BOOST_NO_CWCTYPE -# endif - -// -// We can't have a swprintf if there is no : -// -# if defined(GECODE_BOOST_NO_CWCHAR) && !defined(GECODE_BOOST_NO_SWPRINTF) -# define GECODE_BOOST_NO_SWPRINTF -# endif - -// -// If Win32 support is turned off, then we must turn off -// threading support also, unless there is some other -// thread API enabled: -// -#if defined(GECODE_BOOST_DISABLE_WIN32) && defined(_WIN32) \ - && !defined(GECODE_BOOST_DISABLE_THREADS) && !defined(GECODE_BOOST_HAS_PTHREADS) -# define GECODE_BOOST_DISABLE_THREADS -#endif - -// -// Turn on threading support if the compiler thinks that it's in -// multithreaded mode. We put this here because there are only a -// limited number of macros that identify this (if there's any missing -// from here then add to the appropriate compiler section): -// -#if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \ - || defined(_PTHREADS) || defined(__APPLE__) || defined(__DragonFly__)) \ - && !defined(GECODE_BOOST_HAS_THREADS) -# define GECODE_BOOST_HAS_THREADS -#endif - -// -// Turn threading support off if GECODE_BOOST_DISABLE_THREADS is defined: -// -#if defined(GECODE_BOOST_DISABLE_THREADS) && defined(GECODE_BOOST_HAS_THREADS) -# undef GECODE_BOOST_HAS_THREADS -#endif - -// -// Turn threading support off if we don't recognise the threading API: -// -#if defined(GECODE_BOOST_HAS_THREADS) && !defined(GECODE_BOOST_HAS_PTHREADS)\ - && !defined(GECODE_BOOST_HAS_WINTHREADS) && !defined(GECODE_BOOST_HAS_BETHREADS)\ - && !defined(GECODE_BOOST_HAS_MPTASKS) -# undef GECODE_BOOST_HAS_THREADS -#endif - -// -// Turn threading detail macros off if we don't (want to) use threading -// -#ifndef GECODE_BOOST_HAS_THREADS -# undef GECODE_BOOST_HAS_PTHREADS -# undef GECODE_BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# undef GECODE_BOOST_HAS_PTHREAD_YIELD -# undef GECODE_BOOST_HAS_PTHREAD_DELAY_NP -# undef GECODE_BOOST_HAS_WINTHREADS -# undef GECODE_BOOST_HAS_BETHREADS -# undef GECODE_BOOST_HAS_MPTASKS -#endif - -// -// If the compiler claims to be C99 conformant, then it had better -// have a : -// -# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) -# define GECODE_BOOST_HAS_STDINT_H -# ifndef GECODE_BOOST_HAS_LOG1P -# define GECODE_BOOST_HAS_LOG1P -# endif -# ifndef GECODE_BOOST_HAS_EXPM1 -# define GECODE_BOOST_HAS_EXPM1 -# endif -# endif - -// -// Define GECODE_BOOST_NO_SLIST and GECODE_BOOST_NO_HASH if required. -// Note that this is for backwards compatibility only. -// -# if !defined(GECODE_BOOST_HAS_SLIST) && !defined(GECODE_BOOST_NO_SLIST) -# define GECODE_BOOST_NO_SLIST -# endif - -# if !defined(GECODE_BOOST_HAS_HASH) && !defined(GECODE_BOOST_NO_HASH) -# define GECODE_BOOST_NO_HASH -# endif - -// -// Set GECODE_BOOST_SLIST_HEADER if not set already: -// -#if defined(GECODE_BOOST_HAS_SLIST) && !defined(GECODE_BOOST_SLIST_HEADER) -# define GECODE_BOOST_SLIST_HEADER -#endif - -// -// Set GECODE_BOOST_HASH_SET_HEADER if not set already: -// -#if defined(GECODE_BOOST_HAS_HASH) && !defined(GECODE_BOOST_HASH_SET_HEADER) -# define GECODE_BOOST_HASH_SET_HEADER -#endif - -// -// Set GECODE_BOOST_HASH_MAP_HEADER if not set already: -// -#if defined(GECODE_BOOST_HAS_HASH) && !defined(GECODE_BOOST_HASH_MAP_HEADER) -# define GECODE_BOOST_HASH_MAP_HEADER -#endif - -// -// Set GECODE_BOOST_NO_INITIALIZER_LISTS if there is no library support. -// - -#if defined(GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST) && !defined(GECODE_BOOST_NO_INITIALIZER_LISTS) -# define GECODE_BOOST_NO_INITIALIZER_LISTS -#endif -#if defined(GECODE_BOOST_NO_INITIALIZER_LISTS) && !defined(GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST) -# define GECODE_BOOST_NO_0X_HDR_INITIALIZER_LIST -#endif - -// -// Set GECODE_BOOST_HAS_RVALUE_REFS when GECODE_BOOST_NO_RVALUE_REFERENCES is not defined -// -#if !defined(GECODE_BOOST_NO_RVALUE_REFERENCES) && !defined(GECODE_BOOST_HAS_RVALUE_REFS) -#define GECODE_BOOST_HAS_RVALUE_REFS -#endif - -// -// Set GECODE_BOOST_HAS_VARIADIC_TMPL when GECODE_BOOST_NO_VARIADIC_TEMPLATES is not defined -// -#if !defined(GECODE_BOOST_NO_VARIADIC_TEMPLATES) && !defined(GECODE_BOOST_HAS_VARIADIC_TMPL) -#define GECODE_BOOST_HAS_VARIADIC_TMPL -#endif - -// GECODE_BOOST_HAS_ABI_HEADERS -// This macro gets set if we have headers that fix the ABI, -// and prevent ODR violations when linking to external libraries: -#if defined(GECODE_BOOST_ABI_PREFIX) && defined(GECODE_BOOST_ABI_SUFFIX) && !defined(GECODE_BOOST_HAS_ABI_HEADERS) -# define GECODE_BOOST_HAS_ABI_HEADERS -#endif - -#if defined(GECODE_BOOST_HAS_ABI_HEADERS) && defined(GECODE_BOOST_DISABLE_ABI_HEADERS) -# undef GECODE_BOOST_HAS_ABI_HEADERS -#endif - -// GECODE_BOOST_NO_STDC_NAMESPACE workaround --------------------------------------// -// Because std::size_t usage is so common, even in boost headers which do not -// otherwise use the C library, the workaround is included here so -// that ugly workaround code need not appear in many other boost headers. -// NOTE WELL: This is a workaround for non-conforming compilers; -// must still be #included in the usual places so that inclusion -// works as expected with standard conforming compilers. The resulting -// double inclusion of is harmless. - -# if defined(GECODE_BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus) -# include - namespace std { using ::ptrdiff_t; using ::size_t; } -# endif - -// Workaround for the unfortunate min/max macros defined by some platform headers - -#define GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION - -#ifndef GECODE_BOOST_USING_STD_MIN -# define GECODE_BOOST_USING_STD_MIN() using std::min -#endif - -#ifndef GECODE_BOOST_USING_STD_MAX -# define GECODE_BOOST_USING_STD_MAX() using std::max -#endif - -// GECODE_BOOST_NO_STD_MIN_MAX workaround -----------------------------------------// - -# if defined(GECODE_BOOST_NO_STD_MIN_MAX) && defined(__cplusplus) - -namespace std { - template - inline const _Tp& min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) { - return __b < __a ? __b : __a; - } - template - inline const _Tp& max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) { - return __a < __b ? __b : __a; - } -} - -# endif - -// GECODE_BOOST_STATIC_CONSTANT workaround --------------------------------------- // -// On compilers which don't allow in-class initialization of static integral -// constant members, we must use enums as a workaround if we want the constants -// to be available at compile-time. This macro gives us a convenient way to -// declare such constants. - -# ifdef GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION -# define GECODE_BOOST_STATIC_CONSTANT(type, assignment) enum { assignment } -# else -# define GECODE_BOOST_STATIC_CONSTANT(type, assignment) static const type assignment -# endif - -// GECODE_BOOST_USE_FACET / HAS_FACET workaround ----------------------------------// -// When the standard library does not have a conforming std::use_facet there -// are various workarounds available, but they differ from library to library. -// The same problem occurs with has_facet. -// These macros provide a consistent way to access a locale's facets. -// Usage: -// replace -// std::use_facet(loc); -// with -// GECODE_BOOST_USE_FACET(Type, loc); -// Note do not add a std:: prefix to the front of GECODE_BOOST_USE_FACET! -// Use for GECODE_BOOST_HAS_FACET is analogous. - -#if defined(GECODE_BOOST_NO_STD_USE_FACET) -# ifdef GECODE_BOOST_HAS_TWO_ARG_USE_FACET -# define GECODE_BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast(0)) -# define GECODE_BOOST_HAS_FACET(Type, loc) std::has_facet(loc, static_cast(0)) -# elif defined(GECODE_BOOST_HAS_MACRO_USE_FACET) -# define GECODE_BOOST_USE_FACET(Type, loc) std::_USE(loc, Type) -# define GECODE_BOOST_HAS_FACET(Type, loc) std::_HAS(loc, Type) -# elif defined(GECODE_BOOST_HAS_STLP_USE_FACET) -# define GECODE_BOOST_USE_FACET(Type, loc) (*std::_Use_facet(loc)) -# define GECODE_BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc) -# endif -#else -# define GECODE_BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc) -# define GECODE_BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc) -#endif - -// GECODE_BOOST_NESTED_TEMPLATE workaround ------------------------------------------// -// Member templates are supported by some compilers even though they can't use -// the A::template member syntax, as a workaround replace: -// -// typedef typename A::template rebind binder; -// -// with: -// -// typedef typename A::GECODE_BOOST_NESTED_TEMPLATE rebind binder; - -#ifndef GECODE_BOOST_NO_MEMBER_TEMPLATE_KEYWORD -# define GECODE_BOOST_NESTED_TEMPLATE template -#else -# define GECODE_BOOST_NESTED_TEMPLATE -#endif - -// GECODE_BOOST_UNREACHABLE_RETURN(x) workaround -------------------------------------// -// Normally evaluates to nothing, unless GECODE_BOOST_NO_UNREACHABLE_RETURN_DETECTION -// is defined, in which case it evaluates to return x; Use when you have a return -// statement that can never be reached. - -#ifdef GECODE_BOOST_NO_UNREACHABLE_RETURN_DETECTION -# define GECODE_BOOST_UNREACHABLE_RETURN(x) return x; -#else -# define GECODE_BOOST_UNREACHABLE_RETURN(x) -#endif - -// GECODE_BOOST_DEDUCED_TYPENAME workaround ------------------------------------------// -// -// Some compilers don't support the use of `typename' for dependent -// types in deduced contexts, e.g. -// -// template void f(T, typename T::type); -// ^^^^^^^^ -// Replace these declarations with: -// -// template void f(T, GECODE_BOOST_DEDUCED_TYPENAME T::type); - -#ifndef GECODE_BOOST_NO_DEDUCED_TYPENAME -# define GECODE_BOOST_DEDUCED_TYPENAME typename -#else -# define GECODE_BOOST_DEDUCED_TYPENAME -#endif - -#ifndef GECODE_BOOST_NO_TYPENAME_WITH_CTOR -# define GECODE_BOOST_CTOR_TYPENAME typename -#else -# define GECODE_BOOST_CTOR_TYPENAME -#endif - -// long long workaround ------------------------------------------// -// On gcc (and maybe other compilers?) long long is alway supported -// but it's use may generate either warnings (with -ansi), or errors -// (with -pedantic -ansi) unless it's use is prefixed by __extension__ -// -#if defined(GECODE_BOOST_HAS_LONG_LONG) && defined(__cplusplus) -namespace gecode_boost{ -# ifdef __GNUC__ - __extension__ typedef long long long_long_type; - __extension__ typedef unsigned long long ulong_long_type; -# else - typedef long long long_long_type; - typedef unsigned long long ulong_long_type; -# endif -} -#endif - -// GECODE_BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------// -// -// Some compilers have problems with function templates whose template -// parameters don't appear in the function parameter list (basically -// they just link one instantiation of the template in the final -// executable). These macros provide a uniform way to cope with the -// problem with no effects on the calling syntax. - -// Example: -// -// #include -// #include -// #include -// -// template -// void f() { std::cout << n << ' '; } -// -// template -// void g() { std::cout << typeid(T).name() << ' '; } -// -// int main() { -// f<1>(); -// f<2>(); -// -// g(); -// g(); -// } -// -// With VC++ 6.0 the output is: -// -// 2 2 double double -// -// To fix it, write -// -// template -// void f(GECODE_BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... } -// -// template -// void g(GECODE_BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... } -// - - -#if defined(GECODE_BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && defined(__cplusplus) - -# include "gecode/third-party/boost/type.hpp" -# include "gecode/third-party/boost/non_type.hpp" - -# define GECODE_BOOST_EXPLICIT_TEMPLATE_TYPE(t) gecode_boost::type* = 0 -# define GECODE_BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) gecode_boost::type* -# define GECODE_BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) gecode_boost::non_type* = 0 -# define GECODE_BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) gecode_boost::non_type* - -# define GECODE_BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \ - , GECODE_BOOST_EXPLICIT_TEMPLATE_TYPE(t) -# define GECODE_BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \ - , GECODE_BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) -# define GECODE_BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \ - , GECODE_BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) -# define GECODE_BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \ - , GECODE_BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) - -#else - -// no workaround needed: expand to nothing - -# define GECODE_BOOST_EXPLICIT_TEMPLATE_TYPE(t) -# define GECODE_BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) -# define GECODE_BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) -# define GECODE_BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) - -# define GECODE_BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) -# define GECODE_BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) -# define GECODE_BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) -# define GECODE_BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) - - -#endif // defined GECODE_BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS - -// When GECODE_BOOST_NO_STD_TYPEINFO is defined, we can just import -// the global definition into std namespace: -#if defined(GECODE_BOOST_NO_STD_TYPEINFO) && defined(__cplusplus) -#include -namespace std{ using ::type_info; } -#endif - -// ---------------------------------------------------------------------------// - -// -// Helper macro GECODE_BOOST_STRINGIZE: -// Converts the parameter X to a string after macro replacement -// on X has been performed. -// -#define GECODE_BOOST_STRINGIZE(X) GECODE_BOOST_DO_STRINGIZE(X) -#define GECODE_BOOST_DO_STRINGIZE(X) #X - -// -// Helper macro GECODE_BOOST_JOIN: -// The following piece of macro magic joins the two -// arguments together, even when one of the arguments is -// itself a macro (see 16.3.1 in C++ standard). The key -// is that macro expansion of macro arguments does not -// occur in GECODE_BOOST_DO_JOIN2 but does in GECODE_BOOST_DO_JOIN. -// -#define GECODE_BOOST_JOIN( X, Y ) GECODE_BOOST_DO_JOIN( X, Y ) -#define GECODE_BOOST_DO_JOIN( X, Y ) GECODE_BOOST_DO_JOIN2(X,Y) -#define GECODE_BOOST_DO_JOIN2( X, Y ) X##Y - -// -// Set some default values for compiler/library/platform names. -// These are for debugging config setup only: -// -# ifndef GECODE_BOOST_COMPILER -# define GECODE_BOOST_COMPILER "Unknown ISO C++ Compiler" -# endif -# ifndef GECODE_BOOST_STDLIB -# define GECODE_BOOST_STDLIB "Unknown ISO standard library" -# endif -# ifndef GECODE_BOOST_PLATFORM -# if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \ - || defined(_POSIX_SOURCE) -# define GECODE_BOOST_PLATFORM "Generic Unix" -# else -# define GECODE_BOOST_PLATFORM "Unknown" -# endif -# endif - -// -// Set some default values GPU support -// -# ifndef GECODE_BOOST_GPU_ENABLED -# define GECODE_BOOST_GPU_ENABLED -# endif - -// -// constexpr workarounds -// -#if defined(GECODE_BOOST_NO_CONSTEXPR) -#define GECODE_BOOST_CONSTEXPR -#define GECODE_BOOST_CONSTEXPR_OR_CONST const -#else -#define GECODE_BOOST_CONSTEXPR constexpr -#define GECODE_BOOST_CONSTEXPR_OR_CONST constexpr -#endif - -#define GECODE_BOOST_STATIC_CONSTEXPR static GECODE_BOOST_CONSTEXPR_OR_CONST - -#endif - diff --git a/gecode/third-party/boost/config/user.hpp b/gecode/third-party/boost/config/user.hpp deleted file mode 100644 index d771c38ea3..0000000000 --- a/gecode/third-party/boost/config/user.hpp +++ /dev/null @@ -1,124 +0,0 @@ -// boost/config/user.hpp ---------------------------------------------------// - -// (C) Copyright John Maddock 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// Do not check in modified versions of this file, -// This file may be customized by the end user, but not by boost. - -// -// Use this file to define a site and compiler specific -// configuration policy: -// - -// define this to locate a compiler config file: -// #define GECODE_BOOST_COMPILER_CONFIG - -// define this to locate a stdlib config file: -// #define GECODE_BOOST_STDLIB_CONFIG - -// define this to locate a platform config file: -// #define GECODE_BOOST_PLATFORM_CONFIG - -// define this to disable compiler config, -// use if your compiler config has nothing to set: -// #define GECODE_BOOST_NO_COMPILER_CONFIG - -// define this to disable stdlib config, -// use if your stdlib config has nothing to set: -// #define GECODE_BOOST_NO_STDLIB_CONFIG - -// define this to disable platform config, -// use if your platform config has nothing to set: -// #define GECODE_BOOST_NO_PLATFORM_CONFIG - -// define this to disable all config options, -// excluding the user config. Use if your -// setup is fully ISO compliant, and has no -// useful extensions, or for autoconf generated -// setups: -// #define GECODE_BOOST_NO_CONFIG - -// define this to make the config "optimistic" -// about unknown compiler versions. Normally -// unknown compiler versions are assumed to have -// all the defects of the last known version, however -// setting this flag, causes the config to assume -// that unknown compiler versions are fully conformant -// with the standard: -// #define GECODE_BOOST_STRICT_CONFIG - -// define this to cause the config to halt compilation -// with an #error if it encounters anything unknown -- -// either an unknown compiler version or an unknown -// compiler/platform/library: -// #define GECODE_BOOST_ASSERT_CONFIG - - -// define if you want to disable threading support, even -// when available: -// #define GECODE_BOOST_DISABLE_THREADS - -// define when you want to disable Win32 specific features -// even when available: -// #define GECODE_BOOST_DISABLE_WIN32 - -// GECODE_BOOST_DISABLE_ABI_HEADERS: Stops boost headers from including any -// prefix/suffix headers that normally control things like struct -// packing and alignment. -// #define GECODE_BOOST_DISABLE_ABI_HEADERS - -// GECODE_BOOST_ABI_PREFIX: A prefix header to include in place of whatever -// boost.config would normally select, any replacement should set up -// struct packing and alignment options as required. -// #define GECODE_BOOST_ABI_PREFIX my-header-name - -// GECODE_BOOST_ABI_SUFFIX: A suffix header to include in place of whatever -// boost.config would normally select, any replacement should undo -// the effects of the prefix header. -// #define GECODE_BOOST_ABI_SUFFIX my-header-name - -// GECODE_BOOST_ALL_DYN_LINK: Forces all libraries that have separate source, -// to be linked as dll's rather than static libraries on Microsoft Windows -// (this macro is used to turn on __declspec(dllimport) modifiers, so that -// the compiler knows which symbols to look for in a dll rather than in a -// static library). Note that there may be some libraries that can only -// be statically linked (Boost.Test for example) and others which may only -// be dynamically linked (Boost.Threads for example), in these cases this -// macro has no effect. -// #define GECODE_BOOST_ALL_DYN_LINK - -// GECODE_BOOST_WHATEVER_DYN_LINK: Forces library "whatever" to be linked as a dll -// rather than a static library on Microsoft Windows: replace the WHATEVER -// part of the macro name with the name of the library that you want to -// dynamically link to, for example use GECODE_BOOST_DATE_TIME_DYN_LINK or -// GECODE_BOOST_REGEX_DYN_LINK etc (this macro is used to turn on __declspec(dllimport) -// modifiers, so that the compiler knows which symbols to look for in a dll -// rather than in a static library). -// Note that there may be some libraries that can only be statically linked -// (Boost.Test for example) and others which may only be dynamically linked -// (Boost.Threads for example), in these cases this macro is unsupported. -// #define GECODE_BOOST_WHATEVER_DYN_LINK - -// GECODE_BOOST_ALL_NO_LIB: Tells the config system not to automatically select -// which libraries to link against. -// Normally if a compiler supports #pragma lib, then the correct library -// build variant will be automatically selected and linked against, -// simply by the act of including one of that library's headers. -// This macro turns that feature off. -// #define GECODE_BOOST_ALL_NO_LIB - -// GECODE_BOOST_WHATEVER_NO_LIB: Tells the config system not to automatically -// select which library to link against for library "whatever", -// replace WHATEVER in the macro name with the name of the library; -// for example GECODE_BOOST_DATE_TIME_NO_LIB or GECODE_BOOST_REGEX_NO_LIB. -// Normally if a compiler supports #pragma lib, then the correct library -// build variant will be automatically selected and linked against, simply -// by the act of including one of that library's headers. This macro turns -// that feature off. -// #define GECODE_BOOST_WHATEVER_NO_LIB - - - diff --git a/gecode/third-party/boost/detail/endian.hpp b/gecode/third-party/boost/detail/endian.hpp deleted file mode 100644 index a7779aa8a0..0000000000 --- a/gecode/third-party/boost/detail/endian.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2005 Caleb Epstein -// Copyright 2006 John Maddock -// Copyright 2010 Rene Rivera -// Distributed under the Boost Software License, Version 1.0. (See accompany- -// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/* - * Copyright notice reproduced from , from - * which this code was originally taken. - * - * Modified by Caleb Epstein to use with GNU libc and to - * defined the GECODE_BOOST_ENDIAN macro. - */ - -#ifndef GECODE_BOOST_DETAIL_ENDIAN_HPP -#define GECODE_BOOST_DETAIL_ENDIAN_HPP - -// GNU libc offers the helpful header which defines -// __BYTE_ORDER - -#if defined (__GLIBC__) -# include -# if (__BYTE_ORDER == __LITTLE_ENDIAN) -# define GECODE_BOOST_LITTLE_ENDIAN -# elif (__BYTE_ORDER == __BIG_ENDIAN) -# define GECODE_BOOST_BIG_ENDIAN -# elif (__BYTE_ORDER == __PDP_ENDIAN) -# define GECODE_BOOST_PDP_ENDIAN -# else -# error Unknown machine endianness detected. -# endif -# define GECODE_BOOST_BYTE_ORDER __BYTE_ORDER -#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ - defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \ - defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN) -# define GECODE_BOOST_BIG_ENDIAN -# define GECODE_BOOST_BYTE_ORDER 4321 -#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \ - defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \ - defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN) -# define GECODE_BOOST_LITTLE_ENDIAN -# define GECODE_BOOST_BYTE_ORDER 1234 -#elif defined(__sparc) || defined(__sparc__) \ - || defined(_POWER) || defined(__powerpc__) \ - || defined(__ppc__) || defined(__hpux) || defined(__hppa) \ - || defined(_MIPSEB) || defined(_POWER) \ - || defined(__s390__) -# define GECODE_BOOST_BIG_ENDIAN -# define GECODE_BOOST_BYTE_ORDER 4321 -#elif defined(__i386__) || defined(__alpha__) \ - || defined(__ia64) || defined(__ia64__) \ - || defined(_M_IX86) || defined(_M_IA64) \ - || defined(_M_ALPHA) || defined(__amd64) \ - || defined(__amd64__) || defined(_M_AMD64) \ - || defined(__x86_64) || defined(__x86_64__) \ - || defined(_M_X64) || defined(__bfin__) - -# define GECODE_BOOST_LITTLE_ENDIAN -# define GECODE_BOOST_BYTE_ORDER 1234 -#else -# error The file boost/detail/endian.hpp needs to be set up for your CPU type. -#endif - - -#endif diff --git a/gecode/third-party/boost/detail/limits.hpp b/gecode/third-party/boost/detail/limits.hpp deleted file mode 100644 index 55b8d96cde..0000000000 --- a/gecode/third-party/boost/detail/limits.hpp +++ /dev/null @@ -1,449 +0,0 @@ -// Copyright 2001 John Maddock -// Distributed under the Boost Software License, Version 1.0. (See accompany- -// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/* NOTE: This is not portable code. Parts of numeric_limits<> are - * inherently machine-dependent, and this file is written for the MIPS - * architecture and the SGI MIPSpro C++ compiler. Parts of it (in - * particular, some of the characteristics of floating-point types) - * are almost certainly incorrect for any other platform. - */ - -/* The above comment is almost certainly out of date. This file works - * on systems other than SGI MIPSpro C++ now. - */ - -/* - * Revision history: - * 21 Sep 2001: - * Only include if GECODE_BOOST_NO_CWCHAR is defined. (Darin Adler) - * 10 Aug 2001: - * Added MIPS (big endian) to the big endian family. (Jens Maurer) - * 13 Apr 2001: - * Added powerpc to the big endian family. (Jeremy Siek) - * 5 Apr 2001: - * Added sparc (big endian) processor support (John Maddock). - * Initial sub: - * Modified by Jens Maurer for gcc 2.95 on x86. - */ - -#ifndef GECODE_BOOST_SGI_CPP_LIMITS -#define GECODE_BOOST_SGI_CPP_LIMITS - -#include -#include -#include -#include - -#ifndef GECODE_BOOST_NO_CWCHAR -#include // for WCHAR_MIN and WCHAR_MAX -#endif - -namespace std { - -enum float_round_style { - round_indeterminate = -1, - round_toward_zero = 0, - round_to_nearest = 1, - round_toward_infinity = 2, - round_toward_neg_infinity = 3 -}; - -enum float_denorm_style { - denorm_indeterminate = -1, - denorm_absent = 0, - denorm_present = 1 -}; - -// The C++ standard (section 18.2.1) requires that some of the members of -// numeric_limits be static const data members that are given constant- -// initializers within the class declaration. On compilers where the -// GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION macro is defined, it is impossible to write -// a standard-conforming numeric_limits class. -// -// There are two possible workarounds: either initialize the data -// members outside the class, or change them from data members to -// enums. Neither workaround is satisfactory: the former makes it -// impossible to use the data members in constant-expressions, and the -// latter means they have the wrong type and that it is impossible to -// take their addresses. We choose the former workaround. - -#ifdef GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION -# define GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \ - enum { __mem_name = __mem_value } -#else /* GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION */ -# define GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \ - static const __mem_type __mem_name = __mem_value -#endif /* GECODE_BOOST_NO_INCLASS_MEMBER_INITIALIZATION */ - -// Base class for all specializations of numeric_limits. -template -class _Numeric_limits_base { -public: - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, false); - - static __number min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __number(); } - static __number max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __number(); } - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, 0); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, 0); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_integer, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_exact, false); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 0); - - static __number epsilon() throw() { return __number(); } - static __number round_error() throw() { return __number(); } - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, 0); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, 0); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, 0); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, 0); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style, - has_denorm, - denorm_absent); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false); - - static __number infinity() throw() { return __number(); } - static __number quiet_NaN() throw() { return __number(); } - static __number signaling_NaN() throw() { return __number(); } - static __number denorm_min() throw() { return __number(); } - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, false); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style, - round_style, - round_toward_zero); -}; - -// Base class for integers. - -template -class _Integer_limits : public _Numeric_limits_base<_Int> -{ -public: - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true); - - static _Int min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __imin; } - static _Int max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __imax; } - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, - digits, - (__idigits < 0) ? (int)(sizeof(_Int) * CHAR_BIT) - - (__imin == 0 ? 0 : 1) - : __idigits); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, (digits * 301) / 1000); - // log 2 = 0.301029995664... - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, __imin != 0); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_integer, true); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_exact, true); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, true); -}; - -#if defined(GECODE_BOOST_BIG_ENDIAN) - - template - struct float_helper{ - static Number get_word() throw() { - // sizeof(long double) == 16 - const unsigned int _S_word[4] = { Word, 0, 0, 0 }; - return *reinterpret_cast(&_S_word); - } -}; - -#else - - template - struct float_helper{ - static Number get_word() throw() { - // sizeof(long double) == 12, but only 10 bytes significant - const unsigned int _S_word[4] = { 0, 0, 0, Word }; - return *reinterpret_cast( - reinterpret_cast(&_S_word)+16- - (sizeof(Number) == 12 ? 10 : sizeof(Number))); - } -}; - -#endif - -// Base class for floating-point numbers. -template -class _Floating_limits : public _Numeric_limits_base<__number> -{ -public: - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, __Digits); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, __Digits10); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, true); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, __MinExp); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, __MaxExp); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, __MinExp10); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, __MaxExp10); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, true); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, true); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, true); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style, - has_denorm, - denorm_indeterminate); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false); - - - static __number infinity() throw() { - return float_helper<__number, __InfinityWord>::get_word(); - } - static __number quiet_NaN() throw() { - return float_helper<__number,__QNaNWord>::get_word(); - } - static __number signaling_NaN() throw() { - return float_helper<__number,__SNaNWord>::get_word(); - } - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, __IsIEC559); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false /* was: true */ ); - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); - - GECODE_BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, __RoundStyle); -}; - -// Class numeric_limits - -// The unspecialized class. - -template -class numeric_limits : public _Numeric_limits_base {}; - -// Specializations for all built-in integral types. - -template<> -class numeric_limits - : public _Integer_limits -{}; - -template<> -class numeric_limits - : public _Integer_limits -{}; - -template<> -class numeric_limits - : public _Integer_limits -{}; - -template<> -class numeric_limits - : public _Integer_limits -{}; - -#ifndef GECODE_BOOST_NO_INTRINSIC_WCHAR_T -template<> -class numeric_limits -#if !defined(WCHAR_MAX) || !defined(WCHAR_MIN) -#if defined(_WIN32) || defined(__CYGWIN__) - : public _Integer_limits -#elif defined(__hppa) -// wchar_t has "unsigned int" as the underlying type - : public _Integer_limits -#else -// assume that wchar_t has "int" as the underlying type - : public _Integer_limits -#endif -#else -// we have WCHAR_MIN and WCHAR_MAX defined, so use it - : public _Integer_limits -#endif -{}; -#endif - -template<> -class numeric_limits - : public _Integer_limits -{}; - -template<> -class numeric_limits - : public _Integer_limits -{}; - -template<> -class numeric_limits - : public _Integer_limits -{}; - -template<> -class numeric_limits - : public _Integer_limits -{}; - -template<> -class numeric_limits - : public _Integer_limits -{}; - -template<> -class numeric_limits - : public _Integer_limits -{}; - -#ifdef __GNUC__ - -// Some compilers have long long, but don't define the -// LONGLONG_MIN and LONGLONG_MAX macros in limits.h. This -// assumes that long long is 64 bits. -#if !defined(LONGLONG_MAX) && !defined(ULONGLONG_MAX) - -# define ULONGLONG_MAX 0xffffffffffffffffLLU -# define LONGLONG_MAX 0x7fffffffffffffffLL - -#endif - -#if !defined(LONGLONG_MIN) -# define LONGLONG_MIN (-LONGLONG_MAX - 1) -#endif - - -#if !defined(ULONGLONG_MIN) -# define ULONGLONG_MIN 0 -#endif - -#endif /* __GNUC__ */ - -// Specializations for all built-in floating-point type. - -template<> class numeric_limits - : public _Floating_limits -{ -public: - static float min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MIN; } - static float denorm_min() throw() { return FLT_MIN; } - static float max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MAX; } - static float epsilon() throw() { return FLT_EPSILON; } - static float round_error() throw() { return 0.5f; } // Units: ulps. -}; - -template<> class numeric_limits - : public _Floating_limits -{ -public: - static double min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MIN; } - static double denorm_min() throw() { return DBL_MIN; } - static double max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MAX; } - static double epsilon() throw() { return DBL_EPSILON; } - static double round_error() throw() { return 0.5; } // Units: ulps. -}; - -template<> class numeric_limits - : public _Floating_limits -{ -public: - static long double min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MIN; } - static long double denorm_min() throw() { return LDBL_MIN; } - static long double max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MAX; } - static long double epsilon() throw() { return LDBL_EPSILON; } - static long double round_error() throw() { return 4; } // Units: ulps. -}; - -} // namespace std - -#endif /* GECODE_BOOST_SGI_CPP_LIMITS */ - -// Local Variables: -// mode:C++ -// End: - - - diff --git a/gecode/third-party/boost/extract.py b/gecode/third-party/boost/extract.py deleted file mode 100755 index 1d8494be68..0000000000 --- a/gecode/third-party/boost/extract.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env -S uv run --script -# /// script -# requires-python = ">=3.11" -# /// - -"""Emit shell commands to copy the Boost header closure for vendoring.""" - -import re -import sys - - -def main() -> int: - library = sys.argv[1] if len(sys.argv) > 1 else "" - dst = sys.argv[2] if len(sys.argv) > 2 else "" - - todo = [library] - done: dict[str, int] = {library: 1} - unresolved: dict[str, int] = {} - defs: dict[str, str] = {} - other: dict[str, int] = {} - - while todo: - f = todo.pop() - try: - fh = open(f, "r", encoding="utf-8") - except OSError: - raise SystemExit(f"File missing: {f}") - with fh: - for line in fh: - m = re.match(r"^\#( )*include <(boost/.*)>", line) - if m: - g = re.sub(r"^\./", "", m.group(2)) - if g not in done: - todo.append(g) - done[g] = 1 - continue - m = re.match(r'^\#( )*include "(boost/.*)"', line) - if m: - g = re.sub(r"^\./", "", m.group(2)) - if g not in done: - todo.append(g) - done[g] = 1 - continue - m = re.match(r"^\#( )*include <(.*)>", line) - if m: - other[m.group(2)] = 1 - continue - m = re.match(r"^\#( )*include (.*)", line) - if m: - k = m.group(2).rstrip("\n") - unresolved[k] = 1 - continue - m = re.match(r"^\#( )*define (GECODE_BOOST_[A-Z_]*) (.*)", line) - if m: - k = m.group(2) - v = m.group(3).rstrip("\n") - qm = re.search(r'\"(.*)\"', v) - if qm: - v = qm.group(1) - am = re.search(r"<(.*)>", v) - if am: - v = am.group(1) - if k in defs: - defs[k] = defs[k] + "," + v - else: - defs[k] = v - - for u in list(unresolved.keys()): - if u in defs: - for d in defs[u].split(","): - if d not in done: - todo.append(d) - done[d] = 1 - - dirs: dict[str, int] = {} - for g in sorted(done.keys()): - m = re.match(r"(.*)/.*", g) - if m: - dirs[m.group(1)] = 1 - - for d in sorted(dirs.keys()): - sys.stdout.write(f"mkdir -p \"{dst}{d}\"\n") - for g in sorted(done.keys()): - m = re.match(r"(.*)/.*", g) - if m: - d = m.group(1) - sys.stdout.write(f"cp \"{g}\" \"{dst}{d}\"\n") - - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/gecode/third-party/boost/limits.hpp b/gecode/third-party/boost/limits.hpp deleted file mode 100644 index 90a59ef0f9..0000000000 --- a/gecode/third-party/boost/limits.hpp +++ /dev/null @@ -1,146 +0,0 @@ - -// (C) Copyright John maddock 1999. -// (C) David Abrahams 2002. Distributed under the Boost -// Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// use this header as a workaround for missing - -// See http://www.boost.org/libs/compatibility/index.html for documentation. - -#ifndef GECODE_BOOST_LIMITS -#define GECODE_BOOST_LIMITS - -#include - -#ifdef GECODE_BOOST_NO_LIMITS -# include -#else -# include -#endif - -#if (defined(GECODE_BOOST_HAS_LONG_LONG) && defined(GECODE_BOOST_NO_LONG_LONG_NUMERIC_LIMITS)) \ - || (defined(GECODE_BOOST_HAS_MS_INT64) && defined(GECODE_BOOST_NO_MS_INT64_NUMERIC_LIMITS)) -// Add missing specializations for numeric_limits: -#ifdef GECODE_BOOST_HAS_MS_INT64 -# define GECODE_BOOST_LLT __int64 -# define GECODE_BOOST_ULLT unsigned __int64 -#else -# define GECODE_BOOST_LLT ::gecode_boost::long_long_type -# define GECODE_BOOST_ULLT ::gecode_boost::ulong_long_type -#endif - -#include // for CHAR_BIT - -namespace std -{ - template<> - class numeric_limits - { - public: - - GECODE_BOOST_STATIC_CONSTANT(bool, is_specialized = true); -#ifdef GECODE_BOOST_HAS_MS_INT64 - static GECODE_BOOST_LLT min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x8000000000000000i64; } - static GECODE_BOOST_LLT max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x7FFFFFFFFFFFFFFFi64; } -#elif defined(LLONG_MAX) - static GECODE_BOOST_LLT min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MIN; } - static GECODE_BOOST_LLT max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MAX; } -#elif defined(LONGLONG_MAX) - static GECODE_BOOST_LLT min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MIN; } - static GECODE_BOOST_LLT max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MAX; } -#else - static GECODE_BOOST_LLT min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 1LL << (sizeof(GECODE_BOOST_LLT) * CHAR_BIT - 1); } - static GECODE_BOOST_LLT max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~(min)(); } -#endif - GECODE_BOOST_STATIC_CONSTANT(int, digits = sizeof(GECODE_BOOST_LLT) * CHAR_BIT -1); - GECODE_BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (GECODE_BOOST_LLT) - 1) * 301L / 1000); - GECODE_BOOST_STATIC_CONSTANT(bool, is_signed = true); - GECODE_BOOST_STATIC_CONSTANT(bool, is_integer = true); - GECODE_BOOST_STATIC_CONSTANT(bool, is_exact = true); - GECODE_BOOST_STATIC_CONSTANT(int, radix = 2); - static GECODE_BOOST_LLT epsilon() throw() { return 0; }; - static GECODE_BOOST_LLT round_error() throw() { return 0; }; - - GECODE_BOOST_STATIC_CONSTANT(int, min_exponent = 0); - GECODE_BOOST_STATIC_CONSTANT(int, min_exponent10 = 0); - GECODE_BOOST_STATIC_CONSTANT(int, max_exponent = 0); - GECODE_BOOST_STATIC_CONSTANT(int, max_exponent10 = 0); - - GECODE_BOOST_STATIC_CONSTANT(bool, has_infinity = false); - GECODE_BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false); - GECODE_BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false); - GECODE_BOOST_STATIC_CONSTANT(bool, has_denorm = false); - GECODE_BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false); - static GECODE_BOOST_LLT infinity() throw() { return 0; }; - static GECODE_BOOST_LLT quiet_NaN() throw() { return 0; }; - static GECODE_BOOST_LLT signaling_NaN() throw() { return 0; }; - static GECODE_BOOST_LLT denorm_min() throw() { return 0; }; - - GECODE_BOOST_STATIC_CONSTANT(bool, is_iec559 = false); - GECODE_BOOST_STATIC_CONSTANT(bool, is_bounded = true); - GECODE_BOOST_STATIC_CONSTANT(bool, is_modulo = true); - - GECODE_BOOST_STATIC_CONSTANT(bool, traps = false); - GECODE_BOOST_STATIC_CONSTANT(bool, tinyness_before = false); - GECODE_BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero); - - }; - - template<> - class numeric_limits - { - public: - - GECODE_BOOST_STATIC_CONSTANT(bool, is_specialized = true); -#ifdef GECODE_BOOST_HAS_MS_INT64 - static GECODE_BOOST_ULLT min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0ui64; } - static GECODE_BOOST_ULLT max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0xFFFFFFFFFFFFFFFFui64; } -#elif defined(ULLONG_MAX) && defined(ULLONG_MIN) - static GECODE_BOOST_ULLT min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MIN; } - static GECODE_BOOST_ULLT max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MAX; } -#elif defined(ULONGLONG_MAX) && defined(ULONGLONG_MIN) - static GECODE_BOOST_ULLT min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MIN; } - static GECODE_BOOST_ULLT max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MAX; } -#else - static GECODE_BOOST_ULLT min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0uLL; } - static GECODE_BOOST_ULLT max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~0uLL; } -#endif - GECODE_BOOST_STATIC_CONSTANT(int, digits = sizeof(GECODE_BOOST_LLT) * CHAR_BIT); - GECODE_BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (GECODE_BOOST_LLT)) * 301L / 1000); - GECODE_BOOST_STATIC_CONSTANT(bool, is_signed = false); - GECODE_BOOST_STATIC_CONSTANT(bool, is_integer = true); - GECODE_BOOST_STATIC_CONSTANT(bool, is_exact = true); - GECODE_BOOST_STATIC_CONSTANT(int, radix = 2); - static GECODE_BOOST_ULLT epsilon() throw() { return 0; }; - static GECODE_BOOST_ULLT round_error() throw() { return 0; }; - - GECODE_BOOST_STATIC_CONSTANT(int, min_exponent = 0); - GECODE_BOOST_STATIC_CONSTANT(int, min_exponent10 = 0); - GECODE_BOOST_STATIC_CONSTANT(int, max_exponent = 0); - GECODE_BOOST_STATIC_CONSTANT(int, max_exponent10 = 0); - - GECODE_BOOST_STATIC_CONSTANT(bool, has_infinity = false); - GECODE_BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false); - GECODE_BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false); - GECODE_BOOST_STATIC_CONSTANT(bool, has_denorm = false); - GECODE_BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false); - static GECODE_BOOST_ULLT infinity() throw() { return 0; }; - static GECODE_BOOST_ULLT quiet_NaN() throw() { return 0; }; - static GECODE_BOOST_ULLT signaling_NaN() throw() { return 0; }; - static GECODE_BOOST_ULLT denorm_min() throw() { return 0; }; - - GECODE_BOOST_STATIC_CONSTANT(bool, is_iec559 = false); - GECODE_BOOST_STATIC_CONSTANT(bool, is_bounded = true); - GECODE_BOOST_STATIC_CONSTANT(bool, is_modulo = true); - - GECODE_BOOST_STATIC_CONSTANT(bool, traps = false); - GECODE_BOOST_STATIC_CONSTANT(bool, tinyness_before = false); - GECODE_BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero); - - }; -} -#endif - -#endif - diff --git a/gecode/third-party/boost/non_type.hpp b/gecode/third-party/boost/non_type.hpp deleted file mode 100644 index b83a54bf94..0000000000 --- a/gecode/third-party/boost/non_type.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// ------------------------------------- -// -// (C) Copyright Gennaro Prota 2003. -// -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// ------------------------------------------------------ - -#ifndef GECODE_BOOST_NON_TYPE_HPP_GP_20030417 -#define GECODE_BOOST_NON_TYPE_HPP_GP_20030417 - - -namespace gecode_boost { - - // Just a simple "envelope" for non-type template parameters. Useful - // to work around some MSVC deficiencies. - - template - struct non_type { }; - - -} - - -#endif // include guard diff --git a/gecode/third-party/boost/numeric/interval.hpp b/gecode/third-party/boost/numeric/interval.hpp deleted file mode 100644 index 82b940f1e7..0000000000 --- a/gecode/third-party/boost/numeric/interval.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/* Boost interval.hpp header file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_HPP - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_HPP diff --git a/gecode/third-party/boost/numeric/interval/arith.hpp b/gecode/third-party/boost/numeric/interval/arith.hpp deleted file mode 100644 index be50dedc2f..0000000000 --- a/gecode/third-party/boost/numeric/interval/arith.hpp +++ /dev/null @@ -1,305 +0,0 @@ -/* Boost interval/arith.hpp template implementation file - * - * Copyright 2000 Jens Maurer - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_ARITH_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_ARITH_HPP - -#include -#include -#include -#include -#include -#include - -namespace gecode_boost { -namespace numeric { - -/* - * Basic arithmetic operators - */ - -template inline -const interval& operator+(const interval& x) -{ - return x; -} - -template inline -interval operator-(const interval& x) -{ - if (interval_lib::detail::test_input(x)) - return interval::empty(); - return interval(-x.upper(), -x.lower(), true); -} - -template inline -interval& interval::operator+=(const interval& r) -{ - if (interval_lib::detail::test_input(*this, r)) - set_empty(); - else { - typename Policies::rounding rnd; - set(rnd.add_down(low, r.low), rnd.add_up(up, r.up)); - } - return *this; -} - -template inline -interval& interval::operator+=(const T& r) -{ - if (interval_lib::detail::test_input(*this, r)) - set_empty(); - else { - typename Policies::rounding rnd; - set(rnd.add_down(low, r), rnd.add_up(up, r)); - } - return *this; -} - -template inline -interval& interval::operator-=(const interval& r) -{ - if (interval_lib::detail::test_input(*this, r)) - set_empty(); - else { - typename Policies::rounding rnd; - set(rnd.sub_down(low, r.up), rnd.sub_up(up, r.low)); - } - return *this; -} - -template inline -interval& interval::operator-=(const T& r) -{ - if (interval_lib::detail::test_input(*this, r)) - set_empty(); - else { - typename Policies::rounding rnd; - set(rnd.sub_down(low, r), rnd.sub_up(up, r)); - } - return *this; -} - -template inline -interval& interval::operator*=(const interval& r) -{ - return *this = *this * r; -} - -template inline -interval& interval::operator*=(const T& r) -{ - return *this = r * *this; -} - -template inline -interval& interval::operator/=(const interval& r) -{ - return *this = *this / r; -} - -template inline -interval& interval::operator/=(const T& r) -{ - return *this = *this / r; -} - -template inline -interval operator+(const interval& x, - const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - typename Policies::rounding rnd; - return interval(rnd.add_down(x.lower(), y.lower()), - rnd.add_up (x.upper(), y.upper()), true); -} - -template inline -interval operator+(const T& x, const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - typename Policies::rounding rnd; - return interval(rnd.add_down(x, y.lower()), - rnd.add_up (x, y.upper()), true); -} - -template inline -interval operator+(const interval& x, const T& y) -{ return y + x; } - -template inline -interval operator-(const interval& x, - const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - typename Policies::rounding rnd; - return interval(rnd.sub_down(x.lower(), y.upper()), - rnd.sub_up (x.upper(), y.lower()), true); -} - -template inline -interval operator-(const T& x, const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - typename Policies::rounding rnd; - return interval(rnd.sub_down(x, y.upper()), - rnd.sub_up (x, y.lower()), true); -} - -template inline -interval operator-(const interval& x, const T& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - typename Policies::rounding rnd; - return interval(rnd.sub_down(x.lower(), y), - rnd.sub_up (x.upper(), y), true); -} - -template inline -interval operator*(const interval& x, - const interval& y) -{ - GECODE_BOOST_USING_STD_MIN(); - GECODE_BOOST_USING_STD_MAX(); - typedef interval I; - if (interval_lib::detail::test_input(x, y)) - return I::empty(); - typename Policies::rounding rnd; - const T& xl = x.lower(); - const T& xu = x.upper(); - const T& yl = y.lower(); - const T& yu = y.upper(); - - if (interval_lib::user::is_neg(xl)) - if (interval_lib::user::is_pos(xu)) - if (interval_lib::user::is_neg(yl)) - if (interval_lib::user::is_pos(yu)) // M * M - return I(min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(rnd.mul_down(xl, yu), rnd.mul_down(xu, yl)), - max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(rnd.mul_up (xl, yl), rnd.mul_up (xu, yu)), true); - else // M * N - return I(rnd.mul_down(xu, yl), rnd.mul_up(xl, yl), true); - else - if (interval_lib::user::is_pos(yu)) // M * P - return I(rnd.mul_down(xl, yu), rnd.mul_up(xu, yu), true); - else // M * Z - return I(static_cast(0), static_cast(0), true); - else - if (interval_lib::user::is_neg(yl)) - if (interval_lib::user::is_pos(yu)) // N * M - return I(rnd.mul_down(xl, yu), rnd.mul_up(xl, yl), true); - else // N * N - return I(rnd.mul_down(xu, yu), rnd.mul_up(xl, yl), true); - else - if (interval_lib::user::is_pos(yu)) // N * P - return I(rnd.mul_down(xl, yu), rnd.mul_up(xu, yl), true); - else // N * Z - return I(static_cast(0), static_cast(0), true); - else - if (interval_lib::user::is_pos(xu)) - if (interval_lib::user::is_neg(yl)) - if (interval_lib::user::is_pos(yu)) // P * M - return I(rnd.mul_down(xu, yl), rnd.mul_up(xu, yu), true); - else // P * N - return I(rnd.mul_down(xu, yl), rnd.mul_up(xl, yu), true); - else - if (interval_lib::user::is_pos(yu)) // P * P - return I(rnd.mul_down(xl, yl), rnd.mul_up(xu, yu), true); - else // P * Z - return I(static_cast(0), static_cast(0), true); - else // Z * ? - return I(static_cast(0), static_cast(0), true); -} - -template inline -interval operator*(const T& x, const interval& y) -{ - typedef interval I; - if (interval_lib::detail::test_input(x, y)) - return I::empty(); - typename Policies::rounding rnd; - const T& yl = y.lower(); - const T& yu = y.upper(); - // x is supposed not to be infinite - if (interval_lib::user::is_neg(x)) - return I(rnd.mul_down(x, yu), rnd.mul_up(x, yl), true); - else if (interval_lib::user::is_zero(x)) - return I(static_cast(0), static_cast(0), true); - else - return I(rnd.mul_down(x, yl), rnd.mul_up(x, yu), true); -} - -template inline -interval operator*(const interval& x, const T& y) -{ return y * x; } - -template inline -interval operator/(const interval& x, - const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - if (zero_in(y)) - if (!interval_lib::user::is_zero(y.lower())) - if (!interval_lib::user::is_zero(y.upper())) - return interval_lib::detail::div_zero(x); - else - return interval_lib::detail::div_negative(x, y.lower()); - else - if (!interval_lib::user::is_zero(y.upper())) - return interval_lib::detail::div_positive(x, y.upper()); - else - return interval::empty(); - else - return interval_lib::detail::div_non_zero(x, y); -} - -template inline -interval operator/(const T& x, const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - if (zero_in(y)) - if (!interval_lib::user::is_zero(y.lower())) - if (!interval_lib::user::is_zero(y.upper())) - return interval_lib::detail::div_zero(x); - else - return interval_lib::detail::div_negative(x, y.lower()); - else - if (!interval_lib::user::is_zero(y.upper())) - return interval_lib::detail::div_positive(x, y.upper()); - else - return interval::empty(); - else - return interval_lib::detail::div_non_zero(x, y); -} - -template inline -interval operator/(const interval& x, const T& y) -{ - if (interval_lib::detail::test_input(x, y) || interval_lib::user::is_zero(y)) - return interval::empty(); - typename Policies::rounding rnd; - const T& xl = x.lower(); - const T& xu = x.upper(); - if (interval_lib::user::is_neg(y)) - return interval(rnd.div_down(xu, y), rnd.div_up(xl, y), true); - else - return interval(rnd.div_down(xl, y), rnd.div_up(xu, y), true); -} - -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_ARITH_HPP diff --git a/gecode/third-party/boost/numeric/interval/arith2.hpp b/gecode/third-party/boost/numeric/interval/arith2.hpp deleted file mode 100644 index 80dcb5c7e8..0000000000 --- a/gecode/third-party/boost/numeric/interval/arith2.hpp +++ /dev/null @@ -1,305 +0,0 @@ -/* Boost interval/arith2.hpp template implementation file - * - * This header provides some auxiliary arithmetic - * functions: fmod, sqrt, square, pov, inverse and - * a multi-interval division. - * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_ARITH2_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_ARITH2_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace gecode_boost { -namespace numeric { - -template inline -interval fmod(const interval& x, - const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - typename Policies::rounding rnd; - typedef typename interval_lib::unprotect >::type I; - T const &yb = interval_lib::user::is_neg(x.lower()) ? y.lower() : y.upper(); - T n = rnd.int_down(rnd.div_down(x.lower(), yb)); - return (const I&)x - n * (const I&)y; -} - -template inline -interval fmod(const interval& x, const T& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - typename Policies::rounding rnd; - typedef typename interval_lib::unprotect >::type I; - T n = rnd.int_down(rnd.div_down(x.lower(), y)); - return (const I&)x - n * I(y); -} - -template inline -interval fmod(const T& x, const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - typename Policies::rounding rnd; - typedef typename interval_lib::unprotect >::type I; - T const &yb = interval_lib::user::is_neg(x) ? y.lower() : y.upper(); - T n = rnd.int_down(rnd.div_down(x, yb)); - return x - n * (const I&)y; -} - -namespace interval_lib { - -template inline -interval division_part1(const interval& x, - const interval& y, bool& b) -{ - typedef interval I; - b = false; - if (detail::test_input(x, y)) - return I::empty(); - if (zero_in(y)) - if (!user::is_zero(y.lower())) - if (!user::is_zero(y.upper())) - return detail::div_zero_part1(x, y, b); - else - return detail::div_negative(x, y.lower()); - else - if (!user::is_zero(y.upper())) - return detail::div_positive(x, y.upper()); - else - return I::empty(); - else - return detail::div_non_zero(x, y); -} - -template inline -interval division_part2(const interval& x, - const interval& y, bool b = true) -{ - if (!b) return interval::empty(); - return detail::div_zero_part2(x, y); -} - -template inline -interval multiplicative_inverse(const interval& x) -{ - typedef interval I; - if (detail::test_input(x)) - return I::empty(); - T one = static_cast(1); - typename Policies::rounding rnd; - if (zero_in(x)) { - typedef typename Policies::checking checking; - if (!user::is_zero(x.lower())) - if (!user::is_zero(x.upper())) - return I::whole(); - else - return I(checking::neg_inf(), rnd.div_up(one, x.lower()), true); - else - if (!user::is_zero(x.upper())) - return I(rnd.div_down(one, x.upper()), checking::pos_inf(), true); - else - return I::empty(); - } else - return I(rnd.div_down(one, x.upper()), rnd.div_up(one, x.lower()), true); -} - -namespace detail { - -template inline -T pow_dn(const T& x_, int pwr, Rounding& rnd) // x and pwr are positive -{ - T x = x_; - T y = (pwr & 1) ? x_ : static_cast(1); - pwr >>= 1; - while (pwr > 0) { - x = rnd.mul_down(x, x); - if (pwr & 1) y = rnd.mul_down(x, y); - pwr >>= 1; - } - return y; -} - -template inline -T pow_up(const T& x_, int pwr, Rounding& rnd) // x and pwr are positive -{ - T x = x_; - T y = (pwr & 1) ? x_ : static_cast(1); - pwr >>= 1; - while (pwr > 0) { - x = rnd.mul_up(x, x); - if (pwr & 1) y = rnd.mul_up(x, y); - pwr >>= 1; - } - return y; -} - -} // namespace detail -} // namespace interval_lib - -template inline -interval pow(const interval& x, int pwr) -{ - GECODE_BOOST_USING_STD_MAX(); - using interval_lib::detail::pow_dn; - using interval_lib::detail::pow_up; - typedef interval I; - - if (interval_lib::detail::test_input(x)) - return I::empty(); - - if (pwr == 0) - if (interval_lib::user::is_zero(x.lower()) - && interval_lib::user::is_zero(x.upper())) - return I::empty(); - else - return I(static_cast(1)); - else if (pwr < 0) - return interval_lib::multiplicative_inverse(pow(x, -pwr)); - - typename Policies::rounding rnd; - - if (interval_lib::user::is_neg(x.upper())) { // [-2,-1] - T yl = pow_dn(static_cast(-x.upper()), pwr, rnd); - T yu = pow_up(static_cast(-x.lower()), pwr, rnd); - if (pwr & 1) // [-2,-1]^1 - return I(-yu, -yl, true); - else // [-2,-1]^2 - return I(yl, yu, true); - } else if (interval_lib::user::is_neg(x.lower())) { // [-1,1] - if (pwr & 1) { // [-1,1]^1 - return I(-pow_up(static_cast(-x.lower()), pwr, rnd), pow_up(x.upper(), pwr, rnd), true); - } else { // [-1,1]^2 - return I(static_cast(0), pow_up(max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(static_cast(-x.lower()), x.upper()), pwr, rnd), true); - } - } else { // [1,2] - return I(pow_dn(x.lower(), pwr, rnd), pow_up(x.upper(), pwr, rnd), true); - } -} - -template inline -interval sqrt(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x) || interval_lib::user::is_neg(x.upper())) - return I::empty(); - typename Policies::rounding rnd; - T l = !interval_lib::user::is_pos(x.lower()) ? static_cast(0) : rnd.sqrt_down(x.lower()); - return I(l, rnd.sqrt_up(x.upper()), true); -} - -template inline -interval square(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - const T& xl = x.lower(); - const T& xu = x.upper(); - if (interval_lib::user::is_neg(xu)) - return I(rnd.mul_down(xu, xu), rnd.mul_up(xl, xl), true); - else if (interval_lib::user::is_pos(x.lower())) - return I(rnd.mul_down(xl, xl), rnd.mul_up(xu, xu), true); - else - return I(static_cast(0), (-xl > xu ? rnd.mul_up(xl, xl) : rnd.mul_up(xu, xu)), true); -} - -namespace interval_lib { -namespace detail { - -template< class I > inline -I root_aux(typename I::base_type const &x, int k) // x and k are bigger than one -{ - typedef typename I::base_type T; - T tk(k); - I y(static_cast(1), x, true); - for(;;) { - T y0 = median(y); - I yy = intersect(y, y0 - (pow(I(y0, y0, true), k) - x) / (tk * pow(y, k - 1))); - if (equal(y, yy)) return y; - y = yy; - } -} - -template< class I > inline // x is positive and k bigger than one -typename I::base_type root_aux_dn(typename I::base_type const &x, int k) -{ - typedef typename I::base_type T; - typedef typename I::traits_type Policies; - typename Policies::rounding rnd; - T one(1); - if (x > one) return root_aux(x, k).lower(); - if (x == one) return one; - return rnd.div_down(one, root_aux(rnd.div_up(one, x), k).upper()); -} - -template< class I > inline // x is positive and k bigger than one -typename I::base_type root_aux_up(typename I::base_type const &x, int k) -{ - typedef typename I::base_type T; - typedef typename I::traits_type Policies; - typename Policies::rounding rnd; - T one(1); - if (x > one) return root_aux(x, k).upper(); - if (x == one) return one; - return rnd.div_up(one, root_aux(rnd.div_down(one, x), k).lower()); -} - -} // namespace detail -} // namespace interval_lib - -template< class T, class Policies > inline -interval nth_root(interval const &x, int k) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) return I::empty(); - assert(k > 0); - if (k == 1) return x; - typename Policies::rounding rnd; - typedef typename interval_lib::unprotect::type R; - if (!interval_lib::user::is_pos(x.upper())) { - if (interval_lib::user::is_zero(x.upper())) { - T zero(0); - if (!(k & 1) || interval_lib::user::is_zero(x.lower())) // [-1,0]^/2 or [0,0] - return I(zero, zero, true); - else // [-1,0]^/3 - return I(-interval_lib::detail::root_aux_up(-x.lower(), k), zero, true); - } else if (!(k & 1)) // [-2,-1]^/2 - return I::empty(); - else { // [-2,-1]^/3 - return I(-interval_lib::detail::root_aux_up(-x.lower(), k), - -interval_lib::detail::root_aux_dn(-x.upper(), k), true); - } - } - T u = interval_lib::detail::root_aux_up(x.upper(), k); - if (!interval_lib::user::is_pos(x.lower())) - if (!(k & 1) || interval_lib::user::is_zero(x.lower())) // [-1,1]^/2 or [0,1] - return I(static_cast(0), u, true); - else // [-1,1]^/3 - return I(-interval_lib::detail::root_aux_up(-x.lower(), k), u, true); - else // [1,2] - return I(interval_lib::detail::root_aux_dn(x.lower(), k), u, true); -} - -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_ARITH2_HPP diff --git a/gecode/third-party/boost/numeric/interval/arith3.hpp b/gecode/third-party/boost/numeric/interval/arith3.hpp deleted file mode 100644 index c19ad74c07..0000000000 --- a/gecode/third-party/boost/numeric/interval/arith3.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* Boost interval/arith3.hpp template implementation file - * - * This headers provides arithmetical functions - * which compute an interval given some base - * numbers. The resulting interval encloses the - * real result of the arithmetic operation. - * - * Copyright 2003 Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_ARITH3_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_ARITH3_HPP - -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -template inline -I add(const typename I::base_type& x, const typename I::base_type& y) -{ - typedef typename I::traits_type Policies; - if (detail::test_input(x, y)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.add_down(x, y), rnd.add_up(x, y), true); -} - -template inline -I sub(const typename I::base_type& x, const typename I::base_type& y) -{ - typedef typename I::traits_type Policies; - if (detail::test_input(x, y)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.sub_down(x, y), rnd.sub_up(x, y), true); -} - -template inline -I mul(const typename I::base_type& x, const typename I::base_type& y) -{ - typedef typename I::traits_type Policies; - if (detail::test_input(x, y)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.mul_down(x, y), rnd.mul_up(x, y), true); -} - -template inline -I div(const typename I::base_type& x, const typename I::base_type& y) -{ - typedef typename I::traits_type Policies; - if (detail::test_input(x, y) || user::is_zero(y)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.div_down(x, y), rnd.div_up(x, y), true); -} - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_ARITH3_HPP diff --git a/gecode/third-party/boost/numeric/interval/checking.hpp b/gecode/third-party/boost/numeric/interval/checking.hpp deleted file mode 100644 index 10af50acd7..0000000000 --- a/gecode/third-party/boost/numeric/interval/checking.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/* Boost interval/checking.hpp template implementation file - * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_CHECKING_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_CHECKING_HPP - -#include -#include -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -struct exception_create_empty -{ - void operator()() - { - throw std::runtime_error("gecode_boost::interval: empty interval created"); - } -}; - -struct exception_invalid_number -{ - void operator()() - { - throw std::invalid_argument("gecode_boost::interval: invalid number"); - } -}; - -template -struct checking_base -{ - static T pos_inf() - { - assert(std::numeric_limits::has_infinity); - return std::numeric_limits::infinity(); - } - static T neg_inf() - { - assert(std::numeric_limits::has_infinity); - return -std::numeric_limits::infinity(); - } - static T nan() - { - assert(std::numeric_limits::has_quiet_NaN); - return std::numeric_limits::quiet_NaN(); - } - static bool is_nan(const T& x) - { - return std::numeric_limits::has_quiet_NaN && (x != x); - } - static T empty_lower() - { - return (std::numeric_limits::has_quiet_NaN ? - std::numeric_limits::quiet_NaN() : static_cast(1)); - } - static T empty_upper() - { - return (std::numeric_limits::has_quiet_NaN ? - std::numeric_limits::quiet_NaN() : static_cast(0)); - } - static bool is_empty(const T& l, const T& u) - { - return !(l <= u); // safety for partial orders - } -}; - -template, - class Exception = exception_create_empty> -struct checking_no_empty: Checking -{ - static T nan() - { - assert(false); - return Checking::nan(); - } - static T empty_lower() - { - Exception()(); - return Checking::empty_lower(); - } - static T empty_upper() - { - Exception()(); - return Checking::empty_upper(); - } - static bool is_empty(const T&, const T&) - { - return false; - } -}; - -template > -struct checking_no_nan: Checking -{ - static bool is_nan(const T&) - { - return false; - } -}; - -template, - class Exception = exception_invalid_number> -struct checking_catch_nan: Checking -{ - static bool is_nan(const T& x) - { - if (Checking::is_nan(x)) Exception()(); - return false; - } -}; - -template -struct checking_strict: - checking_no_nan > -{}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_CHECKING_HPP diff --git a/gecode/third-party/boost/numeric/interval/compare.hpp b/gecode/third-party/boost/numeric/interval/compare.hpp deleted file mode 100644 index ed4d355832..0000000000 --- a/gecode/third-party/boost/numeric/interval/compare.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/* Boost interval/compare.hpp template implementation file - * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_HPP - -#include -#include -#include -#include -#include - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_HPP diff --git a/gecode/third-party/boost/numeric/interval/compare/certain.hpp b/gecode/third-party/boost/numeric/interval/compare/certain.hpp deleted file mode 100644 index 1e65c965a6..0000000000 --- a/gecode/third-party/boost/numeric/interval/compare/certain.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/* Boost interval/compare/certain.hpp template implementation file - * - * Copyright 2003 Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_CERTAIN_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_CERTAIN_HPP - -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace compare { -namespace certain { - -template inline -bool operator<(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() < y.lower(); -} - -template inline -bool operator<(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() < y; -} - -template inline -bool operator<=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() <= y.lower(); -} - -template inline -bool operator<=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() <= y; -} - -template inline -bool operator>(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() > y.upper(); -} - -template inline -bool operator>(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() > y; -} - -template inline -bool operator>=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() >= y.upper(); -} - -template inline -bool operator>=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() >= y; -} - -template inline -bool operator==(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() == y.lower() && x.lower() == y.upper(); -} - -template inline -bool operator==(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() == y && x.lower() == y; -} - -template inline -bool operator!=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() < y.lower() || x.lower() > y.upper(); -} - -template inline -bool operator!=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() < y || x.lower() > y; -} - -} // namespace certain -} // namespace compare -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_CERTAIN_HPP diff --git a/gecode/third-party/boost/numeric/interval/compare/explicit.hpp b/gecode/third-party/boost/numeric/interval/compare/explicit.hpp deleted file mode 100644 index 8383e3f402..0000000000 --- a/gecode/third-party/boost/numeric/interval/compare/explicit.hpp +++ /dev/null @@ -1,248 +0,0 @@ -/* Boost interval/compare/explicit.hpp template implementation file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_EXPLICIT_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_EXPLICIT_HPP - -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -/* - * Certainly... operations - */ - -template inline -bool cerlt(const interval& x, const interval& y) -{ - return x.upper() < y.lower(); -} - -template inline -bool cerlt(const interval& x, const T& y) -{ - return x.upper() < y; -} - -template inline -bool cerlt(const T& x, const interval& y) -{ - return x < y.lower(); -} - -template inline -bool cerle(const interval& x, const interval& y) -{ - return x.upper() <= y.lower(); -} - -template inline -bool cerle(const interval& x, const T& y) -{ - return x.upper() <= y; -} - -template inline -bool cerle(const T& x, const interval& y) -{ - return x <= y.lower(); -} - -template inline -bool cergt(const interval& x, const interval& y) -{ - return x.lower() > y.upper(); -} - -template inline -bool cergt(const interval& x, const T& y) -{ - return x.lower() > y; -} - -template inline -bool cergt(const T& x, const interval& y) -{ - return x > y.upper(); -} - -template inline -bool cerge(const interval& x, const interval& y) -{ - return x.lower() >= y.upper(); -} - -template inline -bool cerge(const interval& x, const T& y) -{ - return x.lower() >= y; -} - -template inline -bool cerge(const T& x, const interval& y) -{ - return x >= y.upper(); -} - -template inline -bool cereq(const interval& x, const interval& y) -{ - return x.lower() == y.upper() && y.lower() == x.upper(); -} - -template inline -bool cereq(const interval& x, const T& y) -{ - return x.lower() == y && x.upper() == y; -} - -template inline -bool cereq(const T& x, const interval& y) -{ - return x == y.lower() && x == y.upper(); -} - -template inline -bool cerne(const interval& x, const interval& y) -{ - return x.upper() < y.lower() || y.upper() < x.lower(); -} - -template inline -bool cerne(const interval& x, const T& y) -{ - return x.upper() < y || y < x.lower(); -} - -template inline -bool cerne(const T& x, const interval& y) -{ - return x < y.lower() || y.upper() < x; -} - -/* - * Possibly... comparisons - */ - -template inline -bool poslt(const interval& x, const interval& y) -{ - return x.lower() < y.upper(); -} - -template inline -bool poslt(const interval& x, const T& y) -{ - return x.lower() < y; -} - -template inline -bool poslt(const T& x, const interval& y) -{ - return x < y.upper(); -} - -template inline -bool posle(const interval& x, const interval& y) -{ - return x.lower() <= y.upper(); -} - -template inline -bool posle(const interval& x, const T& y) -{ - return x.lower() <= y; -} - -template inline -bool posle(const T& x, const interval& y) -{ - return x <= y.upper(); -} - -template inline -bool posgt(const interval& x, const interval& y) -{ - return x.upper() > y.lower(); -} - -template inline -bool posgt(const interval& x, const T& y) -{ - return x.upper() > y; -} - -template inline -bool posgt(const T& x, const interval & y) -{ - return x > y.lower(); -} - -template inline -bool posge(const interval& x, const interval& y) -{ - return x.upper() >= y.lower(); -} - -template inline -bool posge(const interval& x, const T& y) -{ - return x.upper() >= y; -} - -template inline -bool posge(const T& x, const interval& y) -{ - return x >= y.lower(); -} - -template inline -bool poseq(const interval& x, const interval& y) -{ - return x.upper() >= y.lower() && y.upper() >= x.lower(); -} - -template inline -bool poseq(const interval& x, const T& y) -{ - return x.upper() >= y && y >= x.lower(); -} - -template inline -bool poseq(const T& x, const interval& y) -{ - return x >= y.lower() && y.upper() >= x; -} - -template inline -bool posne(const interval& x, const interval& y) -{ - return x.upper() != y.lower() || y.upper() != x.lower(); -} - -template inline -bool posne(const interval& x, const T& y) -{ - return x.upper() != y || y != x.lower(); -} - -template inline -bool posne(const T& x, const interval& y) -{ - return x != y.lower() || y.upper() != x; -} - -} // namespace interval_lib -} // namespace numeric -} //namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_EXPLICIT_HPP diff --git a/gecode/third-party/boost/numeric/interval/compare/lexicographic.hpp b/gecode/third-party/boost/numeric/interval/compare/lexicographic.hpp deleted file mode 100644 index fae4343169..0000000000 --- a/gecode/third-party/boost/numeric/interval/compare/lexicographic.hpp +++ /dev/null @@ -1,122 +0,0 @@ -/* Boost interval/compare/lexicographic.hpp template implementation file - * - * Copyright 2002-2003 Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_LEXICOGRAPHIC_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_LEXICOGRAPHIC_HPP - -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace compare { -namespace lexicographic { - -template inline -bool operator<(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - const T& xl = x.lower(); - const T& yl = y.lower(); - return xl < yl || (xl == yl && x.upper() < y.upper()); -} - -template inline -bool operator<(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() < y; -} - -template inline -bool operator<=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - const T& xl = x.lower(); - const T& yl = y.lower(); - return xl < yl || (xl == yl && x.upper() <= y.upper()); -} - -template inline -bool operator<=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - const T& xl = x.lower(); - return xl < y || (xl == y && x.upper() <= y); -} - -template inline -bool operator>(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - const T& xl = x.lower(); - const T& yl = y.lower(); - return xl > yl || (xl == yl && x.upper() > y.upper()); -} - -template inline -bool operator>(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - const T& xl = x.lower(); - return xl > y || (xl == y && x.upper() > y); -} - -template inline -bool operator>=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - const T& xl = x.lower(); - const T& yl = y.lower(); - return xl > yl || (xl == yl && x.upper() >= y.upper()); -} - -template inline -bool operator>=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() >= y; -} - -template inline -bool operator==(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() == y.lower() && x.upper() == y.upper(); -} - -template inline -bool operator==(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() == y && x.upper() == y; -} - -template inline -bool operator!=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() != y.lower() || x.upper() != y.upper(); -} - -template inline -bool operator!=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() != y || x.upper() != y; -} - -} // namespace lexicographic -} // namespace compare -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_LEXICOGRAPHIC_HPP diff --git a/gecode/third-party/boost/numeric/interval/compare/possible.hpp b/gecode/third-party/boost/numeric/interval/compare/possible.hpp deleted file mode 100644 index 9885a115d3..0000000000 --- a/gecode/third-party/boost/numeric/interval/compare/possible.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/* Boost interval/compare/possible.hpp template implementation file - * - * Copyright 2003 Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP - -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace compare { -namespace possible { - -template inline -bool operator<(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() < y.upper(); -} - -template inline -bool operator<(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() < y; -} - -template inline -bool operator<=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() <= y.upper(); -} - -template inline -bool operator<=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() <= y; -} - -template inline -bool operator>(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() > y.lower(); -} - -template inline -bool operator>(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() > y; -} - -template inline -bool operator>=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() >= y.lower(); -} - -template inline -bool operator>=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.upper() >= y; -} - -template inline -bool operator==(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() <= y.upper() && x.upper() >= y.lower(); -} - -template inline -bool operator==(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() <= y && x.upper() >= y; -} - -template inline -bool operator!=(const interval& x, const interval& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() != y.upper() || x.upper() != y.lower(); -} - -template inline -bool operator!=(const interval& x, const T& y) -{ - if (detail::test_input(x, y)) throw comparison_error(); - return x.lower() != y || x.upper() != y; -} - -} // namespace possible -} // namespace compare -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP diff --git a/gecode/third-party/boost/numeric/interval/compare/set.hpp b/gecode/third-party/boost/numeric/interval/compare/set.hpp deleted file mode 100644 index f6c3af4706..0000000000 --- a/gecode/third-party/boost/numeric/interval/compare/set.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* Boost interval/compare/set.hpp template implementation file - * - * Copyright 2002-2003 Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP - -#include -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace compare { -namespace set { - -template inline -bool operator<(const interval& x, const interval& y) -{ - return proper_subset(x, y); -} - -template inline -bool operator<(const interval& x, const T& y) -{ - (void)x; (void)y; - throw comparison_error(); -} - -template inline -bool operator<=(const interval& x, const interval& y) -{ - return subset(x, y); -} - -template inline -bool operator<=(const interval& x, const T& y) -{ - (void)x; (void)y; - throw comparison_error(); -} - -template inline -bool operator>(const interval& x, const interval& y) -{ - return proper_subset(y, x); -} - -template inline -bool operator>(const interval& x, const T& y) -{ - (void)x; (void)y; - throw comparison_error(); -} - -template inline -bool operator>=(const interval& x, const interval& y) -{ - return subset(y, x); -} - -template inline -bool operator>=(const interval& x, const T& y) -{ - (void)x; (void)y; - throw comparison_error(); -} - -template inline -bool operator==(const interval& x, const interval& y) -{ - return equal(y, x); -} - -template inline -bool operator==(const interval& x, const T& y) -{ - (void)x; (void)y; - throw comparison_error(); -} - -template inline -bool operator!=(const interval& x, const interval& y) -{ - return !equal(y, x); -} - -template inline -bool operator!=(const interval& x, const T& y) -{ - (void)x; (void)y; - throw comparison_error(); -} - -} // namespace set -} // namespace compare -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP diff --git a/gecode/third-party/boost/numeric/interval/constants.hpp b/gecode/third-party/boost/numeric/interval/constants.hpp deleted file mode 100644 index 14907616bc..0000000000 --- a/gecode/third-party/boost/numeric/interval/constants.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Boost interval/constants.hpp template implementation file - * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_CONSTANTS_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_CONSTANTS_HPP - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace constants { - -// These constants should be exactly computed. -// Decimal representations wouldn't do it since the standard doesn't -// specify the rounding (even nearest) that should be used. - -static const float pi_f_l = 13176794.0f/(1<<22); -static const float pi_f_u = 13176795.0f/(1<<22); -static const double pi_d_l = (3373259426.0 + 273688.0 / (1<<21)) / (1<<30); -static const double pi_d_u = (3373259426.0 + 273689.0 / (1<<21)) / (1<<30); - -template inline T pi_lower() { return 3; } -template inline T pi_upper() { return 4; } -template inline T pi_half_lower() { return 1; } -template inline T pi_half_upper() { return 2; } -template inline T pi_twice_lower() { return 6; } -template inline T pi_twice_upper() { return 7; } - -template<> inline float pi_lower() { return pi_f_l; } -template<> inline float pi_upper() { return pi_f_u; } -template<> inline float pi_half_lower() { return pi_f_l / 2; } -template<> inline float pi_half_upper() { return pi_f_u / 2; } -template<> inline float pi_twice_lower() { return pi_f_l * 2; } -template<> inline float pi_twice_upper() { return pi_f_u * 2; } - -template<> inline double pi_lower() { return pi_d_l; } -template<> inline double pi_upper() { return pi_d_u; } -template<> inline double pi_half_lower() { return pi_d_l / 2; } -template<> inline double pi_half_upper() { return pi_d_u / 2; } -template<> inline double pi_twice_lower() { return pi_d_l * 2; } -template<> inline double pi_twice_upper() { return pi_d_u * 2; } - -template<> inline long double pi_lower() { return pi_d_l; } -template<> inline long double pi_upper() { return pi_d_u; } -template<> inline long double pi_half_lower() { return pi_d_l / 2; } -template<> inline long double pi_half_upper() { return pi_d_u / 2; } -template<> inline long double pi_twice_lower() { return pi_d_l * 2; } -template<> inline long double pi_twice_upper() { return pi_d_u * 2; } - -} // namespace constants - -template inline -I pi() -{ - typedef typename I::base_type T; - return I(constants::pi_lower(), - constants::pi_upper(), true); -} - -template inline -I pi_half() -{ - typedef typename I::base_type T; - return I(constants::pi_half_lower(), - constants::pi_half_upper(), true); -} - -template inline -I pi_twice() -{ - typedef typename I::base_type T; - return I(constants::pi_twice_lower(), - constants::pi_twice_upper(), true); -} - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_CONSTANTS_HPP diff --git a/gecode/third-party/boost/numeric/interval/detail/alpha_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/alpha_rounding_control.hpp deleted file mode 100644 index 8affb601e3..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/alpha_rounding_control.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/* Boost interval/detail/alpha_rounding_control.hpp file - * - * Copyright 2005 Felix Höfling, Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_ALPHA_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_ALPHA_ROUNDING_CONTROL_HPP - -#if !defined(alpha) && !defined(__alpha__) -#error This header only works on Alpha CPUs. -#endif - -#if defined(__GNUC__) || defined(__digital__) || defined(__DECCXX) - -#include // write_rnd() and read_rnd() - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -namespace detail { -#if defined(__GNUC__ ) - typedef union { - ::gecode_boost::long_long_type imode; - double dmode; - } rounding_mode_struct; - - // set bits 59-58 (DYN), - // clear all exception bits and disable overflow (51) and inexact exceptions (62) - static const rounding_mode_struct mode_upward = { 0x4C08000000000000LL }; - static const rounding_mode_struct mode_downward = { 0x4408000000000000LL }; - static const rounding_mode_struct mode_to_nearest = { 0x4808000000000000LL }; - static const rounding_mode_struct mode_toward_zero = { 0x4008000000000000LL }; - - struct alpha_rounding_control - { - typedef double rounding_mode; - - static void set_rounding_mode(const rounding_mode mode) - { __asm__ __volatile__ ("mt_fpcr %0" : : "f"(mode)); } - - static void get_rounding_mode(rounding_mode& mode) - { __asm__ __volatile__ ("mf_fpcr %0" : "=f"(mode)); } - - static void downward() { set_rounding_mode(mode_downward.dmode); } - static void upward() { set_rounding_mode(mode_upward.dmode); } - static void to_nearest() { set_rounding_mode(mode_to_nearest.dmode); } - static void toward_zero() { set_rounding_mode(mode_toward_zero.dmode); } - }; -#elif defined(__digital__) || defined(__DECCXX) - -#if defined(__DECCXX) && !(defined(__FLT_ROUNDS) && __FLT_ROUNDS == -1) -#error Dynamic rounding mode not enabled. See cxx man page for details. -#endif - - struct alpha_rounding_control - { - typedef unsigned int rounding_mode; - - static void set_rounding_mode(const rounding_mode& mode) { write_rnd(mode); } - static void get_rounding_mode(rounding_mode& mode) { mode = read_rnd(); } - - static void downward() { set_rounding_mode(FP_RND_RM); } - static void upward() { set_rounding_mode(FP_RND_RP); } - static void to_nearest() { set_rounding_mode(FP_RND_RN); } - static void toward_zero() { set_rounding_mode(FP_RND_RZ); } - }; -#endif -} // namespace detail - -extern "C" { - float rintf(float); - double rint(double); - long double rintl(long double); -} - -template<> -struct rounding_control: - detail::alpha_rounding_control -{ - static float force_rounding(const float r) - { volatile float _r = r; return _r; } - static float to_int(const float& x) { return rintf(x); } -}; - -template<> -struct rounding_control: - detail::alpha_rounding_control -{ - static const double & force_rounding(const double& r) { return r; } - static double to_int(const double& r) { return rint(r); } -}; - -template<> -struct rounding_control: - detail::alpha_rounding_control -{ - static const long double & force_rounding(const long double& r) { return r; } - static long double to_int(const long double& r) { return rintl(r); } -}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#undef GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE -#endif - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_ALPHA_ROUNDING_CONTROL_HPP */ diff --git a/gecode/third-party/boost/numeric/interval/detail/bcc_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/bcc_rounding_control.hpp deleted file mode 100644 index 1bfc337010..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/bcc_rounding_control.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* Boost interval/detail/bcc_rounding_control.hpp file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_BCC_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_BCC_ROUNDING_CONTROL_HPP - -#ifndef __BORLANDC__ -# error This header is only intended for Borland C++. -#endif - -#ifndef _M_IX86 -# error This header only works on x86 CPUs. -#endif - -#include // Borland C++ rounding control - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_KEEP_EXCEPTIONS_FOR_BCC -extern "C" { unsigned int _RTLENTRY _fm_init(void); } - -struct borland_workaround { - borland_workaround() { _fm_init(); } -}; - -static borland_workaround borland_workaround_exec; -#endif // GECODE_BOOST_NUMERIC_INTERVAL_KEEP_EXCEPTIONS_FOR_BCC - -__inline double rint(double) -{ __emit__(0xD9); __emit__(0xFC); /* asm FRNDINT */ } - -struct x86_rounding -{ - typedef unsigned int rounding_mode; - static void get_rounding_mode(rounding_mode& mode) - { mode = _control87(0, 0); } - static void set_rounding_mode(const rounding_mode mode) - { _control87(mode, 0xffff); } - static double to_int(const double& x) { return rint(x); } -}; - -} // namespace detail -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_BCC_ROUNDING_CONTROL_HPP */ diff --git a/gecode/third-party/boost/numeric/interval/detail/bugs.hpp b/gecode/third-party/boost/numeric/interval/detail/bugs.hpp deleted file mode 100644 index 0d277aba6b..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/bugs.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/* Boost interval/detail/bugs.hpp file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_BUGS -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_BUGS - -#include - -#if defined(__GLIBC__) && (defined(__USE_MISC) || defined(__USE_XOPEN_EXTENDED) || defined(__USE_ISOC99)) && !defined(__ICC) -# define GECODE_BOOST_HAS_INV_HYPERBOLIC -#endif - -#ifdef GECODE_BOOST_NO_STDC_NAMESPACE -# define GECODE_BOOST_NUMERIC_INTERVAL_using_math(a) using ::a -# ifdef GECODE_BOOST_HAS_INV_HYPERBOLIC -# define GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(a) using ::a -# endif -#else -# define GECODE_BOOST_NUMERIC_INTERVAL_using_math(a) using std::a -# if defined(GECODE_BOOST_HAS_INV_HYPERBOLIC) -# if defined(__GLIBCPP__) || defined(__GLIBCXX__) -# define GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(a) using ::a -# else -# define GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(a) using std::a -# endif -# endif -#endif - -#if defined(__COMO__) || defined(GECODE_BOOST_INTEL) -# define GECODE_BOOST_NUMERIC_INTERVAL_using_max(a) using std::a -#elif defined(GECODE_BOOST_NO_STDC_NAMESPACE) -# define GECODE_BOOST_NUMERIC_INTERVAL_using_max(a) using ::a -#else -# define GECODE_BOOST_NUMERIC_INTERVAL_using_max(a) using std::a -#endif - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp -# define GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(a) -#endif - -#if defined(__GNUC__) && (__GNUC__ <= 2) -// cf PR c++/1981 for a description of the bug -#include -#include -namespace gecode_boost { -namespace numeric { - using std::min; - using std::max; - using std::sqrt; - using std::exp; - using std::log; - using std::cos; - using std::tan; - using std::asin; - using std::acos; - using std::atan; - using std::ceil; - using std::floor; - using std::sinh; - using std::cosh; - using std::tanh; -# undef GECODE_BOOST_NUMERIC_INTERVAL_using_max -# undef GECODE_BOOST_NUMERIC_INTERVAL_using_math -# define GECODE_BOOST_NUMERIC_INTERVAL_using_max(a) -# define GECODE_BOOST_NUMERIC_INTERVAL_using_math(a) -# undef GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp -# define GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(a) -} // namespace numeric -} // namespace gecode_boost -#endif - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_BUGS diff --git a/gecode/third-party/boost/numeric/interval/detail/c99_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/c99_rounding_control.hpp deleted file mode 100644 index f3baedb195..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/c99_rounding_control.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* Boost interval/detail/c99_rounding_control.hpp file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_C99_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_C99_ROUNDING_CONTROL_HPP - -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -template<> -struct rounding_control: - detail::c99_rounding_control -{ - static float force_rounding(float const &r) - { volatile float r_ = r; return r_; } -}; - -template<> -struct rounding_control: - detail::c99_rounding_control -{ - static double force_rounding(double const &r) - { volatile double r_ = r; return r_; } -}; - -template<> -struct rounding_control: - detail::c99_rounding_control -{ - static long double force_rounding(long double const &r) - { volatile long double r_ = r; return r_; } -}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#undef GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_C99_ROUNDING_CONTROL_HPP diff --git a/gecode/third-party/boost/numeric/interval/detail/c99sub_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/c99sub_rounding_control.hpp deleted file mode 100644 index 3ad4665d31..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/c99sub_rounding_control.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* Boost interval/detail/c99sub_rounding_control.hpp file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_C99SUB_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_C99SUB_ROUNDING_CONTROL_HPP - -#include // ISO C 99 rounding mode control - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - -extern "C" { double rint(double); } - -struct c99_rounding_control -{ - typedef int rounding_mode; - - static void set_rounding_mode(rounding_mode mode) { fesetround(mode); } - static void get_rounding_mode(rounding_mode &mode) { mode = fegetround(); } - static void downward() { set_rounding_mode(FE_DOWNWARD); } - static void upward() { set_rounding_mode(FE_UPWARD); } - static void to_nearest() { set_rounding_mode(FE_TONEAREST); } - static void toward_zero() { set_rounding_mode(FE_TOWARDZERO); } - - template - static T to_int(const T& r) { return rint(r); } -}; - -} // namespace detail -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_C99SUB_ROUBDING_CONTROL_HPP diff --git a/gecode/third-party/boost/numeric/interval/detail/division.hpp b/gecode/third-party/boost/numeric/interval/detail/division.hpp deleted file mode 100644 index 119c20a7c9..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/division.hpp +++ /dev/null @@ -1,194 +0,0 @@ -/* Boost interval/detail/division.hpp file - * - * Copyright 2003 Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_DIVISION_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_DIVISION_HPP - -#include -#include -#include -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - -template inline -interval div_non_zero(const interval& x, - const interval& y) -{ - // assert(!in_zero(y)); - typename Policies::rounding rnd; - typedef interval I; - const T& xl = x.lower(); - const T& xu = x.upper(); - const T& yl = y.lower(); - const T& yu = y.upper(); - if (::gecode_boost::numeric::interval_lib::user::is_neg(xu)) - if (::gecode_boost::numeric::interval_lib::user::is_neg(yu)) - return I(rnd.div_down(xu, yl), rnd.div_up(xl, yu), true); - else - return I(rnd.div_down(xl, yl), rnd.div_up(xu, yu), true); - else if (::gecode_boost::numeric::interval_lib::user::is_neg(xl)) - if (::gecode_boost::numeric::interval_lib::user::is_neg(yu)) - return I(rnd.div_down(xu, yu), rnd.div_up(xl, yu), true); - else - return I(rnd.div_down(xl, yl), rnd.div_up(xu, yl), true); - else - if (::gecode_boost::numeric::interval_lib::user::is_neg(yu)) - return I(rnd.div_down(xu, yu), rnd.div_up(xl, yl), true); - else - return I(rnd.div_down(xl, yu), rnd.div_up(xu, yl), true); -} - -template inline -interval div_non_zero(const T& x, const interval& y) -{ - // assert(!in_zero(y)); - typename Policies::rounding rnd; - typedef interval I; - const T& yl = y.lower(); - const T& yu = y.upper(); - if (::gecode_boost::numeric::interval_lib::user::is_neg(x)) - return I(rnd.div_down(x, yl), rnd.div_up(x, yu), true); - else - return I(rnd.div_down(x, yu), rnd.div_up(x, yl), true); -} - -template inline -interval div_positive(const interval& x, const T& yu) -{ - // assert(::gecode_boost::numeric::interval_lib::user::is_pos(yu)); - if (::gecode_boost::numeric::interval_lib::user::is_zero(x.lower()) && - ::gecode_boost::numeric::interval_lib::user::is_zero(x.upper())) - return x; - typename Policies::rounding rnd; - typedef interval I; - const T& xl = x.lower(); - const T& xu = x.upper(); - typedef typename Policies::checking checking; - if (::gecode_boost::numeric::interval_lib::user::is_neg(xu)) - return I(checking::neg_inf(), rnd.div_up(xu, yu), true); - else if (::gecode_boost::numeric::interval_lib::user::is_neg(xl)) - return I(checking::neg_inf(), checking::pos_inf(), true); - else - return I(rnd.div_down(xl, yu), checking::pos_inf(), true); -} - -template inline -interval div_positive(const T& x, const T& yu) -{ - // assert(::gecode_boost::numeric::interval_lib::user::is_pos(yu)); - typedef interval I; - if (::gecode_boost::numeric::interval_lib::user::is_zero(x)) - return I(static_cast(0), static_cast(0), true); - typename Policies::rounding rnd; - typedef typename Policies::checking checking; - if (::gecode_boost::numeric::interval_lib::user::is_neg(x)) - return I(checking::neg_inf(), rnd.div_up(x, yu), true); - else - return I(rnd.div_down(x, yu), checking::pos_inf(), true); -} - -template inline -interval div_negative(const interval& x, const T& yl) -{ - // assert(::gecode_boost::numeric::interval_lib::user::is_neg(yl)); - if (::gecode_boost::numeric::interval_lib::user::is_zero(x.lower()) && - ::gecode_boost::numeric::interval_lib::user::is_zero(x.upper())) - return x; - typename Policies::rounding rnd; - typedef interval I; - const T& xl = x.lower(); - const T& xu = x.upper(); - typedef typename Policies::checking checking; - if (::gecode_boost::numeric::interval_lib::user::is_neg(xu)) - return I(rnd.div_down(xu, yl), checking::pos_inf(), true); - else if (::gecode_boost::numeric::interval_lib::user::is_neg(xl)) - return I(checking::neg_inf(), checking::pos_inf(), true); - else - return I(checking::neg_inf(), rnd.div_up(xl, yl), true); -} - -template inline -interval div_negative(const T& x, const T& yl) -{ - // assert(::gecode_boost::numeric::interval_lib::user::is_neg(yl)); - typedef interval I; - if (::gecode_boost::numeric::interval_lib::user::is_zero(x)) - return I(static_cast(0), static_cast(0), true); - typename Policies::rounding rnd; - typedef typename Policies::checking checking; - if (::gecode_boost::numeric::interval_lib::user::is_neg(x)) - return I(rnd.div_down(x, yl), checking::pos_inf(), true); - else - return I(checking::neg_inf(), rnd.div_up(x, yl), true); -} - -template inline -interval div_zero(const interval& x) -{ - if (::gecode_boost::numeric::interval_lib::user::is_zero(x.lower()) && - ::gecode_boost::numeric::interval_lib::user::is_zero(x.upper())) - return x; - else return interval::whole(); -} - -template inline -interval div_zero(const T& x) -{ - if (::gecode_boost::numeric::interval_lib::user::is_zero(x)) - return interval(static_cast(0), static_cast(0), true); - else return interval::whole(); -} - -template inline -interval div_zero_part1(const interval& x, - const interval& y, bool& b) -{ - // assert(::gecode_boost::numeric::interval_lib::user::is_neg(y.lower()) && ::gecode_boost::numeric::interval_lib::user::is_pos(y.upper())); - if (::gecode_boost::numeric::interval_lib::user::is_zero(x.lower()) && ::gecode_boost::numeric::interval_lib::user::is_zero(x.upper())) - { b = false; return x; } - typename Policies::rounding rnd; - typedef interval I; - const T& xl = x.lower(); - const T& xu = x.upper(); - const T& yl = y.lower(); - const T& yu = y.upper(); - typedef typename Policies::checking checking; - if (::gecode_boost::numeric::interval_lib::user::is_neg(xu)) - { b = true; return I(checking::neg_inf(), rnd.div_up(xu, yu), true); } - else if (::gecode_boost::numeric::interval_lib::user::is_neg(xl)) - { b = false; return I(checking::neg_inf(), checking::pos_inf(), true); } - else - { b = true; return I(checking::neg_inf(), rnd.div_up(xl, yl), true); } -} - -template inline -interval div_zero_part2(const interval& x, - const interval& y) -{ - // assert(::gecode_boost::numeric::interval_lib::user::is_neg(y.lower()) && ::gecode_boost::numeric::interval_lib::user::is_pos(y.upper()) && (div_zero_part1(x, y, b), b)); - typename Policies::rounding rnd; - typedef interval I; - typedef typename Policies::checking checking; - if (::gecode_boost::numeric::interval_lib::user::is_neg(x.upper())) - return I(rnd.div_down(x.upper(), y.lower()), checking::pos_inf(), true); - else - return I(rnd.div_down(x.lower(), y.upper()), checking::pos_inf(), true); -} - -} // namespace detail -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_DIVISION_HPP diff --git a/gecode/third-party/boost/numeric/interval/detail/ia64_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/ia64_rounding_control.hpp deleted file mode 100644 index 386c3837bb..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/ia64_rounding_control.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Boost interval/detail/ia64_rounding_control.hpp file - * - * Copyright 2006-2007 Boris Gubenko - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_IA64_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_IA64_ROUNDING_CONTROL_HPP - -#if !defined(ia64) && !defined(__ia64) && !defined(__ia64__) -#error This header only works on ia64 CPUs. -#endif - -#if defined(__hpux) - -# include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - - - struct ia64_rounding_control - { - typedef unsigned int rounding_mode; - - static void set_rounding_mode(const rounding_mode& mode) { -fesetround(mode); } - static void get_rounding_mode(rounding_mode& mode) { mode = fegetround(); } - - static void downward() { set_rounding_mode(FE_DOWNWARD); } - static void upward() { set_rounding_mode(FE_UPWARD); } - static void to_nearest() { set_rounding_mode(FE_TONEAREST); } - static void toward_zero() { set_rounding_mode(FE_TOWARDZERO); } - }; - -} // namespace detail - -extern "C" { - float rintf(float); - double rint(double); - long double rintl(long double); -} - -template<> -struct rounding_control: - detail::ia64_rounding_control -{ - static float force_rounding(const float r) - { volatile float _r = r; return _r; } - static float to_int(const float& x) { return rintf(x); } -}; - -template<> -struct rounding_control: - detail::ia64_rounding_control -{ - static const double & force_rounding(const double& r) { return r; } - static double to_int(const double& r) { return rint(r); } -}; - -template<> -struct rounding_control: - detail::ia64_rounding_control -{ - static const long double & force_rounding(const long double& r) { return r; } - static long double to_int(const long double& r) { return rintl(r); } -}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#undef GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE - -#endif /* __hpux */ - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_IA64_ROUNDING_CONTROL_HPP */ - diff --git a/gecode/third-party/boost/numeric/interval/detail/interval_prototype.hpp b/gecode/third-party/boost/numeric/interval/detail/interval_prototype.hpp deleted file mode 100644 index b7f4c1e26a..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/interval_prototype.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* Boost interval/detail/interval_prototype.hpp file - * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_INTERVAL_PROTOTYPE_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_INTERVAL_PROTOTYPE_HPP - -namespace gecode_boost { -namespace numeric { - -namespace interval_lib { - -template struct rounded_math; -template struct checking_strict; -class comparison_error; -template struct policies; - -/* - * default policies class - */ - -template -struct default_policies -{ - typedef policies, checking_strict > type; -}; - -} // namespace interval_lib - -template::type > -class interval; - -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_INTERVAL_PROTOTYPE_HPP diff --git a/gecode/third-party/boost/numeric/interval/detail/msvc_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/msvc_rounding_control.hpp deleted file mode 100644 index 5df52908d4..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/msvc_rounding_control.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/* Boost interval/detail/msvc_rounding_control.hpp file - * - * Copyright 2000 Maarten Keijzer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_MSVC_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_MSVC_ROUNDING_CONTROL_HPP - -#ifndef _MSC_VER -# error This header is only intended for MSVC, but might work for Borland as well -#endif - -#include // MSVC rounding control - -// Although the function is called _control87, it seems to work for -// other FPUs too, so it does not have to be changed to _controlfp. - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - -#if GECODE_BOOST_MSVC < 1400 || defined(_WIN64) -extern "C" { double rint(double); } -#else -inline double rint(double x) -{ -_asm FLD [x] ; -_asm FRNDINT ; -//_asm RET ; -} -#endif - -struct x86_rounding -{ - static unsigned int hard2msvc(unsigned short m) { - unsigned int n = 0; - if (m & 0x01) n |= _EM_INVALID; - if (m & 0x02) n |= _EM_DENORMAL; - if (m & 0x04) n |= _EM_ZERODIVIDE; - if (m & 0x08) n |= _EM_OVERFLOW; - if (m & 0x10) n |= _EM_UNDERFLOW; - if (m & 0x20) n |= _EM_INEXACT; - switch (m & 0x300) { - case 0x000: n |= _PC_24; break; - case 0x200: n |= _PC_53; break; - case 0x300: n |= _PC_64; break; - } - switch (m & 0xC00) { - case 0x000: n |= _RC_NEAR; break; - case 0x400: n |= _RC_DOWN; break; - case 0x800: n |= _RC_UP; break; - case 0xC00: n |= _RC_CHOP; break; - } - if (m & 0x1000) n |= _IC_AFFINE; // only useful on 287 - return n; - } - - static unsigned short msvc2hard(unsigned int n) { - unsigned short m = 0; - if (n & _EM_INVALID) m |= 0x01; - if (n & _EM_DENORMAL) m |= 0x02; - if (n & _EM_ZERODIVIDE) m |= 0x04; - if (n & _EM_OVERFLOW) m |= 0x08; - if (n & _EM_UNDERFLOW) m |= 0x10; - if (n & _EM_INEXACT) m |= 0x20; - switch (n & _MCW_RC) { - case _RC_NEAR: m |= 0x000; break; - case _RC_DOWN: m |= 0x400; break; - case _RC_UP: m |= 0x800; break; - case _RC_CHOP: m |= 0xC00; break; - } - switch (n & _MCW_PC) { - case _PC_24: m |= 0x000; break; - case _PC_53: m |= 0x200; break; - case _PC_64: m |= 0x300; break; - } - if ((n & _MCW_IC) == _IC_AFFINE) m |= 0x1000; - return m; - } - - typedef unsigned short rounding_mode; - static void get_rounding_mode(rounding_mode& mode) - { mode = msvc2hard(_control87(0, 0)); } - static void set_rounding_mode(const rounding_mode mode) -#if defined(_M_X64) || defined(_M_IA64) - { _control87(hard2msvc(mode), _MCW_EM | _MCW_RC ); } -#else - { _control87(hard2msvc(mode), _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC); } -#endif - static double to_int(const double& x) { return rint(x); } -}; - -} // namespace detail -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_MSVC_ROUNDING_CONTROL_HPP */ diff --git a/gecode/third-party/boost/numeric/interval/detail/msvc_rounding_control.hpp.orig b/gecode/third-party/boost/numeric/interval/detail/msvc_rounding_control.hpp.orig deleted file mode 100644 index c0dc8fce04..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/msvc_rounding_control.hpp.orig +++ /dev/null @@ -1,100 +0,0 @@ -/* Boost interval/detail/msvc_rounding_control.hpp file - * - * Copyright 2000 Maarten Keijzer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_MSVC_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_MSVC_ROUNDING_CONTROL_HPP - -#ifndef _MSC_VER -# error This header is only intended for MSVC, but might work for Borland as well -#endif - -#include // MSVC rounding control - -// Although the function is called _control87, it seems to work for -// other FPUs too, so it does not have to be changed to _controlfp. - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - -#if GECODE_BOOST_MSVC < 1400 || defined(_WIN64) -extern "C" { double rint(double); } -#else -inline double rint(double x) -{ -_asm FLD [x] ; -_asm FRNDINT ; -//_asm RET ; -} -#endif - -struct x86_rounding -{ - static unsigned int hard2msvc(unsigned short m) { - unsigned int n = 0; - if (m & 0x01) n |= _EM_INVALID; - if (m & 0x02) n |= _EM_DENORMAL; - if (m & 0x04) n |= _EM_ZERODIVIDE; - if (m & 0x08) n |= _EM_OVERFLOW; - if (m & 0x10) n |= _EM_UNDERFLOW; - if (m & 0x20) n |= _EM_INEXACT; - switch (m & 0x300) { - case 0x000: n |= _PC_24; break; - case 0x200: n |= _PC_53; break; - case 0x300: n |= _PC_64; break; - } - switch (m & 0xC00) { - case 0x000: n |= _RC_NEAR; break; - case 0x400: n |= _RC_DOWN; break; - case 0x800: n |= _RC_UP; break; - case 0xC00: n |= _RC_CHOP; break; - } - if (m & 0x1000) n |= _IC_AFFINE; // only useful on 287 - return n; - } - - static unsigned short msvc2hard(unsigned int n) { - unsigned short m = 0; - if (n & _EM_INVALID) m |= 0x01; - if (n & _EM_DENORMAL) m |= 0x02; - if (n & _EM_ZERODIVIDE) m |= 0x04; - if (n & _EM_OVERFLOW) m |= 0x08; - if (n & _EM_UNDERFLOW) m |= 0x10; - if (n & _EM_INEXACT) m |= 0x20; - switch (n & _MCW_RC) { - case _RC_NEAR: m |= 0x000; break; - case _RC_DOWN: m |= 0x400; break; - case _RC_UP: m |= 0x800; break; - case _RC_CHOP: m |= 0xC00; break; - } - switch (n & _MCW_PC) { - case _PC_24: m |= 0x000; break; - case _PC_53: m |= 0x200; break; - case _PC_64: m |= 0x300; break; - } - if ((n & _MCW_IC) == _IC_AFFINE) m |= 0x1000; - return m; - } - - typedef unsigned short rounding_mode; - static void get_rounding_mode(rounding_mode& mode) - { mode = msvc2hard(_control87(0, 0)); } - static void set_rounding_mode(const rounding_mode mode) - { _control87(hard2msvc(mode), _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC); } - static double to_int(const double& x) { return rint(x); } -}; - -} // namespace detail -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_MSVC_ROUNDING_CONTROL_HPP */ diff --git a/gecode/third-party/boost/numeric/interval/detail/ppc_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/ppc_rounding_control.hpp deleted file mode 100644 index 4fdd84e604..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/ppc_rounding_control.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* Boost interval/detail/ppc_rounding_control.hpp file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * Copyright 2005 Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_PPC_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_PPC_ROUNDING_CONTROL_HPP - -#if !defined(powerpc) && !defined(__powerpc__) && !defined(__ppc__) -#error This header only works on PPC CPUs. -#endif - -#if defined(__GNUC__ ) || (__IBMCPP__ >= 700) - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - -typedef union { - ::gecode_boost::long_long_type imode; - double dmode; -} rounding_mode_struct; - -static const rounding_mode_struct mode_upward = { - static_cast< ::gecode_boost::long_long_type >(0xFFF8000000000002LL) -}; -static const rounding_mode_struct mode_downward = { - static_cast< ::gecode_boost::long_long_type >(0xFFF8000000000003LL) -}; -static const rounding_mode_struct mode_to_nearest = { - static_cast< ::gecode_boost::long_long_type >(0xFFF8000000000000LL) -}; -static const rounding_mode_struct mode_toward_zero = { - static_cast< ::gecode_boost::long_long_type >(0xFFF8000000000001LL) -}; - -struct ppc_rounding_control -{ - typedef double rounding_mode; - - static void set_rounding_mode(const rounding_mode mode) - { __asm__ __volatile__ ("mtfsf 255,%0" : : "f"(mode)); } - - static void get_rounding_mode(rounding_mode& mode) - { __asm__ __volatile__ ("mffs %0" : "=f"(mode)); } - - static void downward() { set_rounding_mode(mode_downward.dmode); } - static void upward() { set_rounding_mode(mode_upward.dmode); } - static void to_nearest() { set_rounding_mode(mode_to_nearest.dmode); } - static void toward_zero() { set_rounding_mode(mode_toward_zero.dmode); } -}; - -} // namespace detail - -// Do not declare the following C99 symbols if provides them. -// Otherwise, conflicts may occur, due to differences between prototypes. -#if !defined(_ISOC99_SOURCE) && !defined(__USE_ISOC99) -extern "C" { - float rintf(float); - double rint(double); -} -#endif - -template<> -struct rounding_control: - detail::ppc_rounding_control -{ - static float force_rounding(const float r) - { - float tmp; - __asm__ __volatile__ ("frsp %0, %1" : "=f" (tmp) : "f" (r)); - return tmp; - } - static float to_int(const float& x) { return rintf(x); } -}; - -template<> -struct rounding_control: - detail::ppc_rounding_control -{ - static const double & force_rounding(const double& r) { return r; } - static double to_int(const double& r) { return rint(r); } -}; - -template<> -struct rounding_control: - detail::ppc_rounding_control -{ - static const long double & force_rounding(const long double& r) { return r; } - static long double to_int(const long double& r) { return rint(r); } -}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#undef GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE -#endif - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_PPC_ROUNDING_CONTROL_HPP */ diff --git a/gecode/third-party/boost/numeric/interval/detail/sparc_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/sparc_rounding_control.hpp deleted file mode 100644 index 598f6cf857..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/sparc_rounding_control.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/* Boost interval/detail/sparc_rounding_control.hpp file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - * - * The basic code in this file was kindly provided by Jeremy Siek. - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_SPARC_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_SPARC_ROUNDING_CONTROL_HPP - -#if !defined(sparc) && !defined(__sparc__) -# error This header is only intended for SPARC CPUs. -#endif - -#ifdef __SUNPRO_CC -# include -#endif - - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - -struct sparc_rounding_control -{ - typedef unsigned int rounding_mode; - - static void set_rounding_mode(const rounding_mode& mode) - { -# if defined(__GNUC__) - __asm__ __volatile__("ld %0, %%fsr" : : "m"(mode)); -# elif defined (__SUNPRO_CC) - fpsetround(fp_rnd(mode)); -# elif defined(__KCC) - asm("sethi %hi(mode), %o1"); - asm("ld [%o1+%lo(mode)], %fsr"); -# else -# error Unsupported compiler for Sparc rounding control. -# endif - } - - static void get_rounding_mode(rounding_mode& mode) - { -# if defined(__GNUC__) - __asm__ __volatile__("st %%fsr, %0" : "=m"(mode)); -# elif defined (__SUNPRO_CC) - mode = fpgetround(); -# elif defined(__KCC) -# error KCC on Sun SPARC get_round_mode: please fix me - asm("st %fsr, [mode]"); -# else -# error Unsupported compiler for Sparc rounding control. -# endif - } - -#if defined(__SUNPRO_CC) - static void downward() { set_rounding_mode(FP_RM); } - static void upward() { set_rounding_mode(FP_RP); } - static void to_nearest() { set_rounding_mode(FP_RN); } - static void toward_zero() { set_rounding_mode(FP_RZ); } -#else - static void downward() { set_rounding_mode(0xc0000000); } - static void upward() { set_rounding_mode(0x80000000); } - static void to_nearest() { set_rounding_mode(0x00000000); } - static void toward_zero() { set_rounding_mode(0x40000000); } -#endif -}; - -} // namespace detail - -extern "C" { - float rintf(float); - double rint(double); -} - -template<> -struct rounding_control: - detail::sparc_rounding_control -{ - static const float& force_rounding(const float& x) { return x; } - static float to_int(const float& x) { return rintf(x); } -}; - -template<> -struct rounding_control: - detail::sparc_rounding_control -{ - static const double& force_rounding(const double& x) { return x; } - static double to_int(const double& x) { return rint(x); } -}; - -template<> -struct rounding_control: - detail::sparc_rounding_control -{ - static const long double& force_rounding(const long double& x) { return x; } - static long double to_int(const long double& x) { return rint(x); } -}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#undef GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_SPARC_ROUNDING_CONTROL_HPP */ diff --git a/gecode/third-party/boost/numeric/interval/detail/test_input.hpp b/gecode/third-party/boost/numeric/interval/detail/test_input.hpp deleted file mode 100644 index 8aa28f1bb4..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/test_input.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/* Boost interval/detail/test_input.hpp file - * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_TEST_INPUT_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_TEST_INPUT_HPP - -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace user { - -template inline -bool is_zero(T const &v) { return v == static_cast(0); } - -template inline -bool is_neg (T const &v) { return v < static_cast(0); } - -template inline -bool is_pos (T const &v) { return v > static_cast(0); } - -} // namespace user - -namespace detail { - -template inline -bool test_input(const interval& x) { - typedef typename Policies::checking checking; - return checking::is_empty(x.lower(), x.upper()); -} - -template inline -bool test_input(const interval& x, const interval& y) { - typedef typename Policies1::checking checking1; - typedef typename Policies2::checking checking2; - return checking1::is_empty(x.lower(), x.upper()) || - checking2::is_empty(y.lower(), y.upper()); -} - -template inline -bool test_input(const T& x, const interval& y) { - typedef typename Policies::checking checking; - return checking::is_nan(x) || checking::is_empty(y.lower(), y.upper()); -} - -template inline -bool test_input(const interval& x, const T& y) { - typedef typename Policies::checking checking; - return checking::is_empty(x.lower(), x.upper()) || checking::is_nan(y); -} - -template inline -bool test_input(const T& x) { - typedef typename Policies::checking checking; - return checking::is_nan(x); -} - -template inline -bool test_input(const T& x, const T& y) { - typedef typename Policies::checking checking; - return checking::is_nan(x) || checking::is_nan(y); -} - -} // namespace detail -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_TEST_INPUT_HPP diff --git a/gecode/third-party/boost/numeric/interval/detail/x86_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/x86_rounding_control.hpp deleted file mode 100644 index 9281965fbf..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/x86_rounding_control.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/* Boost interval/detail/x86_rounding_control.hpp file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_X86_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_X86_ROUNDING_CONTROL_HPP - -#ifdef __GNUC__ -# include -#elif defined(__BORLANDC__) -# include -#elif defined(_MSC_VER) -# include -#elif defined(__MWERKS__) || defined(__ICC) || defined (__SUNPRO_CC) -# define GECODE_BOOST_NUMERIC_INTERVAL_USE_C99_SUBSYSTEM -# include -#else -# error Unsupported C++ compiler. -#endif - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -namespace detail { - -#ifdef GECODE_BOOST_NUMERIC_INTERVAL_USE_C99_SUBSYSTEM -typedef c99_rounding_control x86_rounding_control; -#undef GECODE_BOOST_NUMERIC_INTERVAL_USE_C99_SUBSYSTEM -#else -struct fpu_rounding_modes -{ - unsigned short to_nearest; - unsigned short downward; - unsigned short upward; - unsigned short toward_zero; -}; - -// exceptions masked, extended precision -// hardware default is 0x037f (0x1000 only has a meaning on 287) -static const fpu_rounding_modes rnd_mode = { 0x137f, 0x177f, 0x1b7f, 0x1f7f }; - -struct x86_rounding_control: x86_rounding -{ - static void to_nearest() { set_rounding_mode(rnd_mode.to_nearest); } - static void downward() { set_rounding_mode(rnd_mode.downward); } - static void upward() { set_rounding_mode(rnd_mode.upward); } - static void toward_zero() { set_rounding_mode(rnd_mode.toward_zero); } -}; -#endif // GECODE_BOOST_NUMERIC_INTERVAL_USE_C99_SUBSYSTEM - -} // namespace detail - -template<> -struct rounding_control: detail::x86_rounding_control -{ - static float force_rounding(const float& r) - { volatile float r_ = r; return r_; } -}; - -template<> -struct rounding_control: detail::x86_rounding_control -{ - /*static double force_rounding(double r) - { asm volatile ("" : "+m"(r) : ); return r; }*/ - static double force_rounding(const double& r) - { volatile double r_ = r; return r_; } -}; - -namespace detail { - -template -struct x86_rounding_control_long_double; - -template<> -struct x86_rounding_control_long_double: x86_rounding_control -{ - static long double force_rounding(long double const &r) - { volatile long double r_ = r; return r_; } -}; - -template<> -struct x86_rounding_control_long_double: x86_rounding_control -{ - static long double const &force_rounding(long double const &r) - { return r; } -}; - -} // namespace detail - -template<> -struct rounding_control: - detail::x86_rounding_control_long_double< (sizeof(long double) >= 10) > -{}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#undef GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_X86_ROUNDING_CONTROL_HPP */ diff --git a/gecode/third-party/boost/numeric/interval/detail/x86gcc_rounding_control.hpp b/gecode/third-party/boost/numeric/interval/detail/x86gcc_rounding_control.hpp deleted file mode 100644 index 6d7e8133ed..0000000000 --- a/gecode/third-party/boost/numeric/interval/detail/x86gcc_rounding_control.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* Boost interval/detail/x86gcc_rounding_control.hpp file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_X86GCC_ROUNDING_CONTROL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_X86GCC_ROUNDING_CONTROL_HPP - -#ifndef __GNUC__ -# error This header only works with GNU CC. -#endif - -#ifndef __i386__ -# error This header only works on x86 CPUs. -#endif - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { -namespace detail { - -struct x86_rounding -{ - typedef unsigned short rounding_mode; - - static void set_rounding_mode(const rounding_mode& mode) - { __asm__ __volatile__ ("fldcw %0" : : "m"(mode)); } - - static void get_rounding_mode(rounding_mode& mode) - { __asm__ __volatile__ ("fnstcw %0" : "=m"(mode)); } - - template - static T to_int(T r) - { - T r_; - __asm__ ("frndint" : "=&t"(r_) : "0"(r)); - return r_; - } -}; - -} // namespace detail -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif /* GECODE_BOOST_NUMERIC_INTERVAL_DETAIL_X86GCC_ROUNDING_CONTROL_HPP */ diff --git a/gecode/third-party/boost/numeric/interval/hw_rounding.hpp b/gecode/third-party/boost/numeric/interval/hw_rounding.hpp deleted file mode 100644 index 9c15689b35..0000000000 --- a/gecode/third-party/boost/numeric/interval/hw_rounding.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/* Boost interval/hw_rounding.hpp template implementation file - * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * Copyright 2005 Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP - -#include -#include - -#define GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE - -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__cplusplus) && __cplusplus >= 201103L) -# define GECODE_BOOST_C99_ENABLED -#endif - -// define appropriate specialization of rounding_control for built-in types -#if defined(__x86_64__) && (defined(GECODE_BOOST_C99_ENABLED) || defined(__APPLE__)) -# include -#elif defined(__i386__) || defined(_M_IX86) || defined(__BORLANDC__) || defined(_M_X64) -# include -#elif defined(powerpc) || defined(__powerpc__) || defined(__ppc__) -#ifndef __NO_FPRS__ -# include -#endif -#elif defined(sparc) || defined(__sparc__) -# include -#elif defined(alpha) || defined(__alpha__) -# include -#elif defined(ia64) || defined(__ia64) || defined(__ia64__) -# include -#endif - -#if defined(GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE) && (defined(GECODE_BOOST_C99_ENABLED) || defined(__MSL__)) -# include -#endif - -#if defined(GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE) -# undef GECODE_BOOST_NUMERIC_INTERVAL_NO_HARDWARE -# error Boost.Numeric.Interval: Please specify rounding control mechanism. -#endif - -#undef GECODE_BOOST_C99_ENABLED - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -/* - * Three specializations of rounded_math - */ - -template<> -struct rounded_math - : save_state > -{}; - -template<> -struct rounded_math - : save_state > -{}; - -template<> -struct rounded_math - : save_state > -{}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP diff --git a/gecode/third-party/boost/numeric/interval/interval.hpp b/gecode/third-party/boost/numeric/interval/interval.hpp deleted file mode 100644 index 159aa34577..0000000000 --- a/gecode/third-party/boost/numeric/interval/interval.hpp +++ /dev/null @@ -1,451 +0,0 @@ -/* Boost interval/interval.hpp header file - * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_INTERVAL_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_INTERVAL_HPP - -#include -#include -#include - -namespace gecode_boost { -namespace numeric { - -namespace interval_lib { - -class comparison_error - : public std::runtime_error -{ -public: - comparison_error() - : std::runtime_error("gecode_boost::interval: uncertain comparison") - { } -}; - -} // namespace interval_lib - -/* - * interval class - */ - -template -class interval -{ -private: - struct interval_holder; - struct number_holder; -public: - typedef T base_type; - typedef Policies traits_type; - - T const &lower() const; - T const &upper() const; - - interval(); - interval(T const &v); - template interval(T1 const &v); - interval(T const &l, T const &u); - template interval(T1 const &l, T2 const &u); - interval(interval const &r); - template interval(interval const &r); - template interval(interval const &r); - - interval &operator=(T const &v); - template interval &operator=(T1 const &v); - interval &operator=(interval const &r); - template interval &operator=(interval const &r); - template interval &operator=(interval const &r); - - void assign(const T& l, const T& u); - - static interval empty(); - static interval whole(); - static interval hull(const T& x, const T& y); - - interval& operator+= (const T& r); - interval& operator+= (const interval& r); - interval& operator-= (const T& r); - interval& operator-= (const interval& r); - interval& operator*= (const T& r); - interval& operator*= (const interval& r); - interval& operator/= (const T& r); - interval& operator/= (const interval& r); - - bool operator< (const interval_holder& r) const; - bool operator> (const interval_holder& r) const; - bool operator<= (const interval_holder& r) const; - bool operator>= (const interval_holder& r) const; - bool operator== (const interval_holder& r) const; - bool operator!= (const interval_holder& r) const; - - bool operator< (const number_holder& r) const; - bool operator> (const number_holder& r) const; - bool operator<= (const number_holder& r) const; - bool operator>= (const number_holder& r) const; - bool operator== (const number_holder& r) const; - bool operator!= (const number_holder& r) const; - - // the following is for internal use only, it is not a published interface - // nevertheless, it's public because friends don't always work correctly. - interval(const T& l, const T& u, bool): low(l), up(u) {} - void set_empty(); - void set_whole(); - void set(const T& l, const T& u); - -private: - struct interval_holder { - template - interval_holder(const interval& r) - : low(r.lower()), up(r.upper()) - { - typedef typename Policies2::checking checking2; - if (checking2::is_empty(low, up)) - throw interval_lib::comparison_error(); - } - - const T& low; - const T& up; - }; - - struct number_holder { - number_holder(const T& r) : val(r) - { - typedef typename Policies::checking checking; - if (checking::is_nan(r)) - throw interval_lib::comparison_error(); - } - - const T& val; - }; - - typedef typename Policies::checking checking; - typedef typename Policies::rounding rounding; - - T low; - T up; -}; - -template inline -interval::interval(): - low(static_cast(0)), up(static_cast(0)) -{} - -template inline -interval::interval(T const &v): low(v), up(v) -{ - if (checking::is_nan(v)) set_empty(); -} - -template template inline -interval::interval(T1 const &v) -{ - if (checking::is_nan(v)) set_empty(); - else { - rounding rnd; - low = rnd.conv_down(v); - up = rnd.conv_up (v); - } -} - -template template inline -interval::interval(T1 const &l, T2 const &u) -{ - if (checking::is_nan(l) || checking::is_nan(u) || !(l <= u)) set_empty(); - else { - rounding rnd; - low = rnd.conv_down(l); - up = rnd.conv_up (u); - } -} - -template inline -interval::interval(T const &l, T const &u): low(l), up(u) -{ - if (checking::is_nan(l) || checking::is_nan(u) || !(l <= u)) - set_empty(); -} - - -template inline -interval::interval(interval const &r): low(r.lower()), up(r.upper()) -{} - -template template inline -interval::interval(interval const &r): low(r.lower()), up(r.upper()) -{ - typedef typename Policies1::checking checking1; - if (checking1::is_empty(r.lower(), r.upper())) set_empty(); -} - -template template inline -interval::interval(interval const &r) -{ - typedef typename Policies1::checking checking1; - if (checking1::is_empty(r.lower(), r.upper())) set_empty(); - else { - rounding rnd; - low = rnd.conv_down(r.lower()); - up = rnd.conv_up (r.upper()); - } -} - -template inline -interval &interval::operator=(T const &v) -{ - if (checking::is_nan(v)) set_empty(); - else low = up = v; - return *this; -} - -template template inline -interval &interval::operator=(T1 const &v) -{ - if (checking::is_nan(v)) set_empty(); - else { - rounding rnd; - low = rnd.conv_down(v); - up = rnd.conv_up (v); - } - return *this; -} - -template inline -interval &interval::operator=(interval const &r) -{ - low = r.lower(); - up = r.upper(); - return *this; -} - -template template inline -interval &interval::operator=(interval const &r) -{ - typedef typename Policies1::checking checking1; - if (checking1::is_empty(r.lower(), r.upper())) set_empty(); - else { - low = r.lower(); - up = r.upper(); - } - return *this; -} - -template template inline -interval &interval::operator=(interval const &r) -{ - typedef typename Policies1::checking checking1; - if (checking1::is_empty(r.lower(), r.upper())) set_empty(); - else { - rounding rnd; - low = rnd.conv_down(r.lower()); - up = rnd.conv_up (r.upper()); - } - return *this; -} - -template inline -void interval::assign(const T& l, const T& u) -{ - if (checking::is_nan(l) || checking::is_nan(u) || !(l <= u)) - set_empty(); - else set(l, u); -} - -template inline -void interval::set(const T& l, const T& u) -{ - low = l; - up = u; -} - -template inline -void interval::set_empty() -{ - low = checking::empty_lower(); - up = checking::empty_upper(); -} - -template inline -void interval::set_whole() -{ - low = checking::neg_inf(); - up = checking::pos_inf(); -} - -template inline -interval interval::hull(const T& x, const T& y) -{ - bool bad_x = checking::is_nan(x); - bool bad_y = checking::is_nan(y); - if (bad_x) - if (bad_y) return interval::empty(); - else return interval(y, y, true); - else - if (bad_y) return interval(x, x, true); - if (x <= y) return interval(x, y, true); - else return interval(y, x, true); -} - -template inline -interval interval::empty() -{ - return interval(checking::empty_lower(), - checking::empty_upper(), true); -} - -template inline -interval interval::whole() -{ - return interval(checking::neg_inf(), checking::pos_inf(), true); -} - -template inline -const T& interval::lower() const -{ - return low; -} - -template inline -const T& interval::upper() const -{ - return up; -} - -/* - * interval/interval comparisons - */ - -template inline -bool interval::operator< (const interval_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (up < r.low) return true; - else if (low >= r.up) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator> (const interval_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (low > r.up) return true; - else if (up <= r.low) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator<= (const interval_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (up <= r.low) return true; - else if (low > r.up) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator>= (const interval_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (low >= r.up) return true; - else if (up < r.low) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator== (const interval_holder& r) const -{ - if (!checking::is_empty(low, up)) { -//Boost bug ? if (up == r.low && low == r.up) return true; - if (up == r.up && low == r.low) return true; - else if (up < r.low || low > r.up) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator!= (const interval_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (up < r.low || low > r.up) return true; - else if (up == r.low && low == r.up) return false; - } - throw interval_lib::comparison_error(); -} - -/* - * interval/number comparisons - */ - -template inline -bool interval::operator< (const number_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (up < r.val) return true; - else if (low >= r.val) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator> (const number_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (low > r.val) return true; - else if (up <= r.val) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator<= (const number_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (up <= r.val) return true; - else if (low > r.val) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator>= (const number_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (low >= r.val) return true; - else if (up < r.val) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator== (const number_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (up == r.val && low == r.val) return true; - else if (up < r.val || low > r.val) return false; - } - throw interval_lib::comparison_error(); -} - -template inline -bool interval::operator!= (const number_holder& r) const -{ - if (!checking::is_empty(low, up)) { - if (up < r.val || low > r.val) return true; - else if (up == r.val && low == r.val) return false; - } - throw interval_lib::comparison_error(); -} - -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_INTERVAL_HPP diff --git a/gecode/third-party/boost/numeric/interval/policies.hpp b/gecode/third-party/boost/numeric/interval/policies.hpp deleted file mode 100644 index 6e151560fd..0000000000 --- a/gecode/third-party/boost/numeric/interval/policies.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/* Boost interval/policies.hpp template implementation file - * - * Copyright 2003 Guillaume Melquiond - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_POLICIES_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_POLICIES_HPP - -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -/* - * policies class - */ - -template -struct policies -{ - typedef Rounding rounding; - typedef Checking checking; -}; - -/* - * policies switching classes - */ - -template -class change_rounding -{ - typedef typename OldInterval::base_type T; - typedef typename OldInterval::traits_type p; - typedef typename p::checking checking; -public: - typedef interval > type; -}; - -template -class change_checking -{ - typedef typename OldInterval::base_type T; - typedef typename OldInterval::traits_type p; - typedef typename p::rounding rounding; -public: - typedef interval > type; -}; - -/* - * Protect / unprotect: control whether the rounding mode is set/reset - * at each operation, rather than once and for all. - */ - -template -class unprotect -{ - typedef typename OldInterval::base_type T; - typedef typename OldInterval::traits_type p; - typedef typename p::rounding r; - typedef typename r::unprotected_rounding newRounding; -public: - typedef typename change_rounding::type type; -}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_POLICIES_HPP diff --git a/gecode/third-party/boost/numeric/interval/rounded_arith.hpp b/gecode/third-party/boost/numeric/interval/rounded_arith.hpp deleted file mode 100644 index 1f61622e62..0000000000 --- a/gecode/third-party/boost/numeric/interval/rounded_arith.hpp +++ /dev/null @@ -1,146 +0,0 @@ -/* Boost interval/rounded_arith.hpp template implementation file - * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_ROUNDED_ARITH_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_ROUNDED_ARITH_HPP - -#include -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -/* - * Three classes of rounding: exact, std, opp - * See documentation for details. - */ - -template -struct rounded_arith_exact: Rounding { - void init() { } - template T conv_down(U const &v) { return v; } - template T conv_up (U const &v) { return v; } - T add_down (const T& x, const T& y) { return x + y; } - T add_up (const T& x, const T& y) { return x + y; } - T sub_down (const T& x, const T& y) { return x - y; } - T sub_up (const T& x, const T& y) { return x - y; } - T mul_down (const T& x, const T& y) { return x * y; } - T mul_up (const T& x, const T& y) { return x * y; } - T div_down (const T& x, const T& y) { return x / y; } - T div_up (const T& x, const T& y) { return x / y; } - T median (const T& x, const T& y) { return (x + y) / 2; } - T sqrt_down(const T& x) - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(sqrt); return sqrt(x); } - T sqrt_up (const T& x) - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(sqrt); return sqrt(x); } - T int_down (const T& x) - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(floor); return floor(x); } - T int_up (const T& x) - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(ceil); return ceil(x); } -}; - -template -struct rounded_arith_std: Rounding { -# define GECODE_BOOST_DN(EXPR) this->downward(); return this->force_rounding(EXPR) -# define GECODE_BOOST_NR(EXPR) this->to_nearest(); return this->force_rounding(EXPR) -# define GECODE_BOOST_UP(EXPR) this->upward(); return this->force_rounding(EXPR) - void init() { } - template T conv_down(U const &v) { GECODE_BOOST_DN(v); } - template T conv_up (U const &v) { GECODE_BOOST_UP(v); } - T add_down(const T& x, const T& y) { GECODE_BOOST_DN(x + y); } - T sub_down(const T& x, const T& y) { GECODE_BOOST_DN(x - y); } - T mul_down(const T& x, const T& y) { GECODE_BOOST_DN(x * y); } - T div_down(const T& x, const T& y) { GECODE_BOOST_DN(x / y); } - T add_up (const T& x, const T& y) { GECODE_BOOST_UP(x + y); } - T sub_up (const T& x, const T& y) { GECODE_BOOST_UP(x - y); } - T mul_up (const T& x, const T& y) { GECODE_BOOST_UP(x * y); } - T div_up (const T& x, const T& y) { GECODE_BOOST_UP(x / y); } - T median(const T& x, const T& y) { GECODE_BOOST_NR((x + y) / 2); } - T sqrt_down(const T& x) - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(sqrt); GECODE_BOOST_DN(sqrt(x)); } - T sqrt_up (const T& x) - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(sqrt); GECODE_BOOST_UP(sqrt(x)); } - T int_down(const T& x) { this->downward(); return this->to_int(x); } - T int_up (const T& x) { this->upward(); return this->to_int(x); } -# undef GECODE_BOOST_DN -# undef GECODE_BOOST_NR -# undef GECODE_BOOST_UP -}; - -template -struct rounded_arith_opp: Rounding { - void init() { this->upward(); } -# define GECODE_BOOST_DN(EXPR) \ - this->downward(); \ - T r = this->force_rounding(EXPR); \ - this->upward(); \ - return r -# define GECODE_BOOST_NR(EXPR) \ - this->to_nearest(); \ - T r = this->force_rounding(EXPR); \ - this->upward(); \ - return r -# define GECODE_BOOST_UP(EXPR) return this->force_rounding(EXPR) -# define GECODE_BOOST_UP_NEG(EXPR) return -this->force_rounding(EXPR) - template T conv_down(U const &v) { GECODE_BOOST_UP_NEG(-v); } - template T conv_up (U const &v) { GECODE_BOOST_UP(v); } - // Gecode: the negated operand passes through negate_opaque. Otherwise - // the compiler may fuse the negation into the rounded operation, which is - // only valid under round-to-nearest. For example, clang on AArch64 turns - // x * (-y) into fnmul, which negates after rounding, so mul_down returned - // the upward-rounded product. MSVC 2015 and 2017 on x64 did the same - // for x * (-y) and x / (-y). - T negate_opaque(const T& x) { -#if defined(__GNUC__) && defined(__aarch64__) - // An empty asm hides the value without a memory round trip. - T r = -x; - __asm__("" : "+w"(r)); - return r; -#elif defined(__GNUC__) && defined(__x86_64__) - // The same barrier on an SSE register. - T r = -x; - __asm__("" : "+x"(r)); - return r; -#else - // Elsewhere, MSVC included (no inline asm on x64), the volatile round - // trip is the barrier. - return this->force_rounding(-x); -#endif - } - T add_down(const T& x, const T& y) - { GECODE_BOOST_UP_NEG(negate_opaque(x) - y); } - T sub_down(const T& x, const T& y) { GECODE_BOOST_UP_NEG(y - x); } - T mul_down(const T& x, const T& y) - { GECODE_BOOST_UP_NEG(x * negate_opaque(y)); } - T div_down(const T& x, const T& y) - { GECODE_BOOST_UP_NEG(x / negate_opaque(y)); } - T add_up (const T& x, const T& y) { GECODE_BOOST_UP(x + y); } - T sub_up (const T& x, const T& y) { GECODE_BOOST_UP(x - y); } - T mul_up (const T& x, const T& y) { GECODE_BOOST_UP(x * y); } - T div_up (const T& x, const T& y) { GECODE_BOOST_UP(x / y); } - T median (const T& x, const T& y) { GECODE_BOOST_NR((x + y) / 2); } - T sqrt_down(const T& x) - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(sqrt); GECODE_BOOST_DN(sqrt(x)); } - T sqrt_up (const T& x) - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(sqrt); GECODE_BOOST_UP(sqrt(x)); } - T int_down(const T& x) { return -this->to_int(-x); } - T int_up (const T& x) { return this->to_int(x); } -# undef GECODE_BOOST_DN -# undef GECODE_BOOST_NR -# undef GECODE_BOOST_UP -# undef GECODE_BOOST_UP_NEG -}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_ROUNDED_ARITH_HPP diff --git a/gecode/third-party/boost/numeric/interval/rounded_transc.hpp b/gecode/third-party/boost/numeric/interval/rounded_transc.hpp deleted file mode 100644 index 23c806a0fb..0000000000 --- a/gecode/third-party/boost/numeric/interval/rounded_transc.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/* Boost interval/rounded_transc.hpp template implementation file - * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_ROUNDED_TRANSC_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_ROUNDED_TRANSC_HPP - -#include -#include -#include - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -template -struct rounded_transc_exact: Rounding -{ -# define GECODE_BOOST_NUMERIC_INTERVAL_new_func(f) \ - T f##_down(const T& x) { GECODE_BOOST_NUMERIC_INTERVAL_using_math(f); return f(x); } \ - T f##_up (const T& x) { GECODE_BOOST_NUMERIC_INTERVAL_using_math(f); return f(x); } - GECODE_BOOST_NUMERIC_INTERVAL_new_func(exp) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(log) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(sin) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(cos) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(tan) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(asin) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(acos) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(atan) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(sinh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(cosh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(tanh) -# undef GECODE_BOOST_NUMERIC_INTERVAL_new_func -# define GECODE_BOOST_NUMERIC_INTERVAL_new_func(f) \ - T f##_down(const T& x) { GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(f); return f(x); } \ - T f##_up (const T& x) { GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(f); return f(x); } - GECODE_BOOST_NUMERIC_INTERVAL_new_func(asinh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(acosh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(atanh) -# undef GECODE_BOOST_NUMERIC_INTERVAL_new_func -}; - -template -struct rounded_transc_std: Rounding -{ -# define GECODE_BOOST_NUMERIC_INTERVAL_new_func(f) \ - T f##_down(const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(f); \ - this->downward(); return this->force_rounding(f(x)); } \ - T f##_up (const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(f); \ - this->upward(); return this->force_rounding(f(x)); } - GECODE_BOOST_NUMERIC_INTERVAL_new_func(exp) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(log) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(sin) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(cos) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(tan) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(asin) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(acos) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(atan) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(sinh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(cosh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(tanh) -# undef GECODE_BOOST_NUMERIC_INTERVAL_new_func -# define GECODE_BOOST_NUMERIC_INTERVAL_new_func(f) \ - T f##_down(const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(f); \ - this->downward(); return this->force_rounding(f(x)); } \ - T f##_up (const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(f); \ - this->upward(); return this->force_rounding(f(x)); } - GECODE_BOOST_NUMERIC_INTERVAL_new_func(asinh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(acosh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(atanh) -# undef GECODE_BOOST_NUMERIC_INTERVAL_new_func -}; - -template -struct rounded_transc_opp: Rounding -{ -# define GECODE_BOOST_NUMERIC_INTERVAL_new_func(f) \ - T f##_down(const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(f); \ - this->downward(); T y = this->force_rounding(f(x)); \ - this->upward(); return y; } \ - T f##_up (const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(f); \ - return this->force_rounding(f(x)); } - GECODE_BOOST_NUMERIC_INTERVAL_new_func(exp) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(log) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(cos) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(acos) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(cosh) -# undef GECODE_BOOST_NUMERIC_INTERVAL_new_func -# define GECODE_BOOST_NUMERIC_INTERVAL_new_func(f) \ - T f##_down(const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(f); \ - return -this->force_rounding(-f(x)); } \ - T f##_up (const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_math(f); \ - return this->force_rounding(f(x)); } - GECODE_BOOST_NUMERIC_INTERVAL_new_func(sin) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(tan) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(asin) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(atan) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(sinh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(tanh) -# undef GECODE_BOOST_NUMERIC_INTERVAL_new_func -# define GECODE_BOOST_NUMERIC_INTERVAL_new_func(f) \ - T f##_down(const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(f); \ - this->downward(); T y = this->force_rounding(f(x)); \ - this->upward(); return y; } \ - T f##_up (const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(f); \ - return this->force_rounding(f(x)); } - GECODE_BOOST_NUMERIC_INTERVAL_new_func(asinh) - GECODE_BOOST_NUMERIC_INTERVAL_new_func(atanh) -# undef GECODE_BOOST_NUMERIC_INTERVAL_new_func -# define GECODE_BOOST_NUMERIC_INTERVAL_new_func(f) \ - T f##_down(const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(f); \ - return -this->force_rounding(-f(x)); } \ - T f##_up (const T& x) \ - { GECODE_BOOST_NUMERIC_INTERVAL_using_ahyp(f); \ - return this->force_rounding(f(x)); } - GECODE_BOOST_NUMERIC_INTERVAL_new_func(acosh) -# undef GECODE_BOOST_NUMERIC_INTERVAL_new_func -}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_ROUNDED_TRANSC_HPP diff --git a/gecode/third-party/boost/numeric/interval/rounding.hpp b/gecode/third-party/boost/numeric/interval/rounding.hpp deleted file mode 100644 index 13449470e0..0000000000 --- a/gecode/third-party/boost/numeric/interval/rounding.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/* Boost interval/rounding.hpp template implementation file - * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_ROUNDING_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_ROUNDING_HPP - -namespace gecode_boost { -namespace numeric { -namespace interval_lib { - -/* - * Default rounding_control class (does nothing) - */ - -template -struct rounding_control -{ - typedef int rounding_mode; - static void get_rounding_mode(rounding_mode&) {} - static void set_rounding_mode(rounding_mode) {} - static void upward() {} - static void downward() {} - static void to_nearest() {} - static const T& to_int(const T& x) { return x; } - static const T& force_rounding(const T& x) { return x; } -}; - -/* - * A few rounding control classes (exact/std/opp: see documentation) - * rounded_arith_* control the rounding of the arithmetic operators - * rounded_transc_* control the rounding of the transcendental functions - */ - -template > -struct rounded_arith_exact; - -template > -struct rounded_arith_std; - -template > -struct rounded_arith_opp; - -template -struct rounded_transc_dummy; - -template > -struct rounded_transc_exact; - -template > -struct rounded_transc_std; - -template > -struct rounded_transc_opp; - -/* - * State-saving classes: allow to set and reset rounding control - */ - -namespace detail { - -template -struct save_state_unprotected: Rounding -{ - typedef save_state_unprotected unprotected_rounding; -}; - -} // namespace detail - -template -struct save_state: Rounding -{ - typename Rounding::rounding_mode mode; - save_state() { - this->get_rounding_mode(mode); - this->init(); - } - ~save_state() { this->set_rounding_mode(mode); } - typedef detail::save_state_unprotected unprotected_rounding; -}; - -template -struct save_state_nothing: Rounding -{ - typedef save_state_nothing unprotected_rounding; -}; - -template -struct rounded_math: save_state_nothing > -{}; - -} // namespace interval_lib -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_ROUNDING_HPP diff --git a/gecode/third-party/boost/numeric/interval/transc.hpp b/gecode/third-party/boost/numeric/interval/transc.hpp deleted file mode 100644 index 746e869500..0000000000 --- a/gecode/third-party/boost/numeric/interval/transc.hpp +++ /dev/null @@ -1,232 +0,0 @@ -/* Boost interval/transc.hpp template implementation file - * - * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_TRANSC_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_TRANSC_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace gecode_boost { -namespace numeric { - -template inline -interval exp(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.exp_down(x.lower()), rnd.exp_up(x.upper()), true); -} - -template inline -interval log(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x) || - !interval_lib::user::is_pos(x.upper())) - return I::empty(); - typename Policies::rounding rnd; - typedef typename Policies::checking checking; - T l = !interval_lib::user::is_pos(x.lower()) - ? checking::neg_inf() : rnd.log_down(x.lower()); - return I(l, rnd.log_up(x.upper()), true); -} - -template inline -interval cos(const interval& x) -{ - if (interval_lib::detail::test_input(x)) - return interval::empty(); - typename Policies::rounding rnd; - typedef interval I; - typedef typename interval_lib::unprotect::type R; - - // get lower bound within [0, pi] - const R pi2 = interval_lib::pi_twice(); - R tmp = fmod((const R&)x, pi2); - if (width(tmp) >= pi2.lower()) - return I(static_cast(-1), static_cast(1), true); // we are covering a full period - if (tmp.lower() >= interval_lib::constants::pi_upper()) - return -cos(tmp - interval_lib::pi()); - T l = tmp.lower(); - T u = tmp.upper(); - - GECODE_BOOST_USING_STD_MIN(); - // separate into monotone subintervals - if (u <= interval_lib::constants::pi_lower()) - return I(rnd.cos_down(u), rnd.cos_up(l), true); - else if (u <= pi2.lower()) - return I(static_cast(-1), rnd.cos_up(min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(rnd.sub_down(pi2.lower(), u), l)), true); - else - return I(static_cast(-1), static_cast(1), true); -} - -template inline -interval sin(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - typedef typename interval_lib::unprotect::type R; - I r = cos((const R&)x - interval_lib::pi_half()); - (void)&rnd; - return r; -} - -template inline -interval tan(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - typedef typename interval_lib::unprotect::type R; - - // get lower bound within [-pi/2, pi/2] - const R pi = interval_lib::pi(); - R tmp = fmod((const R&)x, pi); - const T pi_half_d = interval_lib::constants::pi_half_lower(); - if (tmp.lower() >= pi_half_d) - tmp -= pi; - if (tmp.lower() <= -pi_half_d || tmp.upper() >= pi_half_d) - return I::whole(); - return I(rnd.tan_down(tmp.lower()), rnd.tan_up(tmp.upper()), true); -} - -template inline -interval asin(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x) - || x.upper() < static_cast(-1) || x.lower() > static_cast(1)) - return I::empty(); - typename Policies::rounding rnd; - T l = (x.lower() <= static_cast(-1)) - ? -interval_lib::constants::pi_half_upper() - : rnd.asin_down(x.lower()); - T u = (x.upper() >= static_cast(1) ) - ? interval_lib::constants::pi_half_upper() - : rnd.asin_up (x.upper()); - return I(l, u, true); -} - -template inline -interval acos(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x) - || x.upper() < static_cast(-1) || x.lower() > static_cast(1)) - return I::empty(); - typename Policies::rounding rnd; - T l = (x.upper() >= static_cast(1) ) - ? static_cast(0) - : rnd.acos_down(x.upper()); - T u = (x.lower() <= static_cast(-1)) - ? interval_lib::constants::pi_upper() - : rnd.acos_up (x.lower()); - return I(l, u, true); -} - -template inline -interval atan(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.atan_down(x.lower()), rnd.atan_up(x.upper()), true); -} - -template inline -interval sinh(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.sinh_down(x.lower()), rnd.sinh_up(x.upper()), true); -} - -template inline -interval cosh(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - if (interval_lib::user::is_neg(x.upper())) - return I(rnd.cosh_down(x.upper()), rnd.cosh_up(x.lower()), true); - else if (!interval_lib::user::is_neg(x.lower())) - return I(rnd.cosh_down(x.lower()), rnd.cosh_up(x.upper()), true); - else - return I(static_cast(1), rnd.cosh_up(-x.lower() > x.upper() ? x.lower() : x.upper()), true); -} - -template inline -interval tanh(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.tanh_down(x.lower()), rnd.tanh_up(x.upper()), true); -} - -template inline -interval asinh(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - typename Policies::rounding rnd; - return I(rnd.asinh_down(x.lower()), rnd.asinh_up(x.upper()), true); -} - -template inline -interval acosh(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x) || x.upper() < static_cast(1)) - return I::empty(); - typename Policies::rounding rnd; - T l = x.lower() <= static_cast(1) ? static_cast(0) : rnd.acosh_down(x.lower()); - return I(l, rnd.acosh_up(x.upper()), true); -} - -template inline -interval atanh(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x) - || x.upper() < static_cast(-1) || x.lower() > static_cast(1)) - return I::empty(); - typename Policies::rounding rnd; - typedef typename Policies::checking checking; - T l = (x.lower() <= static_cast(-1)) - ? checking::neg_inf() : rnd.atanh_down(x.lower()); - T u = (x.upper() >= static_cast(1) ) - ? checking::pos_inf() : rnd.atanh_up (x.upper()); - return I(l, u, true); -} - -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_TRANSC_HPP diff --git a/gecode/third-party/boost/numeric/interval/utility.hpp b/gecode/third-party/boost/numeric/interval/utility.hpp deleted file mode 100644 index 5335d5db31..0000000000 --- a/gecode/third-party/boost/numeric/interval/utility.hpp +++ /dev/null @@ -1,336 +0,0 @@ -/* Boost interval/utility.hpp template implementation file - * - * Copyright 2000 Jens Maurer - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef GECODE_BOOST_NUMERIC_INTERVAL_UTILITY_HPP -#define GECODE_BOOST_NUMERIC_INTERVAL_UTILITY_HPP - -#include -#include -#include -#include -#include -#include - -/* - * Implementation of simple functions - */ - -namespace gecode_boost { -namespace numeric { - -/* - * Utility Functions - */ - -template inline -const T& lower(const interval& x) -{ - return x.lower(); -} - -template inline -const T& upper(const interval& x) -{ - return x.upper(); -} - -template inline -T checked_lower(const interval& x) -{ - if (empty(x)) { - typedef typename Policies::checking checking; - return checking::nan(); - } - return x.lower(); -} - -template inline -T checked_upper(const interval& x) -{ - if (empty(x)) { - typedef typename Policies::checking checking; - return checking::nan(); - } - return x.upper(); -} - -template inline -T width(const interval& x) -{ - if (interval_lib::detail::test_input(x)) return static_cast(0); - typename Policies::rounding rnd; - return rnd.sub_up(x.upper(), x.lower()); -} - -template inline -T median(const interval& x) -{ - if (interval_lib::detail::test_input(x)) { - typedef typename Policies::checking checking; - return checking::nan(); - } - typename Policies::rounding rnd; - return rnd.median(x.lower(), x.upper()); -} - -template inline -interval widen(const interval& x, const T& v) -{ - if (interval_lib::detail::test_input(x)) - return interval::empty(); - typename Policies::rounding rnd; - return interval(rnd.sub_down(x.lower(), v), - rnd.add_up (x.upper(), v), true); -} - -/* - * Set-like operations - */ - -template inline -bool empty(const interval& x) -{ - return interval_lib::detail::test_input(x); -} - -template inline -bool zero_in(const interval& x) -{ - if (interval_lib::detail::test_input(x)) return false; - return (!interval_lib::user::is_pos(x.lower())) && - (!interval_lib::user::is_neg(x.upper())); -} - -template inline -bool in_zero(const interval& x) // DEPRECATED -{ - return zero_in(x); -} - -template inline -bool in(const T& x, const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) return false; - return y.lower() <= x && x <= y.upper(); -} - -template inline -bool subset(const interval& x, - const interval& y) -{ - if (empty(x)) return true; - return !empty(y) && y.lower() <= x.lower() && x.upper() <= y.upper(); -} - -template inline -bool proper_subset(const interval& x, - const interval& y) -{ - if (empty(y)) return false; - if (empty(x)) return true; - return y.lower() <= x.lower() && x.upper() <= y.upper() && - (y.lower() != x.lower() || x.upper() != y.upper()); -} - -template inline -bool overlap(const interval& x, - const interval& y) -{ - if (interval_lib::detail::test_input(x, y)) return false; - return (x.lower() <= y.lower() && y.lower() <= x.upper()) || - (y.lower() <= x.lower() && x.lower() <= y.upper()); -} - -template inline -bool singleton(const interval& x) -{ - return !empty(x) && x.lower() == x.upper(); -} - -template inline -bool equal(const interval& x, const interval& y) -{ - if (empty(x)) return empty(y); - return !empty(y) && x.lower() == y.lower() && x.upper() == y.upper(); -} - -template inline -interval intersect(const interval& x, - const interval& y) -{ - GECODE_BOOST_USING_STD_MIN(); - GECODE_BOOST_USING_STD_MAX(); - if (interval_lib::detail::test_input(x, y)) - return interval::empty(); - const T& l = max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.lower(), y.lower()); - const T& u = min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.upper(), y.upper()); - if (l <= u) return interval(l, u, true); - else return interval::empty(); -} - -template inline -interval hull(const interval& x, - const interval& y) -{ - GECODE_BOOST_USING_STD_MIN(); - GECODE_BOOST_USING_STD_MAX(); - bool bad_x = interval_lib::detail::test_input(x); - bool bad_y = interval_lib::detail::test_input(y); - if (bad_x) - if (bad_y) return interval::empty(); - else return y; - else - if (bad_y) return x; - return interval(min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.lower(), y.lower()), - max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.upper(), y.upper()), true); -} - -template inline -interval hull(const interval& x, const T& y) -{ - GECODE_BOOST_USING_STD_MIN(); - GECODE_BOOST_USING_STD_MAX(); - bool bad_x = interval_lib::detail::test_input(x); - bool bad_y = interval_lib::detail::test_input(y); - if (bad_y) - if (bad_x) return interval::empty(); - else return x; - else - if (bad_x) return interval(y, y, true); - return interval(min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.lower(), y), - max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.upper(), y), true); -} - -template inline -interval hull(const T& x, const interval& y) -{ - GECODE_BOOST_USING_STD_MIN(); - GECODE_BOOST_USING_STD_MAX(); - bool bad_x = interval_lib::detail::test_input(x); - bool bad_y = interval_lib::detail::test_input(y); - if (bad_x) - if (bad_y) return interval::empty(); - else return y; - else - if (bad_y) return interval(x, x, true); - return interval(min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x, y.lower()), - max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x, y.upper()), true); -} - -template inline -interval hull(const T& x, const T& y) -{ - return interval::hull(x, y); -} - -template inline -std::pair, interval > -bisect(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return std::pair(I::empty(), I::empty()); - const T m = median(x); - return std::pair(I(x.lower(), m, true), I(m, x.upper(), true)); -} - -/* - * Elementary functions - */ - -template inline -T norm(const interval& x) -{ - if (interval_lib::detail::test_input(x)) { - typedef typename Policies::checking checking; - return checking::nan(); - } - GECODE_BOOST_USING_STD_MAX(); - return max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(static_cast(-x.lower()), x.upper()); -} - -template inline -interval abs(const interval& x) -{ - typedef interval I; - if (interval_lib::detail::test_input(x)) - return I::empty(); - if (!interval_lib::user::is_neg(x.lower())) return x; - if (!interval_lib::user::is_pos(x.upper())) return -x; - GECODE_BOOST_USING_STD_MAX(); - return I(static_cast(0), max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(static_cast(-x.lower()), x.upper()), true); -} - -template inline -interval max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (const interval& x, - const interval& y) -{ - typedef interval I; - if (interval_lib::detail::test_input(x, y)) - return I::empty(); - GECODE_BOOST_USING_STD_MAX(); - return I(max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.lower(), y.lower()), max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.upper(), y.upper()), true); -} - -template inline -interval max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (const interval& x, const T& y) -{ - typedef interval I; - if (interval_lib::detail::test_input(x, y)) - return I::empty(); - GECODE_BOOST_USING_STD_MAX(); - return I(max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.lower(), y), max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.upper(), y), true); -} - -template inline -interval max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (const T& x, const interval& y) -{ - typedef interval I; - if (interval_lib::detail::test_input(x, y)) - return I::empty(); - GECODE_BOOST_USING_STD_MAX(); - return I(max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x, y.lower()), max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x, y.upper()), true); -} - -template inline -interval min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (const interval& x, - const interval& y) -{ - typedef interval I; - if (interval_lib::detail::test_input(x, y)) - return I::empty(); - GECODE_BOOST_USING_STD_MIN(); - return I(min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.lower(), y.lower()), min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.upper(), y.upper()), true); -} - -template inline -interval min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (const interval& x, const T& y) -{ - typedef interval I; - if (interval_lib::detail::test_input(x, y)) - return I::empty(); - GECODE_BOOST_USING_STD_MIN(); - return I(min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.lower(), y), min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.upper(), y), true); -} - -template inline -interval min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION (const T& x, const interval& y) -{ - typedef interval I; - if (interval_lib::detail::test_input(x, y)) - return I::empty(); - GECODE_BOOST_USING_STD_MIN(); - return I(min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x, y.lower()), min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x, y.upper()), true); -} - -} // namespace numeric -} // namespace gecode_boost - -#endif // GECODE_BOOST_NUMERIC_INTERVAL_UTILITY_HPP diff --git a/gecode/third-party/boost/patch.txt b/gecode/third-party/boost/patch.txt deleted file mode 100644 index 2f4ba9dd2f..0000000000 --- a/gecode/third-party/boost/patch.txt +++ /dev/null @@ -1,16 +0,0 @@ -diff -u -r boost/numeric/interval/detail/msvc_rounding_control.hpp /cygdrive/c/Users/schulte/boost/numeric/interval/detail/msvc_rounding_control.hpp ---- boost/numeric/interval/detail/msvc_rounding_control.hpp 2010-11-10 16:52:44.696786200 +0100 -+++ /cygdrive/c/Users/schulte/boost/numeric/interval/detail/msvc_rounding_control.hpp 2010-11-10 16:01:56.730082700 +0100 -@@ -79,7 +79,11 @@ - static void get_rounding_mode(rounding_mode& mode) - { mode = msvc2hard(_control87(0, 0)); } - static void set_rounding_mode(const rounding_mode mode) -+#if defined(_M_X64) || defined(_M_IA64) -+ { _control87(hard2msvc(mode), _MCW_EM | _MCW_RC ); } -+#else - { _control87(hard2msvc(mode), _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC); } -+#endif - static double to_int(const double& x) { return rint(x); } - }; - - diff --git a/gecode/third-party/boost/type.hpp b/gecode/third-party/boost/type.hpp deleted file mode 100644 index 35da45a506..0000000000 --- a/gecode/third-party/boost/type.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// (C) Copyright David Abrahams 2001. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef GECODE_BOOST_TYPE_DWA20010120_HPP -# define GECODE_BOOST_TYPE_DWA20010120_HPP - -namespace gecode_boost { - - // Just a simple "type envelope". Useful in various contexts, mostly to work - // around some MSVC deficiencies. - template - struct type {}; - -} - -#endif // GECODE_BOOST_TYPE_DWA20010120_HPP diff --git a/misc/check.py b/misc/check.py index e5be24fbe3..5b208c4dfa 100644 --- a/misc/check.py +++ b/misc/check.py @@ -60,7 +60,6 @@ def owned_files() -> list[Path]: for name in sorted(set(output.decode().split("\0"))): path = Path(name) if (path.suffix in SOURCE_SUFFIXES | HEADER_SUFFIXES - and not name.startswith("gecode/third-party/") and name not in GENERATED_PARSER and (ROOT / path).is_file()): files.append(path) @@ -115,7 +114,7 @@ def lint(build_dir: Path, jobs: int, *, report_missing: bool = True) -> None: def path_pattern(path: Path) -> str: return separator.join(re.escape(part) for part in path.as_posix().split("/")) - excluded_sources = path_pattern(Path("gecode/third-party")) + separator + "|" + "|".join( + excluded_sources = "|".join( path_pattern(Path(path)) + "$" for path in sorted(GENERATED_PARSER) ) owned_directory = "(gecode|test|examples|tools)" + separator @@ -124,8 +123,7 @@ def path_pattern(path: Path) -> str: # LLVM header filters use POSIX regular expressions, without lookarounds. header_filter = path_pattern(ROOT) + separator + owned_directory generated_headers = path_pattern(build_dir / "gecode/kernel") + separator + r"var-(type|imp)\.hpp$" - exclude_filter = (separator + path_pattern(Path("gecode/third-party")) + separator - + "|" + separator + path_pattern(Path("gecode/flatzinc")) + exclude_filter = (separator + path_pattern(Path("gecode/flatzinc")) + separator + r"(parser\.tab\.(cpp|hpp)|lexer\.yy\.cpp)$") runner_command = [sys.executable, runner] if os.name == "nt" else [runner] run([*runner_command, "-clang-tidy-binary", tidy, "-config-file", str(configuration), diff --git a/test/array.cpp b/test/array.cpp index 439910ff1e..22058860c1 100644 --- a/test/array.cpp +++ b/test/array.cpp @@ -106,6 +106,7 @@ namespace Test { #ifdef GECODE_HAS_FLOAT_VARS // A float value is two bounds and stays trivially copyable. static_assert(std::is_trivially_copyable_v); + static_assert(std::is_trivially_copyable_v); #endif /* diff --git a/test/float/interval-oracle.cpp b/test/float/interval-oracle.cpp deleted file mode 100644 index dcb522e744..0000000000 --- a/test/float/interval-oracle.cpp +++ /dev/null @@ -1,626 +0,0 @@ -/* - * Main authors: - * Mikael Zayenz Lagerkvist - * - * Copyright: - * Mikael Zayenz Lagerkvist, 2026 - * - * This file is part of Gecode, the generic constraint - * development environment: - * http://www.gecode.dev - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/* - * Temporary differential test: FloatVal, and Float::Interval where FloatVal - * does not forward to it, against the vendored Boost interval that FloatVal - * used before. It is removed together with the Boost copy. - * - */ - -#include "test/float.hh" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Test { namespace Float { namespace { - - using Gecode::FloatNum; - using Gecode::FloatVal; - using Gecode::Float::Interval; - - /// Boost's rounding interface over Gecode's rounding operations and mode control - class ReferenceRounding : public Gecode::Float::RoundingBase { - public: - /// Rounding mode, as Boost's save_state stores it - typedef Mode rounding_mode; - /// Store the current rounding mode in \a m - static void - get_rounding_mode(rounding_mode& m) { - m = current_mode(); - } - /// Restore rounding mode \a m - static void - set_rounding_mode(rounding_mode m) { - restore_mode(m); - } - using RoundingBase::init; - }; - - /// FloatVal's former implementation type, which gives the expected results - using Reference = - gecode_boost::numeric::interval, - gecode_boost::numeric::interval_lib::checking_strict>>; - - namespace reference = gecode_boost::numeric; - - /// Bounds of an operand interval - struct Bounds { - FloatNum lower; - FloatNum upper; - }; - - /// Return the operand numbers: infinities, extreme normals, - /// denormals, signed zeros, inexact decimals, a 1-ulp neighbour, and NaN - std::vector - grid_numbers(void) { - const FloatNum inf = std::numeric_limits::infinity(); - const FloatNum max_normal = std::numeric_limits::max(); - const FloatNum min_normal = std::numeric_limits::min(); - const FloatNum denorm = std::numeric_limits::denorm_min(); - const FloatNum nan = std::numeric_limits::quiet_NaN(); - return {-inf, -max_normal, -1e5, -3.0, -1.0, - -0.1, -min_normal, -denorm, -0.0, 0.0, - denorm, min_normal, 0.1, 1.0, std::nextafter(1.0, 2.0), - 2.0, 3.0, 7.0, 1e5, max_normal, - inf, nan}; - } - - /// Return the operand intervals: every non-NaN singleton, ranges - /// straddling or touching zero, infinite and extreme bounds, tight - /// intervals, \f$[0,-0]\f$, and the NaN singleton - std::vector - grid_intervals(void) { - const FloatNum inf = std::numeric_limits::infinity(); - const FloatNum max_normal = std::numeric_limits::max(); - const FloatNum min_normal = std::numeric_limits::min(); - const FloatNum denorm = std::numeric_limits::denorm_min(); - const FloatNum nan = std::numeric_limits::quiet_NaN(); - const FloatNum one_up = std::nextafter(1.0, 2.0); - std::vector v; - for (FloatNum n : grid_numbers()) - if (!std::isnan(n)) - v.push_back({n, n}); - const std::vector ranges = {{-inf, inf}, - {-inf, -1.0}, - {-inf, 0.0}, - {-inf, 0.1}, - {0.0, inf}, - {1.0, inf}, - {-max_normal, max_normal}, - {-1.0, 1.0}, - {-0.0, 0.0}, - {0.0, -0.0}, - {-1.0, 0.0}, - {0.0, 1.0}, - {-0.1, 0.1}, - {0.1, 0.3}, - {1.0, one_up}, - {1.0, 2.0}, - {2.0, 3.0}, - {-3.0, -2.0}, - {-3.0, 7.0}, - {-0.1, -0.0}, - {0.0, 0.1}, - {denorm, min_normal}, - {-denorm, denorm}, - {1e5, max_normal}, - {-max_normal, -1e5}, - {0.1, 7.0}, - {3.0, 1e5}, - {-1.0, -0.0}, - {0.5, 1.0}, - {-7.0, -0.1}}; - v.insert(v.end(), ranges.begin(), ranges.end()); - v.push_back({nan, nan}); - return v; - } - - /// What an operation produced - enum class Kind { BOUNDS, TRUTH, THROW }; - - /// Observed result of one operation in one caller mode - struct Outcome { - Kind kind = Kind::BOUNDS; - /// Bit patterns of the bounds, as bound_bits() gives them, for Kind::BOUNDS - std::uint64_t lower = 0; - std::uint64_t upper = 0; - /// Truth value, for Kind::TRUTH - bool truth = false; - /// Dynamic type of the exception, for Kind::THROW - std::type_index exception = typeid(void); - /// Whether the caller's rounding mode was unchanged afterwards - bool mode_kept = true; - bool operator==(const Outcome&) const = default; - }; - - /** - * \brief Return the bit pattern of bound \a b, without the sign of a NaN - * - * IEEE 754 leaves the sign of a NaN result unspecified. On x86-64 it - * depends on the operand order that the compiler picks, so GCC and Clang - * builds of the same code differ in it. All other bits of a NaN, its - * payload and its quiet bit, are compared. - */ - std::uint64_t - bound_bits(FloatNum b) { - return std::bit_cast(std::isnan(b) ? std::fabs(b) : b); - } - /// Return the outcome for the bounds \a l and \a u - Outcome - bounds_outcome(FloatNum l, FloatNum u) { - Outcome o; - o.lower = bound_bits(l); - o.upper = bound_bits(u); - return o; - } - /// Return the outcome for value \a x - Outcome - outcome_of(const FloatVal& x) { - return bounds_outcome(x.min(), x.max()); - } - /// Return the outcome for interval \a x - Outcome - outcome_of(const Interval& x) { - return bounds_outcome(x.lower(), x.upper()); - } - /// Return the outcome for interval \a x - Outcome - outcome_of(const Reference& x) { - return bounds_outcome(x.lower(), x.upper()); - } - /// Return the outcome for number \a n, as the bounds \f$[n,n]\f$ - Outcome - outcome_of(FloatNum n) { - return bounds_outcome(n, n); - } - /// Return the outcome for truth value \a b - Outcome - outcome_of(bool b) { - Outcome o; - o.kind = Kind::TRUTH; - o.truth = b; - return o; - } - - /// Return the outcome of \a operation in caller mode \a mode, and reset the mode - template - Outcome - observe(int mode, Operation operation) { - std::fesetround(mode); - Outcome o; - try { - o = outcome_of(operation()); - } catch (const std::exception& e) { - o.kind = Kind::THROW; - o.exception = typeid(e); - } catch (...) { - o.kind = Kind::THROW; - } - o.mode_kept = std::fegetround() == mode; - std::fesetround(FE_TONEAREST); - return o; - } - - /// Return the result of the Boost comparison \a comparison, with an uncertain result as false (as FloatVal does) - template - bool - certainly(Comparison comparison) { - try { - return comparison(); - } catch (const gecode_boost::numeric::interval_lib::comparison_error&) { - return false; - } - } - - /// Return \a n in hexadecimal floating-point notation - std::string - hex(FloatNum n) { - std::ostringstream s; - s << std::hexfloat << n; - return s.str(); - } - /// Return \a b in hexadecimal floating-point notation - std::string - hex(const Bounds& b) { - return '[' + hex(b.lower) + ',' + hex(b.upper) + ']'; - } - /// Return a readable form of \a o - std::string - text(const Outcome& o) { - std::string s; - switch (o.kind) { - case Kind::BOUNDS: - s = '[' + hex(std::bit_cast(o.lower)) + ',' + hex(std::bit_cast(o.upper)) + ']'; - break; - case Kind::TRUTH: - s = o.truth ? "true" : "false"; - break; - case Kind::THROW: - s = std::string("throw ") + o.exception.name(); - break; - } - return s + (o.mode_kept ? "" : " (mode changed)"); - } - - /// FloatVal and Float::Interval give the vendored Boost interval's results bit for bit - class MatchesBoost : public Base { - private: - /// Most mismatches to log - static constexpr int max_logged = 20; - /// Caller modes that the platform supports - std::vector modes; - /// Operands of the operations being compared, for the log - std::string operands; - /// Number of mismatches - int mismatches = 0; - - /// Compare \a candidate_op with \a reference_op in every caller mode - template - void - compare(const char* op, CandidateOp candidate_op, ReferenceOp reference_op) { - for (int mode : modes) { - const Outcome c = observe(mode, candidate_op); - const Outcome r = observe(mode, reference_op); - if ((c == r) && c.mode_kept) - continue; - if (mismatches < max_logged) - olog << "Mode " << mode << ' ' << op << ' ' << operands << ": " << text(c) << ", Boost " << text(r) - << '\n'; - mismatches++; - } - } - - /// Compare the default value and the constants - void - constants(void) { - operands = ""; - compare("default", [] { return FloatVal(); }, [] { return Reference(); }); - compare( - "pi_half", [] { return FloatVal::pi_half(); }, - [] { return reference::interval_lib::pi_half(); }); - compare("pi", [] { return FloatVal::pi(); }, [] { return reference::interval_lib::pi(); }); - compare( - "pi_twice", [] { return FloatVal::pi_twice(); }, - [] { return reference::interval_lib::pi_twice(); }); - } - /// Compare construction from \a n - void - from_number(FloatNum n) { - operands = hex(n); - compare("from_number", [&] { return FloatVal(n); }, [&] { return Reference(n); }); - compare( - "assign_number", - [&] { - FloatVal z(1.0, 2.0); - z = n; - return z; - }, - [&] { - Reference z(1.0, 2.0); - z = n; - return z; - }); - } - /// Compare construction from \a l and \a u - void - from_numbers(FloatNum l, FloatNum u) { - operands = hex(l) + ' ' + hex(u); - compare("construct", [&] { return FloatVal(l, u); }, [&] { return Reference(l, u); }); - compare( - "assign", - [&] { - FloatVal z; - z.assign(l, u); - return z; - }, - [&] { - Reference z; - z.assign(l, u); - return z; - }); - } - /// Compare the operations on one interval \a b - void - unary(const Bounds& b) { - operands = hex(b); - const FloatVal x = value_of(b); - const Reference rx = reference_of(b); - compare("pos", [&] { return +x; }, [&] { return +rx; }); - // FloatVal's negation makes zero bounds positive and was never Boost's. - const Interval ix = interval_of(b); - compare("neg", [&] { return -ix; }, [&] { return -rx; }); - compare("abs", [&] { return Gecode::abs(x); }, [&] { return reference::abs(rx); }); - compare("sqrt", [&] { return Gecode::sqrt(x); }, [&] { return reference::sqrt(rx); }); - compare("sqr", [&] { return Gecode::sqr(x); }, [&] { return reference::square(rx); }); - for (int n = -3; n <= 5; n++) { - operands = hex(b) + " pow " + std::to_string(n); - compare("pow", [&] { return Gecode::pow(x, n); }, [&] { return reference::pow(rx, n); }); - } - for (int k = 1; k <= 5; k++) { - operands = hex(b) + " root " + std::to_string(k); - compare("nroot", [&] { return Gecode::nroot(x, k); }, [&] { return reference::nth_root(rx, k); }); - } - operands = hex(b); - compare("size", [&] { return x.size(); }, [&] { return reference::width(rx); }); - compare("singleton", [&] { return x.singleton(); }, [&] { return reference::singleton(rx); }); - compare("zero_in", [&] { return x.zero_in(); }, [&] { return reference::zero_in(rx); }); -#ifdef GECODE_HAS_MPFR - compare("exp", [&] { return Gecode::exp(x); }, [&] { return reference::exp(rx); }); - compare("log", [&] { return Gecode::log(x); }, [&] { return reference::log(rx); }); - compare("sin", [&] { return Gecode::sin(x); }, [&] { return reference::sin(rx); }); - compare("cos", [&] { return Gecode::cos(x); }, [&] { return reference::cos(rx); }); - compare("tan", [&] { return Gecode::tan(x); }, [&] { return reference::tan(rx); }); - compare("asin", [&] { return Gecode::asin(x); }, [&] { return reference::asin(rx); }); - compare("acos", [&] { return Gecode::acos(x); }, [&] { return reference::acos(rx); }); - compare("atan", [&] { return Gecode::atan(x); }, [&] { return reference::atan(rx); }); - compare("sinh", [&] { return Gecode::sinh(x); }, [&] { return reference::sinh(rx); }); - compare("cosh", [&] { return Gecode::cosh(x); }, [&] { return reference::cosh(rx); }); - compare("tanh", [&] { return Gecode::tanh(x); }, [&] { return reference::tanh(rx); }); - compare("asinh", [&] { return Gecode::asinh(x); }, [&] { return reference::asinh(rx); }); - compare("acosh", [&] { return Gecode::acosh(x); }, [&] { return reference::acosh(rx); }); - compare("atanh", [&] { return Gecode::atanh(x); }, [&] { return reference::atanh(rx); }); -#endif - } - /// Compare the operations on the intervals \a a and \a b - void - binary(const Bounds& a, const Bounds& b) { - operands = hex(a) + ' ' + hex(b); - const FloatVal x = value_of(a); - const FloatVal y = value_of(b); - const Reference rx = reference_of(a); - const Reference ry = reference_of(b); - compare("add", [&] { return x + y; }, [&] { return rx + ry; }); - compare("sub", [&] { return x - y; }, [&] { return rx - ry; }); - compare("mul", [&] { return x * y; }, [&] { return rx * ry; }); - compare("div", [&] { return x / y; }, [&] { return rx / ry; }); - compare( - "add_assign", - [&] { - FloatVal z = x; - return z += y; - }, - [&] { - Reference z = rx; - return z += ry; - }); - compare( - "sub_assign", - [&] { - FloatVal z = x; - return z -= y; - }, - [&] { - Reference z = rx; - return z -= ry; - }); - compare( - "mul_assign", - [&] { - FloatVal z = x; - return z *= y; - }, - [&] { - Reference z = rx; - return z *= ry; - }); - compare( - "div_assign", - [&] { - FloatVal z = x; - return z /= y; - }, - [&] { - Reference z = rx; - return z /= ry; - }); - compare("lt", [&] { return x < y; }, [&] { return certainly([&] { return rx < ry; }); }); - compare("le", [&] { return x <= y; }, [&] { return certainly([&] { return rx <= ry; }); }); - compare("gt", [&] { return x > y; }, [&] { return certainly([&] { return rx > ry; }); }); - compare("ge", [&] { return x >= y; }, [&] { return certainly([&] { return rx >= ry; }); }); - compare("eq", [&] { return x == y; }, [&] { return certainly([&] { return rx == ry; }); }); - compare("ne", [&] { return x != y; }, [&] { return certainly([&] { return rx != ry; }); }); - compare("equal", [&] { return x == y; }, [&] { return reference::equal(rx, ry); }); - compare("max", [&] { return Gecode::max(x, y); }, [&] { return reference::max(rx, ry); }); - compare("min", [&] { return Gecode::min(x, y); }, [&] { return reference::min(rx, ry); }); - compare("subset", [&] { return Gecode::Float::subset(x, y); }, [&] { return reference::subset(rx, ry); }); - compare( - "proper_subset", [&] { return Gecode::Float::proper_subset(x, y); }, - [&] { return reference::proper_subset(rx, ry); }); - compare( - "overlap", [&] { return Gecode::Float::overlap(x, y); }, [&] { return reference::overlap(rx, ry); }); - compare( - "intersect", [&] { return Gecode::Float::intersect(x, y); }, - [&] { return reference::intersect(rx, ry); }); - compare("hull", [&] { return Gecode::Float::hull(x, y); }, [&] { return reference::hull(rx, ry); }); -#ifdef GECODE_HAS_MPFR - compare("fmod", [&] { return Gecode::fmod(x, y); }, [&] { return reference::fmod(rx, ry); }); -#else - // FloatVal has fmod only with MPFR. - const Interval ix = interval_of(a); - const Interval iy = interval_of(b); - compare("fmod", [&] { return Gecode::Float::fmod(ix, iy); }, [&] { return reference::fmod(rx, ry); }); -#endif - } - /// Compare the operations on the interval \a b and the number \a n - void - mixed(const Bounds& b, FloatNum n) { - operands = hex(b) + ' ' + hex(n); - const FloatVal x = value_of(b); - const Reference rx = reference_of(b); - compare("add", [&] { return x + n; }, [&] { return rx + n; }); - compare("add_left", [&] { return n + x; }, [&] { return n + rx; }); - compare("sub", [&] { return x - n; }, [&] { return rx - n; }); - compare("sub_left", [&] { return n - x; }, [&] { return n - rx; }); - compare("mul", [&] { return x * n; }, [&] { return rx * n; }); - compare("mul_left", [&] { return n * x; }, [&] { return n * rx; }); - compare("div", [&] { return x / n; }, [&] { return rx / n; }); - compare("div_left", [&] { return n / x; }, [&] { return n / rx; }); - compare( - "add_assign", - [&] { - FloatVal z = x; - return z += n; - }, - [&] { - Reference z = rx; - return z += n; - }); - compare( - "sub_assign", - [&] { - FloatVal z = x; - return z -= n; - }, - [&] { - Reference z = rx; - return z -= n; - }); - compare( - "mul_assign", - [&] { - FloatVal z = x; - return z *= n; - }, - [&] { - Reference z = rx; - return z *= n; - }); - compare( - "div_assign", - [&] { - FloatVal z = x; - return z /= n; - }, - [&] { - Reference z = rx; - return z /= n; - }); - compare("lt", [&] { return x < n; }, [&] { return certainly([&] { return rx < n; }); }); - compare("le", [&] { return x <= n; }, [&] { return certainly([&] { return rx <= n; }); }); - compare("gt", [&] { return x > n; }, [&] { return certainly([&] { return rx > n; }); }); - compare("ge", [&] { return x >= n; }, [&] { return certainly([&] { return rx >= n; }); }); - compare("ne", [&] { return x != n; }, [&] { return certainly([&] { return rx != n; }); }); - // Boost has no comparisons with the number on the left; FloatVal mirrors them. - compare("lt_left", [&] { return n < x; }, [&] { return certainly([&] { return rx > n; }); }); - compare("le_left", [&] { return n <= x; }, [&] { return certainly([&] { return rx >= n; }); }); - compare("gt_left", [&] { return n > x; }, [&] { return certainly([&] { return rx < n; }); }); - compare("ge_left", [&] { return n >= x; }, [&] { return certainly([&] { return rx <= n; }); }); - compare("ne_left", [&] { return n != x; }, [&] { return certainly([&] { return rx != n; }); }); - compare("max", [&] { return Gecode::max(x, n); }, [&] { return reference::max(rx, n); }); - compare("max_left", [&] { return Gecode::max(n, x); }, [&] { return reference::max(n, rx); }); - compare("min", [&] { return Gecode::min(x, n); }, [&] { return reference::min(rx, n); }); - compare("min_left", [&] { return Gecode::min(n, x); }, [&] { return reference::min(n, rx); }); - compare("hull", [&] { return Gecode::Float::hull(x, n); }, [&] { return reference::hull(rx, n); }); - compare("hull_left", [&] { return Gecode::Float::hull(n, x); }, [&] { return reference::hull(n, rx); }); - compare("in", [&] { return x.in(n); }, [&] { return reference::in(n, rx); }); -#ifdef GECODE_HAS_MPFR - compare("fmod", [&] { return Gecode::fmod(x, n); }, [&] { return reference::fmod(rx, n); }); - compare("fmod_left", [&] { return Gecode::fmod(n, x); }, [&] { return reference::fmod(n, rx); }); -#else - // FloatVal has fmod only with MPFR. - const Interval ix = interval_of(b); - compare("fmod", [&] { return Gecode::Float::fmod(ix, n); }, [&] { return reference::fmod(rx, n); }); - compare("fmod_left", [&] { return Gecode::Float::fmod(n, ix); }, [&] { return reference::fmod(n, rx); }); -#endif - } - - /// Return the value with bounds \a b - static FloatVal - value_of(const Bounds& b) { - return std::isnan(b.lower) ? FloatVal(b.lower) : FloatVal(b.lower, b.upper); - } - /// Return the interval with bounds \a b - static Interval - interval_of(const Bounds& b) { - return std::isnan(b.lower) ? Interval(b.lower) : Interval(b.lower, b.upper); - } - /// Return the reference interval with bounds \a b - static Reference - reference_of(const Bounds& b) { - return std::isnan(b.lower) ? Reference(b.lower) : Reference(b.lower, b.upper); - } - - public: - MatchesBoost(void) : Base("Float::Interval::MatchesBoost", TestTags::standard()) {} - bool - run(void) override { - const int previous = std::fegetround(); - modes.clear(); - for (int mode : {FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO}) - if (std::fesetround(mode) == 0) - modes.push_back(mode); - std::fesetround(FE_TONEAREST); - mismatches = 0; - - const std::vector numbers = grid_numbers(); - const std::vector intervals = grid_intervals(); - constants(); - for (FloatNum n : numbers) - from_number(n); - for (FloatNum l : numbers) - for (FloatNum u : numbers) - from_numbers(l, u); - for (const Bounds& b : intervals) - unary(b); - for (const Bounds& a : intervals) - for (const Bounds& b : intervals) - binary(a, b); - for (const Bounds& b : intervals) - for (FloatNum n : numbers) - mixed(b, n); - - if (previous != -1) - std::fesetround(previous); - if (mismatches > 0) - olog << mismatches << " mismatches\n"; - return mismatches == 0; - } - } matches_boost; - -}}} // namespace Test::Float - -// STATISTICS: test-float From 22f1bd0346a31b55a1151fd7980f83b6a0860e67 Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Wed, 4 Nov 2026 15:36:55 +0100 Subject: [PATCH 5/5] Record the native interval library in the changelog The 7.0.0 entries describe Gecode's own Float::Interval and the removed Boost copy, the API changes of Float::RoundingBase, Float::Rounding, and FloatValImpType, and the trivially copyable FloatVal, whose by-value calling convention changes for the two exported functions that take it by value. Zdev-Change-Id: Zfb4cd384cd9b0d57890f4ecef2c4ec0803d04137d6a43586a4990458f0cc0537 --- changelog.in | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/changelog.in b/changelog.in index a5e574017c..86eb6924c7 100644 --- a/changelog.in +++ b/changelog.in @@ -250,6 +250,48 @@ volatile store and reload with other compilers. Integer rounding uses floor and ceil, which do not depend on the rounding mode. The even-root bounds of pow and nroot use the same rounding operations. +[ENTRY] +Module: float +What: change +Rank: major +[DESCRIPTION] +Implement interval arithmetic in Gecode itself, as the new type +Float::Interval with its free functions in namespace Gecode::Float. Gecode +no longer contains, or installs, its renamed copy of the Boost interval +library and Boost's LICENSE_1_0.txt, and it takes on no external dependency in +their place. Bounds, comparison results, and search behave exactly as +before. The empty-interval exception is still a std::runtime_error, but its +message is now "Gecode::Float::Interval: empty interval". +[MORE] +The interval code is Gecode code under Gecode's MIT license. + +[ENTRY] +Module: float +What: change +Rank: major +[DESCRIPTION] +Make Float::RoundingBase and Float::Rounding plain Gecode classes. Their +arithmetic members are unchanged. RoundingBase no longer derives from a Boost +rounding class: init, upward, downward, and to_nearest are now protected, +and toward_zero, get_rounding_mode, set_rounding_mode, to_int, conv_down, +conv_up, force_rounding, and rounding_mode are gone. Rounding is a scope that +saves the caller's rounding mode and restores it; it cannot be copied and no +longer has the mode member or unprotected_rounding typedef of Boost's +save_state. The typedef RoundingControl is gone, FloatVal::FloatValImpType is +now Float::Interval, and FloatVal's protected typedefs R and P are gone. + +[ENTRY] +Module: float +What: change +Rank: major +[DESCRIPTION] +Make FloatVal trivially copyable. Its layout is unchanged, but on AArch64 and +SysV x86-64 it is now passed and returned by value in registers instead of +through memory. A program built against older headers must be rebuilt: the +symbol names are unchanged, so the dynamic linker does not catch the +mismatch. Two exported functions take a FloatVal by value and are affected: +FloatValArgs::create and Float::Linear::post. + [ENTRY] Module: search What: bug