annotate DEPENDENCIES/generic/include/boost/numeric/interval/compare/certain.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 /* Boost interval/compare/certain.hpp template implementation file
Chris@16 2 *
Chris@16 3 * Copyright 2003 Guillaume Melquiond
Chris@16 4 *
Chris@16 5 * Distributed under the Boost Software License, Version 1.0.
Chris@16 6 * (See accompanying file LICENSE_1_0.txt or
Chris@16 7 * copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 8 */
Chris@16 9
Chris@16 10 #ifndef BOOST_NUMERIC_INTERVAL_COMPARE_CERTAIN_HPP
Chris@16 11 #define BOOST_NUMERIC_INTERVAL_COMPARE_CERTAIN_HPP
Chris@16 12
Chris@16 13 #include <boost/numeric/interval/detail/interval_prototype.hpp>
Chris@16 14 #include <boost/numeric/interval/detail/test_input.hpp>
Chris@16 15
Chris@16 16 namespace boost {
Chris@16 17 namespace numeric {
Chris@16 18 namespace interval_lib {
Chris@16 19 namespace compare {
Chris@16 20 namespace certain {
Chris@16 21
Chris@16 22 template<class T, class Policies1, class Policies2> inline
Chris@16 23 bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
Chris@16 24 {
Chris@16 25 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 26 return x.upper() < y.lower();
Chris@16 27 }
Chris@16 28
Chris@16 29 template<class T, class Policies> inline
Chris@16 30 bool operator<(const interval<T, Policies>& x, const T& y)
Chris@16 31 {
Chris@16 32 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 33 return x.upper() < y;
Chris@16 34 }
Chris@16 35
Chris@16 36 template<class T, class Policies1, class Policies2> inline
Chris@16 37 bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
Chris@16 38 {
Chris@16 39 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 40 return x.upper() <= y.lower();
Chris@16 41 }
Chris@16 42
Chris@16 43 template<class T, class Policies> inline
Chris@16 44 bool operator<=(const interval<T, Policies>& x, const T& y)
Chris@16 45 {
Chris@16 46 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 47 return x.upper() <= y;
Chris@16 48 }
Chris@16 49
Chris@16 50 template<class T, class Policies1, class Policies2> inline
Chris@16 51 bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
Chris@16 52 {
Chris@16 53 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 54 return x.lower() > y.upper();
Chris@16 55 }
Chris@16 56
Chris@16 57 template<class T, class Policies> inline
Chris@16 58 bool operator>(const interval<T, Policies>& x, const T& y)
Chris@16 59 {
Chris@16 60 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 61 return x.lower() > y;
Chris@16 62 }
Chris@16 63
Chris@16 64 template<class T, class Policies1, class Policies2> inline
Chris@16 65 bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
Chris@16 66 {
Chris@16 67 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 68 return x.lower() >= y.upper();
Chris@16 69 }
Chris@16 70
Chris@16 71 template<class T, class Policies> inline
Chris@16 72 bool operator>=(const interval<T, Policies>& x, const T& y)
Chris@16 73 {
Chris@16 74 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 75 return x.lower() >= y;
Chris@16 76 }
Chris@16 77
Chris@16 78 template<class T, class Policies1, class Policies2> inline
Chris@16 79 bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
Chris@16 80 {
Chris@16 81 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 82 return x.upper() == y.lower() && x.lower() == y.upper();
Chris@16 83 }
Chris@16 84
Chris@16 85 template<class T, class Policies> inline
Chris@16 86 bool operator==(const interval<T, Policies>& x, const T& y)
Chris@16 87 {
Chris@16 88 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 89 return x.upper() == y && x.lower() == y;
Chris@16 90 }
Chris@16 91
Chris@16 92 template<class T, class Policies1, class Policies2> inline
Chris@16 93 bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
Chris@16 94 {
Chris@16 95 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 96 return x.upper() < y.lower() || x.lower() > y.upper();
Chris@16 97 }
Chris@16 98
Chris@16 99 template<class T, class Policies> inline
Chris@16 100 bool operator!=(const interval<T, Policies>& x, const T& y)
Chris@16 101 {
Chris@16 102 if (detail::test_input(x, y)) throw comparison_error();
Chris@16 103 return x.upper() < y || x.lower() > y;
Chris@16 104 }
Chris@16 105
Chris@16 106 } // namespace certain
Chris@16 107 } // namespace compare
Chris@16 108 } // namespace interval_lib
Chris@16 109 } // namespace numeric
Chris@16 110 } // namespace boost
Chris@16 111
Chris@16 112
Chris@16 113 #endif // BOOST_NUMERIC_INTERVAL_COMPARE_CERTAIN_HPP