Added boost header
This commit is contained in:
113
test/external/boost/numeric/interval/compare/certain.hpp
vendored
Normal file
113
test/external/boost/numeric/interval/compare/certain.hpp
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
/* Boost interval/compare/certain.hpp template implementation file
|
||||
*
|
||||
* Copyright 2003 Guillaume Melquiond
|
||||
*
|
||||
* 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_CERTAIN_HPP
|
||||
#define BOOST_NUMERIC_INTERVAL_COMPARE_CERTAIN_HPP
|
||||
|
||||
#include <boost/numeric/interval/detail/interval_prototype.hpp>
|
||||
#include <boost/numeric/interval/detail/test_input.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace interval_lib {
|
||||
namespace compare {
|
||||
namespace certain {
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() < y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() < y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() <= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() <= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() > y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() > y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() >= y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() >= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() == y.lower() && x.lower() == y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator==(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() == y && x.lower() == y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() < y.lower() || x.lower() > y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator!=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() < y || x.lower() > y;
|
||||
}
|
||||
|
||||
} // namespace certain
|
||||
} // namespace compare
|
||||
} // namespace interval_lib
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_INTERVAL_COMPARE_CERTAIN_HPP
|
||||
248
test/external/boost/numeric/interval/compare/explicit.hpp
vendored
Normal file
248
test/external/boost/numeric/interval/compare/explicit.hpp
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
/* Boost interval/compare/explicit.hpp template implementation file
|
||||
*
|
||||
* Copyright 2000 Jens Maurer
|
||||
* Copyright 2002 Herv<72> Br<42>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 <boost/numeric/interval/detail/interval_prototype.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace interval_lib {
|
||||
|
||||
/*
|
||||
* Certainly... operations
|
||||
*/
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool cerlt(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.upper() < y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cerlt(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.upper() < y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cerlt(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x < y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool cerle(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.upper() <= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cerle(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.upper() <= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cerle(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x <= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool cergt(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.lower() > y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cergt(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.lower() > y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cergt(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x > y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool cerge(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.lower() >= y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cerge(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.lower() >= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cerge(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x >= y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool cereq(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.lower() == y.upper() && y.lower() == x.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cereq(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.lower() == y && x.upper() == y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cereq(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x == y.lower() && x == y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool cerne(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.upper() < y.lower() || y.upper() < x.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cerne(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.upper() < y || y < x.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool cerne(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x < y.lower() || y.upper() < x;
|
||||
}
|
||||
|
||||
/*
|
||||
* Possibly... comparisons
|
||||
*/
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool poslt(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.lower() < y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool poslt(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.lower() < y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool poslt(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x < y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool posle(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.lower() <= y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool posle(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.lower() <= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool posle(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x <= y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool posgt(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.upper() > y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool posgt(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.upper() > y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool posgt(const T& x, const interval<T, Policies> & y)
|
||||
{
|
||||
return x > y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool posge(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.upper() >= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool posge(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.upper() >= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool posge(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x >= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool poseq(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.upper() >= y.lower() && y.upper() >= x.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool poseq(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.upper() >= y && y >= x.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool poseq(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x >= y.lower() && y.upper() >= x;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool posne(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return x.upper() != y.lower() || y.upper() != x.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool posne(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
return x.upper() != y || y != x.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool posne(const T& x, const interval<T, Policies>& y)
|
||||
{
|
||||
return x != y.lower() || y.upper() != x;
|
||||
}
|
||||
|
||||
} // namespace interval_lib
|
||||
} // namespace numeric
|
||||
} //namespace boost
|
||||
|
||||
#endif // BOOST_NUMERIC_INTERVAL_COMPARE_EXPLICIT_HPP
|
||||
122
test/external/boost/numeric/interval/compare/lexicographic.hpp
vendored
Normal file
122
test/external/boost/numeric/interval/compare/lexicographic.hpp
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
/* Boost interval/compare/lexicographic.hpp template implementation file
|
||||
*
|
||||
* Copyright 2002-2003 Guillaume Melquiond
|
||||
*
|
||||
* 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_LEXICOGRAPHIC_HPP
|
||||
#define BOOST_NUMERIC_INTERVAL_COMPARE_LEXICOGRAPHIC_HPP
|
||||
|
||||
#include <boost/numeric/interval/detail/interval_prototype.hpp>
|
||||
#include <boost/numeric/interval/detail/test_input.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace interval_lib {
|
||||
namespace compare {
|
||||
namespace lexicographic {
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
const T& xl = x.lower();
|
||||
const T& yl = y.lower();
|
||||
return xl < yl || (xl == yl && x.upper() < y.upper());
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() < y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
const T& xl = x.lower();
|
||||
const T& yl = y.lower();
|
||||
return xl < yl || (xl == yl && x.upper() <= y.upper());
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
const T& xl = x.lower();
|
||||
return xl < y || (xl == y && x.upper() <= y);
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
const T& xl = x.lower();
|
||||
const T& yl = y.lower();
|
||||
return xl > yl || (xl == yl && x.upper() > y.upper());
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
const T& xl = x.lower();
|
||||
return xl > y || (xl == y && x.upper() > y);
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
const T& xl = x.lower();
|
||||
const T& yl = y.lower();
|
||||
return xl > yl || (xl == yl && x.upper() >= y.upper());
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() >= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() == y.lower() && x.upper() == y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator==(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() == y && x.upper() == y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() != y.lower() || x.upper() != y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator!=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() != y || x.upper() != y;
|
||||
}
|
||||
|
||||
} // namespace lexicographic
|
||||
} // namespace compare
|
||||
} // namespace interval_lib
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_NUMERIC_INTERVAL_COMPARE_LEXICOGRAPHIC_HPP
|
||||
113
test/external/boost/numeric/interval/compare/possible.hpp
vendored
Normal file
113
test/external/boost/numeric/interval/compare/possible.hpp
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
/* Boost interval/compare/possible.hpp template implementation file
|
||||
*
|
||||
* Copyright 2003 Guillaume Melquiond
|
||||
*
|
||||
* 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_POSSIBLE_HPP
|
||||
#define BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP
|
||||
|
||||
#include <boost/numeric/interval/detail/interval_prototype.hpp>
|
||||
#include <boost/numeric/interval/detail/test_input.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace interval_lib {
|
||||
namespace compare {
|
||||
namespace possible {
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() < y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() < y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() <= y.upper();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() <= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() > y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() > y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() >= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.upper() >= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() <= y.upper() && x.upper() >= y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator==(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() <= y && x.upper() >= y;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() != y.upper() || x.upper() != y.lower();
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator!=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
return x.lower() != y || x.upper() != y;
|
||||
}
|
||||
|
||||
} // namespace possible
|
||||
} // namespace compare
|
||||
} // namespace interval_lib
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_INTERVAL_COMPARE_POSSIBLE_HPP
|
||||
101
test/external/boost/numeric/interval/compare/set.hpp
vendored
Normal file
101
test/external/boost/numeric/interval/compare/set.hpp
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
/* Boost interval/compare/set.hpp template implementation file
|
||||
*
|
||||
* Copyright 2002-2003 Guillaume Melquiond
|
||||
*
|
||||
* 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_SET_HPP
|
||||
#define BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP
|
||||
|
||||
#include <boost/numeric/interval/detail/interval_prototype.hpp>
|
||||
#include <boost/numeric/interval/detail/test_input.hpp>
|
||||
#include <boost/numeric/interval/utility.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace interval_lib {
|
||||
namespace compare {
|
||||
namespace set {
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return proper_subset(x, y);
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
throw comparison_error();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return subset(x, y);
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator<=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
throw comparison_error();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return proper_subset(y, x);
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
throw comparison_error();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return subset(y, x);
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator>=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
throw comparison_error();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return equal(y, x);
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator==(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
throw comparison_error();
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
return !equal(y, x);
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
bool operator!=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
throw comparison_error();
|
||||
}
|
||||
|
||||
} // namespace set
|
||||
} // namespace compare
|
||||
} // namespace interval_lib
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP
|
||||
138
test/external/boost/numeric/interval/compare/tribool.hpp
vendored
Normal file
138
test/external/boost/numeric/interval/compare/tribool.hpp
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
/* Boost interval/compare/tribool.hpp template implementation file
|
||||
*
|
||||
* Copyright 2002-2003 Guillaume Melquiond
|
||||
*
|
||||
* 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_TRIBOOL_HPP
|
||||
#define BOOST_NUMERIC_INTERVAL_COMPARE_TRIBOOL_HPP
|
||||
|
||||
#include <boost/numeric/interval/detail/interval_prototype.hpp>
|
||||
#include <boost/numeric/interval/detail/test_input.hpp>
|
||||
#include <boost/logic/tribool.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace interval_lib {
|
||||
namespace compare {
|
||||
namespace tribool {
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
logic::tribool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.upper() < y.lower()) return true;
|
||||
if (x.lower() >= y.upper()) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
logic::tribool operator<(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.upper() < y) return true;
|
||||
if (x.lower() >= y) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
logic::tribool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.upper() <= y.lower()) return true;
|
||||
if (x.lower() > y.upper()) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
logic::tribool operator<=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.upper() <= y) return true;
|
||||
if (x.lower() > y) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
logic::tribool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.lower() > y.upper()) return true;
|
||||
if (x.upper() <= y.lower()) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
logic::tribool operator>(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.lower() > y) return true;
|
||||
if (x.upper() <= y) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
logic::tribool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.lower() >= y.upper()) return true;
|
||||
if (x.upper() < y.lower()) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
logic::tribool operator>=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.lower() >= y) return true;
|
||||
if (x.upper() < y) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
logic::tribool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.upper() == y.lower() && x.lower() == y.upper()) return true;
|
||||
if (x.upper() < y.lower() || x.lower() > y.upper()) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
logic::tribool operator==(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.upper() == y && x.lower() == y) return true;
|
||||
if (x.upper() < y || x.lower() > y) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies1, class Policies2> inline
|
||||
logic::tribool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.upper() < y.lower() || x.lower() > y.upper()) return true;
|
||||
if (x.upper() == y.lower() && x.lower() == y.upper()) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
template<class T, class Policies> inline
|
||||
logic::tribool operator!=(const interval<T, Policies>& x, const T& y)
|
||||
{
|
||||
if (detail::test_input(x, y)) throw comparison_error();
|
||||
if (x.upper() < y || x.lower() > y) return true;
|
||||
if (x.upper() == y && x.lower() == y) return false;
|
||||
return logic::indeterminate;
|
||||
}
|
||||
|
||||
} // namespace tribool
|
||||
} // namespace compare
|
||||
} // namespace interval_lib
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_INTERVAL_COMPARE_TRIBOOL_HPP
|
||||
Reference in New Issue
Block a user