Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54497 - in sandbox/itl: boost/itl boost/itl/detail boost/validate/gentor libs/itl/build/win32 libs/itl/doc libs/itl/example libs/itl/example/boost_party libs/itl/example/interval libs/itl/example/interval_container libs/itl/example/party libs/itl/example/partys_height_average libs/itl/example/partys_tallest_guests libs/itl/example/user_groups libs/itl/test/test_casual libs/validate/example/labat_single libs/validate/src/gentor
From: afojgo_at_[hidden]
Date: 2009-06-29 03:35:22


Author: jofaber
Date: 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
New Revision: 54497
URL: http://svn.boost.org/trac/boost/changeset/54497

Log:
Added documentation, some inlining, removing tabs. Stable {msvc-9.0 r+d, gcc-3.4.4}
Text files modified:
   sandbox/itl/boost/itl/detail/design_config.hpp | 12
   sandbox/itl/boost/itl/interval.hpp | 166 +++++++----------
   sandbox/itl/boost/itl/interval_base_map.hpp | 160 ++++++++--------
   sandbox/itl/boost/itl/interval_map.hpp | 363 +++++++++++++++++++--------------------
   sandbox/itl/boost/itl/interval_set.hpp | 22 +-
   sandbox/itl/boost/itl/separate_interval_set.hpp | 18
   sandbox/itl/boost/itl/set.hpp | 8
   sandbox/itl/boost/itl/split_interval_map.hpp | 286 +++++++++++++++---------------
   sandbox/itl/boost/itl/split_interval_set.hpp | 108 +++++-----
   sandbox/itl/boost/validate/gentor/randomgentor.hpp | 8
   sandbox/itl/libs/itl/build/win32/vc9_all.sln | 6
   sandbox/itl/libs/itl/doc/examples.qbk | 3
   sandbox/itl/libs/itl/doc/itl.qbk | 7
   sandbox/itl/libs/itl/example/boost_party/boost_party.cpp | 4
   sandbox/itl/libs/itl/example/interval/interval.cpp | 2
   sandbox/itl/libs/itl/example/interval_container/interval_container.cpp | 19 +
   sandbox/itl/libs/itl/example/party/party.cpp | 9
   sandbox/itl/libs/itl/example/partys_height_average/partys_height_average.cpp | 32 +-
   sandbox/itl/libs/itl/example/partys_tallest_guests/partys_tallest_guests.cpp | 22 +-
   sandbox/itl/libs/itl/example/toytime.h | 9
   sandbox/itl/libs/itl/example/user_groups/user_groups.cpp | 4
   sandbox/itl/libs/itl/test/test_casual/test_casual.cpp | 4
   sandbox/itl/libs/validate/example/labat_single/labat_single.cpp | 10
   sandbox/itl/libs/validate/src/gentor/gentorprofile.cpp | 38 ++--
   24 files changed, 653 insertions(+), 667 deletions(-)

Modified: sandbox/itl/boost/itl/detail/design_config.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/design_config.hpp (original)
+++ sandbox/itl/boost/itl/detail/design_config.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -26,12 +26,12 @@
 // template type parameter variants.
 
 #define ITL_USE_COMPARE_TEMPLATE_TEMPLATE
-#define ITL_USE_COMBINE_TEMPLATE_TEMPLATE
-#define ITL_USE_SECTION_TEMPLATE_TEMPLATE
+//#define ITL_USE_COMBINE_TEMPLATE_TEMPLATE
+//#define ITL_USE_SECTION_TEMPLATE_TEMPLATE
 
 //#define ITL_USE_COMPARE_TEMPLATE_TYPE
-//#define ITL_USE_COMBINE_TEMPLATE_TYPE
-//#define ITL_USE_SECTION_TEMPLATE_TYPE
+#define ITL_USE_COMBINE_TEMPLATE_TYPE
+#define ITL_USE_SECTION_TEMPLATE_TYPE
 
 //------------------------------------------------------------------------------
 // template parameter Compare can not be a template type parameter as long as
@@ -54,11 +54,11 @@
 #ifdef ITL_USE_COMBINE_TEMPLATE_TEMPLATE
 # define ITL_COMBINE template<class>class
 # define ITL_COMBINE_CODOMAIN(itl_combine, codomain_type) itl_combine<codomain_type>
-# define ITL_COMBINE_INSTANCE(compare_instance,codomain_type) compare_instance
+# define ITL_COMBINE_INSTANCE(combine_instance,codomain_type) combine_instance
 #else//ITL_USE_COMBINE_TEMPLATE_TYPE
 # define ITL_COMBINE class
 # define ITL_COMBINE_CODOMAIN(itl_combine, codomain_type) itl_combine
-# define ITL_COMBINE_INSTANCE(compare_instance,codomain_type) compare_instance<codomain_type>
+# define ITL_COMBINE_INSTANCE(combine_instance,codomain_type) combine_instance<codomain_type>
 #endif
 
 //------------------------------------------------------------------------------

Modified: sandbox/itl/boost/itl/interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval.hpp (original)
+++ sandbox/itl/boost/itl/interval.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -143,17 +143,17 @@
     bool contained_in(const interval& super)const ;
 
     /** <tt>sub</tt> is proper subset of <tt>*this</tt> and does not touch the borders of <tt>*this</tt> */
- bool free_contains(const interval& sub)const;
+ bool free_contains(const interval& sub)const;
 
     /** <tt>sub</tt> is proper subset of <tt>*this</tt> */
- bool proper_contains(const interval& sub)const;
+ bool proper_contains(const interval& sub)const;
 
     /** <tt>*this</tt> and <tt>x2</tt> are disjoint; their intersection is empty */
     bool is_disjoint(const interval& x2)const
     { return exclusive_less(x2) || x2.exclusive_less(*this); }
 
     /** <tt>*this</tt> and <tt>x2</tt> have a non empty intersection */
- bool intersects(const interval& x2)const
+ bool intersects(const interval& x2)const
     { return !is_disjoint(x2); }
 
     //==========================================================================
@@ -197,11 +197,19 @@
         maximum of upper bounds */
     interval& extend(const interval& x2);
 
- interval& left_extend(const interval& x2);
- interval& right_extend(const interval& x2);
+ /** Extend \c *this interval to the minimum of the lower bounds of
+ \c this and \c left_extesion */
+ interval& left_extend(const interval& left_extesion);
+
+ /** Extend \c *this interval to the maximum of the upper bounds of
+ \c this and \c right_extesion */
+ interval& right_extend(const interval& right_extesion);
 
- interval& left_set(const interval& x2);
- interval& right_set(const interval& x2);
+ /** Set the lower bound and bound type according to \c left */
+ interval& left_set(const interval& left);
+
+ /** Set the upper bound and bound type according to \c right */
+ interval& right_set(const interval& right);
 
     /** Interval spanning from lower bound of \c *this interval to the upper bound of \c rhs.
         Bordertypes according to the lower bound of \c *this and the upper bound of \c rhs. */
@@ -302,7 +310,7 @@
     bool exclusive_less(const interval& x2)const;
 
     /** Maximal element of <tt>*this</tt> is less than the minimal element of <tt>x2</tt>
- and there is at least one element in between. */
+ and there is at least one element in between. */
     bool distant_less(const interval& x2)const;
 
     /** Set \c *this interval to from \c low to \c up with boundtype \c bounds */
@@ -380,8 +388,8 @@
     BoundT upb_min(const interval& x2)const;
     BoundT upb_max(const interval& x2)const;
 
- BoundT lwb_rightOf(const interval& x2)const;
- BoundT upb_leftOf(const interval& x2)const;
+ BoundT lwb_right_of(const interval& x2)const;
+ BoundT upb_left_of(const interval& x2)const;
 
 private:
     DomainT _lwb;
@@ -425,7 +433,7 @@
 };
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::empty()const
+inline bool interval<DomainT,Compare>::empty()const
 {
     using namespace boost::mpl;
 
@@ -521,7 +529,7 @@
 // NOTE structural similarities between empty and exclusive_less!
 // emptieness can be defined as being exclusive less to oneself.
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::exclusive_less(const interval& x2)const
+inline bool interval<DomainT,Compare>::exclusive_less(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_right(closed_bounded) && x2.is_left(closed_bounded)) return domain_less(_upb, x2._lwb); //_upb < x2._lwb
@@ -538,14 +546,13 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::distant_less(const interval& x2)const
+inline bool interval<DomainT,Compare>::distant_less(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_right(open_bounded) && x2.is_left(closed_bounded)) return domain_less(_upb, x2._lwb); //_upb < x2._lwb;
     if(is_right(closed_bounded) && x2.is_left(open_bounded) ) return domain_less(_upb, x2._lwb); //_upb < x2._lwb;
     if(is_right(open_bounded) && x2.is_left(open_bounded) ) return domain_less_equal(_upb, x2._lwb); //_upb <= x2._lwb;
 
- //CL if(is_right(closed_bounded) && x2.is_left(closed_bounded)) return domain_less(succ(_upb), x2._lwb); //succ(_upb) < x2._lwb
     return
         if_<
             bool_<is_continuous<DomainT>::value>,
@@ -557,7 +564,7 @@
 
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::lower_less(const interval& x2)const
+inline bool interval<DomainT,Compare>::lower_less(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_left(closed_bounded) && x2.is_left(closed_bounded)) return domain_less(_lwb, x2._lwb);
@@ -575,7 +582,7 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::upper_less(const interval& x2)const
+inline bool interval<DomainT,Compare>::upper_less(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_right(closed_bounded) && x2.is_right(closed_bounded)) return domain_less(_upb, x2._upb);
@@ -594,7 +601,7 @@
 
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::lower_less_equal(const interval& x2)const
+inline bool interval<DomainT,Compare>::lower_less_equal(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_left(closed_bounded) && x2.is_left(closed_bounded)) return domain_less_equal(_lwb, x2._lwb);
@@ -613,7 +620,7 @@
 
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::upper_less_equal(const interval& x2)const
+inline bool interval<DomainT,Compare>::upper_less_equal(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_right(closed_bounded) && x2.is_right(closed_bounded)) return domain_less_equal(_upb, x2._upb);
@@ -634,7 +641,7 @@
 //NOTE THINK: This implementation is rather interesting wrt. continuous value types.
 // An alternative implementation was x.lwb_equal(y)={return x.lower_less_equal(y) && y.lower_less_equal(x)}
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::lower_equal(const interval& x2)const
+inline bool interval<DomainT,Compare>::lower_equal(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_left(closed_bounded) && x2.is_left(closed_bounded)) return domain_equal(_lwb, x2._lwb);
@@ -652,7 +659,7 @@
 //NOTE THINK: This implementation is rather interesting wrt. continuous value types.
 // An alternative implementation was x.lwb_equal(y)={return x.lower_less_equal(y) && y.lower_less_equal(x)}
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::upper_equal(const interval& x2)const
+inline bool interval<DomainT,Compare>::upper_equal(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_right(closed_bounded) && x2.is_right(closed_bounded)) return domain_equal(_upb, x2._upb);
@@ -670,7 +677,7 @@
 
 
 template <class DomainT, ITL_COMPARE Compare>
-typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::lwb_min(const interval& x2)const
+inline typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::lwb_min(const interval& x2)const
 {
     if( x2.lower_less(*this) )
         return BoundT(x2._lwb, x2.boundtype());
@@ -679,7 +686,7 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::upb_max(const interval& x2)const
+inline typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::upb_max(const interval& x2)const
 {
     if( upper_less(x2) )
         return BoundT(x2._upb, x2.boundtype());
@@ -689,7 +696,7 @@
 
 
 template <class DomainT, ITL_COMPARE Compare>
-typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::lwb_max(const interval& x2)const
+inline typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::lwb_max(const interval& x2)const
 {
     if( lower_less(x2) )
         return BoundT(x2._lwb, x2.boundtype());
@@ -698,7 +705,7 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::upb_min(const interval& x2)const
+inline typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::upb_min(const interval& x2)const
 {
     if( x2.upper_less(*this) )
         return BoundT(x2._upb, x2.boundtype());
@@ -708,13 +715,13 @@
 
 
 template <class DomainT, ITL_COMPARE Compare>
-typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::upb_leftOf(const interval& x2)const
+inline typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::upb_left_of(const interval& x2)const
 {
     return BoundT(x2._lwb, x2.succession_bounds());
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::lwb_rightOf(const interval& x2)const
+inline typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::lwb_right_of(const interval& x2)const
 {
     return BoundT(x2._upb, x2.succession_bounds());
 }
@@ -722,7 +729,7 @@
 
 // NOTE non symmetric version: *this[upb].touches(x2[lwb])
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::touches(const interval& x2)const
+inline bool interval<DomainT,Compare>::touches(const interval& x2)const
 {
     using namespace boost::mpl;
     if(is_right(open_bounded) && x2.is_left(closed_bounded)) return domain_equal(_upb, x2._lwb);
@@ -738,7 +745,7 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::contains(const DomainT& x)const
+inline bool interval<DomainT,Compare>::contains(const DomainT& x)const
 {
     if(is_right(closed_bounded) && is_left(closed_bounded)) return domain_less_equal(_lwb, x) && domain_less_equal(x, _upb);
     if(is_right(closed_bounded) && is_left(open_bounded) ) return domain_less(_lwb, x) && domain_less_equal(x, _upb);
@@ -747,30 +754,28 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::contained_in(const interval& super)const
+inline bool interval<DomainT,Compare>::contained_in(const interval& super)const
 { return super.lower_less_equal(*this) && upper_less_equal(super); }
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::contains(const interval& sub)const
+inline bool interval<DomainT,Compare>::contains(const interval& sub)const
 { return lower_less_equal(sub) && sub.upper_less_equal(*this); }
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::free_contains(const interval& sub)const
+inline bool interval<DomainT,Compare>::free_contains(const interval& sub)const
 { return lower_less(sub) && sub.upper_less(*this); }
 
 template <class DomainT, ITL_COMPARE Compare>
-bool interval<DomainT,Compare>::proper_contains(const interval& sub)const
+inline bool interval<DomainT,Compare>::proper_contains(const interval& sub)const
 { return contains(sub) && (lower_less(sub) || sub.upper_less(*this)); }
 
 template <class DomainT, ITL_COMPARE Compare>
-interval<DomainT,Compare>& interval<DomainT,Compare>::extend(const interval<DomainT,Compare>& x2)
+inline interval<DomainT,Compare>& interval<DomainT,Compare>::extend(const interval<DomainT,Compare>& x2)
 {
- if(x2.empty()) return *this;
- else if(empty())
- {
- *this = x2;
+ if(x2.empty())
         return *this;
- }
+ else if(empty())
+ return *this = x2;
     else
     {
         set_lwb(lwb_min(x2));
@@ -780,14 +785,12 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-interval<DomainT,Compare>& interval<DomainT,Compare>::left_extend(const interval<DomainT,Compare>& x2)
+inline interval<DomainT,Compare>& interval<DomainT,Compare>::left_extend(const interval<DomainT,Compare>& x2)
 {
- if(x2.empty()) return *this;
- else if(empty())
- {
- *this = x2;
+ if(x2.empty())
         return *this;
- }
+ else if(empty())
+ return *this = x2;
     else
     {
         set_lwb(lwb_min(x2));
@@ -796,14 +799,12 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-interval<DomainT,Compare>& interval<DomainT,Compare>::right_extend(const interval<DomainT,Compare>& x2)
+inline interval<DomainT,Compare>& interval<DomainT,Compare>::right_extend(const interval<DomainT,Compare>& x2)
 {
- if(x2.empty()) return *this;
- else if(empty())
- {
- *this = x2;
+ if(x2.empty())
         return *this;
- }
+ else if(empty())
+ return *this = x2;
     else
     {
         set_upb(upb_max(x2));
@@ -812,14 +813,12 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-interval<DomainT,Compare>& interval<DomainT,Compare>::left_set(const interval<DomainT,Compare>& x2)
+inline interval<DomainT,Compare>& interval<DomainT,Compare>::left_set(const interval<DomainT,Compare>& x2)
 {
- if(x2.empty()) return *this;
- else if(empty())
- {
- *this = x2;
+ if(x2.empty())
         return *this;
- }
+ else if(empty())
+ return *this = x2;
     else
     {
         set_lwb(BoundT(x2._lwb, x2.boundtype()));
@@ -828,14 +827,12 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-interval<DomainT,Compare>& interval<DomainT,Compare>::right_set(const interval<DomainT,Compare>& x2)
+inline interval<DomainT,Compare>& interval<DomainT,Compare>::right_set(const interval<DomainT,Compare>& x2)
 {
- if(x2.empty()) return *this;
- else if(empty())
- {
- *this = x2;
+ if(x2.empty())
         return *this;
- }
+ else if(empty())
+ return *this = x2;
     else
     {
         set_upb(BoundT(x2._upb, x2.boundtype()));
@@ -860,33 +857,6 @@
     return *this;
 }
 
-/*CL
-template <class DomainT, ITL_COMPARE Compare>
-void interval<DomainT,Compare>::right_subtract(interval<DomainT,Compare>& lsur, const interval<DomainT,Compare>& x2)const
-{
- if(lower_less(x2)) {
- lsur.set_lwb( BoundT(_lwb,boundtype()) );
- if(exclusive_less(x2))
- lsur.set_upb( BoundT(_upb,boundtype()) );
- else
- lsur.set_upb( upb_leftOf(x2) );
- }
- else lsur.clear();
-}
-
-template <class DomainT, ITL_COMPARE Compare>
-void interval<DomainT,Compare>::left_subtract(interval<DomainT,Compare>& rsur, const interval<DomainT,Compare>& x2)const
-{
- if(x2.upper_less(*this)) {
- if(x2.exclusive_less(*this))
- rsur.set_lwb( BoundT(_lwb,boundtype()) );
- else
- rsur.set_lwb(lwb_rightOf(x2));
- rsur.set_upb( BoundT(_upb,boundtype()) );
- }
- else rsur.clear();
-}
-*/
 
 template <class DomainT, ITL_COMPARE Compare>
 const std::string interval<DomainT,Compare>::as_string()const
@@ -904,21 +874,21 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-DomainT interval<DomainT,Compare>::first()const
+inline DomainT interval<DomainT,Compare>::first()const
 {
     BOOST_ASSERT((!itl::is_continuous<DomainT>::value));
     return is_left(closed_bounded) ? _lwb : succ(_lwb);
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-DomainT interval<DomainT,Compare>::last()const
+inline DomainT interval<DomainT,Compare>::last()const
 {
     BOOST_ASSERT((!itl::is_continuous<DomainT>::value));
     return is_right(closed_bounded) ? _upb : pred(_upb);
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-typename interval<DomainT,Compare>::size_type interval<DomainT,Compare>::cardinality()const
+inline typename interval<DomainT,Compare>::size_type interval<DomainT,Compare>::cardinality()const
 {
     using namespace boost::mpl;
     return if_<
@@ -930,7 +900,7 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-typename interval<DomainT,Compare>::difference_type interval<DomainT,Compare>::length()const
+inline typename interval<DomainT,Compare>::difference_type interval<DomainT,Compare>::length()const
 {
     using namespace boost::mpl;
     return if_<
@@ -942,7 +912,7 @@
 }
 
 template <class DomainT, ITL_COMPARE Compare>
-interval<DomainT,Compare>& interval<DomainT,Compare>::as(bound_type bounded)
+inline interval<DomainT,Compare>& interval<DomainT,Compare>::as(bound_type bounded)
 {
     switch(bounded)
     {
@@ -1003,7 +973,7 @@
 //==============================================================================
 
 /** subtract \c right_minuend from the \c left interval on it's right side.
- Return the difference: The part of \c left right of \c x2.
+ Return the difference: The part of \c left right of \c right_minuend.
 \code
 left_over = left - right_minuend; //on the right side.
 [a ... : left
@@ -1015,7 +985,7 @@
 inline interval<DomainT,Compare> right_subtract(interval<DomainT,Compare> left,
                                    const interval<DomainT,Compare>& right_minuend)
 {
- return left.right_subtract(right_minuend);
+ return left.right_subtract(right_minuend);
 }
 
 /** subtract \c left_minuend from the \c right interval on it's left side.
@@ -1031,7 +1001,7 @@
 inline interval<DomainT,Compare> left_subtract(interval<DomainT,Compare> right,
                                          const interval<DomainT,Compare>& left_minuend)
 {
- return right.left_subtract(left_minuend);
+ return right.left_subtract(left_minuend);
 }
 
 // ----------------------------------------------------------------------------
@@ -1039,7 +1009,7 @@
 // ----------------------------------------------------------------------------
 template <class DomainT, ITL_COMPARE Compare>
 inline itl::interval<DomainT,Compare> operator & (const itl::interval<DomainT,Compare>& left,
- const itl::interval<DomainT,Compare>& right)
+ const itl::interval<DomainT,Compare>& right)
 {
     return itl::interval<DomainT,Compare>(left) &= right;
 }

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 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -624,54 +624,54 @@
 
 protected:
 
- iterator prior(iterator it_)
- {
- if(it_ == this->_map.begin())
- return this->_map.end();
- else
- return --it_;
- }
-
- template <class Combiner>
- bool combine(iterator& it_, const codomain_type& co_val)
- {
- Combiner()(it_->CONT_VALUE, co_val);
- if(Traits::absorbs_neutrons && it_->CONT_VALUE == Combiner::neutron())
- { this->_map.erase(it_); it_ = _map.end(); return false; }
- return true;
- }
-
- template <class Combiner>
- std::pair<iterator,bool> map_insert(const interval_type& inter_val, const codomain_type& co_val)
- {
- if(Traits::is_total)
- {
- CodomainT added_val = Combiner::neutron();
- Combiner()(added_val, co_val);
- if(Traits::absorbs_neutrons && added_val == Combiner::neutron())
- return std::pair<iterator,bool>(this->_map.end(), false);
- else
- return this->_map.insert(value_type(inter_val, added_val));
- }
- else
- return this->_map.insert(value_type(inter_val, co_val));
- }
-
- template <class Combiner>
- iterator map_insert(iterator& prior_, const interval_type& inter_val, const codomain_type& co_val)
- {
- if(Traits::is_total)
- {
- CodomainT added_val = Combiner::neutron();
- Combiner()(added_val, co_val);
- if(Traits::absorbs_neutrons && added_val == Combiner::neutron())
- return this->_map.end();
- else
- return this->_map.insert(prior_, value_type(inter_val, added_val));
- }
- else
- return this->_map.insert(prior_, value_type(inter_val, co_val));
- }
+ iterator prior(iterator it_)
+ {
+ if(it_ == this->_map.begin())
+ return this->_map.end();
+ else
+ return --it_;
+ }
+
+ template <class Combiner>
+ bool combine(iterator& it_, const codomain_type& co_val)
+ {
+ Combiner()(it_->CONT_VALUE, co_val);
+ if(Traits::absorbs_neutrons && it_->CONT_VALUE == Combiner::neutron())
+ { this->_map.erase(it_); it_ = _map.end(); return false; }
+ return true;
+ }
+
+ template <class Combiner>
+ std::pair<iterator,bool> map_insert(const interval_type& inter_val, const codomain_type& co_val)
+ {
+ if(Traits::is_total)
+ {
+ CodomainT added_val = Combiner::neutron();
+ Combiner()(added_val, co_val);
+ if(Traits::absorbs_neutrons && added_val == Combiner::neutron())
+ return std::pair<iterator,bool>(this->_map.end(), false);
+ else
+ return this->_map.insert(value_type(inter_val, added_val));
+ }
+ else
+ return this->_map.insert(value_type(inter_val, co_val));
+ }
+
+ template <class Combiner>
+ iterator map_insert(iterator& prior_, const interval_type& inter_val, const codomain_type& co_val)
+ {
+ if(Traits::is_total)
+ {
+ CodomainT added_val = Combiner::neutron();
+ Combiner()(added_val, co_val);
+ if(Traits::absorbs_neutrons && added_val == Combiner::neutron())
+ return this->_map.end();
+ else
+ return this->_map.insert(prior_, value_type(inter_val, added_val));
+ }
+ else
+ return this->_map.insert(prior_, value_type(inter_val, co_val));
+ }
 
 protected:
     ImplMapT _map;
@@ -1083,46 +1083,46 @@
     ::erase(const interval_type& minuend)
 {
     if(minuend.empty())
- return *that();
+ return *that();
 
     iterator fst_it = _map.lower_bound(minuend);
     if(fst_it==_map.end())
- return *that();
+ return *that();
     iterator end_it = _map.upper_bound(minuend);
- if(fst_it==end_it)
- return *that();
+ if(fst_it==end_it)
+ return *that();
 
- iterator lst_it = end_it; --lst_it;
+ iterator lst_it = end_it; --lst_it;
 
- interval_type left_resid = right_subtract(fst_it->KEY_VALUE, minuend);
+ interval_type left_resid = right_subtract(fst_it->KEY_VALUE, minuend);
     interval_type right_resid = left_subtract(lst_it->KEY_VALUE, minuend);
 
- if(fst_it == lst_it)
- if(!left_resid.empty())
- {
- const_cast<interval_type&>(fst_it->KEY_VALUE).right_subtract(minuend);
- if(!right_resid.empty())
- this->_map.insert(fst_it, value_type(right_resid, fst_it->CONT_VALUE));
- }
- else if(!right_resid.empty())
- const_cast<interval_type&>(fst_it->KEY_VALUE).left_subtract(minuend);
- else
- this->_map.erase(fst_it);
- else
- { // [-------- minuend ---------)
- // [left_resid fst) . . . . [lst right_resid)
- iterator snd_it = fst_it; ++snd_it;
-
- iterator start_ = left_resid.empty()? fst_it: snd_it;
- iterator stop_ = right_resid.empty()? end_it: lst_it;
- this->_map.erase(start_, stop_); //erase [start_, stop_)
-
- if(!left_resid.empty())
- const_cast<interval_type&>(fst_it->KEY_VALUE).right_subtract(minuend);
-
- if(!right_resid.empty())
- const_cast<interval_type&>(lst_it->KEY_VALUE).left_subtract(minuend);
- }
+ if(fst_it == lst_it)
+ if(!left_resid.empty())
+ {
+ const_cast<interval_type&>(fst_it->KEY_VALUE).right_subtract(minuend);
+ if(!right_resid.empty())
+ this->_map.insert(fst_it, value_type(right_resid, fst_it->CONT_VALUE));
+ }
+ else if(!right_resid.empty())
+ const_cast<interval_type&>(fst_it->KEY_VALUE).left_subtract(minuend);
+ else
+ this->_map.erase(fst_it);
+ else
+ { // [-------- minuend ---------)
+ // [left_resid fst) . . . . [lst right_resid)
+ iterator snd_it = fst_it; ++snd_it;
+
+ iterator start_ = left_resid.empty()? fst_it: snd_it;
+ iterator stop_ = right_resid.empty()? end_it: lst_it;
+ this->_map.erase(start_, stop_); //erase [start_, stop_)
+
+ if(!left_resid.empty())
+ const_cast<interval_type&>(fst_it->KEY_VALUE).right_subtract(minuend);
+
+ if(!right_resid.empty())
+ const_cast<interval_type&>(lst_it->KEY_VALUE).left_subtract(minuend);
+ }
     return *that();
 }
 

Modified: sandbox/itl/boost/itl/interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_map.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -139,12 +139,9 @@
     bool join_right(iterator& it);
     void join_neighbours(iterator& it){ join_left(it); join_right(it); };
     bool joinable(const iterator& some, const iterator& next)const;
- iterator join_on_left(iterator& some, const iterator& next);
- iterator join_on_right(const iterator& some, iterator& next);
- iterator join_segments(iterator& some, const iterator& next){ return join_on_left(some, next); };//JODO ausbauen
-
- iterator fill_join_left(const value_type&);
- iterator fill_join_both(const value_type&);
+ iterator join_on_left(iterator& some, const iterator& next);
+ iterator join_on_right(const iterator& some, iterator& next);
+ iterator join_segments(iterator& some, const iterator& next){ return join_on_left(some, next); };//JODO ausbauen
 
     template<class Combiner>
     void add_main(interval_type& inter_val, const CodomainT& co_val,
@@ -210,7 +207,7 @@
 
     interval_type right_interval = right_it->KEY_VALUE;
     this->_map.erase(right_it);
- const_cast<interval_type&>(left_it->KEY_VALUE).extend(right_interval);
+ const_cast<interval_type&>(left_it->KEY_VALUE).extend(right_interval);
     
     return left_it;
 }
@@ -224,15 +221,15 @@
     // both left and right are in the map and they are neighbours
     BOOST_ASSERT(joinable(left_it, right_it));
 
- //JODO: This implementation does not work in very rare cases. Causes are not clear
- //interval_type left_interval = left_it->KEY_VALUE;
- //this->_map.erase(left_it);
- //const_cast<interval_type&>(right_it->KEY_VALUE).extend(left_interval);
+ //JODO: This implementation does not work in very rare cases. Causes are not clear
+ //interval_type left_interval = left_it->KEY_VALUE;
+ //this->_map.erase(left_it);
+ //const_cast<interval_type&>(right_it->KEY_VALUE).extend(left_interval);
 
     interval_type right_interval = right_it->KEY_VALUE;
     this->_map.erase(right_it);
- const_cast<interval_type&>(left_it->KEY_VALUE).extend(right_interval);
- right_it = left_it;
+ const_cast<interval_type&>(left_it->KEY_VALUE).extend(right_interval);
+ right_it = left_it;
 
     return right_it;
 }
@@ -251,7 +248,7 @@
 
     if(joinable(it_pred, it))
     {
- join_on_right(it_pred, it);
+ join_on_right(it_pred, it);
         return true;
     }
 
@@ -296,7 +293,7 @@
         return;
 
     std::pair<iterator,bool> insertion
- = this->template map_insert<Combiner>(inter_val, co_val);
+ = this->template map_insert<Combiner>(inter_val, co_val);
 
     if(insertion.WAS_SUCCESSFUL)
         join_neighbours(insertion.ITERATOR);
@@ -307,12 +304,12 @@
                  lst_it = insertion.ITERATOR;
         //assert(end_it == this->_map.upper_bound(inter_val));
 
- iterator it_ = fst_it;
- interval_type rest_interval = inter_val;
+ iterator it_ = fst_it;
+ interval_type rest_interval = inter_val;
 
- add_front (rest_interval, co_val, it_);
+ add_front (rest_interval, co_val, it_);
         add_main<Combiner>(rest_interval, co_val, it_, lst_it);
- add_rear<Combiner>(rest_interval, co_val, it_);
+ add_rear<Combiner>(rest_interval, co_val, it_);
     }
 }
 
@@ -321,25 +318,25 @@
 inline void interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
     ::add_front(const interval_type& inter_val, const CodomainT& co_val, iterator& first_)
 {
- // If the collision sequence has a right residual 'right_resid' is will
- // be split, to provide a standardized start of algorithms:
- // The addend interval 'inver_val' covers the beginning of the collision sequence.
+ // If the collision sequence has a right residual 'right_resid' is will
+ // be split, to provide a standardized start of algorithms:
+ // The addend interval 'inver_val' covers the beginning of the collision sequence.
 
     // only for the first there can be a left_resid: a part of *first_ left of inter_val
     interval_type left_resid = right_subtract(first_->KEY_VALUE, inter_val);
 
- if(!left_resid.empty())
- { // [------------ . . .
- // [prior) [left_resid---fst_it --- . . .
- iterator prior_ = this->prior(first_);
- const_cast<interval_type&>(first_->KEY_VALUE).left_subtract(left_resid);
- //NOTE: Only splitting
- this->_map.insert(prior_, value_type(left_resid, first_->CONT_VALUE));
- }
-
- //POST:
- // [----- inter_val ---- . . .
- // ...[-- first_ --...
+ if(!left_resid.empty())
+ { // [------------ . . .
+ // [prior) [left_resid---fst_it --- . . .
+ iterator prior_ = this->prior(first_);
+ const_cast<interval_type&>(first_->KEY_VALUE).left_subtract(left_resid);
+ //NOTE: Only splitting
+ this->_map.insert(prior_, value_type(left_resid, first_->CONT_VALUE));
+ }
+
+ //POST:
+ // [----- inter_val ---- . . .
+ // ...[-- first_ --...
 }
 
 
@@ -348,11 +345,11 @@
 inline void interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
     ::add_main(interval_type& x_rest, const CodomainT& co_val, iterator& it, const iterator& lst_it)
 {
- interval_type cur_interval;
+ interval_type cur_interval;
     while(it!=lst_it)
     {
         cur_interval = it->KEY_VALUE ;
- add_segment<Combiner>(x_rest, co_val, it);
+ add_segment<Combiner>(x_rest, co_val, it);
         // shrink interval
         x_rest.left_subtract(cur_interval);
     }
@@ -365,31 +362,31 @@
     ::add_segment(const interval_type& inter_val, const CodomainT& co_val, iterator& it_)
 {
     interval_type lead_gap = right_subtract(inter_val, it_->KEY_VALUE);
- if(!lead_gap.empty())
- {
- // [------ . . .
- // [-- it ...
- iterator prior_ = it_;
- if(prior_ != this->_map.begin())
- {
- iterator inserted_ = this->template map_insert<Combiner>(--prior_, lead_gap, co_val);
- if(joinable(prior_, inserted_))
- join_on_right(prior_, inserted_);
- }
- else
- this->template map_insert<Combiner>(lead_gap, co_val);
- }
-
- // . . . --------- . . . addend interval
- // [-- it_ --) has a common part with the first overval
- Combiner()(it_->CONT_VALUE, co_val);
- if(Traits::absorbs_neutrons && it_->CONT_VALUE == Combiner::neutron())
- this->_map.erase(it_++);
- else
- {
- join_left(it_);
- ++it_;
- }
+ if(!lead_gap.empty())
+ {
+ // [------ . . .
+ // [-- it ...
+ iterator prior_ = it_;
+ if(prior_ != this->_map.begin())
+ {
+ iterator inserted_ = this->template map_insert<Combiner>(--prior_, lead_gap, co_val);
+ if(joinable(prior_, inserted_))
+ join_on_right(prior_, inserted_);
+ }
+ else
+ this->template map_insert<Combiner>(lead_gap, co_val);
+ }
+
+ // . . . --------- . . . addend interval
+ // [-- it_ --) has a common part with the first overval
+ Combiner()(it_->CONT_VALUE, co_val);
+ if(Traits::absorbs_neutrons && it_->CONT_VALUE == Combiner::neutron())
+ this->_map.erase(it_++);
+ else
+ {
+ join_left(it_);
+ ++it_;
+ }
 }
 
 
@@ -399,74 +396,74 @@
 inline void interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
     ::add_rear(const interval_type& inter_val, const CodomainT& co_val, iterator& it)
 {
- iterator prior_ = this->prior(it);
+ iterator prior_ = this->prior(it);
     interval_type cur_itv = (*it).KEY_VALUE ;
 
     interval_type lead_gap = right_subtract(inter_val, cur_itv);
- if(!lead_gap.empty())
- { // [------ . . .
- // [-- it ...
- iterator inserted_ = this->template map_insert<Combiner>(prior_, lead_gap, co_val);
- if(prior_ != this->_map.end() && joinable(prior_, inserted_))
- join_on_left(prior_, inserted_);
- }
+ if(!lead_gap.empty())
+ { // [------ . . .
+ // [-- it ...
+ iterator inserted_ = this->template map_insert<Combiner>(prior_, lead_gap, co_val);
+ if(prior_ != this->_map.end() && joinable(prior_, inserted_))
+ join_on_left(prior_, inserted_);
+ }
 
     interval_type end_gap = left_subtract(inter_val, cur_itv);
- if(!end_gap.empty())
- {
- // [-------------------)
- // . . . -- it --)
- Combiner()(it->CONT_VALUE, co_val);
+ if(!end_gap.empty())
+ {
+ // [-------------------)
+ // . . . -- it --)
+ Combiner()(it->CONT_VALUE, co_val);
 
         if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
- {
+ {
             this->_map.erase(it);
- iterator inserted_ = this->template map_insert<Combiner>(prior_, end_gap, co_val);
- join_right(inserted_);
- }
+ iterator inserted_ = this->template map_insert<Combiner>(prior_, end_gap, co_val);
+ join_right(inserted_);
+ }
         else
- {
+ {
             join_left(it);
- iterator inserted_ = this->template map_insert<Combiner>(it, end_gap, co_val);
- join_neighbours(inserted_);
- }
- }
- else
- {
- // only for the last there can be a right_resid: a part of *it right of x
- interval_type right_resid = left_subtract(cur_itv, inter_val);
-
- if(right_resid.empty())
- {
- // [---------------)
- // [-- it ----)
- Combiner()(it->CONT_VALUE, co_val);
-
- if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
- this->_map.erase(it);
- else
- join_neighbours(it);
- }
- else
- {
- // [-------------)
- // [-- it ---right_resid)
- const_cast<interval_type&>(it->KEY_VALUE).right_subtract(right_resid);
-
- //NOTE: This is NOT an insertion that has to take care for correct application of
- // the Combiner functor. It only reestablished that state after splitting the
- // 'it' interval value pair. Using map_insert<Combiner> does not work here.
- iterator insertion_ = this->_map.insert(it, value_type(right_resid, it->CONT_VALUE));
- join_right(insertion_);
-
- Combiner()(it->CONT_VALUE, co_val);
-
- if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
- this->_map.erase(it);
- else
- join_neighbours(it);
- }
- }
+ iterator inserted_ = this->template map_insert<Combiner>(it, end_gap, co_val);
+ join_neighbours(inserted_);
+ }
+ }
+ else
+ {
+ // only for the last there can be a right_resid: a part of *it right of x
+ interval_type right_resid = left_subtract(cur_itv, inter_val);
+
+ if(right_resid.empty())
+ {
+ // [---------------)
+ // [-- it ----)
+ Combiner()(it->CONT_VALUE, co_val);
+
+ if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
+ this->_map.erase(it);
+ else
+ join_neighbours(it);
+ }
+ else
+ {
+ // [-------------)
+ // [-- it ---right_resid)
+ const_cast<interval_type&>(it->KEY_VALUE).right_subtract(right_resid);
+
+ //NOTE: This is NOT an insertion that has to take care for correct application of
+ // the Combiner functor. It only reestablished that state after splitting the
+ // 'it' interval value pair. Using map_insert<Combiner> does not work here.
+ iterator insertion_ = this->_map.insert(it, value_type(right_resid, it->CONT_VALUE));
+ join_right(insertion_);
+
+ Combiner()(it->CONT_VALUE, co_val);
+
+ if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
+ this->_map.erase(it);
+ else
+ join_neighbours(it);
+ }
+ }
 }
 
 
@@ -489,16 +486,16 @@
 
     iterator fst_it = this->_map.lower_bound(inter_val);
     if(fst_it==this->_map.end())
- return;
+ return;
     iterator end_it = this->_map.upper_bound(inter_val);
     if(fst_it==end_it)
- return;
+ return;
 
- iterator lst_it = end_it; --lst_it;
- iterator it_ = fst_it;
- subtract_front (inter_val, co_val, it_);
+ iterator lst_it = end_it; --lst_it;
+ iterator it_ = fst_it;
+ subtract_front (inter_val, co_val, it_);
     subtract_main<Combiner>(inter_val, co_val, it_, lst_it);
- subtract_rear<Combiner>(inter_val, co_val, it_);
+ subtract_rear<Combiner>(inter_val, co_val, it_);
 }
 
 
@@ -511,9 +508,9 @@
 
     if(!left_resid.empty())
     {
- iterator prior_ = this->prior(it_);
- const_cast<interval_type&>(it_->KEY_VALUE).left_subtract(left_resid);
- this->_map.insert(prior_, value_type(left_resid, it_->CONT_VALUE));
+ iterator prior_ = this->prior(it_);
+ const_cast<interval_type&>(it_->KEY_VALUE).left_subtract(left_resid);
+ this->_map.insert(prior_, value_type(left_resid, it_->CONT_VALUE));
     }
 }
 
@@ -552,23 +549,23 @@
         if(Traits::absorbs_neutrons && cur_val==Combiner::neutron())
             this->_map.erase(it);
         else
- join_neighbours(it);
+ join_neighbours(it);
     }
     else
     {
- const_cast<interval_type&>(it->KEY_VALUE).right_subtract(right_resid);
- iterator next_ = this->_map.insert(it, value_type(right_resid, it->CONT_VALUE));
- Combiner()(it->CONT_VALUE, co_val);
+ const_cast<interval_type&>(it->KEY_VALUE).right_subtract(right_resid);
+ iterator next_ = this->_map.insert(it, value_type(right_resid, it->CONT_VALUE));
+ Combiner()(it->CONT_VALUE, co_val);
         if(Traits::absorbs_neutrons && it->CONT_VALUE==Combiner::neutron())
- {
+ {
             this->_map.erase(it);
- join_right(next_);
- }
- else
- {
- join_left(it);
- join_neighbours(next_);
- }
+ join_right(next_);
+ }
+ else
+ {
+ join_left(it);
+ join_neighbours(next_);
+ }
     }
 }
 
@@ -599,8 +596,8 @@
         iterator fst_it = this->_map.lower_bound(inter_val),
                  lst_it = insertion.ITERATOR;
         //assert((++lst_it) == this->_map.upper_bound(inter_val));
- iterator it_ = fst_it;
- insert_range(inter_val, co_val, it_, lst_it);
+ iterator it_ = fst_it;
+ insert_range(inter_val, co_val, it_, lst_it);
     }
 }
 
@@ -610,12 +607,12 @@
 void interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
     ::insert_range(const interval_type& inter_val, const CodomainT& co_val, iterator& it, iterator& lst_it)
 {
- iterator end_it = lst_it; ++end_it;
- iterator prior_ = it, inserted_;
- if(prior_ != this->_map.end())
- --prior_;
+ iterator end_it = lst_it; ++end_it;
+ iterator prior_ = it, inserted_;
+ if(prior_ != this->_map.end())
+ --prior_;
     interval_type rest_interval = inter_val, left_gap, cur_itv;
- interval_type last_interval = lst_it->KEY_VALUE;
+ interval_type last_interval = lst_it->KEY_VALUE;
 
     while(it != end_it)
     {
@@ -624,25 +621,25 @@
 
         if(!left_gap.empty())
         {
- inserted_ = this->_map.insert(prior_, value_type(left_gap, co_val));
- join_left(inserted_);
+ inserted_ = this->_map.insert(prior_, value_type(left_gap, co_val));
+ join_left(inserted_);
             // after filling that gap there may be another joining opportunity
             join_left(it);
         }
 
         // shrink interval
         rest_interval.left_subtract(cur_itv);
- prior_ = it;
- ++it;
+ prior_ = it;
+ ++it;
     }
 
     //insert_rear(rest_interval, co_val, lst_it):
     interval_type end_gap = left_subtract(rest_interval, last_interval);
- if(!end_gap.empty())
- {
- inserted_ = this->_map.insert(prior_, value_type(end_gap, co_val));
- join_neighbours(inserted_);
- }
+ if(!end_gap.empty())
+ {
+ inserted_ = this->_map.insert(prior_, value_type(end_gap, co_val));
+ join_neighbours(inserted_);
+ }
 }
 
 
@@ -663,12 +660,12 @@
 
     iterator fst_it = this->_map.lower_bound(inter_val);
     if(fst_it==this->_map.end())
- return;
+ return;
     iterator end_it = this->_map.upper_bound(inter_val);
     if(fst_it==end_it)
- return;
+ return;
 
- iterator lst_it = end_it; --lst_it;
+ iterator lst_it = end_it; --lst_it;
 
     iterator snd_it = fst_it; snd_it++;
     if(fst_it == lst_it)
@@ -678,16 +675,16 @@
 
         if(fst_it->CONT_VALUE == co_val)
         {
- interval_type left_resid = right_subtract(fst_it->KEY_VALUE, inter_val);
- if(!left_resid.empty())
- {
- const_cast<interval_type&>(fst_it->KEY_VALUE) = left_resid;
- if(!right_resid.empty())
- this->_map.insert(fst_it, value_type(right_resid, co_val));
- }
- else if(!right_resid.empty())
- const_cast<interval_type&>(fst_it->KEY_VALUE) = right_resid;
- else
+ interval_type left_resid = right_subtract(fst_it->KEY_VALUE, inter_val);
+ if(!left_resid.empty())
+ {
+ const_cast<interval_type&>(fst_it->KEY_VALUE) = left_resid;
+ if(!right_resid.empty())
+ this->_map.insert(fst_it, value_type(right_resid, co_val));
+ }
+ else if(!right_resid.empty())
+ const_cast<interval_type&>(fst_it->KEY_VALUE) = right_resid;
+ else
                 this->_map.erase(fst_it);
         }
     }
@@ -695,13 +692,13 @@
     {
         // first AND NOT last
         if(fst_it->CONT_VALUE == co_val)
- {
- interval_type left_resid = right_subtract(fst_it->KEY_VALUE, inter_val);
- if(left_resid.empty())
- this->_map.erase(fst_it);
- else
- const_cast<interval_type&>(fst_it->KEY_VALUE) = left_resid;
- }
+ {
+ interval_type left_resid = right_subtract(fst_it->KEY_VALUE, inter_val);
+ if(left_resid.empty())
+ this->_map.erase(fst_it);
+ else
+ const_cast<interval_type&>(fst_it->KEY_VALUE) = left_resid;
+ }
 
         erase_rest(inter_val, co_val, snd_it, lst_it);
     }
@@ -719,15 +716,15 @@
             this->_map.erase(it_++);
         else it_++;
 
- //erase_rear:
+ //erase_rear:
     if(it_->CONT_VALUE == co_val)
- {
+ {
         interval_type right_resid = left_subtract(it_->KEY_VALUE, inter_val);
- if(right_resid.empty())
- this->_map.erase(it_);
- else
- const_cast<interval_type&>(it_->KEY_VALUE) = right_resid;
- }
+ if(right_resid.empty())
+ this->_map.erase(it_);
+ else
+ const_cast<interval_type&>(it_->KEY_VALUE) = right_resid;
+ }
 }
 
 

Modified: sandbox/itl/boost/itl/interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_set.hpp (original)
+++ sandbox/itl/boost/itl/interval_set.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -223,7 +223,7 @@
 
     interval_type right_itv = (*right_it);
     this->_set.erase(right_it);
- const_cast<value_type&>(*left_it).extend(right_itv);
+ const_cast<value_type&>(*left_it).extend(right_itv);
 
     return left_it;
 }
@@ -249,13 +249,13 @@
         interval_type leftResid = right_subtract(*fst_it, addend);
         interval_type rightResid = left_subtract(*lst_it, addend);
 
- this->_set.erase(snd_it, end_it);
+ this->_set.erase(snd_it, end_it);
 
         interval_type extended = addend;
         extended.extend(leftResid).extend(rightResid);
 
- const_cast<value_type&>(*fst_it) = extended;
- handle_neighbours(fst_it);
+ const_cast<value_type&>(*fst_it) = extended;
+ handle_neighbours(fst_it);
     }
 }
 
@@ -271,16 +271,16 @@
 
     interval_type leftResid = right_subtract(*fst_it, minuend);
     interval_type rightResid;
- if(fst_it != end_it)
- rightResid = left_subtract(*lst_it, minuend);
+ if(fst_it != end_it)
+ rightResid = left_subtract(*lst_it, minuend);
 
- this->_set.erase(fst_it, end_it);
+ this->_set.erase(fst_it, end_it);
 
- if(!leftResid.empty())
- this->_set.insert(leftResid);
+ if(!leftResid.empty())
+ this->_set.insert(leftResid);
 
- if(!rightResid.empty())
- this->_set.insert(rightResid);
+ if(!rightResid.empty())
+ this->_set.insert(rightResid);
 }
 
 

Modified: sandbox/itl/boost/itl/separate_interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/separate_interval_set.hpp (original)
+++ sandbox/itl/boost/itl/separate_interval_set.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -174,12 +174,12 @@
         interval_type leftResid = right_subtract(*fst_it, addend);
         interval_type rightResid = left_subtract(*lst_it, addend);
 
- this->_set.erase(snd_it, end_it);
+ this->_set.erase(snd_it, end_it);
 
         interval_type extended = addend;
         extended.extend(leftResid).extend(rightResid);
 
- const_cast<value_type&>(*fst_it) = extended;
+ const_cast<value_type&>(*fst_it) = extended;
     }
 }
 
@@ -196,16 +196,16 @@
 
     interval_type leftResid = right_subtract(*fst_it, minuend);
     interval_type rightResid;
- if(fst_it != end_it)
- rightResid = left_subtract(*lst_it, minuend);
+ if(fst_it != end_it)
+ rightResid = left_subtract(*lst_it, minuend);
 
- this->_set.erase(fst_it, end_it);
+ this->_set.erase(fst_it, end_it);
 
- if(!leftResid.empty())
- this->_set.insert(leftResid);
+ if(!leftResid.empty())
+ this->_set.insert(leftResid);
 
- if(!rightResid.empty())
- this->_set.insert(rightResid);
+ if(!rightResid.empty())
+ this->_set.insert(rightResid);
 }
 
 //-----------------------------------------------------------------------------

Modified: sandbox/itl/boost/itl/set.hpp
==============================================================================
--- sandbox/itl/boost/itl/set.hpp (original)
+++ sandbox/itl/boost/itl/set.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -603,10 +603,10 @@
 {
     typedef itl::set<DomainT,Compare,Alloc> ObjectT;
     stream << "{";
- typename ObjectT::const_iterator it = object.begin();
- if(it != object.end())
- stream << *it++;
- while(it != object.end())
+ typename ObjectT::const_iterator it = object.begin();
+ if(it != object.end())
+ stream << *it++;
+ while(it != object.end())
         stream << " " << *it++;
 
     return stream << "}";

Modified: sandbox/itl/boost/itl/split_interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/split_interval_map.hpp (original)
+++ sandbox/itl/boost/itl/split_interval_map.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -43,8 +43,8 @@
     typedef interval_base_map <split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>,
                                DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> base_type;
 
- typedef DomainT domain_type;
- typedef CodomainT codomain_type;
+ typedef DomainT domain_type;
+ typedef CodomainT codomain_type;
     typedef Interval<DomainT,Compare> interval_type;
     typedef typename base_type::iterator iterator;
     typedef typename base_type::value_type value_type;
@@ -188,7 +188,7 @@
         return;
 
     std::pair<iterator,bool> insertion
- = this->template map_insert<Combiner>(inter_val, co_val);
+ = this->template map_insert<Combiner>(inter_val, co_val);
 
     if(!insertion.WAS_SUCCESSFUL)
     {
@@ -197,12 +197,12 @@
                  lst_it = insertion.ITERATOR;
         //assert(end_it == this->_map.upper_bound(inter_val));
 
- iterator it_ = fst_it;
- interval_type rest_interval = inter_val;
+ iterator it_ = fst_it;
+ interval_type rest_interval = inter_val;
 
- add_front (rest_interval, co_val, it_);
+ add_front (rest_interval, co_val, it_);
         add_main<Combiner>(rest_interval, co_val, it_, lst_it);
- add_rear<Combiner>(rest_interval, co_val, it_);
+ add_rear<Combiner>(rest_interval, co_val, it_);
     }
 }
 
@@ -211,25 +211,25 @@
 inline void split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
     ::add_front(const interval_type& inter_val, const CodomainT& co_val, iterator& first_)
 {
- // If the collision sequence has a right residual 'right_resid' is will
- // be split, to provide a standardized start of algorithms:
- // The addend interval 'inver_val' covers the beginning of the collision sequence.
+ // If the collision sequence has a right residual 'right_resid' is will
+ // be split, to provide a standardized start of algorithms:
+ // The addend interval 'inver_val' covers the beginning of the collision sequence.
 
     // only for the first there can be a left_resid: a part of *first_ left of inter_val
     interval_type left_resid = right_subtract(first_->KEY_VALUE, inter_val);
 
- if(!left_resid.empty())
- { // [------------ . . .
- // [left_resid---fst_it --- . . .
- iterator prior_ = this->prior(first_);
- const_cast<interval_type&>(first_->KEY_VALUE).left_subtract(left_resid);
- //NOTE: Only splitting
- iterator insertion_ = this->_map.insert(prior_, value_type(left_resid, first_->CONT_VALUE));
- }
-
- //POST:
- // [----- inter_val ---- . . .
- // ...[-- first_ --...
+ if(!left_resid.empty())
+ { // [------------ . . .
+ // [left_resid---fst_it --- . . .
+ iterator prior_ = this->prior(first_);
+ const_cast<interval_type&>(first_->KEY_VALUE).left_subtract(left_resid);
+ //NOTE: Only splitting
+ iterator insertion_ = this->_map.insert(prior_, value_type(left_resid, first_->CONT_VALUE));
+ }
+
+ //POST:
+ // [----- inter_val ---- . . .
+ // ...[-- first_ --...
 }
 
 
@@ -238,11 +238,11 @@
 inline void split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
     ::add_main(interval_type& x_rest, const CodomainT& co_val, iterator& it, const iterator& lst_it)
 {
- interval_type cur_interval;
+ interval_type cur_interval;
     while(it!=lst_it)
     {
         cur_interval = it->KEY_VALUE ;
- add_segment<Combiner>(x_rest, co_val, it);
+ add_segment<Combiner>(x_rest, co_val, it);
         // shrink interval
         x_rest.left_subtract(cur_interval);
     }
@@ -255,24 +255,24 @@
     ::add_segment(const interval_type& inter_val, const CodomainT& co_val, iterator& it_)
 {
     interval_type lead_gap = right_subtract(inter_val, it_->KEY_VALUE);
- if(!lead_gap.empty())
- {
- // [------ . . .
- // [-- it ...
- iterator prior_ = it_;
- if(prior_ != this->_map.begin())
- this->template map_insert<Combiner>(--prior_, lead_gap, co_val);
- else
- this->template map_insert<Combiner>(lead_gap, co_val);
- }
-
- // . . . --------- . . . addend interval
- // [-- it_ --) has a common part with the first overval
- Combiner()(it_->CONT_VALUE, co_val);
- if(Traits::absorbs_neutrons && it_->CONT_VALUE == Combiner::neutron())
- this->_map.erase(it_++);
- else
- ++it_;
+ if(!lead_gap.empty())
+ {
+ // [------ . . .
+ // [-- it ...
+ iterator prior_ = it_;
+ if(prior_ != this->_map.begin())
+ this->template map_insert<Combiner>(--prior_, lead_gap, co_val);
+ else
+ this->template map_insert<Combiner>(lead_gap, co_val);
+ }
+
+ // . . . --------- . . . addend interval
+ // [-- it_ --) has a common part with the first overval
+ Combiner()(it_->CONT_VALUE, co_val);
+ if(Traits::absorbs_neutrons && it_->CONT_VALUE == Combiner::neutron())
+ this->_map.erase(it_++);
+ else
+ ++it_;
 }
 
 
@@ -282,62 +282,62 @@
 inline void split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
     ::add_rear(const interval_type& inter_val, const CodomainT& co_val, iterator& it)
 {
- iterator prior_ = this->prior(it);
+ iterator prior_ = this->prior(it);
     interval_type cur_itv = (*it).KEY_VALUE ;
 
     interval_type lead_gap = right_subtract(inter_val, cur_itv);
- if(!lead_gap.empty())
- // [------ . . .
- // [prior) [-- it ...
- this->template map_insert<Combiner>(prior_, lead_gap, co_val);
-
+ if(!lead_gap.empty())
+ // [------ . . .
+ // [prior) [-- it ...
+ this->template map_insert<Combiner>(prior_, lead_gap, co_val);
+
 
     interval_type end_gap = left_subtract(inter_val, cur_itv);
- if(!end_gap.empty())
- {
- // [------------------)
- // [-- it --)
- Combiner()(it->CONT_VALUE, co_val);
+ if(!end_gap.empty())
+ {
+ // [------------------)
+ // [-- it --)
+ Combiner()(it->CONT_VALUE, co_val);
 
         if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
- {
+ {
             this->_map.erase(it);
- iterator inserted_ = this->template map_insert<Combiner>(prior_, end_gap, co_val);
- }
+ iterator inserted_ = this->template map_insert<Combiner>(prior_, end_gap, co_val);
+ }
+ else
+ this->template map_insert<Combiner>(it, end_gap, co_val);
+ }
+ else
+ {
+ // only for the last there can be a right_resid: a part of *it right of addend
+ interval_type right_resid = left_subtract(cur_itv, inter_val);
+
+ if(right_resid.empty())
+ {
+ // [---------------)
+ // [-- it ----)
+ Combiner()(it->CONT_VALUE, co_val);
+
+ if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
+ this->_map.erase(it);
+ }
         else
- this->template map_insert<Combiner>(it, end_gap, co_val);
- }
- else
- {
- // only for the last there can be a right_resid: a part of *it right of addend
- interval_type right_resid = left_subtract(cur_itv, inter_val);
-
- if(right_resid.empty())
- {
- // [---------------)
- // [-- it ----)
- Combiner()(it->CONT_VALUE, co_val);
-
- if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
- this->_map.erase(it);
- }
- else
- {
- // [-------------)
- // [-- it ---right_resid)
- const_cast<interval_type&>(it->KEY_VALUE).right_subtract(right_resid);
-
- //NOTE: This is NOT an insertion that has to take care for correct application of
- // the Combiner functor. It only reestablished that state after splitting the
- // 'it' interval value pair. Using map_insert<Combiner> does not work here.
- iterator insertion_ = this->_map.insert(it, value_type(right_resid, it->CONT_VALUE));
-
- Combiner()(it->CONT_VALUE, co_val);
-
- if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
- this->_map.erase(it);
- }
- }
+ {
+ // [-------------)
+ // [-- it ---right_resid)
+ const_cast<interval_type&>(it->KEY_VALUE).right_subtract(right_resid);
+
+ //NOTE: This is NOT an insertion that has to take care for correct application of
+ // the Combiner functor. It only reestablished that state after splitting the
+ // 'it' interval value pair. Using map_insert<Combiner> does not work here.
+ iterator insertion_ = this->_map.insert(it, value_type(right_resid, it->CONT_VALUE));
+
+ Combiner()(it->CONT_VALUE, co_val);
+
+ if(Traits::absorbs_neutrons && it->CONT_VALUE == Combiner::neutron())
+ this->_map.erase(it);
+ }
+ }
 }
 
 
@@ -362,16 +362,16 @@
 
     iterator fst_it = this->_map.lower_bound(inter_val);
     if(fst_it==this->_map.end())
- return;
+ return;
     iterator end_it = this->_map.upper_bound(inter_val);
     if(fst_it==end_it)
- return;
+ return;
 
- iterator lst_it = end_it; --lst_it;
- iterator it_ = fst_it;
- subtract_front (inter_val, co_val, it_);
+ iterator lst_it = end_it; --lst_it;
+ iterator it_ = fst_it;
+ subtract_front (inter_val, co_val, it_);
     subtract_main<Combiner>(inter_val, co_val, it_, lst_it);
- subtract_rear<Combiner>(inter_val, co_val, it_);
+ subtract_rear<Combiner>(inter_val, co_val, it_);
 }
 
 
@@ -383,11 +383,11 @@
 
     if(!left_resid.empty())
     {
- iterator prior_ = it_;
- if(prior_ != this->_map.begin())
- --prior_;
- const_cast<interval_type&>(it_->KEY_VALUE).left_subtract(left_resid);
- this->_map.insert(prior_, value_type(left_resid, it_->CONT_VALUE));
+ iterator prior_ = it_;
+ if(prior_ != this->_map.begin())
+ --prior_;
+ const_cast<interval_type&>(it_->KEY_VALUE).left_subtract(left_resid);
+ this->_map.insert(prior_, value_type(left_resid, it_->CONT_VALUE));
     }
 }
 
@@ -424,10 +424,10 @@
     }
     else
     { // . . . ---)
- // . . . ---right_resid) : split it_
- const_cast<interval_type&>(it_->KEY_VALUE).right_subtract(right_resid);
- iterator next_ = this->_map.insert(it_, value_type(right_resid, it_->CONT_VALUE));
- Combiner()(it_->CONT_VALUE, co_val);
+ // . . . ---right_resid) : split it_
+ const_cast<interval_type&>(it_->KEY_VALUE).right_subtract(right_resid);
+ iterator next_ = this->_map.insert(it_, value_type(right_resid, it_->CONT_VALUE));
+ Combiner()(it_->CONT_VALUE, co_val);
         if(Traits::absorbs_neutrons && it_->CONT_VALUE==Combiner::neutron())
             this->_map.erase(it_);
     }
@@ -458,8 +458,8 @@
         iterator fst_it = this->_map.lower_bound(inter_val),
                  lst_it = insertion.ITERATOR;
         //assert((++lst_it) == this->_map.upper_bound(inter_val));
- iterator it_ = fst_it;
- insert_range(inter_val, co_val, it_, lst_it);
+ iterator it_ = fst_it;
+ insert_range(inter_val, co_val, it_, lst_it);
     }
 }
 
@@ -469,12 +469,12 @@
 inline void split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
     ::insert_range(const interval_type& inter_val, const CodomainT& co_val, iterator& it, iterator& lst_it)
 {
- iterator end_it = lst_it; ++end_it;
- iterator prior_ = it, inserted_;
- if(prior_ != this->_map.end())
- --prior_;
+ iterator end_it = lst_it; ++end_it;
+ iterator prior_ = it, inserted_;
+ if(prior_ != this->_map.end())
+ --prior_;
     interval_type rest_interval = inter_val, left_gap, cur_itv;
- interval_type last_interval = lst_it->KEY_VALUE;
+ interval_type last_interval = lst_it->KEY_VALUE;
 
     while(it != end_it)
     {
@@ -482,18 +482,18 @@
         left_gap = right_subtract(rest_interval, cur_itv);
 
         if(!left_gap.empty())
- inserted_ = this->_map.insert(prior_, value_type(left_gap, co_val));
+ inserted_ = this->_map.insert(prior_, value_type(left_gap, co_val));
 
         // shrink interval
         rest_interval.left_subtract(cur_itv);
- prior_ = it;
- ++it;
+ prior_ = it;
+ ++it;
     }
 
     //insert_rear(rest_interval, co_val, lst_it):
     interval_type end_gap = left_subtract(rest_interval, last_interval);
- if(!end_gap.empty())
- inserted_ = this->_map.insert(prior_, value_type(end_gap, co_val));
+ if(!end_gap.empty())
+ inserted_ = this->_map.insert(prior_, value_type(end_gap, co_val));
 }
 
 
@@ -514,12 +514,12 @@
 
     iterator fst_it = this->_map.lower_bound(inter_val);
     if(fst_it==this->_map.end())
- return;
+ return;
     iterator end_it = this->_map.upper_bound(inter_val);
     if(fst_it==end_it)
- return;
+ return;
 
- iterator lst_it = end_it; --lst_it;
+ iterator lst_it = end_it; --lst_it;
 
     iterator snd_it = fst_it; ++snd_it;
     if(fst_it == lst_it)
@@ -529,16 +529,16 @@
 
         if(fst_it->CONT_VALUE == co_val)
         {
- interval_type left_resid = right_subtract(fst_it->KEY_VALUE, inter_val);
- if(!left_resid.empty())
- {
- const_cast<interval_type&>(fst_it->KEY_VALUE) = left_resid;
- if(!right_resid.empty())
- this->_map.insert(fst_it, value_type(right_resid, co_val));
- }
- else if(!right_resid.empty())
- const_cast<interval_type&>(fst_it->KEY_VALUE) = right_resid;
- else
+ interval_type left_resid = right_subtract(fst_it->KEY_VALUE, inter_val);
+ if(!left_resid.empty())
+ {
+ const_cast<interval_type&>(fst_it->KEY_VALUE) = left_resid;
+ if(!right_resid.empty())
+ this->_map.insert(fst_it, value_type(right_resid, co_val));
+ }
+ else if(!right_resid.empty())
+ const_cast<interval_type&>(fst_it->KEY_VALUE) = right_resid;
+ else
                 this->_map.erase(fst_it);
         }
     }
@@ -546,13 +546,13 @@
     {
         // first AND NOT last
         if(fst_it->CONT_VALUE == co_val)
- {
- interval_type left_resid = right_subtract(fst_it->KEY_VALUE, inter_val);
- if(left_resid.empty())
- this->_map.erase(fst_it);
- else
- const_cast<interval_type&>(fst_it->KEY_VALUE) = left_resid;
- }
+ {
+ interval_type left_resid = right_subtract(fst_it->KEY_VALUE, inter_val);
+ if(left_resid.empty())
+ this->_map.erase(fst_it);
+ else
+ const_cast<interval_type&>(fst_it->KEY_VALUE) = left_resid;
+ }
 
         erase_rest(inter_val, co_val, snd_it, lst_it);
     }
@@ -570,15 +570,15 @@
             this->_map.erase(it_++);
         else it_++;
 
- //erase_rear:
+ //erase_rear:
     if(it_->CONT_VALUE == co_val)
- {
+ {
         interval_type right_resid = left_subtract(it_->KEY_VALUE, inter_val);
- if(right_resid.empty())
- this->_map.erase(it_);
- else
- const_cast<interval_type&>(it_->KEY_VALUE) = right_resid;
- }
+ if(right_resid.empty())
+ this->_map.erase(it_);
+ else
+ const_cast<interval_type&>(it_->KEY_VALUE) = right_resid;
+ }
 }
 
 

Modified: sandbox/itl/boost/itl/split_interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/split_interval_set.hpp (original)
+++ sandbox/itl/boost/itl/split_interval_set.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -167,41 +167,41 @@
                  end_it = insertion.ITERATOR; end_it++;
         //BOOST_ASSERT(end_it == this->_map.upper_bound(inter_val));
 
- iterator pre_it = fst_it;
- if(pre_it != this->_set.begin())
- --pre_it;
-
- // handle the beginning of the sequence of intervals of *this
- // overlapped by insertee inverval 'addend'
- interval_type leadGap = right_subtract(addend, *fst_it);
+ iterator pre_it = fst_it;
+ if(pre_it != this->_set.begin())
+ --pre_it;
+
+ // handle the beginning of the sequence of intervals of *this
+ // overlapped by insertee inverval 'addend'
+ interval_type leadGap = right_subtract(addend, *fst_it);
         // this is a new interval that is a gap in the current map
- if(!leadGap.empty())
- this->_set.insert(pre_it, leadGap);
- else
- {
- interval_type leftResid = right_subtract(*fst_it, addend);
- if(!leftResid.empty())
- {
- const_cast<value_type&>(*fst_it).left_subtract(leftResid);
- this->_set.insert(pre_it, leftResid);
- }
- }
-
- // handle the ending of the sequence of intervals of *this
- // overlapped by insertee inverval 'addend'
- interval_type endGap = left_subtract(addend, *lst_it);
-
- if(!endGap.empty())
- this->_set.insert(lst_it, endGap);
- else
- {
- interval_type rightResid = left_subtract(*lst_it, addend);
- if(!rightResid.empty())
- {
- const_cast<value_type&>(*lst_it).right_subtract(rightResid);
- this->_set.insert(lst_it, rightResid);
- }
- }
+ if(!leadGap.empty())
+ this->_set.insert(pre_it, leadGap);
+ else
+ {
+ interval_type leftResid = right_subtract(*fst_it, addend);
+ if(!leftResid.empty())
+ {
+ const_cast<value_type&>(*fst_it).left_subtract(leftResid);
+ this->_set.insert(pre_it, leftResid);
+ }
+ }
+
+ // handle the ending of the sequence of intervals of *this
+ // overlapped by insertee inverval 'addend'
+ interval_type endGap = left_subtract(addend, *lst_it);
+
+ if(!endGap.empty())
+ this->_set.insert(lst_it, endGap);
+ else
+ {
+ interval_type rightResid = left_subtract(*lst_it, addend);
+ if(!rightResid.empty())
+ {
+ const_cast<value_type&>(*lst_it).right_subtract(rightResid);
+ this->_set.insert(lst_it, rightResid);
+ }
+ }
         
         iterator snd_it = fst_it; snd_it++;
         interval_type addend_rest = left_subtract(addend, *fst_it);
@@ -213,19 +213,19 @@
 template <typename DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
 inline void split_interval_set<DomainT,Compare,Interval,Alloc>::insert_rest(interval_type& addend, iterator& it, iterator& end_it)
 {//JODO add_rest
- interval_type left_gap, cur_itv;
- iterator pred_it = it; --pred_it;
- while(it != end_it)
- {
+ interval_type left_gap, cur_itv;
+ iterator pred_it = it; --pred_it;
+ while(it != end_it)
+ {
         cur_itv = *it;
- left_gap = right_subtract(addend, cur_itv);
- if(!left_gap.empty())
- this->_set.insert(pred_it, left_gap);
-
- pred_it = it;
- addend.left_subtract(cur_itv);
- ++it;
- }
+ left_gap = right_subtract(addend, cur_itv);
+ if(!left_gap.empty())
+ this->_set.insert(pred_it, left_gap);
+
+ pred_it = it;
+ addend.left_subtract(cur_itv);
+ ++it;
+ }
 }
 
 
@@ -241,16 +241,16 @@
 
     interval_type leftResid = right_subtract(*fst_it, minuend);
     interval_type rightResid;
- if(fst_it != end_it)
- rightResid = left_subtract(*lst_it, minuend);
+ if(fst_it != end_it)
+ rightResid = left_subtract(*lst_it, minuend);
 
- this->_set.erase(fst_it, end_it);
-
- if(!leftResid.empty())
- this->_set.insert(leftResid);
+ this->_set.erase(fst_it, end_it);
+
+ if(!leftResid.empty())
+ this->_set.insert(leftResid);
 
- if(!rightResid.empty())
- this->_set.insert(rightResid);
+ if(!rightResid.empty())
+ this->_set.insert(rightResid);
 }
 
 

Modified: sandbox/itl/boost/validate/gentor/randomgentor.hpp
==============================================================================
--- sandbox/itl/boost/validate/gentor/randomgentor.hpp (original)
+++ sandbox/itl/boost/validate/gentor/randomgentor.hpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -56,7 +56,7 @@
     class RandomGentor<itl::split_interval_set<DomainT> > :
         public SetGentorT<itl::split_interval_set<DomainT> > {};
 
- // ----- tree --------------------------------------------------------------
+ // ----- tree --------------------------------------------------------------
 #ifdef USE_ITL_TREE
     template <class DomainT>
     class RandomGentor<itl::tree<DomainT> > :
@@ -277,13 +277,13 @@
 
 
     //--------------------------------------------------------------------------
- // itl::tree
+ // itl::tree
     //--------------------------------------------------------------------------
 #ifdef USE_ITL_TREE
     template <>
- struct Calibrater<itl::tree<int>, RandomGentor>
+ struct Calibrater<itl::tree<int>, RandomGentor>
     {
- static void apply(RandomGentor<itl::tree<int> >& gentor)
+ static void apply(RandomGentor<itl::tree<int> >& gentor)
         {
             gentor.setRangeOfSampleSize(GentorProfileSgl::it()->range_ContainerSize());
             ItvGentorT<int>* itvGentor = new ItvGentorT<int>;

Modified: sandbox/itl/libs/itl/build/win32/vc9_all.sln
==============================================================================
--- sandbox/itl/libs/itl/build/win32/vc9_all.sln (original)
+++ sandbox/itl/libs/itl/build/win32/vc9_all.sln 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -91,6 +91,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_test_interval_map_mixed2", "..\..\test\test_interval_map_mixed2\vc9_test_interval_map_mixed2.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B8D3B9F9F}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_perform", "..\..\..\itl_xt\test\perform\vc9_perform.vcproj", "{EF64A2C7-DE78-46C2-953F-C4685A5D6A98}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -277,6 +279,10 @@
                 {EE61B7EF-EC45-4165-8B49-FD5B8D3B9F9F}.Debug|Win32.Build.0 = Debug|Win32
                 {EE61B7EF-EC45-4165-8B49-FD5B8D3B9F9F}.Release|Win32.ActiveCfg = Release|Win32
                 {EE61B7EF-EC45-4165-8B49-FD5B8D3B9F9F}.Release|Win32.Build.0 = Release|Win32
+ {EF64A2C7-DE78-46C2-953F-C4685A5D6A98}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EF64A2C7-DE78-46C2-953F-C4685A5D6A98}.Debug|Win32.Build.0 = Debug|Win32
+ {EF64A2C7-DE78-46C2-953F-C4685A5D6A98}.Release|Win32.ActiveCfg = Release|Win32
+ {EF64A2C7-DE78-46C2-953F-C4685A5D6A98}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Modified: sandbox/itl/libs/itl/doc/examples.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/examples.qbk (original)
+++ sandbox/itl/libs/itl/doc/examples.qbk 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -21,7 +21,7 @@
             [__itv__] [Intervals for integral and continuous instance types.
                        Closed and open interval borders]]
         [[basic] [[link boost_itl.examples.interval_container Interval container]]
- [__itv_set__,\n__sep_itv_set__,\n__spl_itv_set__,\n__spl_itv_map__]
+ [__itv_set__,\n__sep_itv_set__,\n__spl_itv_set__,\n__spl_itv_map__,\n__itv_map__]
                                        [basic characteristics of interval container]]
         [[basic] [[link boost_itl.examples.overlap_counter Overlap counter]]
             [__itv_map__][The most simple application of an interval map:
@@ -122,6 +122,7 @@
 [example_interval_container]
 [endsect]
 
+
 [section Overlap counter]
 
 Example [*overlap counter] provides the simplest application

Modified: sandbox/itl/libs/itl/doc/itl.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/itl.qbk (original)
+++ sandbox/itl/libs/itl/doc/itl.qbk 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -1,7 +1,7 @@
 [library Boost.Itl
     [quickbook 1.4]
     [authors [Faulhaber, Joachim]]
- [copyright 2007-2008 Joachim Faulhaber]
+ [copyright 2007-2009 Joachim Faulhaber]
     [copyright 1999-2006 Cortex Software GmbH]
     [category container]
     [id optional]
@@ -127,11 +127,6 @@
 [def __GO_TO__ [$images/callouts/R.png]]
 
 
-[/aggregate on overlap aggrovering]
-[/aggregate on collide aggrolliding]
-[/split on insertion sploning splonsing; split on addition splonadding,
- spladding, splinsertion, splinsoring; decomposition on insertion]
-
 [include introduction.qbk]
 [include examples.qbk]
 [include concepts.qbk]

Modified: sandbox/itl/libs/itl/example/boost_party/boost_party.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/boost_party/boost_party.cpp (original)
+++ sandbox/itl/libs/itl/example/boost_party/boost_party.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -75,7 +75,7 @@
     GuestSetT peter;
     peter.insert("Peter");
 
- // A party is an interval map that maps time intervals to sets of guests
+ // A party is an interval map that maps time intervals to sets of guests
     interval_map<ptime, GuestSetT> party;
 
     party.add( // add and element
@@ -104,7 +104,7 @@
     cout << "----- History of party guests -------------------------\n";
     while(it != party.end())
     {
- interval<ptime> when = (*it).first;
+ interval<ptime> when = it->first;
         // Who is at the party within the time interval 'when' ?
         GuestSetT who = (*it++).second;
         cout << "[" << when.first() << " - " << when.upper() << ")"

Modified: sandbox/itl/libs/itl/example/interval/interval.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/interval/interval.cpp (original)
+++ sandbox/itl/libs/itl/example/interval/interval.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -10,7 +10,7 @@
 +-----------------------------------------------------------------------------*/
 /** Example interval.cpp \file interval.cpp
 
- Of course much of the library code deals with intervals which are implemented
+ Much of the library code deals with intervals which are implemented
     as class interval.
 
     This program gives a very short samlpe of different interval instances.

Modified: sandbox/itl/libs/itl/example/interval_container/interval_container.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/interval_container/interval_container.cpp (original)
+++ sandbox/itl/libs/itl/example/interval_container/interval_container.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -77,7 +77,12 @@
     overlapCounter += make_pair(next_morning, 1); //touching
     overlapCounter += make_pair(next_evening, 1); //disjoint
 
- cout << "Split times overlap counted:\n" << overlapCounter.as_string() << endl;
+ cout << "Split times overlap counted:\n" << overlapCounter << endl;
+
+ // An interval map joins touching intervals, if associated values are equal
+ interval_map<Time, int> joiningOverlapCounter;
+ joiningOverlapCounter = overlapCounter;
+ cout << "Times overlap counted:\n" << joiningOverlapCounter << endl;
 }
 
 int main()
@@ -95,10 +100,14 @@
 --------------------------------------------------------------
 Joined times :[mon:20:00,wed:10:00)[wed:18:00,wed:21:00)
 Separate times:[mon:20:00,wed:07:00)[wed:07:00,wed:10:00)[wed:18:00,wed:21:00)
-Split times :[mon:20:00,tue:07:00)[tue:07:00,tue:20:00)[tue:20:00,wed:07:00)
- [wed:07:00,wed:10:00)[wed:18:00,wed:21:00)
+Split times :
+[mon:20:00,tue:07:00)[tue:07:00,tue:20:00)[tue:20:00,wed:07:00)
+[wed:07:00,wed:10:00)[wed:18:00,wed:21:00)
 Split times overlap counted:
-([mon:20:00,tue:07:00),1)([tue:07:00,tue:20:00),2)([tue:20:00,wed:07:00),1)
-([wed:07:00,wed:10:00),1)([wed:18:00,wed:21:00),1)
+{([mon:20:00,tue:07:00)->1)([tue:07:00,tue:20:00)->2)([tue:20:00,wed:07:00)->1)
+([wed:07:00,wed:10:00)->1)([wed:18:00,wed:21:00)->1)}
+Times overlap counted:
+{([mon:20:00,tue:07:00)->1)([tue:07:00,tue:20:00)->2)([tue:20:00,wed:10:00)->1)
+([wed:18:00,wed:21:00)->1)}
 -----------------------------------------------------------------------------*/
 //]

Modified: sandbox/itl/libs/itl/example/party/party.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/party/party.cpp (original)
+++ sandbox/itl/libs/itl/example/party/party.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -62,7 +62,6 @@
 // Time is the domain type the the split_interval_map. It's key values are therefore
 // time intervals: interval<Time>. The content is the set of names: GuestSetT.
 
-typedef interval_map<Time, GuestSetT> PartyAttendenceHistoryT;
 
 void party()
 {
@@ -77,19 +76,19 @@
     GuestSetT peter;
     peter.insert("Peter");
 
- PartyAttendenceHistoryT party;
+ interval_map<Time, GuestSetT> party;
 
     party += make_pair( interval<Time>::rightopen(Time(19,30), Time(23,00)), mary_harry);
     party += make_pair( interval<Time>::rightopen(Time(20,10), Time(monday,0,0)), diana_susan);
     party += make_pair( interval<Time>::rightopen(Time(22,15), Time(monday,0,30)), peter);
 
- PartyAttendenceHistoryT::iterator it = party.begin();
+ interval_map<Time, GuestSetT>::iterator it = party.begin();
     while(it != party.end())
     {
- interval<Time> when = (*it).first;
+ interval<Time> when = it->first;
         // Who is at the party within the time interval 'when' ?
         GuestSetT who = (*it++).second;
- cout << when.as_string() << ": " << who.as_string() << endl;
+ cout << when << ": " << who << endl;
     }
 }
 

Modified: sandbox/itl/libs/itl/example/partys_height_average/partys_height_average.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/partys_height_average/partys_height_average.cpp (original)
+++ sandbox/itl/libs/itl/example/partys_height_average/partys_height_average.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -12,12 +12,12 @@
 /** Example partys_height_average.cpp \file partys_height_average.cpp
 
     In partys_height_average.cpp we compute yet another aggregation:
- The average height of guests. This is done by defining a class
- counted_sum that sums up heights and counts the numer of guests
- via an operator +=.
-
- Based on the operator += we can aggregate counted sums on addition
- of interval value pairs into an interval_map.
+ The average height of guests. This is done by defining a class
+ counted_sum that sums up heights and counts the numer of guests
+ via an operator +=.
+
+ Based on the operator += we can aggregate counted sums on addition
+ of interval value pairs into an interval_map.
 
     \include partys_height_average/partys_height_average.cpp
 */
@@ -39,19 +39,19 @@
 class counted_sum
 {
 public:
- counted_sum():_sum(0),_count(0){}
- counted_sum(int sum):_sum(sum),_count(1){}
+ counted_sum():_sum(0),_count(0){}
+ counted_sum(int sum):_sum(sum),_count(1){}
 
- int sum()const {return _sum;}
- int count()const{return _count;}
- double average()const{ return _count==0 ? 0.0 : _sum/static_cast<double>(_count); }
+ int sum()const {return _sum;}
+ int count()const{return _count;}
+ double average()const{ return _count==0 ? 0.0 : _sum/static_cast<double>(_count); }
 
- counted_sum& operator += (const counted_sum& right)
- { _sum += right.sum(); _count += right.count(); return *this; }
+ counted_sum& operator += (const counted_sum& right)
+ { _sum += right.sum(); _count += right.count(); return *this; }
 
 private:
- int _sum;
- int _count;
+ int _sum;
+ int _count;
 };
 
 bool operator == (const counted_sum& left, const counted_sum& right)
@@ -105,7 +105,7 @@
 
         double height_average = (*height_sum_++).second.average();
         cout << setprecision(3)
- << "[" << when.first() << " - " << when.upper() << ")"
+ << "[" << when.first() << " - " << when.upper() << ")"
              << ": " << height_average <<" cm = " << height_average/30.48 << " ft" << endl;
     }
 }

Modified: sandbox/itl/libs/itl/example/partys_tallest_guests/partys_tallest_guests.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/partys_tallest_guests/partys_tallest_guests.cpp (original)
+++ sandbox/itl/libs/itl/example/partys_tallest_guests/partys_tallest_guests.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -12,16 +12,16 @@
 /** Example partys_tallest_guests.cpp \file partys_tallest_guests.cpp
 
     In partys_tallest_guests.cpp we use a different instantiation of
- interval map templates to compute maxima of guest heights.
+ interval map templates to compute maxima of guest heights.
 
- Instead of aggregating groups of people attending the party in time
- we aggregate the maximum of guest height for the time intervals.
+ Instead of aggregating groups of people attending the party in time
+ we aggregate the maximum of guest height for the time intervals.
 
- Using a joining interval_map results in a smaller map: All interval
- value pairs are joined if the maximum does not change in time. Using
- a split_interval_map results in a larger map: All splits of intervals
- that occur due to entering and leaving of guests are preserved in
- the split_interval_map.
+ Using a joining interval_map results in a smaller map: All interval
+ value pairs are joined if the maximum does not change in time. Using
+ a split_interval_map results in a larger map: All splits of intervals
+ that occur due to entering and leaving of guests are preserved in
+ the split_interval_map.
 
     \include partys_tallest_guests/partys_tallest_guests.cpp
 */
@@ -43,10 +43,10 @@
 // A party's height shall be defined as the maximum height of all guests ;-)
 // The last parameter 'inplace_max' is a functor template that calls a max
 // aggregation on overlap.
-typedef interval_map<ptime, int, partial_absorber, less, inplace_max> PartyHeightHistoryT;
+typedef interval_map<ptime, int, partial_absorber, less, inplace_max<int> > PartyHeightHistoryT;
 
 // Using a split_interval_map we preserve interval splittings that occured via insertion.
-typedef split_interval_map<ptime, int, partial_absorber, less, inplace_max> PartyHeightSplitHistoryT;
+typedef split_interval_map<ptime, int, partial_absorber, less, inplace_max<int> > PartyHeightSplitHistoryT;
 
 void partys_height()
 {
@@ -135,7 +135,7 @@
     cout << ">> Interval Template Library: Sample partys_tallest_guests.cpp <<\n";
     cout << "------------------------------------------------------------------\n";
     partys_height();
- partys_split_height();
+ partys_split_height();
     return 0;
 }
 

Modified: sandbox/itl/libs/itl/example/toytime.h
==============================================================================
--- sandbox/itl/libs/itl/example/toytime.h (original)
+++ sandbox/itl/libs/itl/example/toytime.h 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -52,5 +52,14 @@
 bool operator == (const Time& x1, const Time& x2) { return x1.asInt() == x2.asInt(); }
 bool operator <= (const Time& x1, const Time& x2) { return x1.asInt() <= x2.asInt(); }
 
+
+template<class CharType, class CharTraits>
+std::basic_ostream<CharType, CharTraits> &operator<<
+ (std::basic_ostream<CharType, CharTraits> &stream, Time const& value)
+{
+ return stream << value.as_string();
+}
+
+
 }} // namespace itl boost
 

Modified: sandbox/itl/libs/itl/example/user_groups/user_groups.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/user_groups/user_groups.cpp (original)
+++ sandbox/itl/libs/itl/example/user_groups/user_groups.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -25,8 +25,8 @@
     user groups and the memebership dates of employees.
 
     Computing an intersection '&' shows the super users. The persons
- that are members of both med_users and admin_users and the times
- of the joint memberships.
+ that are members of both med_users and admin_users and the times
+ of the joint memberships.
     
     \include user_groups/user_groups.cpp
 */

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 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -40,9 +40,9 @@
     
     SplitIntervalSetT left;
     left.add(I_I(0,2)).add(I_I(3,3)).add(I_I(4,4)).add(I_I(5,5)).add(I_I(6,8));
- cout << endl;
+ cout << endl;
 
- left.add(I_I(1,7));
+ left.add(I_I(1,7));
 
 
     BOOST_CHECK_EQUAL(I_I(0,2).contains(I_I(0,2).lower()), true);

Modified: sandbox/itl/libs/validate/example/labat_single/labat_single.cpp
==============================================================================
--- sandbox/itl/libs/validate/example/labat_single/labat_single.cpp (original)
+++ sandbox/itl/libs/validate/example/labat_single/labat_single.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -61,12 +61,12 @@
     // Interval::Atomize, protonic_equal> TestLawT;
     //LawValidater<TestLawT, RandomGentor> test_law;
 
- //typedef Balance<itl::tree<int> > TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
+ //typedef Balance<itl::tree<int> > TestLawT;
+ //LawValidater<TestLawT, RandomGentor> test_law;
 
- typedef InplaceDeMorgan
- <itl::interval_map<int, int> > TestLawT;
- LawValidater<TestLawT, RandomGentor> test_law;
+ typedef InplaceDeMorgan
+ <itl::interval_map<int, int> > TestLawT;
+ LawValidater<TestLawT, RandomGentor> test_law;
 
     //-----------------------------------------------------------------------------
     int test_count = 1000;

Modified: sandbox/itl/libs/validate/src/gentor/gentorprofile.cpp
==============================================================================
--- sandbox/itl/libs/validate/src/gentor/gentorprofile.cpp (original)
+++ sandbox/itl/libs/validate/src/gentor/gentorprofile.cpp 2009-06-29 03:35:19 EDT (Mon, 29 Jun 2009)
@@ -62,25 +62,25 @@
 
     //set_range_element_ContainerSize(0,10);
 
- //--------------------------------------------------------------------------
- // values for novial_tree test
- //set_range_int(-5, 5);
- //set_range_nat(0, 16);
- //set_range_double(0.0, 1.0);
- //set_range_ContainerSize(0,1000);
-
- //set_range_interval_int(0, 100000);
- //set_maxIntervalLength(1200);
- //set_range_element_ContainerSize(0,10);
-
- //set_range_int(-5, 5);
- //set_range_nat(0, 16);
- //set_range_double(0.0, 1.0);
- //set_range_ContainerSize(0,40);
-
- //set_range_interval_int(0, 1000);
- //set_maxIntervalLength(50);
- //set_range_element_ContainerSize(0,10);
+ //--------------------------------------------------------------------------
+ // values for novial_tree test
+ //set_range_int(-5, 5);
+ //set_range_nat(0, 16);
+ //set_range_double(0.0, 1.0);
+ //set_range_ContainerSize(0,1000);
+
+ //set_range_interval_int(0, 100000);
+ //set_maxIntervalLength(1200);
+ //set_range_element_ContainerSize(0,10);
+
+ //set_range_int(-5, 5);
+ //set_range_nat(0, 16);
+ //set_range_double(0.0, 1.0);
+ //set_range_ContainerSize(0,40);
+
+ //set_range_interval_int(0, 1000);
+ //set_maxIntervalLength(50);
+ //set_range_element_ContainerSize(0,10);
 
 }
 


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