Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65643 - in sandbox/itl: boost/itl boost/itl/concept boost/itl/concept/interval boost/itl/type_traits libs/itl/example libs/itl/example/custom_interval_ libs/itl/example/large_bitset_ libs/itl/test libs/itl/test/test_casual_
From: afojgo_at_[hidden]
Date: 2010-09-27 15:20:42


Author: jofaber
Date: 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
New Revision: 65643
URL: http://svn.boost.org/trac/boost/changeset/65643

Log:
Adding example custom_interval. Some refactoring around interval customization. Stable{msvc-9.0, gcc-3.4.4}
Added:
   sandbox/itl/boost/itl/concept/interval_bounds.hpp (contents, props changed)
   sandbox/itl/boost/itl/dynamic_interval_traits.hpp (contents, props changed)
   sandbox/itl/boost/itl/interval_traits.hpp (contents, props changed)
   sandbox/itl/libs/itl/example/custom_interval_/
   sandbox/itl/libs/itl/example/custom_interval_/Jamfile.v2 (contents, props changed)
   sandbox/itl/libs/itl/example/custom_interval_/custom_interval.cpp (contents, props changed)
   sandbox/itl/libs/itl/example/custom_interval_/vc9_custom_interval.vcproj (contents, props changed)
Removed:
   sandbox/itl/boost/itl/concept/domain_comparable.hpp
   sandbox/itl/boost/itl/type_traits/is_domain_comparable.hpp
Text files modified:
   sandbox/itl/boost/itl/concept/container.hpp | 1
   sandbox/itl/boost/itl/concept/interval.hpp | 186 +++++++++++++++++++++++++++------------
   sandbox/itl/boost/itl/concept/interval/base.hpp | 2
   sandbox/itl/boost/itl/continuous_interval.hpp | 30 ++---
   sandbox/itl/boost/itl/discrete_interval.hpp | 31 ++----
   sandbox/itl/boost/itl/interval.hpp | 5
   sandbox/itl/boost/itl/interval_base_map.hpp | 8 -
   sandbox/itl/boost/itl/interval_base_set.hpp | 10 +-
   sandbox/itl/boost/itl/interval_bounds.hpp | 121 +------------------------
   sandbox/itl/boost/itl/rightopen_interval.hpp | 33 +-----
   sandbox/itl/boost/itl/type_traits/has_dynamic_bounds.hpp | 4
   sandbox/itl/boost/itl/type_traits/is_continuous.hpp | 17 ++-
   sandbox/itl/boost/itl/type_traits/is_discrete.hpp | 10 +
   sandbox/itl/boost/itl/type_traits/is_interval.hpp | 33 +++++-
   sandbox/itl/libs/itl/example/Jamfile.v2 | 8 +
   sandbox/itl/libs/itl/example/large_bitset_/bits.hpp | 5
   sandbox/itl/libs/itl/example/large_bitset_/large_bitset.cpp | 17 +-
   sandbox/itl/libs/itl/example/large_bitset_/large_bitset.hpp | 22 ++--
   sandbox/itl/libs/itl/example/vc9_itl_examples.sln | 6 +
   sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp | 59 +++++++-----
   sandbox/itl/libs/itl/test/test_interval_map_shared.hpp | 16 +-
   sandbox/itl/libs/itl/test/test_interval_set_shared.hpp | 4
   22 files changed, 304 insertions(+), 324 deletions(-)

Modified: sandbox/itl/boost/itl/concept/container.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/container.hpp (original)
+++ sandbox/itl/boost/itl/concept/container.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -8,6 +8,7 @@
 #ifndef BOOST_ITL_CONCEPT_CONTAINER_HPP_JOFA_100923
 #define BOOST_ITL_CONCEPT_CONTAINER_HPP_JOFA_100923
 
+#include <boost/utility/enable_if.hpp>
 #include <boost/itl/type_traits/is_container.hpp>
 
 namespace boost{ namespace itl

Deleted: sandbox/itl/boost/itl/concept/domain_comparable.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/domain_comparable.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
+++ (empty file)
@@ -1,43 +0,0 @@
-/*-----------------------------------------------------------------------------+
-Copyright (c) 2010-2010: Joachim Faulhaber
-+------------------------------------------------------------------------------+
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENCE.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt)
-+-----------------------------------------------------------------------------*/
-#ifndef BOOST_ITL_CONCEPT_DOMAIN_COMPARABLE_HPP_JOFA_100925
-#define BOOST_ITL_CONCEPT_DOMAIN_COMPARABLE_HPP_JOFA_100925
-
-#include <boost/itl/type_traits/is_domain_comparable.hpp>
-
-namespace boost{ namespace itl
-{
-
-template<class Type>
-inline typename enable_if<is_domain_comparable<Type>, bool>::type
-domain_less(const typename Type::domain_param left, const typename Type::domain_param right)
-{
- return typename Type::domain_compare()(left, right);
-}
-
-template<class Type>
-inline typename enable_if<is_domain_comparable<Type>, bool>::type
-domain_less_equal(const typename Type::domain_param left, const typename Type::domain_param right)
-{
- return !(typename Type::domain_compare()(right, left));
-}
-
-template<class Type>
-inline typename enable_if<is_domain_comparable<Type>, bool>::type
-domain_equal(const typename Type::domain_param left, const typename Type::domain_param right)
-{
- typedef typename Type::domain_compare domain_compare;
- return !domain_compare()(left, right) && !domain_compare()(right, left);
-}
-
-
-}} // namespace boost itl
-
-#endif
-
-

Modified: sandbox/itl/boost/itl/concept/interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -10,6 +10,7 @@
 
 #include <boost/utility/enable_if.hpp>
 #include <boost/mpl/and.hpp>
+#include <boost/detail/is_incrementable.hpp>
 #include <boost/itl/detail/design_config.hpp>
 #include <boost/itl/type_traits/is_discrete.hpp>
 #include <boost/itl/type_traits/is_asymmetric_interval.hpp>
@@ -17,72 +18,126 @@
 #include <boost/itl/type_traits/is_discrete_interval.hpp>
 #include <boost/itl/type_traits/is_continuous_interval.hpp>
 #include <boost/itl/type_traits/has_dynamic_bounds.hpp>
-#include <boost/itl/concept/domain_comparable.hpp>
+#include <boost/itl/concept/interval_bounds.hpp>
+#include <boost/itl/interval_traits.hpp>
+#include <boost/itl/dynamic_interval_traits.hpp>
 
 
 namespace boost{namespace itl
 {
 
-typedef unsigned char bound_type; //JODO encapsulation in a small class
-
 //==============================================================================
-//= Construct
+//= Ordering
 //==============================================================================
-
-class interval_bounds; //JODO separate dynamically and statically bounded interval concepts
-template<class DomainT> class bounded_value;
-
-//------------------------------------------------------------------------------
-//- Adapter classes
-//------------------------------------------------------------------------------
 template<class Type>
-struct intervals
+inline typename enable_if<is_interval<Type>, bool>::type
+domain_less(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
 {
- typedef typename Type::domain_type domain_type;
- typedef typename Type::domain_compare domain_compare;
-
- static Type construct(const domain_type& lo, const domain_type& up);
+ return typename interval_traits<Type>::domain_compare()(left, right);
+}
 
- static domain_type upper(const Type& inter_val);
- static domain_type lower(const Type& inter_val);
-};
+template<class Type>
+inline typename enable_if<is_interval<Type>, bool>::type
+domain_less_equal(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
+{
+ return !(typename interval_traits<Type>::domain_compare()(right, left));
+}
 
+template<class Type>
+inline typename enable_if<is_interval<Type>, bool>::type
+domain_equal(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
+{
+ return !(typename interval_traits<Type>::domain_compare()(left, right))
+ && !(typename interval_traits<Type>::domain_compare()(right, left));
+}
 
+//==============================================================================
+//= Construct<Interval> singleton
+//==============================================================================
 template<class Type>
-struct dynamic_intervals
+typename enable_if
+<
+ mpl::and_< is_static_rightopen<Type>
+ , is_discrete<typename interval_traits<Type>::domain_type> >
+ , Type
+>::type
+construct(const typename interval_traits<Type>::domain_type& value)
 {
- typedef typename Type::domain_type domain_type;
- typedef typename Type::domain_compare domain_compare;
+ //ASSERT: This always creates an interval with exactly one element
+ return interval_traits<Type>::construct(value, itl::succ(value));
+}
 
- static Type construct(const domain_type& lo, const domain_type& up, interval_bounds bounds);
- static Type construct_bounded(const bounded_value<domain_type>& lo,
- const bounded_value<domain_type>& up);
-};
+template<class Type>
+typename enable_if
+<
+ mpl::and_< is_static_leftopen<Type>
+ , is_discrete<typename interval_traits<Type>::domain_type> >
+ , Type
+>::type
+construct(const typename interval_traits<Type>::domain_type& value)
+{
+ //ASSERT: This always creates an interval with exactly one element
+ BOOST_ASSERT((std::numeric_limits<Type>::min)() < value);
+ return interval_traits<Type>::construct(itl::pred(value), value);
+}
 
+template<class Type>
+typename enable_if
+<
+ mpl::and_< is_static_open<Type>
+ , is_discrete<typename interval_traits<Type>::domain_type> >
+ , Type
+>::type
+construct(const typename interval_traits<Type>::domain_type& value)
+{
+ //ASSERT: This always creates an interval with exactly one element
+ BOOST_ASSERT((std::numeric_limits<Type>::min)() < value);
+ return interval_traits<Type>::construct(itl::pred(value), itl::succ(value));
+}
 
+template<class Type>
+typename enable_if
+<
+ mpl::and_< is_static_closed<Type>
+ , is_discrete<typename interval_traits<Type>::domain_type> >
+ , Type
+>::type
+construct(const typename interval_traits<Type>::domain_type& value)
+{
+ //ASSERT: This always creates an interval with exactly one element
+ return interval_traits<Type>::construct(value, value);
+}
 
+template<class Type>
+typename enable_if<has_dynamic_bounds<Type>, Type>::type
+construct(const typename interval_traits<Type>::domain_type& value)
+{
+ return dynamic_interval_traits<Type>::construct(value, value, interval_bounds::closed());
+}
 
 //==============================================================================
-//= Construct
+//= Construct<Interval> multon
 //==============================================================================
-
 template<class Type>
 typename enable_if<is_asymmetric_interval<Type>, Type>::type
-construct(const typename Type::domain_type& low, //JODO Parameter passing DomainP
- const typename Type::domain_type& up,
+construct(const typename interval_traits<Type>::domain_type& low,
+ const typename interval_traits<Type>::domain_type& up,
           interval_bounds bounds = interval_bounds::right_open()) //JODO separate static intervals to avoid dependency
 {
- return intervals<Type>::construct(low, up);
+ return interval_traits<Type>::construct(low, up);
 }
 
 
 template<class Type>
 typename enable_if<is_dynamic_bounded<Type>, Type>::type
-construct(const typename Type::domain_type& low,
- const typename Type::domain_type& up,
+construct(const typename interval_traits<Type>::domain_type& low,
+ const typename interval_traits<Type>::domain_type& up,
           interval_bounds bounds = interval_bounds::right_open())
 {
- return dynamic_intervals<Type>::construct(low, up, bounds);
+ return dynamic_interval_traits<Type>::construct(low, up, bounds);
 }
 
 
@@ -92,15 +147,15 @@
 construct(const typename Type::bounded_domain_type& low,
           const typename Type::bounded_domain_type& up)
 {
- return dynamic_intervals<Type>::construct_bounded(low, up);
+ return dynamic_interval_traits<Type>::construct_bounded(low, up);
 }
 
 template<class Type>
 typename enable_if<is_interval<Type>, Type>::type
-span(const typename Type::domain_type& lhs,
- const typename Type::domain_type& rhs)
+span(const typename interval_traits<Type>::domain_type& lhs,
+ const typename interval_traits<Type>::domain_type& rhs)
 {
- if(Type::domain_compare(lhs,rhs))
+ if(interval_traits<Type>::domain_compare(lhs,rhs))
         return construct(lhs, rhs);
     else
         return construct(rhs, lhs);
@@ -113,25 +168,25 @@
 
 template<class Type>
 inline typename enable_if<is_interval<Type>,
- typename Type::domain_type>::type
+ typename interval_traits<Type>::domain_type>::type
 lower(const Type& object)
 {
- return intervals<Type>::lower(object);
+ return interval_traits<Type>::lower(object);
 }
 
 template<class Type>
 inline typename enable_if<is_interval<Type>,
- typename Type::domain_type>::type
+ typename interval_traits<Type>::domain_type>::type
 upper(const Type& object)
 {
- return intervals<Type>::upper(object);
+ return interval_traits<Type>::upper(object);
 }
 
 
 //- first ----------------------------------------------------------------------
 template<class Type>
 inline typename enable_if<is_static_rightopen<Type>,
- typename Type::domain_type>::type
+ typename interval_traits<Type>::domain_type>::type
 first(const Type& object)
 {
     return lower(object);
@@ -139,7 +194,7 @@
 
 template<class Type>
 inline typename enable_if<is_discrete_interval<Type>,
- typename Type::domain_type>::type
+ typename interval_traits<Type>::domain_type>::type
 first(const Type& object)
 {
     return is_left_closed(object.bounds()) ?
@@ -150,8 +205,8 @@
 //- last -----------------------------------------------------------------------
 template<class Type>
 inline typename enable_if<mpl::and_<is_static_rightopen<Type>,
- is_discrete<typename Type::domain_type> >,
- typename Type::domain_type>::type
+ is_discrete<typename interval_traits<Type>::domain_type> >,
+ typename interval_traits<Type>::domain_type>::type
 last(const Type& object)
 {
     return pred(upper(object));
@@ -159,7 +214,7 @@
 
 template<class Type>
 inline typename enable_if<is_discrete_interval<Type>,
- typename Type::domain_type>::type
+ typename interval_traits<Type>::domain_type>::type
 last(const Type& object)
 {
     return is_right_closed(object.bounds()) ?
@@ -260,7 +315,7 @@
 
 template<class Type>
 typename boost::enable_if<is_interval<Type>, bool>::type
-contains(const Type& super, const typename Type::domain_type& element)
+contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
 {
     return contains(super,Type(element));
 }
@@ -284,7 +339,7 @@
 typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
 exclusive_less(const Type& left, const Type& right)
 {
- return domain_less_equal<Type>(left.upper(), right.lower());
+ return domain_less_equal<Type>(upper(left), lower(right));
 }
 
 template<class Type>
@@ -518,7 +573,7 @@
 typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
 touches(const Type& left, const Type& right)
 {
- return domain_equal<Type>(left.upper(), right.lower());
+ return domain_equal<Type>(upper(left), lower(right));
 }
 
 template<class Type>
@@ -659,8 +714,8 @@
     return
         Type
         (
- (std::min)(left.lower(), right.lower(), Type::domain_compare()),
- (std::max)(left.upper(), right.upper(), Type::domain_compare())
+ (std::min)(lower(left), lower(right), interval_traits<Type>::domain_compare()),
+ (std::max)(upper(left), upper(right), interval_traits<Type>::domain_compare())
         );
 }
 
@@ -681,7 +736,7 @@
         return right;
 
     //JODO return construct<Type,std::less>
- return dynamic_intervals<Type>::construct_bounded
+ return dynamic_interval_traits<Type>::construct_bounded
             (
                 lower_min(left, right),
                 upper_max(left, right)
@@ -708,7 +763,7 @@
     if(exclusive_less(left_minuend, right))
         return right;
     //JODO return construct(left_minuend.upper(), right.upper());
- return Type(left_minuend.upper(), right.upper());
+ return Type(upper(left_minuend), upper(right));
 }
 
 template<class Type>
@@ -724,7 +779,7 @@
 {
     if(exclusive_less(left_minuend, right))
         return right;
- return dynamic_intervals<Type>::construct_bounded
+ return dynamic_interval_traits<Type>::construct_bounded
             ( reverse_bounded_upper(left_minuend), bounded_upper(right) );
 }
 
@@ -745,7 +800,7 @@
 {
     if(exclusive_less(left, right_minuend))
         return left;
- return Type(left.lower(), right_minuend.lower());
+ return Type(lower(left), lower(right_minuend));
     //JODO return construct(left.lower(), right_minuend.lower());
 }
 
@@ -764,7 +819,7 @@
     if(exclusive_less(left, right_minuend))
         return left;
     //JODO return construct<Type,std::less>(left.lower(), right_minuend.lower(),
- return dynamic_intervals<Type>::construct_bounded
+ return dynamic_interval_traits<Type>::construct_bounded
             ( bounded_lower(left), reverse_bounded_lower(right_minuend) );
 }
 
@@ -781,8 +836,8 @@
         return Type(); //JODO return neutron<Type>::value; neutron for new interval_types.
     else
         return
- Type((std::max)(left.lower(), right.lower(), Type::domain_compare()),
- (std::min)(left.upper(), right.upper(), Type::domain_compare()));
+ Type((std::max)(itl::lower(left), itl::lower(right), interval_traits<Type>::domain_compare()),
+ (std::min)(itl::upper(left), itl::upper(right), interval_traits<Type>::domain_compare()));
 }
 
 template<class Type>
@@ -800,7 +855,7 @@
         return Type(); //JODO return neutron<Type>::value; neutron for new interval_types.
     else
         //JODO return construct<Type,std::less>
- return dynamic_intervals<Type>::construct_bounded
+ return dynamic_interval_traits<Type>::construct_bounded
                 (
                     lower_max(left, right),
                     upper_min(left, right)
@@ -825,6 +880,17 @@
 }
 
 //------------------------------------------------------------------------------
+template<class CharType, class CharTraits, class Type>
+typename boost::enable_if<is_interval<Type>,
+ std::basic_ostream<CharType, CharTraits> >::type&
+operator << (std::basic_ostream<CharType, CharTraits> &stream, Type const& object)
+{
+ if(boost::itl::is_empty(object))
+ return stream << "[)";
+ else
+ return stream << "[" << interval_traits<Type>::lower(object) << ","
+ << interval_traits<Type>::upper(object) << ")";
+}
 
 
 

Modified: sandbox/itl/boost/itl/concept/interval/base.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval/base.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval/base.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -19,7 +19,7 @@
 {
     typedef typename Type::interval_type interval_type;
     typedef typename Type::segment_type segment_type;
- return segment_type(interval_type(element.key), element.data);
+ return segment_type(itl::construct<interval_type>(element.key), element.data);
 }
 
 namespace segmental

Added: sandbox/itl/boost/itl/concept/interval_bounds.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/concept/interval_bounds.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -0,0 +1,132 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2010-2010: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_CONCEPT_INTERVAL_BOUNDS_HPP_JOFA_100927
+#define BOOST_ITL_CONCEPT_INTERVAL_BOUNDS_HPP_JOFA_100927
+
+#include <boost/itl/interval_bounds.hpp>
+#include <boost/itl/type_traits/has_dynamic_bounds.hpp>
+
+namespace boost{namespace itl
+{
+
+inline interval_bounds left(interval_bounds x1)
+{ return interval_bounds(x1._bits & interval_bounds::_left); }
+
+inline interval_bounds right(interval_bounds x1)
+{ return interval_bounds(x1._bits & interval_bounds::_right); }
+
+inline interval_bounds all(interval_bounds x1)
+{ return interval_bounds(x1._bits & interval_bounds::_all); }
+
+inline bool operator == (const interval_bounds x1, const interval_bounds x2)
+{ return x1._bits == x2._bits; }
+
+inline bool operator != (const interval_bounds x1, const interval_bounds x2)
+{ return x1._bits != x2._bits; }
+
+inline interval_bounds operator & (interval_bounds x1, interval_bounds x2)
+{ return interval_bounds(x1._bits & x2._bits); }
+
+inline interval_bounds operator | (interval_bounds x1, interval_bounds x2)
+{ return interval_bounds(x1._bits | x2._bits); }
+
+// left shift (multiplies by 2^shift)
+inline interval_bounds operator << (interval_bounds bounds, unsigned int shift)
+{ return interval_bounds(bounds._bits << shift); }
+
+// right shift (divides by 2^shift)
+inline interval_bounds operator >> (interval_bounds bounds, unsigned int shift)
+{ return interval_bounds(bounds._bits >> shift); }
+
+inline interval_bounds operator ~ (interval_bounds x1)
+{ return all(interval_bounds(~(x1._bits))); }
+
+inline interval_bounds outer_bounds(interval_bounds x1, interval_bounds x2)
+{ return left(x1) | right(x2); }
+
+inline interval_bounds inner_bounds(interval_bounds x1, interval_bounds x2)
+{ return interval_bounds(x1.reverse_right() | x2.reverse_left()); }
+
+inline interval_bounds left_bounds(interval_bounds x1, interval_bounds x2)
+{ return left(x1) | (left(x2) >> 1); }
+
+inline interval_bounds right_bounds(interval_bounds x1, interval_bounds x2)
+{ return (right(x1) <<1 ) | right(x2); }
+
+inline interval_bounds left_subtract_bounds(interval_bounds x1, interval_bounds x2)
+{ return right(x1) | ~(right(x2) << 1); }
+
+inline interval_bounds right_subtract_bounds(interval_bounds x1, interval_bounds x2)
+{ return left(x1) | ~(left(x2) >> 1); }
+
+inline bool is_complementary(interval_bounds x1)
+{ return x1 == interval_bounds::right_open() || x1 == interval_bounds::left_open(); }
+
+inline bool is_left_closed(interval_bounds bounds)
+{ return bounds.left().bits()==2; }
+
+inline bool is_right_closed(interval_bounds bounds)
+{ return bounds.right().bits()==1; }
+
+inline std::string left_bracket(interval_bounds bounds)
+{ return is_left_closed(bounds) ? "[" : "("; }
+
+inline std::string right_bracket(interval_bounds bounds)
+{ return is_right_closed(bounds) ? "]" : ")"; }
+
+template<class CharType, class CharTraits>
+std::basic_ostream<CharType, CharTraits>& operator <<
+ (std::basic_ostream<CharType, CharTraits> &stream,
+ interval_bounds const& object)
+{
+ return stream << "'" << left_bracket(object) << right_bracket(object) << "'";
+}
+
+
+
+template<class IntervalT>
+inline typename
+boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
+outer_bounds(const IntervalT& x1, const IntervalT& x2)
+{ return outer_bounds(x1.bounds(), x2.bounds()); }
+
+template<class IntervalT>
+inline typename
+boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
+inner_bounds(const IntervalT& x1, const IntervalT& x2)
+{ return inner_bounds(x1.bounds(), x2.bounds()); }
+
+template<class IntervalT>
+inline typename
+boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
+left_bounds(const IntervalT& x1, const IntervalT& x2)
+{ return left_bounds(x1.bounds(), x2.bounds()); }
+
+template<class IntervalT>
+inline typename
+boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
+right_bounds(const IntervalT& x1, const IntervalT& x2)
+{ return right_bounds(x1.bounds(), x2.bounds()); }
+
+template<class IntervalT>
+inline typename
+boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
+left_subtract_bounds(const IntervalT& x1, const IntervalT& x2)
+{ return left_subtract_bounds(x1.bounds(), x2.bounds()); }
+
+template<class IntervalT>
+inline typename
+boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
+right_subtract_bounds(const IntervalT& x1, const IntervalT& x2)
+{ return right_subtract_bounds(x1.bounds(), x2.bounds()); }
+
+
+}} // namespace itl boost
+
+#endif
+

Modified: sandbox/itl/boost/itl/continuous_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/continuous_interval.hpp (original)
+++ sandbox/itl/boost/itl/continuous_interval.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -94,12 +94,12 @@
 
 
 //==============================================================================
-//=T continuous_interval -> concept intervals
+//=T continuous_interval -> concept interval
 //==============================================================================
 template<class DomainT, ITL_COMPARE Compare>
-struct intervals< itl::continuous_interval<DomainT, Compare> >
+struct interval_traits< itl::continuous_interval<DomainT, Compare> >
 {
- typedef intervals type;
+ typedef interval_traits type;
     typedef DomainT domain_type;
     typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
     typedef itl::continuous_interval<DomainT, Compare> interval_type;
@@ -115,14 +115,17 @@
 
 
 //==============================================================================
-//=T continuous_interval -> concept dynamic_intervals
+//=T continuous_interval -> concept dynamic_interval
 //==============================================================================
 template<class DomainT, ITL_COMPARE Compare>
-struct dynamic_intervals<boost::itl::continuous_interval<DomainT,Compare> >
+struct dynamic_interval_traits<boost::itl::continuous_interval<DomainT,Compare> >
 {
+ typedef dynamic_interval_traits type;
     typedef boost::itl::continuous_interval<DomainT,Compare> interval_type;
+ typedef DomainT domain_type;
+ typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
 
- static interval_type construct(const DomainT& lo, const DomainT& up, interval_bounds bounds)
+ static interval_type construct(const domain_type lo, const domain_type up, interval_bounds bounds)
     {
         return itl::continuous_interval<DomainT,Compare>(lo, up, bounds,
             static_cast<itl::continuous_interval<DomainT,Compare>* >(0) );
@@ -140,16 +143,14 @@
     }
 };
 
-
-
 //==============================================================================
 //= Type traits
 //==============================================================================
 template <class DomainT, ITL_COMPARE Compare>
-struct is_interval<continuous_interval<DomainT,Compare> >
+struct interval_bound_type< continuous_interval<DomainT,Compare> >
 {
- typedef is_interval<continuous_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
+ typedef interval_bound_type type;
+ BOOST_STATIC_CONSTANT(unsigned char, value = interval_bounds::dynamic);
 };
 
 template <class DomainT, ITL_COMPARE Compare>
@@ -159,13 +160,6 @@
     BOOST_STATIC_CONSTANT(bool, value = true);
 };
 
-template <class DomainT, ITL_COMPARE Compare>
-struct has_dynamic_bounds<continuous_interval<DomainT,Compare> >
-{
- typedef has_dynamic_bounds<continuous_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
 template <class DomainT, ITL_COMPARE Compare>
 struct type_to_string<itl::continuous_interval<DomainT,Compare> >
 {

Modified: sandbox/itl/boost/itl/discrete_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/discrete_interval.hpp (original)
+++ sandbox/itl/boost/itl/discrete_interval.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -100,9 +100,9 @@
 //=T discrete_interval -> concept intervals
 //==============================================================================
 template<class DomainT, ITL_COMPARE Compare>
-struct intervals< itl::discrete_interval<DomainT, Compare> >
+struct interval_traits< itl::discrete_interval<DomainT, Compare> >
 {
- typedef intervals type;
+ typedef interval_traits type;
     typedef DomainT domain_type;
     typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
     typedef itl::discrete_interval<DomainT, Compare> interval_type;
@@ -116,18 +116,18 @@
     static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
 };
 
-
-
 //==============================================================================
-//=T discrete_interval -> concept dynamic_intervals
+//=T discrete_interval -> concept dynamic_interval_traits
 //==============================================================================
 template<class DomainT, ITL_COMPARE Compare>
-struct dynamic_intervals<boost::itl::discrete_interval<DomainT,Compare> >
+struct dynamic_interval_traits<boost::itl::discrete_interval<DomainT,Compare> >
 {
- typedef dynamic_intervals type;
+ typedef dynamic_interval_traits type;
     typedef boost::itl::discrete_interval<DomainT,Compare> interval_type;
+ typedef DomainT domain_type;
+ typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
 
- static interval_type construct(const DomainT& lo, const DomainT& up, interval_bounds bounds)
+ static interval_type construct(const domain_type& lo, const domain_type& up, interval_bounds bounds)
     {
         return interval_type(lo, up, bounds, static_cast<interval_type*>(0) );
     }
@@ -144,16 +144,14 @@
     }
 };
 
-
-
 //==============================================================================
 //= Type traits
 //==============================================================================
 template <class DomainT, ITL_COMPARE Compare>
-struct is_interval<discrete_interval<DomainT,Compare> >
+struct interval_bound_type< discrete_interval<DomainT,Compare> >
 {
- typedef is_interval<discrete_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
+ typedef interval_bound_type type;
+ BOOST_STATIC_CONSTANT(unsigned char, value = interval_bounds::dynamic);
 };
 
 template <class DomainT, ITL_COMPARE Compare>
@@ -163,13 +161,6 @@
     BOOST_STATIC_CONSTANT(bool, value = !is_continuous<DomainT>::value); //JODO
 };
 
-template <class DomainT, ITL_COMPARE Compare>
-struct has_dynamic_bounds<discrete_interval<DomainT,Compare> >
-{
- typedef has_dynamic_bounds<discrete_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
 template <class DomainT, ITL_COMPARE Compare>
 struct type_to_string<itl::discrete_interval<DomainT,Compare> >
 {

Added: sandbox/itl/boost/itl/dynamic_interval_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/dynamic_interval_traits.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -0,0 +1,38 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2010-2010: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_DYNAMIC_INTERVAL_TRAITS_HPP_JOFA_100926
+#define BOOST_ITL_DYNAMIC_INTERVAL_TRAITS_HPP_JOFA_100926
+
+namespace boost{ namespace itl
+{
+
+class interval_bounds;
+template<class DomainT> class bounded_value;
+
+
+//------------------------------------------------------------------------------
+//- Adapter class
+//------------------------------------------------------------------------------
+template<class Type>
+struct dynamic_interval_traits
+{
+ typedef typename Type::domain_type domain_type;
+ typedef typename Type::domain_compare domain_compare;
+ typedef typename boost::call_traits<domain_type>::param_type domain_param;
+
+ static Type construct(const domain_type& lo, const domain_type& up, interval_bounds bounds);
+ static Type construct_bounded(const bounded_value<domain_type>& lo,
+ const bounded_value<domain_type>& up);
+};
+
+
+}} // namespace boost itl
+
+#endif
+
+

Modified: sandbox/itl/boost/itl/interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval.hpp (original)
+++ sandbox/itl/boost/itl/interval.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -17,7 +17,6 @@
 #include <boost/static_assert.hpp>
 #include <boost/concept_check.hpp>
 #include <boost/next_prior.hpp>
-#include <boost/call_traits.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/assert.hpp>
@@ -1140,10 +1139,10 @@
 
 
 //------------------------------------------------------------------------------
-//- dynamic_intervals: Adapt interval class to interval concept
+//- dynamic_interval_traits: Adapt interval class to interval concept
 //------------------------------------------------------------------------------
 template<class DomainT, ITL_COMPARE Compare>
-struct dynamic_intervals< itl::interval<DomainT,Compare> >
+struct dynamic_interval_traits< itl::interval<DomainT,Compare> >
 {
     typedef boost::itl::interval<DomainT,Compare> interval_type;
 

Modified: sandbox/itl/boost/itl/interval_base_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_map.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -113,9 +113,9 @@
     //- Associated types: Size
     //--------------------------------------------------------------------------
     /// The difference type of an interval which is sometimes different form the domain_type
- typedef typename interval_type::difference_type difference_type;
+ typedef typename difference_type_of<domain_type>::type difference_type;
     /// The size type of an interval which is mostly std::size_t
- typedef typename interval_type::size_type size_type;
+ typedef typename size_type_of<domain_type>::type size_type;
 
     //--------------------------------------------------------------------------
     //- Associated types: Functors
@@ -368,10 +368,6 @@
     //==========================================================================
     //= Insertion
     //==========================================================================
-
- //std::pair<iterator,bool> _insert(const value_type& value_pair){ return _map.insert(value_pair); } //CL
- //iterator _insert(iterator prior, const value_type& value_pair){ return _map.insert(prior, value_pair); } //CL
-
     /** Insertion of a \c key_value_pair into the map. */
     SubType& insert(const element_type& key_value_pair)
     {

Modified: sandbox/itl/boost/itl/interval_base_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_set.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_set.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -165,10 +165,10 @@
     //- Associated types: Size
     //--------------------------------------------------------------------------
     /// The difference type of an interval which is sometimes different form the data_type
- typedef typename interval_type::difference_type difference_type;
+ typedef typename difference_type_of<domain_type>::type difference_type;
 
     /// The size type of an interval which is mostly std::size_t
- typedef typename interval_type::size_type size_type;
+ typedef typename size_type_of<domain_type>::type size_type;
 
 
     //--------------------------------------------------------------------------
@@ -325,7 +325,7 @@
     /** Find the interval value pair, that contains element \c key */
     const_iterator find(const element_type& key)const
     {
- return this->_set.find(interval_type(key));
+ return this->_set.find(itl::construct<segment_type>(key));
     }
 
     const_iterator find(const segment_type& segment)const
@@ -340,7 +340,7 @@
     /** Add a single element \c key to the set */
     SubType& add(const element_type& key)
     {
- return add(segment_type(key));
+ return add(itl::construct<segment_type>(key));
     }
 
     /** Add an interval of elements \c inter_val to the set */
@@ -365,7 +365,7 @@
     /** Subtract a single element \c key from the set */
     SubType& subtract(const element_type& key)
     {
- return subtract(segment_type(key));
+ return subtract(itl::construct<interval_type>(key));
     }
 
     /** Subtract an interval of elements \c inter_val from the set */

Modified: sandbox/itl/boost/itl/interval_bounds.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_bounds.hpp (original)
+++ sandbox/itl/boost/itl/interval_bounds.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -10,11 +10,11 @@
 
 #include <boost/utility/enable_if.hpp>
 #include <boost/itl/detail/design_config.hpp>
-#include <boost/itl/type_traits/has_dynamic_bounds.hpp>
 
 namespace boost{namespace itl
 {
 
+//JODO CL?
 /// Constants for interval bounds
 enum BoundTypes {
     /// Both open: <tt>(x,y)</tt>
@@ -32,6 +32,13 @@
 class interval_bounds
 {
 public:
+ BOOST_STATIC_CONSTANT(bound_type, static_open = 0);
+ BOOST_STATIC_CONSTANT(bound_type, static_leftopen = 1);
+ BOOST_STATIC_CONSTANT(bound_type, static_rightopen = 2);
+ BOOST_STATIC_CONSTANT(bound_type, static_closed = 3);
+ BOOST_STATIC_CONSTANT(bound_type, dynamic = 4);
+ BOOST_STATIC_CONSTANT(bound_type, undefined = 5);
+
     BOOST_STATIC_CONSTANT(bound_type, _open = 0);
     BOOST_STATIC_CONSTANT(bound_type, _leftopen = 1);
     BOOST_STATIC_CONSTANT(bound_type, _rightopen = 2);
@@ -62,118 +69,6 @@
 };
 
 
-inline interval_bounds left(interval_bounds x1)
-{ return interval_bounds(x1._bits & interval_bounds::_left); }
-
-inline interval_bounds right(interval_bounds x1)
-{ return interval_bounds(x1._bits & interval_bounds::_right); }
-
-inline interval_bounds all(interval_bounds x1)
-{ return interval_bounds(x1._bits & interval_bounds::_all); }
-
-inline bool operator == (const interval_bounds x1, const interval_bounds x2)
-{ return x1._bits == x2._bits; }
-
-inline bool operator != (const interval_bounds x1, const interval_bounds x2)
-{ return x1._bits != x2._bits; }
-
-inline interval_bounds operator & (interval_bounds x1, interval_bounds x2)
-{ return interval_bounds(x1._bits & x2._bits); }
-
-inline interval_bounds operator | (interval_bounds x1, interval_bounds x2)
-{ return interval_bounds(x1._bits | x2._bits); }
-
-// left shift (multiplies by 2^shift)
-inline interval_bounds operator << (interval_bounds bounds, unsigned int shift)
-{ return interval_bounds(bounds._bits << shift); }
-
-// right shift (divides by 2^shift)
-inline interval_bounds operator >> (interval_bounds bounds, unsigned int shift)
-{ return interval_bounds(bounds._bits >> shift); }
-
-inline interval_bounds operator ~ (interval_bounds x1)
-{ return all(interval_bounds(~(x1._bits))); }
-
-inline interval_bounds outer_bounds(interval_bounds x1, interval_bounds x2)
-{ return left(x1) | right(x2); }
-
-inline interval_bounds inner_bounds(interval_bounds x1, interval_bounds x2)
-{ return interval_bounds(x1.reverse_right() | x2.reverse_left()); }
-
-inline interval_bounds left_bounds(interval_bounds x1, interval_bounds x2)
-{ return left(x1) | (left(x2) >> 1); }
-
-inline interval_bounds right_bounds(interval_bounds x1, interval_bounds x2)
-{ return (right(x1) <<1 ) | right(x2); }
-
-inline interval_bounds left_subtract_bounds(interval_bounds x1, interval_bounds x2)
-{ return right(x1) | ~(right(x2) << 1); }
-
-inline interval_bounds right_subtract_bounds(interval_bounds x1, interval_bounds x2)
-{ return left(x1) | ~(left(x2) >> 1); }
-
-inline bool is_complementary(interval_bounds x1)
-{ return x1 == interval_bounds::right_open() || x1 == interval_bounds::left_open(); }
-
-inline bool is_left_closed(interval_bounds bounds)
-{ return bounds.left().bits()==2; }
-
-inline bool is_right_closed(interval_bounds bounds)
-{ return bounds.right().bits()==1; }
-
-inline std::string left_bracket(interval_bounds bounds)
-{ return is_left_closed(bounds) ? "[" : "("; }
-
-inline std::string right_bracket(interval_bounds bounds)
-{ return is_right_closed(bounds) ? "]" : ")"; }
-
-template<class CharType, class CharTraits>
-std::basic_ostream<CharType, CharTraits>& operator <<
- (std::basic_ostream<CharType, CharTraits> &stream,
- interval_bounds const& object)
-{
- return stream << "'" << left_bracket(object) << right_bracket(object) << "'";
-}
-
-
-
-template<class IntervalT>
-inline typename
-boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
-outer_bounds(const IntervalT& x1, const IntervalT& x2)
-{ return outer_bounds(x1.bounds(), x2.bounds()); }
-
-template<class IntervalT>
-inline typename
-boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
-inner_bounds(const IntervalT& x1, const IntervalT& x2)
-{ return inner_bounds(x1.bounds(), x2.bounds()); }
-
-template<class IntervalT>
-inline typename
-boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
-left_bounds(const IntervalT& x1, const IntervalT& x2)
-{ return left_bounds(x1.bounds(), x2.bounds()); }
-
-template<class IntervalT>
-inline typename
-boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
-right_bounds(const IntervalT& x1, const IntervalT& x2)
-{ return right_bounds(x1.bounds(), x2.bounds()); }
-
-template<class IntervalT>
-inline typename
-boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
-left_subtract_bounds(const IntervalT& x1, const IntervalT& x2)
-{ return left_subtract_bounds(x1.bounds(), x2.bounds()); }
-
-template<class IntervalT>
-inline typename
-boost::enable_if<has_dynamic_bounds<IntervalT>, interval_bounds>::type
-right_subtract_bounds(const IntervalT& x1, const IntervalT& x2)
-{ return right_subtract_bounds(x1.bounds(), x2.bounds()); }
-
-
 template<class DomainT>
 class bounded_value
 {

Added: sandbox/itl/boost/itl/interval_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/interval_traits.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -0,0 +1,35 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2010-2010: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_INTERVAL_TRAITS_HPP_JOFA_100926
+#define BOOST_ITL_INTERVAL_TRAITS_HPP_JOFA_100926
+
+
+namespace boost{ namespace itl
+{
+
+//------------------------------------------------------------------------------
+//- Adapter class
+//------------------------------------------------------------------------------
+template<class Type>
+struct interval_traits
+{
+ typedef typename Type::domain_type domain_type;
+ typedef typename Type::domain_compare domain_compare;
+
+ static Type construct(const domain_type& lo, const domain_type& up);
+
+ static domain_type upper(const Type& inter_val);
+ static domain_type lower(const Type& inter_val);
+};
+
+
+}} // namespace boost itl
+
+#endif
+
+

Modified: sandbox/itl/boost/itl/rightopen_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/rightopen_interval.hpp (original)
+++ sandbox/itl/boost/itl/rightopen_interval.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -84,7 +84,7 @@
 //=T rightopen_interval -> concept intervals
 //==============================================================================
 template<class DomainT, ITL_COMPARE Compare>
-struct intervals< itl::rightopen_interval<DomainT, Compare> >
+struct interval_traits< itl::rightopen_interval<DomainT, Compare> >
 {
     typedef DomainT domain_type;
     typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
@@ -104,31 +104,10 @@
 //= Type traits
 //==============================================================================
 template <class DomainT, ITL_COMPARE Compare>
-struct is_interval<rightopen_interval<DomainT,Compare> >
+struct interval_bound_type< rightopen_interval<DomainT,Compare> >
 {
- typedef is_interval<rightopen_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template <class DomainT, ITL_COMPARE Compare>
-struct has_static_bounds<rightopen_interval<DomainT,Compare> >
-{
- typedef has_static_bounds<rightopen_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template <class DomainT, ITL_COMPARE Compare>
-struct has_asymmetric_bounds<rightopen_interval<DomainT,Compare> >
-{
- typedef has_asymmetric_bounds<rightopen_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template <class DomainT, ITL_COMPARE Compare>
-struct is_static_rightopen<rightopen_interval<DomainT,Compare> >//JODO replace this predicate static_borders in {open, leftopen, rightopen, cloded}
-{
- typedef is_static_rightopen<rightopen_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
+ typedef interval_bound_type type;
+ BOOST_STATIC_CONSTANT(unsigned char, value = interval_bounds::static_rightopen);
 };
 
 template <class DomainT, ITL_COMPARE Compare>
@@ -138,8 +117,8 @@
     { return "[I)<"+ type_to_string<DomainT>::apply() +">"; }
 };
 
-template<class DomainT>
-struct value_size<itl::rightopen_interval<DomainT> >
+template<class DomainT, ITL_COMPARE Compare>
+struct value_size<itl::rightopen_interval<DomainT,Compare> >
 {
     static std::size_t apply(const itl::rightopen_interval<DomainT>& value)
     { return 2; }

Modified: sandbox/itl/boost/itl/type_traits/has_dynamic_bounds.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/has_dynamic_bounds.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/has_dynamic_bounds.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -8,6 +8,7 @@
 #ifndef BOOST_ITL_TYPE_TRAITS_HAS_DYNAMIC_BOUNDS_HPP_JOFA_100327
 #define BOOST_ITL_TYPE_TRAITS_HAS_DYNAMIC_BOUNDS_HPP_JOFA_100327
 
+#include <boost/itl/interval_bounds.hpp>
 #include <boost/itl/type_traits/is_interval.hpp>
 
 namespace boost{ namespace itl
@@ -16,7 +17,8 @@
 template <class Type> struct has_dynamic_bounds
 {
     typedef has_dynamic_bounds<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(bool,
+ value = (interval_bound_type<Type>::value == interval_bounds::dynamic));
 };
 
 template <class Type> struct is_dynamic_bounded //JODO rearrange for all those predicates.

Modified: sandbox/itl/boost/itl/type_traits/is_continuous.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_continuous.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_continuous.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -9,10 +9,19 @@
 #define BOOST_ITL_TYPE_TRAITS_IS_CONTINUOUS_HPP_JOFA_080910
 
 #include <string>
-#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/itl/type_traits/is_discrete.hpp>
 
 namespace boost{ namespace itl
 {
+ //JODO Dies waere eigentlich besser, funktioniert aber nicht
+ //template <class Type> struct is_continuous
+ //{
+ // typedef is_continuous type;
+ // BOOST_STATIC_CONSTANT(bool,
+ // value = mpl::not_<is_discrete<Type> >::value);
+ //};
+
     template <class Type> struct is_continuous;
 
     template<> struct is_continuous<float>
@@ -43,12 +52,6 @@
     {
         typedef is_continuous<Type> type;
         BOOST_STATIC_CONSTANT(bool, value = false);
- //JODO Meta Fortsetzung des Praedikats auf interval<Type> etc.
- // so nicht, vielleicht anders? Meta lambda?
- //value = (mpl::and_<has_domain<Type>::value,
- // is_continuous<typename Type::domain_type>
- // >::value
- // ));
     };
 
 }} // namespace boost itl

Modified: sandbox/itl/boost/itl/type_traits/is_discrete.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_discrete.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_discrete.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -9,14 +9,22 @@
 #define BOOST_ITL_TYPE_TRAITS_IS_DISCRETE_HPP_JOFA_100410
 
 #include <string>
+#include <boost/config.hpp> // For macro BOOST_STATIC_CONSTANT
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/detail/is_incrementable.hpp>
 #include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/is_floating_point.hpp>
 
 namespace boost{ namespace itl
 {
     template <class Type> struct is_discrete
     {
         typedef is_discrete type;
- BOOST_STATIC_CONSTANT(bool, value = is_integral<Type>::value);
+ BOOST_STATIC_CONSTANT(bool,
+ value = (mpl::and_< boost::detail::is_incrementable<Type>
+ , mpl::not_<is_floating_point<Type> > >::value)
+ );
     };
 
 }} // namespace boost itl

Deleted: sandbox/itl/boost/itl/type_traits/is_domain_comparable.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_domain_comparable.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
+++ (empty file)
@@ -1,39 +0,0 @@
-/*-----------------------------------------------------------------------------+
-Copyright (c) 2010-2010: Joachim Faulhaber
-+------------------------------------------------------------------------------+
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENCE.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt)
-+-----------------------------------------------------------------------------*/
-#ifndef BOOST_ITL_TYPE_TRAITS_IS_DOMAIN_COMPARABLE_HPP_JOFA_100925
-#define BOOST_ITL_TYPE_TRAITS_IS_DOMAIN_COMPARABLE_HPP_JOFA_100925
-
-#include <boost/mpl/has_xxx.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/not.hpp>
-#include <boost/itl/type_traits/domain_type_of.hpp>
-
-namespace boost{ namespace itl
-{
- namespace detail
- {
- BOOST_MPL_HAS_XXX_TRAIT_DEF(domain_param)
- BOOST_MPL_HAS_XXX_TRAIT_DEF(domain_compare)
- }
-
- template <class Type>
- struct is_domain_comparable
- : mpl::bool_
- <
- detail::has_domain_type<Type>::value &&
- detail::has_domain_param<Type>::value &&
- detail::has_domain_compare<Type>::value
- >
- {};
-
-}} // namespace boost itl
-
-#endif
-
-

Modified: sandbox/itl/boost/itl/type_traits/is_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_interval.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_interval.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -8,52 +8,71 @@
 #ifndef BOOST_ITL_TYPE_TRAITS_IS_INTERVAL_HPP_JOFA_100327
 #define BOOST_ITL_TYPE_TRAITS_IS_INTERVAL_HPP_JOFA_100327
 
+#include <boost/itl/interval_bounds.hpp>
+
 namespace boost{ namespace itl
 {
 
+template <class Type>
+struct interval_bound_type
+{
+ typedef interval_bound_type type;
+ BOOST_STATIC_CONSTANT(unsigned char, value = (interval_bounds::undefined));
+};
+
 template <class Type> struct is_interval
 {
     typedef is_interval<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(bool,
+ value = (interval_bound_type<Type>::value < interval_bounds::undefined));
 };
 
 //JODO separate. Consider introducing interval_trais.
 template <class Type> struct has_static_bounds
 {
     typedef has_static_bounds<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(bool,
+ value = (interval_bound_type<Type>::value < interval_bounds::dynamic));
 };
 
 template <class Type> struct has_asymmetric_bounds
 {
     typedef has_asymmetric_bounds<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(unsigned char, bounds = (interval_bound_type<Type>::value));
+ BOOST_STATIC_CONSTANT(bool,
+ value = ( bounds == interval_bounds::static_leftopen
+ || bounds == interval_bounds::static_rightopen));
 };
 
 template <class Type> struct is_static_rightopen
 {
     typedef is_static_rightopen<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(bool,
+ value = (interval_bound_type<Type>::value == interval_bounds::static_rightopen));
 };
 
 template <class Type> struct is_static_leftopen
 {
     typedef is_static_leftopen<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(bool,
+ value = (interval_bound_type<Type>::value == interval_bounds::static_leftopen));
 };
 
 template <class Type> struct is_static_open
 {
     typedef is_static_leftopen<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(bool,
+ value = (interval_bound_type<Type>::value == interval_bounds::static_open));
 };
 
 template <class Type> struct is_static_closed
 {
     typedef is_static_leftopen<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(bool,
+ value = (interval_bound_type<Type>::value == interval_bounds::static_closed));
 };
 
+
 }} // namespace boost itl
 
 #endif

Modified: sandbox/itl/libs/itl/example/Jamfile.v2
==============================================================================
--- sandbox/itl/libs/itl/example/Jamfile.v2 (original)
+++ sandbox/itl/libs/itl/example/Jamfile.v2 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -51,6 +51,14 @@
         <include>$(BOOST_ROOT)
     ;
 
+exe custom_interval
+ :
+ custom_interval_/custom_interval.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
 # Examples using boost_date_time
 exe boost_party
     :

Added: sandbox/itl/libs/itl/example/custom_interval_/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/example/custom_interval_/Jamfile.v2 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -0,0 +1,11 @@
+# (C) Copyright 2010: Joachim Faulhaber
+# 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)
+
+exe custom_interval
+ :
+ custom_interval.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;

Added: sandbox/itl/libs/itl/example/custom_interval_/custom_interval.cpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/example/custom_interval_/custom_interval.cpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -0,0 +1,100 @@
+/*-----------------------------------------------------------------------------+
+Interval Template Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2010: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+
+/** Example custom_interval.cpp \file custom_interval.cpp
+ \brief Shows how to use interval containers with own interval classes.
+
+ There may be instances, where we want to use interval container with our
+ own user defined interval classes. Boost interval containers can be adapted
+ to your interval class by partial template specialisation. Only a few lines
+ of code are needed to achieve this.
+
+ \include custom_interval_/custom_interval.cpp
+*/
+//[example_custom_interval
+#include <iostream>
+#include <boost/itl/interval_set.hpp>
+
+using namespace std;
+using namespace boost::itl;
+
+// Here is a typical class that may model intervals in your application.
+class MyInterval
+{
+public:
+ MyInterval(): _first(), _past(){}
+ MyInterval(int lo, int up): _first(lo), _past(up){}
+ int first()const{ return _first; }
+ int past ()const{ return _past; }
+private:
+ int _first, _past;
+};
+
+// Class template interval_traits serves as adapter to register and customize your interval class
+template<>
+struct interval_traits< MyInterval > //1. Partially specialize interval_traits for
+{ // your class MyInterval
+ //2. Define associated types
+ typedef MyInterval interval_type; //2.1 MyInterval will be the interval_type
+ typedef int domain_type; //2.2 The elements of the domain are ints
+ typedef std::less<int> domain_compare; //2.3 This is the way our element shall be ordered.
+ //3. Next we define the essential functions
+ // of the specialisation
+ //3.1 Construction of intervals
+ static interval_type construct(const domain_type& lo, const domain_type& up)
+ { return interval_type(lo, up); }
+ //3.2 Selection of values
+ static domain_type lower(const interval_type& inter_val){ return inter_val.first(); };
+ static domain_type upper(const interval_type& inter_val){ return inter_val.past(); };
+};
+
+template<>
+struct interval_bound_type<MyInterval> //4. Finally we define the interval borders.
+{ // Choose between static_open (lo..up)
+ typedef interval_bound_type type; // static_leftopen (lo..up]
+ BOOST_STATIC_CONSTANT(unsigned char, value = interval_bounds::static_rightopen);//[lo..up)
+}; // and static_closed [lo..up]
+
+
+void custom_interval()
+{
+ // Now we can use class MyInterval with interval containers:
+ typedef interval_set<int, std::less, MyInterval> MyIntervalSet;
+ MyIntervalSet mySet;
+ mySet += MyInterval(1,9);
+ cout << mySet << endl;
+ mySet.subtract(3) -= 6;
+ cout << mySet << " subtracted 3 and 6\n";
+ mySet ^= MyInterval(2,8);
+ cout << mySet << " flipped between 2 and 7\n";
+}
+
+
+int main()
+{
+ cout << ">> Interval Template Library: Sample custom_interval.cpp <<\n";
+ cout << "-----------------------------------------------------------\n";
+ cout << "This program uses a user defined interval class:\n";
+ custom_interval();
+ return 0;
+}
+
+// Program output:
+/*-----------------------------------------------------------------------------
+>> Interval Template Library: Sample custom_interval.cpp <<
+-----------------------------------------------------------
+This program uses a user defined interval class:
+{[1, 9)}
+{[1, 3) [4, 6) [7, 9)} subtracted 3 and 6
+{[1,2) [3,4) [6,7) [8,9)} flipped between 2 and 7
+-----------------------------------------------------------------------------*/
+//]
+

Added: sandbox/itl/libs/itl/example/custom_interval_/vc9_custom_interval.vcproj
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/example/custom_interval_/vc9_custom_interval.vcproj 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_custom_interval"
+ ProjectGUID="{0D1DB87E-E72A-4FE9-A067-1907CC6614F8}"
+ RootNamespace="Custom_interval"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\custom_interval.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Modified: sandbox/itl/libs/itl/example/large_bitset_/bits.hpp
==============================================================================
--- sandbox/itl/libs/itl/example/large_bitset_/bits.hpp (original)
+++ sandbox/itl/libs/itl/example/large_bitset_/bits.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -10,8 +10,9 @@
 #define BOOST_LIBS_ITL_EXAMPLE_LARGE_BITSET_BITS_HPP_JOFA_091019
 //[mini_bits_includes
                                                // These includes are needed ...
-#include <string> // for conversion to output
-#include <boost/itl/type_traits/is_set.hpp> // to define that bits is a set
+#include <string> // for conversion to output and to
+#include <boost/itl/type_traits/has_set_semantics.hpp>//declare that bits has the
+ // behavior of a set.
 //]
 
 namespace mini

Modified: sandbox/itl/libs/itl/example/large_bitset_/large_bitset.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/large_bitset_/large_bitset.cpp (original)
+++ sandbox/itl/libs/itl/example/large_bitset_/large_bitset.cpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -44,7 +44,7 @@
 {
     const nat64 much = 0xffffffffffffffffull;
     large_bitset<> venti; // ... the largest, I can think of ;)
- venti += interval<nat64>(0, much);
+ venti += discrete_interval<nat64>(0, much);
 
     cout << "----- Test function test_large() -----------------------------------------------\n";
     cout << "We have just turned on the awesome amount of 18,446,744,073,709,551,616 bits ;-)\n";
@@ -69,22 +69,23 @@
 
     cout << "----- Test function test_small() -----------\n";
     cout << "-- Switch on all bits in range [0,64] ------\n";
- tall += interval<nat>(0, 64);
+ tall += discrete_interval<nat>(0, 64);
     tall.show_segments();
     cout << "--------------------------------------------\n";
 
     cout << "-- Turn off bits: 25,27,28 -----------------\n";
+
     (((tall -= 25) -= 27) -= 28) ;
     tall.show_segments();
     cout << "--------------------------------------------\n";
 
     cout << "-- Flip bits in range [24,30) --------------\n";
- tall ^= interval<nat>::rightopen(24,30);
+ tall ^= discrete_interval<nat>::rightopen(24,30);
     tall.show_segments();
     cout << "--------------------------------------------\n";
 
     cout << "-- Remove the first 10 bits ----------------\n";
- tall -= interval<nat>::rightopen(0,10);
+ tall -= discrete_interval<nat>::rightopen(0,10);
     tall.show_segments();
 
     cout << "-- Remove even bits in range [0,72) --------\n";
@@ -107,14 +108,14 @@
     typedef large_bitset<nat, bits8> Bit8Set;
 
     Bit8Set square, stare;
- square += interval<nat>(0,7);
+ square += discrete_interval<nat>(0,8);
     for(int i=1; i<5; i++)
     {
         square += 8*i;
         square += 8*i+7;
     }
 
- square += interval<nat>(41,46);
+ square += discrete_interval<nat>(41,47);
 
     cout << "----- Test function test_picturesque() -----\n";
     cout << "-------- empty face: "
@@ -122,7 +123,7 @@
     square.show_matrix(" *");
 
     stare += 18; stare += 21;
- stare += interval<nat>(34,37);
+ stare += discrete_interval<nat>(34,38);
 
     cout << "-------- compressed smile: "
          << stare.interval_count() << " intervals -----\n";
@@ -142,7 +143,7 @@
     const NatT much = (numeric_limits<NatT>::max)();
 
     large_bitset<NatT, BitsT> venti; //the largest, I can think of
- venti += interval<NatT>(0, much);
+ venti += discrete_interval<NatT>(0, much);
 
     cout << "--------------------------------------------------------------------------------\n";
     venti.show_segments();

Modified: sandbox/itl/libs/itl/example/large_bitset_/large_bitset.hpp
==============================================================================
--- sandbox/itl/libs/itl/example/large_bitset_/large_bitset.hpp (original)
+++ sandbox/itl/libs/itl/example/large_bitset_/large_bitset.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -93,11 +93,11 @@
     large_bitset& operator &=(const large_bitset& rhs) {_map &= rhs._map; return *this;}
     large_bitset& operator ^=(const large_bitset& rhs) {_map ^= rhs._map; return *this;}
 
- large_bitset& operator +=(const element_type& rhs) {return add(interval_type(rhs, rhs)); }
- large_bitset& operator |=(const element_type& rhs) {return add(interval_type(rhs, rhs)); }
- large_bitset& operator -=(const element_type& rhs) {return subtract(interval_type(rhs, rhs)); }
- large_bitset& operator &=(const element_type& rhs) {return intersect(interval_type(rhs, rhs));}
- large_bitset& operator ^=(const element_type& rhs) {return flip(interval_type(rhs, rhs)); }
+ large_bitset& operator +=(const element_type& rhs) {return add(interval_type(rhs)); }
+ large_bitset& operator |=(const element_type& rhs) {return add(interval_type(rhs)); }
+ large_bitset& operator -=(const element_type& rhs) {return subtract(interval_type(rhs)); }
+ large_bitset& operator &=(const element_type& rhs) {return intersect(interval_type(rhs));}
+ large_bitset& operator ^=(const element_type& rhs) {return flip(interval_type(rhs)); }
 
     large_bitset& operator +=(const interval_type& rhs){return add(rhs); }
     large_bitset& operator |=(const interval_type& rhs){return add(rhs); }
@@ -131,7 +131,7 @@
         typename interval_bitmap_type::const_iterator iter = _map.begin();
         while(iter != _map.end())
         {
- element_type fst = iter->first.first(), lst = iter->first.last();
+ element_type fst = itl::first(iter->first), lst = itl::last(iter->first);
             for(element_type chunk = fst; chunk <= lst; chunk++)
                 std::cout << iter->second.as_string(off_on) << std::endl;
             ++iter;
@@ -164,11 +164,11 @@
 
     //[large_bitset_segment_apply
     large_bitset& segment_apply(segment_combiner combine, const interval_type& operand)
- { // same as
- element_type base = operand.first() >> shift, // operand.first()/ divisor
- ceil = operand.last() >> shift; // operand.last() / divisor
- word_type base_rest = operand.first() & mask , // operand.first()% divisor
- ceil_rest = operand.last() & mask ; // operand.last() % divisor
+ { // same as
+ element_type base = itl::first(operand) >> shift, // itl::first(operand) / divisor
+ ceil = itl::last (operand) >> shift; // itl::last (operand) / divisor
+ word_type base_rest = itl::first(operand) & mask , // itl::first(operand) % divisor
+ ceil_rest = itl::last (operand) & mask ; // itl::last (operand) % divisor
 
         if(base == ceil) // [first, last] are within one bitset (chunk)
             (this->*combine)(base, base+1, bitset_type( to_upper_from(base_rest)

Modified: sandbox/itl/libs/itl/example/vc9_itl_examples.sln
==============================================================================
--- sandbox/itl/libs/itl/example/vc9_itl_examples.sln (original)
+++ sandbox/itl/libs/itl/example/vc9_itl_examples.sln 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -27,6 +27,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_user_groups", "user_groups_\vc9_user_groups.vcproj", "{900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_custom_interval", "custom_interval_\vc9_custom_interval.vcproj", "{0D1DB87E-E72A-4FE9-A067-1907CC6614F8}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -85,6 +87,10 @@
                 {900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}.Debug|Win32.Build.0 = Debug|Win32
                 {900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}.Release|Win32.ActiveCfg = Release|Win32
                 {900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}.Release|Win32.Build.0 = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6614F8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6614F8}.Debug|Win32.Build.0 = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6614F8}.Release|Win32.ActiveCfg = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6614F8}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Modified: sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp (original)
+++ sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -18,6 +18,8 @@
 #include "../test_value_maker.hpp"
 
 #include <boost/type_traits/is_same.hpp>
+#include <boost/detail/is_incrementable.hpp>
+#include <boost/type_traits/is_floating_point.hpp>
 
 #include <boost/itl/interval_set.hpp>
 #include <boost/itl/separate_interval_set.hpp>
@@ -205,38 +207,47 @@
     typedef interval_set<T> IntervalSetT;
     typedef IntervalMapT::interval_type IntervalT;
 
- BOOST_CHECK_EQUAL((is_key_container_of< int , itl::map<int,int> >::value), false);
- BOOST_CHECK_EQUAL((is_key_container_of<std::pair<int,int> , itl::map<int,int> >::value), false);
- BOOST_CHECK_EQUAL((is_key_container_of<itl::set<int>, itl::set<int> >::value), true);
- BOOST_CHECK_EQUAL((is_key_container_of<itl::set<int>, itl::map<int,int> >::value), true);
- BOOST_CHECK_EQUAL((is_key_container_of<itl::map<int,int>, itl::map<int,int> >::value), true);
+ BOOST_CHECK_EQUAL((is_key_container_of< int , itl::map<int,int> >::value), false);
+ BOOST_CHECK_EQUAL((is_key_container_of<std::pair<int,int> , itl::map<int,int> >::value), false);
+ BOOST_CHECK_EQUAL((is_key_container_of<itl::set<int>, itl::set<int> >::value), true);
+ BOOST_CHECK_EQUAL((is_key_container_of<itl::set<int>, itl::map<int,int> >::value), true);
+ BOOST_CHECK_EQUAL((is_key_container_of<itl::map<int,int>, itl::map<int,int> >::value), true);
 
- //BOOST_CHECK_EQUAL((is_element_container<itl::map<int,int> >::value), true);
+ //BOOST_CHECK_EQUAL((is_element_container<itl::map<int,int> >::value), true);
 
- typedef itl::map<int,int> MapII;
+ typedef itl::map<int,int> MapII;
 
- //const bool xx = is_same< typename itl::map<int,int>::codomain_type,
- // typename codomain_type_of<itl::map<int,int> >::type >::value;
+ //const bool xx = is_same< typename itl::map<int,int>::codomain_type,
+ // typename codomain_type_of<itl::map<int,int> >::type >::value;
 
- BOOST_CHECK_EQUAL(has_codomain_type<MapII>::value, true);
- BOOST_CHECK_EQUAL((is_same<MapII::codomain_type, int>::value), true);
+ BOOST_CHECK_EQUAL(has_codomain_type<MapII>::value, true);
+ BOOST_CHECK_EQUAL((is_same<MapII::codomain_type, int>::value), true);
 
- BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII,true>::type, int>::value), true);
- BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII,false>::type, int>::value), false);
- BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII,false>::type, itl::no_type>::value), true);
+ BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII,true>::type, int>::value), true);
+ BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII,false>::type, int>::value), false);
+ BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII,false>::type, itl::no_type>::value), true);
 
- BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII, has_codomain_type<MapII>::value >::type, int>::value), true);
- BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII, has_codomain_type<MapII>::value >::type, itl::no_type>::value), false);
+ BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII, has_codomain_type<MapII>::value >::type, int>::value), true);
+ BOOST_CHECK_EQUAL((is_same<get_codomain_type<MapII, has_codomain_type<MapII>::value >::type, itl::no_type>::value), false);
 
- BOOST_CHECK_EQUAL((is_map<MapII>::value), true);
- BOOST_CHECK_EQUAL((is_icl_container<MapII>::value), true);
+ BOOST_CHECK_EQUAL((is_map<MapII>::value), true);
+ BOOST_CHECK_EQUAL((is_icl_container<MapII>::value), true);
 
- BOOST_CHECK_EQUAL((is_fragment_of<IntervalSetT::element_type, IntervalSetT>::value), true);
- BOOST_CHECK_EQUAL((is_fragment_of<IntervalSetT::segment_type, IntervalSetT>::value), true);
- BOOST_CHECK_EQUAL((is_fragment_of<discrete_interval<T>, IntervalSetT>::value), true);
- BOOST_CHECK_EQUAL((is_fragment_of<double, IntervalSetT>::value), false);
+ BOOST_CHECK_EQUAL((is_fragment_of<IntervalSetT::element_type, IntervalSetT>::value), true);
+ BOOST_CHECK_EQUAL((is_fragment_of<IntervalSetT::segment_type, IntervalSetT>::value), true);
+ BOOST_CHECK_EQUAL((is_fragment_of<discrete_interval<T>, IntervalSetT>::value), true);
+ BOOST_CHECK_EQUAL((is_fragment_of<double, IntervalSetT>::value), false);
 
- //BOOST_CHECK_EQUAL(xx, true);
-
+
+ BOOST_CHECK_EQUAL((boost::detail::is_incrementable<int>::value), true);
+ BOOST_CHECK_EQUAL((boost::detail::is_incrementable<double>::value), true);
+ BOOST_CHECK_EQUAL((boost::detail::is_incrementable<std::string>::value), false);
+
+ BOOST_CHECK_EQUAL((is_floating_point<long double>::value), true);
+ BOOST_CHECK_EQUAL((is_floating_point<double>::value), true);
+ BOOST_CHECK_EQUAL((is_floating_point<float>::value), true);
+
+ //BOOST_CHECK_EQUAL(xx, true);
+
 }
 

Modified: sandbox/itl/libs/itl/test/test_interval_map_shared.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_map_shared.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_map_shared.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -134,7 +134,7 @@
     BOOST_CHECK_EQUAL(hull(single_I0_1I_u1).upper(), I0_1I.upper());
 
     //contains predicate
- BOOST_CHECK_EQUAL(call::contains(single_I0_0I_u1, v0), true);
+ BOOST_CHECK_EQUAL(call::contains(single_I0_0I_u1, v0), true);
     BOOST_CHECK_EQUAL(call::contains(single_I0_0I_u1, v0_u1), true);
     BOOST_CHECK_EQUAL(call::contains(single_I0_0I_u1, I0_0I_u1), true);
 
@@ -435,15 +435,15 @@
     BOOST_CHECK_EQUAL( call::contains(itv_map, MK_v(3)), true );
     BOOST_CHECK_EQUAL( call::contains(itv_map, K_v(3,1)), true );
 
- BOOST_CHECK_EQUAL( call::contains(IntervalMapT().add(K_v(3,1)), K_v(3,1)), true );
- BOOST_CHECK_EQUAL( call::contains(IntervalMapT().add(K_v(3,1)), MK_v(3)), true );
+ BOOST_CHECK_EQUAL( call::contains(IntervalMapT().add(K_v(3,1)), K_v(3,1)), true );
+ BOOST_CHECK_EQUAL( call::contains(IntervalMapT().add(K_v(3,1)), MK_v(3)), true );
     BOOST_CHECK_EQUAL( call::contains(IntervalMapT().insert(K_v(3,1)), K_v(3,1)), true );
     itv_map.clear();
- BOOST_CHECK_EQUAL( call::contains((itv_map += IIv(3,7,1)), IIv(3,7,1)), true );
+ BOOST_CHECK_EQUAL( call::contains((itv_map += IIv(3,7,1)), IIv(3,7,1)), true );
     BOOST_CHECK_EQUAL( call::contains(itv_map, IIv(3,7,2)), false );
     BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(3,7)), true );
     BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(4,6)), true );
- BOOST_CHECK_EQUAL( call::contains((itv_map += CIv(7,9,1)),IIv(3,9,1)), true );
+ BOOST_CHECK_EQUAL( call::contains((itv_map += CIv(7,9,1)),IIv(3,9,1)), true );
     BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(4,8)), true );
     BOOST_CHECK_EQUAL( call::contains((itv_map += IIv(11,12,1)), IIv(3,12,1)), false );
     BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(4,11)), false );
@@ -456,7 +456,7 @@
     itv_map += itv_map2;
     BOOST_CHECK_EQUAL( call::contains(itv_map, itv_map2), true );
     IntervalSetT itv_set2;
- itl::domain(itv_set2, itv_map2);
+ itl::domain(itv_set2, itv_map2);
     BOOST_CHECK_EQUAL( call::contains(itv_map, itv_set2), true );
 }
 
@@ -538,7 +538,7 @@
     all -= section;
     complement += all;
     //complement.erase(I3_5I);
- itl::erase(complement, section);
+ itl::erase(complement, section);
     BOOST_CHECK_EQUAL( disjoint(section, complement), true );
     BOOST_CHECK_EQUAL( intersects(section, complement), false );
 }
@@ -1138,7 +1138,7 @@
     IntervalMapT map_a;
     map_a.add(CDv(1,3,1)).add(IDv(8,9,1)).add(IIv(6,11,3));
 
- BOOST_CHECK_EQUAL( call::contains(map_a.set(CDv(2,10,4)), CDv(2,10,4)), true );
+ BOOST_CHECK_EQUAL( call::contains(map_a.set(CDv(2,10,4)), CDv(2,10,4)), true );
     BOOST_CHECK_EQUAL( call::contains(map_a.set(K_v(4,5)), K_v(4,5)), true );
     BOOST_CHECK_EQUAL( call::contains(map_a.set(K_v(4,5)).set(CDv(3,5,6)), CDv(3,5,6)), true );
 }

Modified: sandbox/itl/libs/itl/test/test_interval_set_shared.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_set_shared.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_set_shared.hpp 2010-09-27 15:20:35 EDT (Mon, 27 Sep 2010)
@@ -102,7 +102,7 @@
 
     BOOST_CHECK_EQUAL(single_I0_0I_from_element, single_I0_0I_from_interval);
     BOOST_CHECK_EQUAL(single_I0_0I_from_element, single_I0_0I);
- BOOST_CHECK_EQUAL(itl::hull(single_I0_0I).lower(), I0_0I.lower());
+ BOOST_CHECK_EQUAL(itl::hull(single_I0_0I).lower(), I0_0I.lower());
     BOOST_CHECK_EQUAL(itl::hull(single_I0_0I).upper(), I0_0I.upper());
 
     IntervalSet<T> single_I1_1I_from_element(v1);
@@ -117,7 +117,7 @@
 
     BOOST_CHECK_EQUAL(single_I0_1I_from_interval, single_I0_1I);
     BOOST_CHECK_EQUAL(hull(single_I0_1I), I0_1I);
- BOOST_CHECK_EQUAL(hull(single_I0_1I).lower(), I0_1I.lower());
+ BOOST_CHECK_EQUAL(hull(single_I0_1I).lower(), I0_1I.lower());
     BOOST_CHECK_EQUAL(hull(single_I0_1I).upper(), I0_1I.upper());
 
     //contains predicate


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk