source: XIOS/dev/dev_olga/src/extern/boost/include/boost/numeric/interval/compare/set.hpp @ 1022

Last change on this file since 1022 was 1022, checked in by mhnguyen, 7 years ago
File size: 2.6 KB
Line 
1/* Boost interval/compare/set.hpp template implementation file
2 *
3 * Copyright 2002-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_SET_HPP
11#define BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP
12
13#include <boost/numeric/interval/detail/interval_prototype.hpp>
14#include <boost/numeric/interval/detail/test_input.hpp>
15#include <boost/numeric/interval/utility.hpp>
16
17namespace boost {
18namespace numeric {
19namespace interval_lib {
20namespace compare {
21namespace set {
22
23template<class T, class Policies1, class Policies2> inline
24bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
25{
26  return proper_subset(x, y);
27}
28
29template<class T, class Policies> inline
30bool operator<(const interval<T, Policies>& x, const T& y)
31{
32  throw comparison_error();
33}
34
35template<class T, class Policies1, class Policies2> inline
36bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
37{
38  return subset(x, y);
39}
40
41template<class T, class Policies> inline
42bool operator<=(const interval<T, Policies>& x, const T& y)
43{
44  throw comparison_error();
45}
46
47template<class T, class Policies1, class Policies2> inline
48bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
49{
50  return proper_subset(y, x);
51}
52
53template<class T, class Policies> inline
54bool operator>(const interval<T, Policies>& x, const T& y)
55{
56  throw comparison_error();
57}
58
59template<class T, class Policies1, class Policies2> inline
60bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
61{
62  return subset(y, x);
63}
64
65template<class T, class Policies> inline
66bool operator>=(const interval<T, Policies>& x, const T& y)
67{
68  throw comparison_error();
69}
70
71template<class T, class Policies1, class Policies2> inline
72bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
73{
74  return equal(y, x);
75}
76
77template<class T, class Policies> inline
78bool operator==(const interval<T, Policies>& x, const T& y)
79{
80  throw comparison_error();
81}
82
83template<class T, class Policies1, class Policies2> inline
84bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
85{
86  return !equal(y, x);
87}
88
89template<class T, class Policies> inline
90bool operator!=(const interval<T, Policies>& x, const T& y)
91{
92  throw comparison_error();
93}
94
95} // namespace set
96} // namespace compare
97} // namespace interval_lib
98} // namespace numeric
99} // namespace boost
100
101#endif // BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP
Note: See TracBrowser for help on using the repository browser.