update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -8,15 +8,19 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#ifndef BOOST_ICL_CLOSED_INTERVAL_HPP_JOFA_100324
#define BOOST_ICL_CLOSED_INTERVAL_HPP_JOFA_100324
#include <functional>
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/icl/detail/concept_check.hpp>
#include <boost/icl/concept/interval.hpp>
#include <boost/icl/type_traits/succ_pred.hpp>
#include <boost/icl/type_traits/value_size.hpp>
#include <boost/icl/type_traits/type_to_string.hpp>
namespace boost{namespace icl
{
template <class DomainT,
template <class DomainT,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)>
class closed_interval
{
@@ -30,8 +34,8 @@ public:
//= Construct, copy, destruct
//==========================================================================
/** Default constructor; yields an empty interval <tt>[0,0)</tt>. */
closed_interval()
: _lwb(unit_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
closed_interval()
: _lwb(unit_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
@@ -84,14 +88,14 @@ struct interval_traits< icl::closed_interval<DomainT, Compare> >
return interval_type(lo, up);
}
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); }
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); }
};
//==============================================================================
//= Type traits
//==============================================================================
template <class DomainT, ICL_COMPARE Compare>
template <class DomainT, ICL_COMPARE Compare>
struct interval_bound_type< closed_interval<DomainT,Compare> >
{
typedef interval_bound_type type;
@@ -105,14 +109,13 @@ struct type_to_string<icl::closed_interval<DomainT,Compare> >
{ return "[I]<"+ type_to_string<DomainT>::apply() +">"; }
};
template<class DomainT>
template<class DomainT>
struct value_size<icl::closed_interval<DomainT> >
{
static std::size_t apply(const icl::closed_interval<DomainT>&)
static std::size_t apply(const icl::closed_interval<DomainT>&)
{ return 2; }
};
}} // namespace icl boost
#endif

View File

@@ -29,6 +29,7 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#include <boost/icl/interval_traits.hpp>
#include <boost/icl/dynamic_interval_traits.hpp>
#include <algorithm>
namespace boost{namespace icl
{
@@ -577,113 +578,6 @@ is_empty(const Type& object)
&& object.bounds() != interval_bounds::closed() );
}
//==============================================================================
//= Orderings, containedness (non empty)
//==============================================================================
namespace non_empty
{
template<class Type>
inline typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
BOOST_ASSERT(!(icl::is_empty(left) || icl::is_empty(right)));
return domain_less_equal<Type>(upper(left), lower(right));
}
template<class Type>
inline typename boost::enable_if<is_discrete_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
BOOST_ASSERT(!(icl::is_empty(left) || icl::is_empty(right)));
return domain_less<Type>(last(left), first(right));
}
template<class Type>
inline typename boost::
enable_if<has_symmetric_bounds<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
BOOST_ASSERT(!(icl::is_empty(left) || icl::is_empty(right)));
return domain_less<Type>(last(left), first(right));
}
template<class Type>
inline typename boost::enable_if<is_continuous_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
BOOST_ASSERT(!(icl::is_empty(left) || icl::is_empty(right)));
return domain_less <Type>(upper(left), lower(right))
|| ( domain_equal<Type>(upper(left), lower(right))
&& inner_bounds(left,right) != interval_bounds::open() );
}
template<class Type>
inline typename boost::enable_if<is_interval<Type>, bool>::type
contains(const Type& super, const Type& sub)
{
return lower_less_equal(super,sub) && upper_less_equal(sub,super);
}
} //namespace non_empty
//- contains -------------------------------------------------------------------
template<class Type>
inline typename boost::enable_if<is_interval<Type>, bool>::type
contains(const Type& super, const Type& sub)
{
return icl::is_empty(sub) || non_empty::contains(super, sub);
}
template<class Type>
typename boost::enable_if<is_discrete_static<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
{
return domain_less_equal<Type>(icl::first(super), element )
&& domain_less_equal<Type>( element, icl::last(super));
}
template<class Type>
typename boost::enable_if<is_continuous_left_open<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
{
return domain_less <Type>(icl::lower(super), element )
&& domain_less_equal<Type>( element, icl::upper(super));
}
template<class Type>
typename boost::enable_if<is_continuous_right_open<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
{
return domain_less_equal<Type>(icl::lower(super), element )
&& domain_less <Type>( element, icl::upper(super));
}
template<class Type>
typename boost::enable_if<has_dynamic_bounds<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
{
return
(is_left_closed(super.bounds())
? domain_less_equal<Type>(lower(super), element)
: domain_less<Type>(lower(super), element))
&&
(is_right_closed(super.bounds())
? domain_less_equal<Type>(element, upper(super))
: domain_less<Type>(element, upper(super)));
}
//- within ---------------------------------------------------------------------
template<class Type>
inline typename boost::enable_if<is_interval<Type>, bool>::type
within(const Type& sub, const Type& super)
{
return contains(super,sub);
}
//==============================================================================
//= Equivalences and Orderings
//==============================================================================
@@ -890,6 +784,109 @@ upper_less_equal(const Type& left, const Type& right)
return upper_less(left,right) || upper_equal(left,right);
}
//==============================================================================
//= Orderings, containedness (non empty)
//==============================================================================
namespace non_empty
{
template<class Type>
inline typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
BOOST_ASSERT(!(icl::is_empty(left) || icl::is_empty(right)));
return domain_less_equal<Type>(upper(left), lower(right));
}
template<class Type>
inline typename boost::enable_if<is_discrete_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
BOOST_ASSERT(!(icl::is_empty(left) || icl::is_empty(right)));
return domain_less<Type>(last(left), first(right));
}
template<class Type>
inline typename boost::
enable_if<has_symmetric_bounds<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
BOOST_ASSERT(!(icl::is_empty(left) || icl::is_empty(right)));
return domain_less<Type>(last(left), first(right));
}
template<class Type>
inline typename boost::enable_if<is_continuous_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
BOOST_ASSERT(!(icl::is_empty(left) || icl::is_empty(right)));
return domain_less <Type>(upper(left), lower(right))
|| ( domain_equal<Type>(upper(left), lower(right))
&& inner_bounds(left,right) != interval_bounds::open() );
}
template<class Type>
inline typename boost::enable_if<is_interval<Type>, bool>::type
contains(const Type& super, const Type& sub)
{
return lower_less_equal(super,sub) && upper_less_equal(sub,super);
}
} //namespace non_empty
//- contains -------------------------------------------------------------------
template<class Type>
inline typename boost::enable_if<is_interval<Type>, bool>::type
contains(const Type& super, const Type& sub)
{
return icl::is_empty(sub) || non_empty::contains(super, sub);
}
template<class Type>
typename boost::enable_if<is_discrete_static<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
{
return domain_less_equal<Type>(icl::first(super), element )
&& domain_less_equal<Type>( element, icl::last(super));
}
template<class Type>
typename boost::enable_if<is_continuous_left_open<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
{
return domain_less <Type>(icl::lower(super), element )
&& domain_less_equal<Type>( element, icl::upper(super));
}
template<class Type>
typename boost::enable_if<is_continuous_right_open<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
{
return domain_less_equal<Type>(icl::lower(super), element )
&& domain_less <Type>( element, icl::upper(super));
}
template<class Type>
typename boost::enable_if<has_dynamic_bounds<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
{
return
(is_left_closed(super.bounds())
? domain_less_equal<Type>(lower(super), element)
: domain_less<Type>(lower(super), element))
&&
(is_right_closed(super.bounds())
? domain_less_equal<Type>(element, upper(super))
: domain_less<Type>(element, upper(super)));
}
//- within ---------------------------------------------------------------------
template<class Type>
inline typename boost::enable_if<is_interval<Type>, bool>::type
within(const Type& sub, const Type& super)
{
return contains(super,sub);
}
//- operator == ----------------------------------------------------------------
template<class Type>

View File

@@ -101,8 +101,8 @@ struct interval_traits< icl::continuous_interval<DomainT, Compare> >
return interval_type(lo, up);
}
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); }
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); }
};

View File

@@ -100,8 +100,8 @@ struct interval_traits< icl::discrete_interval<DomainT, Compare> >
return interval_type(lo, up);
}
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); }
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); }
};
//==============================================================================

View File

@@ -9,15 +9,18 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#define BOOST_ICL_LEFT_OPEN_INTERVAL_HPP_JOFA_100930
#include <functional>
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/icl/detail/concept_check.hpp>
#include <boost/icl/concept/interval.hpp>
#include <boost/icl/type_traits/succ_pred.hpp>
#include <boost/icl/type_traits/value_size.hpp>
#include <boost/icl/type_traits/type_to_string.hpp>
namespace boost{namespace icl
{
template <class DomainT,
template <class DomainT,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)>
class left_open_interval
{
@@ -31,8 +34,8 @@ public:
//= Construct, copy, destruct
//==========================================================================
/** Default constructor; yields an empty interval <tt>(0,0]</tt>. */
left_open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
left_open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
@@ -46,11 +49,11 @@ public:
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
// Only for discrete types this ctor creates an interval containing
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
BOOST_ASSERT((numeric_minimum<DomainT, domain_compare, is_numeric<DomainT>::value >
::is_less_than(val) ));
::is_less_than(val) ));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
@@ -84,15 +87,15 @@ struct interval_traits< icl::left_open_interval<DomainT, Compare> >
return interval_type(lo, up);
}
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); }
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); }
};
//==============================================================================
//= Type traits
//==============================================================================
template <class DomainT, ICL_COMPARE Compare>
template <class DomainT, ICL_COMPARE Compare>
struct interval_bound_type< left_open_interval<DomainT,Compare> >
{
typedef interval_bound_type type;
@@ -106,14 +109,13 @@ struct type_to_string<icl::left_open_interval<DomainT,Compare> >
{ return "(I]<"+ type_to_string<DomainT>::apply() +">"; }
};
template<class DomainT, ICL_COMPARE Compare>
template<class DomainT, ICL_COMPARE Compare>
struct value_size<icl::left_open_interval<DomainT,Compare> >
{
static std::size_t apply(const icl::left_open_interval<DomainT>&)
static std::size_t apply(const icl::left_open_interval<DomainT>&)
{ return 2; }
};
}} // namespace icl boost
#endif

View File

@@ -9,16 +9,18 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#define BOOST_ICL_OPEN_INTERVAL_HPP_JOFA_100930
#include <functional>
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/icl/detail/concept_check.hpp>
#include <boost/icl/concept/interval.hpp>
#include <boost/icl/type_traits/succ_pred.hpp>
#include <boost/icl/type_traits/value_size.hpp>
#include <boost/icl/type_traits/type_to_string.hpp>
namespace boost{namespace icl
{
template <class DomainT,
template <class DomainT,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)>
class open_interval
{
@@ -32,8 +34,8 @@ public:
//= Construct, copy, destruct
//==========================================================================
/** Default constructor; yields an empty interval <tt>(0,0)</tt>. */
open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
@@ -47,11 +49,11 @@ public:
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
// Only for discrete types this ctor creates an interval containing
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
BOOST_ASSERT((numeric_minimum<DomainT, domain_compare, is_numeric<DomainT>::value >
::is_less_than(val) ));
::is_less_than(val) ));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
@@ -85,15 +87,15 @@ struct interval_traits< icl::open_interval<DomainT, Compare> >
return interval_type(lo, up);
}
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); }
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); }
};
//==============================================================================
//= Type traits
//==============================================================================
template <class DomainT, ICL_COMPARE Compare>
template <class DomainT, ICL_COMPARE Compare>
struct interval_bound_type< open_interval<DomainT,Compare> >
{
typedef interval_bound_type type;
@@ -107,14 +109,13 @@ struct type_to_string<icl::open_interval<DomainT,Compare> >
{ return "(I)<"+ type_to_string<DomainT>::apply() +">"; }
};
template<class DomainT, ICL_COMPARE Compare>
template<class DomainT, ICL_COMPARE Compare>
struct value_size<icl::open_interval<DomainT,Compare> >
{
static std::size_t apply(const icl::open_interval<DomainT>&)
static std::size_t apply(const icl::open_interval<DomainT>&)
{ return 2; }
};
}} // namespace icl boost
#endif

View File

@@ -9,7 +9,9 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#define BOOST_ICL_RIGHT_OPEN_INTERVAL_HPP_JOFA_100323
#include <functional>
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/icl/detail/concept_check.hpp>
#include <boost/icl/concept/interval.hpp>
#include <boost/icl/type_traits/succ_pred.hpp>
#include <boost/icl/type_traits/value_size.hpp>
@@ -18,7 +20,7 @@ Copyright (c) 2010-2010: Joachim Faulhaber
namespace boost{namespace icl
{
template <class DomainT,
template <class DomainT,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)>
class right_open_interval
{
@@ -32,8 +34,8 @@ public:
//= Construct, copy, destruct
//==========================================================================
/** Default constructor; yields an empty interval <tt>[0,0)</tt>. */
right_open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
right_open_interval()
: _lwb(identity_element<DomainT>::value()), _upb(identity_element<DomainT>::value())
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
@@ -47,7 +49,7 @@ public:
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
// Only for discrete types this ctor creates an interval containing
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
}
@@ -83,15 +85,15 @@ struct interval_traits< icl::right_open_interval<DomainT, Compare> >
return interval_type(lo, up);
}
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); }
static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); }
};
//==============================================================================
//= Type traits
//==============================================================================
template <class DomainT, ICL_COMPARE Compare>
template <class DomainT, ICL_COMPARE Compare>
struct interval_bound_type< right_open_interval<DomainT,Compare> >
{
typedef interval_bound_type type;
@@ -105,14 +107,13 @@ struct type_to_string<icl::right_open_interval<DomainT,Compare> >
{ return "[I)<"+ type_to_string<DomainT>::apply() +">"; }
};
template<class DomainT, ICL_COMPARE Compare>
template<class DomainT, ICL_COMPARE Compare>
struct value_size<icl::right_open_interval<DomainT,Compare> >
{
static std::size_t apply(const icl::right_open_interval<DomainT>&)
static std::size_t apply(const icl::right_open_interval<DomainT>&)
{ return 2; }
};
}} // namespace icl boost
#endif