1 /* Boost interval/utility.hpp template interface file 2 * 3 * Copyright 2013 Cromwell D. Enage 4 * 5 * Distributed under the Boost Software License, Version 1.0. 6 * (See accompanying file LICENSE_1_0.txt or copy at 7 * http://www.boost.org/LICENSE_1_0.txt) 8 */ 9 10 #ifndef BOOST_NUMERIC_INTERVAL_UTILITY_FWD_HPP 11 #define BOOST_NUMERIC_INTERVAL_UTILITY_FWD_HPP 12 13 #include <boost/config.hpp> 14 #include <boost/numeric/interval/detail/interval_prototype.hpp> 15 #include <utility> 16 17 /* 18 * Interface of simple functions 19 */ 20 21 namespace boost { namespace numeric { 22 23 /* 24 * Utility Functions 25 */ 26 27 template<class T, class Policies> 28 const T& lower(const interval<T,Policies>& x); 29 30 template<class T, class Policies> 31 const T& upper(const interval<T,Policies>& x); 32 33 template<class T, class Policies> 34 T checked_lower(const interval<T,Policies>& x); 35 36 template<class T, class Policies> 37 T width(const interval<T,Policies>& x); 38 39 template<class T, class Policies> 40 T median(const interval<T,Policies>& x); 41 42 template<class T, class Policies> 43 interval<T,Policies> widen(const interval<T,Policies>& x, const T& v); 44 45 /* 46 * Set-like operations 47 */ 48 49 template <class T, class Policies> 50 bool empty(const interval<T,Policies>& x); 51 52 template <class T, class Policies> 53 bool zero_in(const interval<T,Policies>& x); 54 55 template <class T, class Policies> 56 bool in_zero(const interval<T,Policies>& x); // DEPRECATED 57 58 template <class T, class Policies> 59 bool in(const T& x, const interval<T,Policies>& y); 60 61 template <class T, class Policies> 62 bool 63 subset( 64 const interval<T,Policies>& x 65 , const interval<T,Policies>& y 66 ); 67 68 template <class T, class Policies1, class Policies2> 69 bool 70 proper_subset( 71 const interval<T,Policies1>& x 72 , const interval<T,Policies2>& y 73 ); 74 75 template <class T, class Policies1, class Policies2> 76 bool 77 overlap( 78 const interval<T,Policies1>& x 79 , const interval<T,Policies2>& y 80 ); 81 82 template <class T, class Policies> 83 bool singleton(const interval<T, Policies>& x); 84 85 template <class T, class Policies1, class Policies2> 86 bool 87 equal( 88 const interval<T,Policies1>& x 89 , const interval<T,Policies2>& y 90 ); 91 92 template <class T, class Policies> 93 interval<T, Policies> 94 intersect( 95 const interval<T,Policies>& x 96 , const interval<T,Policies>& y 97 ); 98 99 template <class T, class Policies> 100 interval<T, Policies> 101 hull(const interval<T,Policies>& x, const interval<T,Policies>& y); 102 103 template <class T, class Policies> 104 interval<T, Policies> 105 hull(const interval<T,Policies>& x, const T& y); 106 107 template <class T, class Policies> 108 interval<T, Policies> 109 hull(const T& x, const interval<T,Policies>& y); 110 111 template <class T> 112 interval<T> hull(const T& x, const T& y); 113 114 template <class T, class Policies> 115 std::pair<interval<T,Policies>,interval<T,Policies> > 116 bisect(const interval<T,Policies>& x); 117 118 /* 119 * Elementary functions 120 */ 121 122 template <class T, class Policies> 123 T norm(const interval<T,Policies>& x); 124 125 template <class T, class Policies> 126 interval<T,Policies> abs(const interval<T,Policies>& x); 127 128 template <class T, class Policies> 129 interval<T,Policies> 130 max BOOST_PREVENT_MACRO_SUBSTITUTION ( 131 const interval<T,Policies>& x 132 , const interval<T,Policies>& y 133 ); 134 135 template <class T, class Policies> 136 interval<T,Policies> 137 max BOOST_PREVENT_MACRO_SUBSTITUTION ( 138 const interval<T,Policies>& x 139 , const T& y 140 ); 141 142 template <class T, class Policies> 143 interval<T,Policies> 144 max BOOST_PREVENT_MACRO_SUBSTITUTION ( 145 const T& x 146 , const interval<T,Policies>& y 147 ); 148 149 template <class T, class Policies> 150 interval<T,Policies> 151 min BOOST_PREVENT_MACRO_SUBSTITUTION ( 152 const interval<T,Policies>& x 153 , const interval<T,Policies>& y 154 ); 155 156 template <class T, class Policies> 157 interval<T,Policies> 158 min BOOST_PREVENT_MACRO_SUBSTITUTION ( 159 const interval<T,Policies>& x 160 , const T& y 161 ); 162 163 template <class T, class Policies> 164 interval<T,Policies> 165 min BOOST_PREVENT_MACRO_SUBSTITUTION ( 166 const T& x 167 , const interval<T,Policies>& y 168 ); 169 }} // namespace boost::numeric 170 171 #endif // include guard 172 173