New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
possible.hpp in vendors/XIOS/current/extern/boost/include/boost/numeric/interval/compare – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/numeric/interval/compare/possible.hpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1/* Boost interval/compare/possible.hpp template implementation file
2 *
3 * Copyright 2003 Guillaume Melquiond
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE_1_0.txt or
7 * copy at http://www.boost.org/LICENSE_1_0.txt)
8 */
9
10#ifndef BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP
11#define BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP
12
13#include <boost/numeric/interval/detail/interval_prototype.hpp>
14#include <boost/numeric/interval/detail/test_input.hpp>
15
16namespace boost {
17namespace numeric {
18namespace interval_lib {
19namespace compare {
20namespace possible {
21
22template<class T, class Policies1, class Policies2> inline
23bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
24{
25  if (detail::test_input(x, y)) throw comparison_error();
26  return x.lower() < y.upper();
27}
28
29template<class T, class Policies> inline
30bool operator<(const interval<T, Policies>& x, const T& y)
31{
32  if (detail::test_input(x, y)) throw comparison_error();
33  return x.lower() < y;
34}
35
36template<class T, class Policies1, class Policies2> inline
37bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
38{
39  if (detail::test_input(x, y)) throw comparison_error();
40  return x.lower() <= y.upper();
41}
42
43template<class T, class Policies> inline
44bool operator<=(const interval<T, Policies>& x, const T& y)
45{
46  if (detail::test_input(x, y)) throw comparison_error();
47  return x.lower() <= y;
48}
49
50template<class T, class Policies1, class Policies2> inline
51bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
52{
53  if (detail::test_input(x, y)) throw comparison_error();
54  return x.upper() > y.lower();
55}
56
57template<class T, class Policies> inline
58bool operator>(const interval<T, Policies>& x, const T& y)
59{
60  if (detail::test_input(x, y)) throw comparison_error();
61  return x.upper() > y;
62}
63
64template<class T, class Policies1, class Policies2> inline
65bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
66{
67  if (detail::test_input(x, y)) throw comparison_error();
68  return x.upper() >= y.lower();
69}
70
71template<class T, class Policies> inline
72bool operator>=(const interval<T, Policies>& x, const T& y)
73{
74  if (detail::test_input(x, y)) throw comparison_error();
75  return x.upper() >= y;
76}
77
78template<class T, class Policies1, class Policies2> inline
79bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
80{
81  if (detail::test_input(x, y)) throw comparison_error();
82  return x.lower() <= y.upper() && x.upper() >= y.lower();
83}
84
85template<class T, class Policies> inline
86bool operator==(const interval<T, Policies>& x, const T& y)
87{
88  if (detail::test_input(x, y)) throw comparison_error();
89  return x.lower() <= y && x.upper() >= y;
90}
91
92template<class T, class Policies1, class Policies2> inline
93bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
94{
95  if (detail::test_input(x, y)) throw comparison_error();
96  return x.lower() != y.upper() || x.upper() != y.lower();
97}
98
99template<class T, class Policies> inline
100bool operator!=(const interval<T, Policies>& x, const T& y)
101{
102  if (detail::test_input(x, y)) throw comparison_error();
103  return x.lower() != y || x.upper() != y;
104}
105
106} // namespace possible
107} // namespace compare
108} // namespace interval_lib
109} // namespace numeric
110} // namespace boost
111
112
113#endif // BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP
Note: See TracBrowser for help on using the repository browser.