/* 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 BOOST_NUMERIC_INTERVAL_COMPARE_EXPLICIT_HPP #define BOOST_NUMERIC_INTERVAL_COMPARE_EXPLICIT_HPP #include namespace 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 boost #endif // BOOST_NUMERIC_INTERVAL_COMPARE_EXPLICIT_HPP