Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53814 - in sandbox/itl: boost/itl boost/validate/gentor libs/itl/build/win32 libs/itl/test libs/itl/test/test_interval_map_mixed libs/itl/test/test_interval_map_mixed2
From: afojgo_at_[hidden]
Date: 2009-06-12 05:00:09


Author: jofaber
Date: 2009-06-12 05:00:07 EDT (Fri, 12 Jun 2009)
New Revision: 53814
URL: http://svn.boost.org/trac/boost/changeset/53814

Log:
Refactoring: Casted away constness in X_interval_set::add_/subract_ algorithms for inplace manipulations to persuade gcc to accept them.
Split up test_interval_map_mixed again due to stack problems with gcc.
Stable {msvc-9.0, gcc-3.4.4}
Added:
   sandbox/itl/libs/itl/test/test_interval_map_mixed2/
   sandbox/itl/libs/itl/test/test_interval_map_mixed2/test_interval_map_mixed2.cpp (contents, props changed)
   sandbox/itl/libs/itl/test/test_interval_map_mixed2/vc9_test_interval_map_mixed2.vcproj (contents, props changed)
Text files modified:
   sandbox/itl/boost/itl/interval_set.hpp | 2
   sandbox/itl/boost/itl/separate_interval_set.hpp | 2
   sandbox/itl/boost/itl/split_interval_set.hpp | 5
   sandbox/itl/boost/validate/gentor/randomgentor.hpp | 6
   sandbox/itl/libs/itl/build/win32/vc9_all.sln | 6
   sandbox/itl/libs/itl/test/Jamfile.v2 | 1
   sandbox/itl/libs/itl/test/test_interval_map_mixed/test_interval_map_mixed.cpp | 1064 ----------------------------------------
   7 files changed, 17 insertions(+), 1069 deletions(-)

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-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -253,7 +253,7 @@
         interval_type extended = addend;
         extended.extend(leftResid).extend(rightResid);
 
- *fst_it = extended;
+ const_cast<value_type&>(*fst_it) = extended;
                 handle_neighbours(fst_it);
     }
 }

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-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -178,7 +178,7 @@
         interval_type extended = addend;
         extended.extend(leftResid).extend(rightResid);
 
- *fst_it = extended;
+ const_cast<value_type&>(*fst_it) = extended;
     }
 }
 

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-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -180,7 +180,7 @@
                         interval_type leftResid = right_subtract(*fst_it, addend);
                         if(!leftResid.empty())
                         {
- fst_it->left_subtract(leftResid);
+ const_cast<value_type&>(*fst_it).left_subtract(leftResid);
                                 this->_set.insert(pre_it, leftResid);
                         }
                 }
@@ -193,11 +193,10 @@
                         this->_set.insert(lst_it, endGap);
                 else
                 {
- //CL lst_it->left_subtract(rightResid, x);
                         interval_type rightResid = left_subtract(*lst_it, addend);
                         if(!rightResid.empty())
                         {
- lst_it->right_subtract(rightResid);
+ const_cast<value_type&>(*lst_it).right_subtract(rightResid);
                                 this->_set.insert(lst_it, 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-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -20,7 +20,9 @@
 #include <boost/itl/split_interval_set.hpp>
 #include <boost/itl/interval_map.hpp>
 #include <boost/itl/split_interval_map.hpp>
+#ifdef USE_ITL_TREE
 #include <boost/itl/tree/tree.hpp>
+#endif
 #include <boost/validate/gentor/gentorprofile.hpp>
 
 
@@ -55,9 +57,11 @@
         public SetGentorT<itl::split_interval_set<DomainT> > {};
 
         // ----- tree --------------------------------------------------------------
+#ifdef USE_ITL_TREE
     template <class DomainT>
     class RandomGentor<itl::tree<DomainT> > :
         public SetGentorT<itl::tree<DomainT> > {};
+#endif
 
     // ----- maps --------------------------------------------------------------
     template <class DomainT, class Neutronizer>
@@ -275,6 +279,7 @@
     //--------------------------------------------------------------------------
         // itl::tree
     //--------------------------------------------------------------------------
+#ifdef USE_ITL_TREE
     template <>
         struct Calibrater<itl::tree<int>, RandomGentor>
     {
@@ -288,6 +293,7 @@
             gentor.setDomainGentor(itvGentor);
         }
     };
+#endif
 
     //----------------------------------------------------------------------------
     // itl::map<DomainT,CodomainT,Neutronizer>

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-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -89,6 +89,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_test_interval_map_infix_mixed", "..\..\test\test_interval_map_infix_mixed\vc9_test_interval_map_infix_mixed.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B8D5A9F9F}"
 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
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -271,6 +273,10 @@
                 {EE61B7EF-EC45-4165-8B49-FD5B8D5A9F9F}.Debug|Win32.Build.0 = Debug|Win32
                 {EE61B7EF-EC45-4165-8B49-FD5B8D5A9F9F}.Release|Win32.ActiveCfg = Release|Win32
                 {EE61B7EF-EC45-4165-8B49-FD5B8D5A9F9F}.Release|Win32.Build.0 = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D3B9F9F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {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
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Modified: sandbox/itl/libs/itl/test/Jamfile.v2
==============================================================================
--- sandbox/itl/libs/itl/test/Jamfile.v2 (original)
+++ sandbox/itl/libs/itl/test/Jamfile.v2 2009-06-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -37,6 +37,7 @@
       [ run test_split_interval_map/test_split_interval_map.cpp ]
       [ run test_split_interval_map_infix/test_split_interval_map_infix.cpp ]
       [ run test_interval_map_mixed/test_interval_map_mixed.cpp ]
+ [ run test_interval_map_mixed2/test_interval_map_mixed2.cpp ]
       [ run test_interval_map_infix_mixed/test_interval_map_infix_mixed.cpp ]
       [ run test_itl_map/test_itl_map.cpp ]
 

Modified: sandbox/itl/libs/itl/test/test_interval_map_mixed/test_interval_map_mixed.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_map_mixed/test_interval_map_mixed.cpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_map_mixed/test_interval_map_mixed.cpp 2009-06-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -214,1067 +214,3 @@
     BOOST_CHECK_EQUAL( is_element_equal(join_map, split_map), true );
 }
 
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_add_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- U u1 = make<U>(1);
-
- T v1 = make<T>(1);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
-
- interval<T> I1_3D = interval<T>::rightopen(v1,v3);
- interval<T> I2_4D = interval<T>::rightopen(v2,v4);
- interval<T> I4_5D = interval<T>::rightopen(v4,v5);
-
- std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
- std::pair<interval<T>,U> I2_4D_1(I2_4D, u1);
- std::pair<interval<T>,U> I4_5D_1(I4_5D, u1);
- mapping_pair<T,U> v1_1(v1, u1);
- mapping_pair<T,U> v3_1(v3, u1);
- mapping_pair<T,U> v5_1(v5, u1);
-
- SplitIntervalMapT split_map;
- split_map.add(I1_3D_1).add(I2_4D_1);
- split_map += I4_5D_1;
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
- IntervalMapT join_map;
- join_map += split_map;
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
-
- IntervalMapT join_map3;
- join_map3.add(v1_1).add(v3_1);
- join_map3 += v5_1;
- BOOST_CHECK_EQUAL( join_map3.iterative_size(), 3 );
- SplitIntervalMapT split_map3;
- split_map3 += join_map3;
- BOOST_CHECK_EQUAL( split_map3.iterative_size(), 3 );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_add2_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- U u1 = make<U>(1);
-
- T v1 = make<T>(1);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
-
- interval<T> I1_3D = interval<T>::rightopen(v1,v3);
- interval<T> I2_4D = interval<T>::rightopen(v2,v4);
- interval<T> I4_5D = interval<T>::rightopen(v4,v5);
-
- std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
- std::pair<interval<T>,U> I2_4D_1(I2_4D, u1);
- std::pair<interval<T>,U> I4_5D_1(I4_5D, u1);
- mapping_pair<T,U> v1_1(v1, u1);
- mapping_pair<T,U> v3_1(v3, u1);
- mapping_pair<T,U> v5_1(v5, u1);
-
- SplitIntervalMapT split_map;
- split_map.add(I1_3D_1).add(I2_4D_1);
- split_map |= I4_5D_1;
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
- IntervalMapT join_map;
- join_map |= split_map;
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
-
- IntervalMapT join_map3;
- join_map3.add(v1_1).add(v3_1);
- join_map3 |= v5_1;
- BOOST_CHECK_EQUAL( join_map3.iterative_size(), 3 );
- SplitIntervalMapT split_map3;
- split_map3 |= join_map3;
- BOOST_CHECK_EQUAL( split_map3.iterative_size(), 3 );
-}
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_subtract_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- U u1 = make<U>(1);
-
- T v0 = make<T>(0);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
- T v6 = make<T>(6);
- T v7 = make<T>(7);
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_4D = interval<T>::rightopen(v0,v4);
- interval<T> I2_6D = interval<T>::rightopen(v2,v6);
- interval<T> I3_6D = interval<T>::rightopen(v3,v6);
- interval<T> I5_7D = interval<T>::rightopen(v5,v7);
- interval<T> I7_8D = interval<T>::rightopen(v7,v8);
- interval<T> I8_9D = interval<T>::rightopen(v8,v9);
- interval<T> I8_9I = interval<T>::closed(v8,v9);
-
- std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
- std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
- std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
- std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
- std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
- std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
- std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
-
- SplitIntervalMapT split_map;
- split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
-
- IntervalMapT join_map;
- join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
-
- // Make maps to be subtracted
- SplitIntervalMapT split_sub;
- split_sub.add(I3_6D_1).add(I8_9D_1);
-
- IntervalMapT join_sub;
- join_sub.add(I3_6D_1).add(I8_9D_1);
-
- //--------------------------------------------------------------------------
- // Test for split_interval_map
- SplitIntervalMapT split_diff = split_map;
- IntervalMapT join_diff = join_map;
-
- //subtraction combinations
- split_diff -= split_sub;
- join_diff -= split_sub;
-
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 7 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
-
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
-
- //--------------------------------------------------------------------------
- // Test for interval_map. Reinitialize
- split_diff = split_map;
- join_diff = join_map;
-
- //subtraction combinations
- split_diff -= join_sub;
- join_diff -= join_sub;
-
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 7 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
-
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
-}
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_erase_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- U u1 = make<U>(1);
-
- T v0 = make<T>(0);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
- T v6 = make<T>(6);
- T v7 = make<T>(7);
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_4D = interval<T>::rightopen(v0,v4);
- interval<T> I2_6D = interval<T>::rightopen(v2,v6);
- interval<T> I3_6D = interval<T>::rightopen(v3,v6);
- interval<T> I5_7D = interval<T>::rightopen(v5,v7);
- interval<T> I7_8D = interval<T>::rightopen(v7,v8);
- interval<T> I8_9D = interval<T>::rightopen(v8,v9);
- interval<T> I8_9I = interval<T>::closed(v8,v9);
-
- std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
- std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
- std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
- std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
- std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
- std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
- std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
-
- SplitIntervalMapT split_map;
- split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
-
- IntervalMapT join_map;
- join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
-
- // Make sets to be erased
- SplitIntervalMapT split_sub;
- split_sub.add(I3_6D_1).add(I8_9D_1);
-
- IntervalMapT join_sub;
- join_sub.add(I3_6D_1).add(I8_9D_1);
-
- //--------------------------------------------------------------------------
- // Test for split_interval_map
- SplitIntervalMapT split_diff = split_map;
- IntervalMapT join_diff = join_map;
-
- //subtraction combinations
- erase(split_diff, split_sub);
- erase(join_diff, split_sub);
-
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 6 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
-
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
-
- //--------------------------------------------------------------------------
- // Test for interval_map. Reinitialize
- split_diff = split_map;
- join_diff = join_map;
-
- //subtraction combinations
- erase(split_diff, join_sub);
- erase(join_diff, join_sub);
-
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 6 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
-
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
-}
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_erase2_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
- U u1 = make<U>(1);
-
- T v0 = make<T>(0);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
- T v6 = make<T>(6);
- T v7 = make<T>(7);
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_4D = interval<T>::rightopen(v0,v4);
- interval<T> I2_6D = interval<T>::rightopen(v2,v6);
- interval<T> I3_6D = interval<T>::rightopen(v3,v6);
- interval<T> I5_7D = interval<T>::rightopen(v5,v7);
- interval<T> I7_8D = interval<T>::rightopen(v7,v8);
- interval<T> I8_9D = interval<T>::rightopen(v8,v9);
- interval<T> I8_9I = interval<T>::closed(v8,v9);
-
- std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
- std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
- std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
- std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
- std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
- std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
- std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
-
- SplitIntervalMapT split_map;
- split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
-
- IntervalMapT join_map;
- join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
-
- // Make sets to be erased
- SplitIntervalSetT split_sub;
- split_sub.add(I3_6D).add(I8_9D);
-
- IntervalSetT join_sub;
- join_sub.add(I3_6D).add(I8_9D);
-
- //--------------------------------------------------------------------------
- // Test for split_interval_map
- SplitIntervalMapT split_diff = split_map;
- IntervalMapT join_diff = join_map;
-
- //subtraction combinations
- erase(split_diff, split_sub);
- erase(join_diff, split_sub);
-
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 5 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 4 );
-
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
-
- //--------------------------------------------------------------------------
- // Test for interval_map. Reinitialize
- split_diff = split_map;
- join_diff = join_map;
-
- //subtraction combinations
- erase(split_diff, join_sub);
- erase(join_diff, join_sub);
-
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 5 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 4 );
-
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
- BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
-}
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_insert_erase_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- U u1 = make<U>(1);
-
- T v0 = make<T>(0);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
- T v6 = make<T>(6);
- T v7 = make<T>(7);
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_4D = interval<T>::rightopen(v0,v4);
- interval<T> I2_6D = interval<T>::rightopen(v2,v6);
- interval<T> I3_6D = interval<T>::rightopen(v3,v6);
- interval<T> I5_7D = interval<T>::rightopen(v5,v7);
- interval<T> I7_8D = interval<T>::rightopen(v7,v8);
- interval<T> I8_9D = interval<T>::rightopen(v8,v9);
- interval<T> I8_9I = interval<T>::closed(v8,v9);
-
- std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
- std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
- std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
- std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
- std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
- std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
- std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
-
- SplitIntervalMapT split_A, split_B, split_all, split_X;
- IntervalMapT join_A, join_B, join_all, join_X;
-
- split_all.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1).insert(I7_8D_1).insert(I8_9I_1);
- split_A.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1);
- split_B.insert(I7_8D_1).insert(I8_9I_1);
-
- join_all.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1).insert(I7_8D_1).insert(I8_9I_1);
- join_A.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1);
- join_B.insert(I7_8D_1).insert(I8_9I_1);
-
- //-------------------------------------------------------------------------
- insert(split_X, split_A);
- BOOST_CHECK_EQUAL( split_X, split_A );
- insert(split_X, split_B);
- BOOST_CHECK_EQUAL( split_X, split_all );
-
- erase(split_X, split_B);
- BOOST_CHECK_EQUAL( split_X, split_A );
- erase(split_X, split_A);
- BOOST_CHECK_EQUAL( split_X, SplitIntervalMapT() );
-
- //-------------------------------------------------------------------------
- insert(join_X, join_A);
- BOOST_CHECK_EQUAL( join_X, join_A );
- insert(join_X, join_B);
- BOOST_CHECK_EQUAL( join_X, join_all );
-
- erase(join_X, join_B);
- BOOST_CHECK_EQUAL( join_X, join_A );
- erase(join_X, join_A);
- BOOST_CHECK_EQUAL( join_X, IntervalMapT() );
-
- //-------------------------------------------------------------------------
- split_X.clear();
- insert(split_X, join_A);
- BOOST_CHECK_EQUAL( is_element_equal(split_X, split_A), true );
- insert(split_X, join_B);
- BOOST_CHECK_EQUAL( is_element_equal(split_X, split_all), true );
-
- erase(split_X, join_B);
- BOOST_CHECK_EQUAL( is_element_equal(split_X, split_A), true );
- erase(split_X, join_A);
- BOOST_CHECK_EQUAL( is_element_equal(split_X, SplitIntervalMapT()), true );
-
- //-------------------------------------------------------------------------
- split_X.clear();
- insert(join_X, split_A);
- BOOST_CHECK_EQUAL( is_element_equal(join_X, split_A), true );
- insert(join_X, split_B);
- BOOST_CHECK_EQUAL( is_element_equal(join_X, join_all), true );
-
- erase(join_X, split_B);
- BOOST_CHECK_EQUAL( is_element_equal(join_X, split_A), true );
- erase(join_X, split_A);
- BOOST_CHECK_EQUAL( is_element_equal(join_X, IntervalMapT()), true );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_insert_erase2_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
- U u1 = make<U>(1);
-
- T v0 = make<T>(0);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
- T v6 = make<T>(6);
- T v7 = make<T>(7);
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_4D = interval<T>::rightopen(v0,v4);
- interval<T> I2_6D = interval<T>::rightopen(v2,v6);
- interval<T> I3_6D = interval<T>::rightopen(v3,v6);
- interval<T> I5_7D = interval<T>::rightopen(v5,v7);
- interval<T> I7_8D = interval<T>::rightopen(v7,v8);
- interval<T> I8_9D = interval<T>::rightopen(v8,v9);
- interval<T> I8_9I = interval<T>::closed(v8,v9);
-
- std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
- std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
- std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
- std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
- std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
- std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
- std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
-
- SplitIntervalMapT split_A, split_B, split_all, split_X;
- IntervalMapT join_A, join_B, join_all, join_X;
- SplitIntervalSetT split_dA, split_dB;
- IntervalSetT join_dA, join_dB;
-
- split_all.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1).insert(I7_8D_1).insert(I8_9I_1);
- split_A.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1);
- split_B.insert(I7_8D_1).insert(I8_9I_1);
-
- join_all.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1).insert(I7_8D_1).insert(I8_9I_1);
- join_A.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1);
- join_B.insert(I7_8D_1).insert(I8_9I_1);
-
- split_A.domain(split_dA);
- split_B.domain(split_dB);
- join_A.domain(join_dA);
- join_B.domain(join_dB);
-
- //-------------------------------------------------------------------------
- insert(split_X, split_A);
- BOOST_CHECK_EQUAL( split_X, split_A );
- insert(split_X, split_B);
- BOOST_CHECK_EQUAL( split_X, split_all );
-
- erase(split_X, split_dB);
- BOOST_CHECK_EQUAL( split_X, split_A );
- erase(split_X, split_dA);
- BOOST_CHECK_EQUAL( split_X, SplitIntervalMapT() );
-
- //-------------------------------------------------------------------------
- insert(join_X, join_A);
- BOOST_CHECK_EQUAL( join_X, join_A );
- insert(join_X, join_B);
- BOOST_CHECK_EQUAL( join_X, join_all );
-
- erase(join_X, join_dB);
- BOOST_CHECK_EQUAL( join_X, join_A );
- erase(join_X, join_dA);
- BOOST_CHECK_EQUAL( join_X, IntervalMapT() );
-
- //-------------------------------------------------------------------------
- split_X.clear();
- insert(split_X, join_A);
- BOOST_CHECK_EQUAL( is_element_equal(split_X, split_A), true );
- insert(split_X, join_B);
- BOOST_CHECK_EQUAL( is_element_equal(split_X, split_all), true );
-
- erase(split_X, join_dB);
- BOOST_CHECK_EQUAL( is_element_equal(split_X, split_A), true );
- erase(split_X, join_dA);
- BOOST_CHECK_EQUAL( is_element_equal(split_X, SplitIntervalMapT()), true );
-
- //-------------------------------------------------------------------------
- split_X.clear();
- insert(join_X, split_A);
- BOOST_CHECK_EQUAL( is_element_equal(join_X, split_A), true );
- insert(join_X, split_B);
- BOOST_CHECK_EQUAL( is_element_equal(join_X, join_all), true );
-
- erase(join_X, split_dB);
- BOOST_CHECK_EQUAL( is_element_equal(join_X, split_A), true );
- erase(join_X, split_dA);
- BOOST_CHECK_EQUAL( is_element_equal(join_X, IntervalMapT()), true );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_basic_intersect_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
- U u1 = make<U>(1);
- U u2 = make<U>(2);
- U u3 = make<U>(3);
-
- T v0 = make<T>(0);
- T v1 = make<T>(1);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
-
-
- T v6 = make<T>(6);
- T v7 = make<T>(7);
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_3D = interval<T>::rightopen(v0,v3);
- interval<T> I1_3D = interval<T>::rightopen(v1,v3);
- interval<T> I1_8D = interval<T>::rightopen(v1,v8);
- interval<T> I2_7D = interval<T>::rightopen(v2,v7);
- interval<T> I2_3D = interval<T>::rightopen(v2,v3);
- interval<T> I6_7D = interval<T>::rightopen(v6,v7);
- interval<T> I6_8D = interval<T>::rightopen(v6,v8);
- interval<T> I6_9D = interval<T>::rightopen(v6,v9);
-
- std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
- std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
- std::pair<interval<T>,U> I1_3D_2(I1_3D, u2);
- std::pair<interval<T>,U> I1_8D_1(I1_8D, u1);
- std::pair<const interval<T>,U> I2_7D_1(I2_7D, u1);
- std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
- std::pair<interval<T>,U> I2_3D_3(I2_3D, u3);
- std::pair<interval<T>,U> I6_7D_1(I6_7D, u1);
- std::pair<interval<T>,U> I6_7D_3(I6_7D, u3);
- std::pair<interval<T>,U> I6_8D_1(I6_8D, u1);
- std::pair<interval<T>,U> I6_8D_2(I6_8D, u2);
- std::pair<interval<T>,U> I6_9D_1(I6_9D, u1);
-
- //--------------------------------------------------------------------------
- // split_interval_map
- //--------------------------------------------------------------------------
- //split_A [0 3) [6 9)
- // &= [1 8)
- //split_AB -> [1 3) [6 8)
- // &= [2 7)
- // -> [2 3) [6 7)
- SplitIntervalMapT split_A, split_B, split_AB, split_ab, split_ab2;
-
- split_A.add(I0_3D_1).add(I6_9D_1);
- split_AB = split_A;
- split_AB &= I1_8D_1;
- split_ab.add(I1_3D_2).add(I6_8D_2);
-
- BOOST_CHECK_EQUAL( split_AB, split_ab );
-
- split_AB = split_A;
- (split_AB &= I1_8D_1) &= I2_7D_1;
- split_ab2.add(I2_3D_3).add(I6_7D_3);
-
- BOOST_CHECK_EQUAL( split_AB, split_ab2 );
-
-
- //--------------------------------------------------------------------------
- //split_A [0 3) [6 9)
- // 1 1
- // &= 1
- // 1
- //split_AB -> [1]
- // 2
- // += (1 7)
- // 2
- // -> [1](1 7)
- // 2 2
- split_A.clear();
- split_A.add(I0_3D_1).add(I6_9D_1);
- split_AB = split_A;
- split_AB &= mapping_pair<T,U>(v1,u1);
- split_ab.clear();
- split_ab.add(mapping_pair<T,U>(v1,u2));
-
- BOOST_CHECK_EQUAL( split_AB, split_ab );
-
- split_AB = split_A;
- split_AB &= mapping_pair<T,U>(v1,u1);
- split_AB += make_pair(interval<T>::open(v1,v7), u2);
- split_ab2.clear();
- split_ab2 += make_pair(interval<T>::rightopen(v1,v7), u2);
-
- BOOST_CHECK_EQUAL( is_element_equal(split_AB, split_ab2), true );
-}
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_basic_intersect2_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
- U u1 = make<U>(1);
- U u2 = make<U>(2);
- U u3 = make<U>(3);
-
- T v0 = make<T>(0);
- T v1 = make<T>(1);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
-
-
- T v6 = make<T>(6);
- T v7 = make<T>(7);
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_3D = interval<T>::rightopen(v0,v3);
- interval<T> I1_3D = interval<T>::rightopen(v1,v3);
- interval<T> I1_8D = interval<T>::rightopen(v1,v8);
- interval<T> I2_7D = interval<T>::rightopen(v2,v7);
- interval<T> I2_3D = interval<T>::rightopen(v2,v3);
- interval<T> I6_7D = interval<T>::rightopen(v6,v7);
- interval<T> I6_8D = interval<T>::rightopen(v6,v8);
- interval<T> I6_9D = interval<T>::rightopen(v6,v9);
-
- std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
- std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
- std::pair<interval<T>,U> I1_3D_2(I1_3D, u2);
- std::pair<interval<T>,U> I1_8D_1(I1_8D, u1);
- std::pair<interval<T>,U> I2_7D_1(I2_7D, u1);
- std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
- std::pair<interval<T>,U> I2_3D_3(I2_3D, u3);
- std::pair<interval<T>,U> I6_7D_1(I6_7D, u1);
- std::pair<interval<T>,U> I6_7D_3(I6_7D, u3);
- std::pair<interval<T>,U> I6_8D_1(I6_8D, u1);
- std::pair<interval<T>,U> I6_8D_2(I6_8D, u2);
- std::pair<interval<T>,U> I6_9D_1(I6_9D, u1);
-
- //--------------------------------------------------------------------------
- // split_interval_map
- //--------------------------------------------------------------------------
- //split_A [0 3) [6 9)
- // &= [1 8)
- //split_AB -> [1 3) [6 8)
- // &= [2 7)
- // -> [2 3) [6 7)
- SplitIntervalMapT split_A, split_B, split_AB, split_ab, split_ab2;
-
- split_A.add(I0_3D_1).add(I6_9D_1);
- split_AB = split_A;
- split_AB &= I1_8D;
- split_ab.add(I1_3D_1).add(I6_8D_1);
-
- BOOST_CHECK_EQUAL( split_AB, split_ab );
-
- split_AB = split_A;
- (split_AB &= I1_8D) &= I2_7D;
- split_ab2.add(I2_3D_1).add(I6_7D_1);
-
- BOOST_CHECK_EQUAL( split_AB, split_ab2 );
-
- //--------------------------------------------------------------------------
- //split_A [0 3) [6 9)
- // 1 1
- // &= 1
- // 1
- //split_AB -> [1]
- // 2
- // += (1 7)
- // 2
- // -> [1](1 7)
- // 2 2
- split_A.clear();
- split_A.add(I0_3D_1).add(I6_9D_1);
- split_AB = split_A;
- split_AB &= v1;
- split_ab.clear();
- split_ab.add(mapping_pair<T,U>(v1,u1));
-
- BOOST_CHECK_EQUAL( split_AB, split_ab );
-
- split_AB = split_A;
- split_AB &= interval<T>(v1);
- split_AB += make_pair(interval<T>::open(v1,v7), u1);
- split_ab2.clear();
- split_ab2 += make_pair(interval<T>::rightopen(v1,v7), u1);
-
- BOOST_CHECK_EQUAL( is_element_equal(split_AB, split_ab2), true );
-
- split_interval_map<T,U> left, right;
- left. add(IDv(0,2,2));
- right.add(IDv(0,2,2));
- BOOST_CHECK_EQUAL( is_element_equal(left, right), true );
-
- split_interval_set<T> left2, right2;
- left2. add(I_D(0,2));
- right2.add(I_D(0,1));
- is_element_equal(left2, right2);
- BOOST_CHECK_EQUAL( is_element_equal(left2, right2), false );
-}
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_intersect_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
- U u1 = make<U>(1);
- U u2 = make<U>(2);
-
-
- T v0 = make<T>(0);
- T v1 = make<T>(1);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
- T v6 = make<T>(6);
-
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_3D = interval<T>::rightopen(v0,v3);
- interval<T> I1_2D = interval<T>::rightopen(v1,v2);
- interval<T> I1_3D = interval<T>::rightopen(v1,v3);
- interval<T> I2_3D = interval<T>::rightopen(v2,v3);
- interval<T> I2_4D = interval<T>::rightopen(v2,v4);
- interval<T> I5_8D = interval<T>::rightopen(v5,v8);
- interval<T> I6_8D = interval<T>::rightopen(v6,v8);
- interval<T> I6_9D = interval<T>::rightopen(v6,v9);
-
- std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
- std::pair<interval<T>,U> I1_2D_1(I1_2D, u1);
- std::pair<interval<T>,U> I1_2D_2(I1_2D, u2);
- std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
- std::pair<interval<T>,U> I1_3D_2(I1_3D, u2);
- std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
- std::pair<interval<T>,U> I2_3D_2(I2_3D, u2);
- std::pair<interval<T>,U> I2_4D_1(I2_4D, u1);
- std::pair<interval<T>,U> I5_8D_1(I5_8D, u1);
- std::pair<interval<T>,U> I6_8D_1(I6_8D, u1);
- std::pair<interval<T>,U> I6_8D_2(I6_8D, u2);
- std::pair<interval<T>,U> I6_9D_1(I6_9D, u1);
-
- //--------------------------------------------------------------------------
- // split_interval_set
- //--------------------------------------------------------------------------
- //split_A [0 3) [6 9)
- // 1 1
- //split_B &= [1 2)[2 4) [5 8)
- // 1 1 1
- //split_AB -> [1 2)[2 3) [6 8)
- // 2 2 2
- SplitIntervalMapT split_A, split_B, split_AB, split_ab, split_ab_jn;
- IntervalMapT join_A, join_B, join_AB, join_ab;
-
- split_A.add(I0_3D_1).add(I6_9D_1);
- split_B.add(I1_2D_1).add(I2_4D_1).add(I5_8D_1);
- split_ab.add(I1_2D_2).add(I2_3D_2).add(I6_8D_2);
- split_ab_jn.add(I1_3D_2).add(I6_8D_2);
- split_AB = split_A;
- split_AB &= split_B;
- BOOST_CHECK_EQUAL( split_AB.iterative_size(), 3 );
- BOOST_CHECK_EQUAL( split_AB, split_ab );
-
- //split_A [0 3) [6 9)
- // 1 1
- //join_B &= [1 4) [5 8)
- // 1 1
- //split_AB -> [1 3) [6 8)
- // 2 2
- split_AB = split_A;
- join_B = split_B;
- split_AB &= join_B;
-
- BOOST_CHECK_EQUAL( split_AB.iterative_size(), 2 );
- BOOST_CHECK_EQUAL( split_AB, split_ab_jn );
-}
-
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_intersect2_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
- U u1 = make<U>(1);
- U u2 = make<U>(2);
-
-
- T v0 = make<T>(0);
- T v1 = make<T>(1);
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
- T v5 = make<T>(5);
- T v6 = make<T>(6);
-
- T v8 = make<T>(8);
- T v9 = make<T>(9);
-
- interval<T> I0_3D = interval<T>::rightopen(v0,v3);
- interval<T> I1_2D = interval<T>::rightopen(v1,v2);
- interval<T> I1_3D = interval<T>::rightopen(v1,v3);
- interval<T> I2_3D = interval<T>::rightopen(v2,v3);
- interval<T> I2_4D = interval<T>::rightopen(v2,v4);
- interval<T> I5_8D = interval<T>::rightopen(v5,v8);
- interval<T> I6_8D = interval<T>::rightopen(v6,v8);
- interval<T> I6_9D = interval<T>::rightopen(v6,v9);
-
- std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
- std::pair<interval<T>,U> I1_2D_1(I1_2D, u1);
- std::pair<interval<T>,U> I1_2D_2(I1_2D, u2);
- std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
- std::pair<interval<T>,U> I1_3D_2(I1_3D, u2);
- std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
- std::pair<interval<T>,U> I2_3D_2(I2_3D, u2);
- std::pair<interval<T>,U> I2_4D_1(I2_4D, u1);
- std::pair<interval<T>,U> I5_8D_1(I5_8D, u1);
- std::pair<interval<T>,U> I6_8D_1(I6_8D, u1);
- std::pair<interval<T>,U> I6_8D_2(I6_8D, u2);
- std::pair<interval<T>,U> I6_9D_1(I6_9D, u1);
-
- //--------------------------------------------------------------------------
- // split_interval_set
- //--------------------------------------------------------------------------
- //split_A [0 3) [6 9)
- // 1 1
- //split_B &= [1 2)[2 4) [5 8)
- //split_AB -> [1 2)[2 3) [6 8)
- // 1 1 1
- SplitIntervalMapT split_A, split_AB, split_ab, split_ab_jn;
- SplitIntervalSetT split_B;
- IntervalMapT join_A, join_AB, join_ab;
- IntervalSetT join_B;
-
- split_A.add(I0_3D_1).add(I6_9D_1);
- split_B.add(I1_2D).add(I2_4D).add(I5_8D);
- split_ab.add(I1_2D_1).add(I2_3D_1).add(I6_8D_1);
- split_ab_jn.add(I1_3D_1).add(I6_8D_1);
- split_AB = split_A;
- split_AB &= split_B;
- BOOST_CHECK_EQUAL( split_AB.iterative_size(), 3 );
- BOOST_CHECK_EQUAL( split_AB, split_ab );
-
- //split_A [0 3) [6 9)
- // 1 1
- //join_B &= [1 4) [5 8)
- //split_AB -> [1 3) [6 8)
- // 1 1
- split_AB = split_A;
- join_B = split_B;
- split_AB &= join_B;
-
- BOOST_CHECK_EQUAL( split_AB.iterative_size(), 2 );
- BOOST_CHECK_EQUAL( split_AB, split_ab_jn );
-}
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_disjoint_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
- U u1 = make<U>(1);
-
- T v0 = make<T>(0);
-
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
-
- T v6 = make<T>(6);
-
-
-
-
- interval<T> I0_2D = interval<T>::rightopen(v0,v2);
- interval<T> I2_3D = interval<T>::rightopen(v2,v3);
- interval<T> I3_4D = interval<T>::rightopen(v3,v4);
- interval<T> I4_4I = interval<T>::closed(v4,v4);
- interval<T> C4_6D = interval<T>::open(v4,v6);
- interval<T> I6_6I = interval<T>::closed(v6,v6);
-
- std::pair<interval<T>,U> I0_2D_1(I0_2D, u1);
- std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
- std::pair<interval<T>,U> I3_4D_1(I3_4D, u1);
- std::pair<interval<T>,U> I4_4I_1(I4_4I, u1);
- std::pair<interval<T>,U> C4_6D_1(C4_6D, u1);
- std::pair<interval<T>,U> I6_6I_1(I6_6I, u1);
-
- //--------------------------------------------------------------------------
- //split_A: [0 2) [4 4] [6 6]
- //split_B: [2 3)[3 4) (4 6)
- SplitIntervalMapT split_A, split_B;
-
- split_A.add(I0_2D_1).add(I4_4I_1).add(I6_6I_1);
- split_B.add(I2_3D_1).add(I3_4D_1).add(C4_6D_1);
-
- IntervalMapT join_A(split_A), join_B(split_B);
-
- BOOST_CHECK_EQUAL( is_disjoint(split_A, split_B), true );
- BOOST_CHECK_EQUAL( is_disjoint(split_A, join_B), true );
-
- BOOST_CHECK_EQUAL( is_disjoint(join_A, split_B), true );
- BOOST_CHECK_EQUAL( is_disjoint(join_A, join_B), true );
-}
-
-template<class Type>
-struct size_greater_1 : public itl::property<Type>
-{
- bool operator()(const Type& value)const
- {
- return value.first.size() > 1 ;
- }
-};
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_erase_if_4_integral_types, T, integral_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
- U u1 = make<U>(1);
-
- T v0 = make<T>(0);
-
- T v2 = make<T>(2);
- T v3 = make<T>(3);
- T v4 = make<T>(4);
-
- T v6 = make<T>(6);
-
-
-
-
- interval<T> I0_3D = interval<T>::rightopen(v0,v3);
- interval<T> I2_3D = interval<T>::rightopen(v2,v3);
- interval<T> I3_4D = interval<T>::rightopen(v3,v4);
- interval<T> I4_4I = interval<T>::closed(v4,v4);
- interval<T> C4_6D = interval<T>::open(v4,v6);
- interval<T> I6_6I = interval<T>::closed(v6,v6);
-
- std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
- std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
- std::pair<interval<T>,U> I3_4D_1(I3_4D, u1);
- std::pair<interval<T>,U> I4_4I_1(I4_4I, u1);
- std::pair<interval<T>,U> C4_6D_1(C4_6D, u1);
- std::pair<interval<T>,U> I6_6I_1(I6_6I, u1);
-
- //--------------------------------------------------------------------------
- //split_A: [0 2) [4 4] [6 6]
- //split_B: [2 3)[3 4) (4 6)
- SplitIntervalMapT split_A, split_B;
-
- split_A.add(I0_3D_1).add(I4_4I_1).add(I6_6I_1);
- split_B.add(I4_4I_1).add(I6_6I_1);
-
- split_A.erase_if(size_greater_1<typename SplitIntervalMapT::value_type>());
-
- BOOST_CHECK_EQUAL( split_A, split_B );
-}
-
-/*
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_infix_plus_overload_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- interval_map<T,U> join_a;
- split_interval_map<T,U> split_a;
-
- join_a .add(CDv(1,3,1)).add(IDv(8,9,1)).add(IIv(6,11,3));
- split_a.add(IDv(0,9,2)).add(IIv(3,6,1)).add(IDv(5,7,1));
-
- BOOST_CHECK_EQUAL(split_a + join_a, join_a + split_a);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_infix_pipe_overload_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- interval_map<T,U> join_a;
- split_interval_map<T,U> split_a;
-
- join_a .add(CDv(1,3,1)).add(IDv(8,9,1)).add(IIv(6,11,3));
- split_a.add(IDv(0,9,2)).add(IIv(3,6,1)).add(IDv(5,7,1));
-
- BOOST_CHECK_EQUAL(split_a | join_a, join_a | split_a);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_infix_minus_overload_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- interval_map<T,U> join_a, join_b;
- split_interval_map<T,U> split_a, split_b;
-
- join_a .add(CDv(1,3,1)).add(IDv(8,9,1)).add(IIv(6,11,3));
- split_a.add(IDv(0,9,2)).add(IIv(3,6,1)).add(IDv(5,7,1));
-
- join_b .add(CDv(1,3,1)).add(IIv(6,11,3));
- split_b.add(IDv(0,9,2)).add(IIv(3,6,1));
-
- BOOST_CHECK_EQUAL(split_a - join_a, (split_b = split_a) -= join_a);
- BOOST_CHECK_EQUAL(split_a - join_a, split_b);
-
- BOOST_CHECK_EQUAL(join_a - split_a, (join_b = join_a) -= split_a);
- BOOST_CHECK_EQUAL(join_a - split_a, join_b);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_infix_et_overload_4_bicremental_types, T, bicremental_types)
-{
- typedef int U;
- typedef interval_map<T,U> IntervalMapT;
- interval_map<T,U> join_a, join_b;
- split_interval_map<T,U> split_a, split_b;
-
- join_a .add(CDv(1,3,1)).add(IDv(8,9,1)).add(IIv(6,11,3));
- split_a.add(IDv(0,9,2)).add(IIv(3,6,1)).add(IDv(5,7,1));
-
- BOOST_CHECK_EQUAL(split_a & join_a, join_a & split_a);
- BOOST_CHECK_EQUAL(split_a & join_a, (split_b = split_a) &= join_a);
- BOOST_CHECK_EQUAL(split_a & join_a, split_b);
-
- BOOST_CHECK_EQUAL(join_a & split_a, (split_b = split_a) &= join_a);
- BOOST_CHECK_EQUAL(join_a & split_a, split_b);
-}
-
-*/

Added: sandbox/itl/libs/itl/test/test_interval_map_mixed2/test_interval_map_mixed2.cpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_interval_map_mixed2/test_interval_map_mixed2.cpp 2009-06-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -0,0 +1,1014 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2008-2009: 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)
++-----------------------------------------------------------------------------*/
+#define BOOST_TEST_MODULE itl::interval_map_mixed unit test
+#include <string>
+#include <boost/mpl/list.hpp>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/test_case_template.hpp>
+
+// interval instance types
+#include "../test_type_lists.hpp"
+#include "../test_value_maker.hpp"
+
+#include <boost/itl/interval_set.hpp>
+#include <boost/itl/separate_interval_set.hpp>
+#include <boost/itl/split_interval_set.hpp>
+#include <boost/itl/interval_map.hpp>
+#include <boost/itl/split_interval_map.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace unit_test;
+using namespace boost::itl;
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_add_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ U u1 = make<U>(1);
+
+ T v1 = make<T>(1);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+
+ interval<T> I1_3D = interval<T>::rightopen(v1,v3);
+ interval<T> I2_4D = interval<T>::rightopen(v2,v4);
+ interval<T> I4_5D = interval<T>::rightopen(v4,v5);
+
+ std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
+ std::pair<interval<T>,U> I2_4D_1(I2_4D, u1);
+ std::pair<interval<T>,U> I4_5D_1(I4_5D, u1);
+ mapping_pair<T,U> v1_1(v1, u1);
+ mapping_pair<T,U> v3_1(v3, u1);
+ mapping_pair<T,U> v5_1(v5, u1);
+
+ SplitIntervalMapT split_map;
+ split_map.add(I1_3D_1).add(I2_4D_1);
+ split_map += I4_5D_1;
+ BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
+ IntervalMapT join_map;
+ join_map += split_map;
+ BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
+
+ IntervalMapT join_map3;
+ join_map3.add(v1_1).add(v3_1);
+ join_map3 += v5_1;
+ BOOST_CHECK_EQUAL( join_map3.iterative_size(), 3 );
+ SplitIntervalMapT split_map3;
+ split_map3 += join_map3;
+ BOOST_CHECK_EQUAL( split_map3.iterative_size(), 3 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_add2_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ U u1 = make<U>(1);
+
+ T v1 = make<T>(1);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+
+ interval<T> I1_3D = interval<T>::rightopen(v1,v3);
+ interval<T> I2_4D = interval<T>::rightopen(v2,v4);
+ interval<T> I4_5D = interval<T>::rightopen(v4,v5);
+
+ std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
+ std::pair<interval<T>,U> I2_4D_1(I2_4D, u1);
+ std::pair<interval<T>,U> I4_5D_1(I4_5D, u1);
+ mapping_pair<T,U> v1_1(v1, u1);
+ mapping_pair<T,U> v3_1(v3, u1);
+ mapping_pair<T,U> v5_1(v5, u1);
+
+ SplitIntervalMapT split_map;
+ split_map.add(I1_3D_1).add(I2_4D_1);
+ split_map |= I4_5D_1;
+ BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
+ IntervalMapT join_map;
+ join_map |= split_map;
+ BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
+
+ IntervalMapT join_map3;
+ join_map3.add(v1_1).add(v3_1);
+ join_map3 |= v5_1;
+ BOOST_CHECK_EQUAL( join_map3.iterative_size(), 3 );
+ SplitIntervalMapT split_map3;
+ split_map3 |= join_map3;
+ BOOST_CHECK_EQUAL( split_map3.iterative_size(), 3 );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_subtract_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ U u1 = make<U>(1);
+
+ T v0 = make<T>(0);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+ T v6 = make<T>(6);
+ T v7 = make<T>(7);
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_4D = interval<T>::rightopen(v0,v4);
+ interval<T> I2_6D = interval<T>::rightopen(v2,v6);
+ interval<T> I3_6D = interval<T>::rightopen(v3,v6);
+ interval<T> I5_7D = interval<T>::rightopen(v5,v7);
+ interval<T> I7_8D = interval<T>::rightopen(v7,v8);
+ interval<T> I8_9D = interval<T>::rightopen(v8,v9);
+ interval<T> I8_9I = interval<T>::closed(v8,v9);
+
+ std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
+ std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
+ std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
+ std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
+ std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
+ std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
+ std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
+
+ SplitIntervalMapT split_map;
+ split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
+ BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
+
+ IntervalMapT join_map;
+ join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
+ BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
+
+ // Make maps to be subtracted
+ SplitIntervalMapT split_sub;
+ split_sub.add(I3_6D_1).add(I8_9D_1);
+
+ IntervalMapT join_sub;
+ join_sub.add(I3_6D_1).add(I8_9D_1);
+
+ //--------------------------------------------------------------------------
+ // Test for split_interval_map
+ SplitIntervalMapT split_diff = split_map;
+ IntervalMapT join_diff = join_map;
+
+ //subtraction combinations
+ split_diff -= split_sub;
+ join_diff -= split_sub;
+
+ BOOST_CHECK_EQUAL( split_diff.iterative_size(), 7 );
+ BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
+
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
+
+ //--------------------------------------------------------------------------
+ // Test for interval_map. Reinitialize
+ split_diff = split_map;
+ join_diff = join_map;
+
+ //subtraction combinations
+ split_diff -= join_sub;
+ join_diff -= join_sub;
+
+ BOOST_CHECK_EQUAL( split_diff.iterative_size(), 7 );
+ BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
+
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_erase_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ U u1 = make<U>(1);
+
+ T v0 = make<T>(0);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+ T v6 = make<T>(6);
+ T v7 = make<T>(7);
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_4D = interval<T>::rightopen(v0,v4);
+ interval<T> I2_6D = interval<T>::rightopen(v2,v6);
+ interval<T> I3_6D = interval<T>::rightopen(v3,v6);
+ interval<T> I5_7D = interval<T>::rightopen(v5,v7);
+ interval<T> I7_8D = interval<T>::rightopen(v7,v8);
+ interval<T> I8_9D = interval<T>::rightopen(v8,v9);
+ interval<T> I8_9I = interval<T>::closed(v8,v9);
+
+ std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
+ std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
+ std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
+ std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
+ std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
+ std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
+ std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
+
+ SplitIntervalMapT split_map;
+ split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
+ BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
+
+ IntervalMapT join_map;
+ join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
+ BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
+
+ // Make sets to be erased
+ SplitIntervalMapT split_sub;
+ split_sub.add(I3_6D_1).add(I8_9D_1);
+
+ IntervalMapT join_sub;
+ join_sub.add(I3_6D_1).add(I8_9D_1);
+
+ //--------------------------------------------------------------------------
+ // Test for split_interval_map
+ SplitIntervalMapT split_diff = split_map;
+ IntervalMapT join_diff = join_map;
+
+ //subtraction combinations
+ erase(split_diff, split_sub);
+ erase(join_diff, split_sub);
+
+ BOOST_CHECK_EQUAL( split_diff.iterative_size(), 6 );
+ BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
+
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
+
+ //--------------------------------------------------------------------------
+ // Test for interval_map. Reinitialize
+ split_diff = split_map;
+ join_diff = join_map;
+
+ //subtraction combinations
+ erase(split_diff, join_sub);
+ erase(join_diff, join_sub);
+
+ BOOST_CHECK_EQUAL( split_diff.iterative_size(), 6 );
+ BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
+
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_erase2_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef split_interval_set<T> SplitIntervalSetT;
+ U u1 = make<U>(1);
+
+ T v0 = make<T>(0);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+ T v6 = make<T>(6);
+ T v7 = make<T>(7);
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_4D = interval<T>::rightopen(v0,v4);
+ interval<T> I2_6D = interval<T>::rightopen(v2,v6);
+ interval<T> I3_6D = interval<T>::rightopen(v3,v6);
+ interval<T> I5_7D = interval<T>::rightopen(v5,v7);
+ interval<T> I7_8D = interval<T>::rightopen(v7,v8);
+ interval<T> I8_9D = interval<T>::rightopen(v8,v9);
+ interval<T> I8_9I = interval<T>::closed(v8,v9);
+
+ std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
+ std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
+ std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
+ std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
+ std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
+ std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
+ std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
+
+ SplitIntervalMapT split_map;
+ split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
+ BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
+
+ IntervalMapT join_map;
+ join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
+ BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
+
+ // Make sets to be erased
+ SplitIntervalSetT split_sub;
+ split_sub.add(I3_6D).add(I8_9D);
+
+ IntervalSetT join_sub;
+ join_sub.add(I3_6D).add(I8_9D);
+
+ //--------------------------------------------------------------------------
+ // Test for split_interval_map
+ SplitIntervalMapT split_diff = split_map;
+ IntervalMapT join_diff = join_map;
+
+ //subtraction combinations
+ erase(split_diff, split_sub);
+ erase(join_diff, split_sub);
+
+ BOOST_CHECK_EQUAL( split_diff.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( join_diff.iterative_size(), 4 );
+
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
+
+ //--------------------------------------------------------------------------
+ // Test for interval_map. Reinitialize
+ split_diff = split_map;
+ join_diff = join_map;
+
+ //subtraction combinations
+ erase(split_diff, join_sub);
+ erase(join_diff, join_sub);
+
+ BOOST_CHECK_EQUAL( split_diff.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( join_diff.iterative_size(), 4 );
+
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
+ BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_insert_erase_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ U u1 = make<U>(1);
+
+ T v0 = make<T>(0);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+ T v6 = make<T>(6);
+ T v7 = make<T>(7);
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_4D = interval<T>::rightopen(v0,v4);
+ interval<T> I2_6D = interval<T>::rightopen(v2,v6);
+ interval<T> I3_6D = interval<T>::rightopen(v3,v6);
+ interval<T> I5_7D = interval<T>::rightopen(v5,v7);
+ interval<T> I7_8D = interval<T>::rightopen(v7,v8);
+ interval<T> I8_9D = interval<T>::rightopen(v8,v9);
+ interval<T> I8_9I = interval<T>::closed(v8,v9);
+
+ std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
+ std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
+ std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
+ std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
+ std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
+ std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
+ std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
+
+ SplitIntervalMapT split_A, split_B, split_all, split_X;
+ IntervalMapT join_A, join_B, join_all, join_X;
+
+ split_all.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1).insert(I7_8D_1).insert(I8_9I_1);
+ split_A.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1);
+ split_B.insert(I7_8D_1).insert(I8_9I_1);
+
+ join_all.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1).insert(I7_8D_1).insert(I8_9I_1);
+ join_A.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1);
+ join_B.insert(I7_8D_1).insert(I8_9I_1);
+
+ //-------------------------------------------------------------------------
+ insert(split_X, split_A);
+ BOOST_CHECK_EQUAL( split_X, split_A );
+ insert(split_X, split_B);
+ BOOST_CHECK_EQUAL( split_X, split_all );
+
+ erase(split_X, split_B);
+ BOOST_CHECK_EQUAL( split_X, split_A );
+ erase(split_X, split_A);
+ BOOST_CHECK_EQUAL( split_X, SplitIntervalMapT() );
+
+ //-------------------------------------------------------------------------
+ insert(join_X, join_A);
+ BOOST_CHECK_EQUAL( join_X, join_A );
+ insert(join_X, join_B);
+ BOOST_CHECK_EQUAL( join_X, join_all );
+
+ erase(join_X, join_B);
+ BOOST_CHECK_EQUAL( join_X, join_A );
+ erase(join_X, join_A);
+ BOOST_CHECK_EQUAL( join_X, IntervalMapT() );
+
+ //-------------------------------------------------------------------------
+ split_X.clear();
+ insert(split_X, join_A);
+ BOOST_CHECK_EQUAL( is_element_equal(split_X, split_A), true );
+ insert(split_X, join_B);
+ BOOST_CHECK_EQUAL( is_element_equal(split_X, split_all), true );
+
+ erase(split_X, join_B);
+ BOOST_CHECK_EQUAL( is_element_equal(split_X, split_A), true );
+ erase(split_X, join_A);
+ BOOST_CHECK_EQUAL( is_element_equal(split_X, SplitIntervalMapT()), true );
+
+ //-------------------------------------------------------------------------
+ split_X.clear();
+ insert(join_X, split_A);
+ BOOST_CHECK_EQUAL( is_element_equal(join_X, split_A), true );
+ insert(join_X, split_B);
+ BOOST_CHECK_EQUAL( is_element_equal(join_X, join_all), true );
+
+ erase(join_X, split_B);
+ BOOST_CHECK_EQUAL( is_element_equal(join_X, split_A), true );
+ erase(join_X, split_A);
+ BOOST_CHECK_EQUAL( is_element_equal(join_X, IntervalMapT()), true );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_insert_erase2_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef split_interval_set<T> SplitIntervalSetT;
+ U u1 = make<U>(1);
+
+ T v0 = make<T>(0);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+ T v6 = make<T>(6);
+ T v7 = make<T>(7);
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_4D = interval<T>::rightopen(v0,v4);
+ interval<T> I2_6D = interval<T>::rightopen(v2,v6);
+ interval<T> I3_6D = interval<T>::rightopen(v3,v6);
+ interval<T> I5_7D = interval<T>::rightopen(v5,v7);
+ interval<T> I7_8D = interval<T>::rightopen(v7,v8);
+ interval<T> I8_9D = interval<T>::rightopen(v8,v9);
+ interval<T> I8_9I = interval<T>::closed(v8,v9);
+
+ std::pair<interval<T>,U> I0_4D_1(I0_4D, u1);
+ std::pair<interval<T>,U> I2_6D_1(I2_6D, u1);
+ std::pair<interval<T>,U> I3_6D_1(I3_6D, u1);
+ std::pair<interval<T>,U> I5_7D_1(I5_7D, u1);
+ std::pair<interval<T>,U> I7_8D_1(I7_8D, u1);
+ std::pair<interval<T>,U> I8_9D_1(I8_9D, u1);
+ std::pair<interval<T>,U> I8_9I_1(I8_9I, u1);
+
+ SplitIntervalMapT split_A, split_B, split_all, split_X;
+ IntervalMapT join_A, join_B, join_all, join_X;
+ SplitIntervalSetT split_dA, split_dB;
+ IntervalSetT join_dA, join_dB;
+
+ split_all.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1).insert(I7_8D_1).insert(I8_9I_1);
+ split_A.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1);
+ split_B.insert(I7_8D_1).insert(I8_9I_1);
+
+ join_all.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1).insert(I7_8D_1).insert(I8_9I_1);
+ join_A.insert(I0_4D_1).insert(I2_6D_1).insert(I5_7D_1);
+ join_B.insert(I7_8D_1).insert(I8_9I_1);
+
+ split_A.domain(split_dA);
+ split_B.domain(split_dB);
+ join_A.domain(join_dA);
+ join_B.domain(join_dB);
+
+ //-------------------------------------------------------------------------
+ insert(split_X, split_A);
+ BOOST_CHECK_EQUAL( split_X, split_A );
+ insert(split_X, split_B);
+ BOOST_CHECK_EQUAL( split_X, split_all );
+
+ erase(split_X, split_dB);
+ BOOST_CHECK_EQUAL( split_X, split_A );
+ erase(split_X, split_dA);
+ BOOST_CHECK_EQUAL( split_X, SplitIntervalMapT() );
+
+ //-------------------------------------------------------------------------
+ insert(join_X, join_A);
+ BOOST_CHECK_EQUAL( join_X, join_A );
+ insert(join_X, join_B);
+ BOOST_CHECK_EQUAL( join_X, join_all );
+
+ erase(join_X, join_dB);
+ BOOST_CHECK_EQUAL( join_X, join_A );
+ erase(join_X, join_dA);
+ BOOST_CHECK_EQUAL( join_X, IntervalMapT() );
+
+ //-------------------------------------------------------------------------
+ split_X.clear();
+ insert(split_X, join_A);
+ BOOST_CHECK_EQUAL( is_element_equal(split_X, split_A), true );
+ insert(split_X, join_B);
+ BOOST_CHECK_EQUAL( is_element_equal(split_X, split_all), true );
+
+ erase(split_X, join_dB);
+ BOOST_CHECK_EQUAL( is_element_equal(split_X, split_A), true );
+ erase(split_X, join_dA);
+ BOOST_CHECK_EQUAL( is_element_equal(split_X, SplitIntervalMapT()), true );
+
+ //-------------------------------------------------------------------------
+ split_X.clear();
+ insert(join_X, split_A);
+ BOOST_CHECK_EQUAL( is_element_equal(join_X, split_A), true );
+ insert(join_X, split_B);
+ BOOST_CHECK_EQUAL( is_element_equal(join_X, join_all), true );
+
+ erase(join_X, split_dB);
+ BOOST_CHECK_EQUAL( is_element_equal(join_X, split_A), true );
+ erase(join_X, split_dA);
+ BOOST_CHECK_EQUAL( is_element_equal(join_X, IntervalMapT()), true );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_basic_intersect_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef split_interval_set<T> SplitIntervalSetT;
+ U u1 = make<U>(1);
+ U u2 = make<U>(2);
+ U u3 = make<U>(3);
+
+ T v0 = make<T>(0);
+ T v1 = make<T>(1);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+
+
+ T v6 = make<T>(6);
+ T v7 = make<T>(7);
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_3D = interval<T>::rightopen(v0,v3);
+ interval<T> I1_3D = interval<T>::rightopen(v1,v3);
+ interval<T> I1_8D = interval<T>::rightopen(v1,v8);
+ interval<T> I2_7D = interval<T>::rightopen(v2,v7);
+ interval<T> I2_3D = interval<T>::rightopen(v2,v3);
+ interval<T> I6_7D = interval<T>::rightopen(v6,v7);
+ interval<T> I6_8D = interval<T>::rightopen(v6,v8);
+ interval<T> I6_9D = interval<T>::rightopen(v6,v9);
+
+ std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
+ std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
+ std::pair<interval<T>,U> I1_3D_2(I1_3D, u2);
+ std::pair<interval<T>,U> I1_8D_1(I1_8D, u1);
+ std::pair<const interval<T>,U> I2_7D_1(I2_7D, u1);
+ std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
+ std::pair<interval<T>,U> I2_3D_3(I2_3D, u3);
+ std::pair<interval<T>,U> I6_7D_1(I6_7D, u1);
+ std::pair<interval<T>,U> I6_7D_3(I6_7D, u3);
+ std::pair<interval<T>,U> I6_8D_1(I6_8D, u1);
+ std::pair<interval<T>,U> I6_8D_2(I6_8D, u2);
+ std::pair<interval<T>,U> I6_9D_1(I6_9D, u1);
+
+ //--------------------------------------------------------------------------
+ // split_interval_map
+ //--------------------------------------------------------------------------
+ //split_A [0 3) [6 9)
+ // &= [1 8)
+ //split_AB -> [1 3) [6 8)
+ // &= [2 7)
+ // -> [2 3) [6 7)
+ SplitIntervalMapT split_A, split_B, split_AB, split_ab, split_ab2;
+
+ split_A.add(I0_3D_1).add(I6_9D_1);
+ split_AB = split_A;
+ split_AB &= I1_8D_1;
+ split_ab.add(I1_3D_2).add(I6_8D_2);
+
+ BOOST_CHECK_EQUAL( split_AB, split_ab );
+
+ split_AB = split_A;
+ (split_AB &= I1_8D_1) &= I2_7D_1;
+ split_ab2.add(I2_3D_3).add(I6_7D_3);
+
+ BOOST_CHECK_EQUAL( split_AB, split_ab2 );
+
+
+ //--------------------------------------------------------------------------
+ //split_A [0 3) [6 9)
+ // 1 1
+ // &= 1
+ // 1
+ //split_AB -> [1]
+ // 2
+ // += (1 7)
+ // 2
+ // -> [1](1 7)
+ // 2 2
+ split_A.clear();
+ split_A.add(I0_3D_1).add(I6_9D_1);
+ split_AB = split_A;
+ split_AB &= mapping_pair<T,U>(v1,u1);
+ split_ab.clear();
+ split_ab.add(mapping_pair<T,U>(v1,u2));
+
+ BOOST_CHECK_EQUAL( split_AB, split_ab );
+
+ split_AB = split_A;
+ split_AB &= mapping_pair<T,U>(v1,u1);
+ split_AB += make_pair(interval<T>::open(v1,v7), u2);
+ split_ab2.clear();
+ split_ab2 += make_pair(interval<T>::rightopen(v1,v7), u2);
+
+ BOOST_CHECK_EQUAL( is_element_equal(split_AB, split_ab2), true );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_basic_intersect2_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef split_interval_set<T> SplitIntervalSetT;
+ U u1 = make<U>(1);
+ U u2 = make<U>(2);
+ U u3 = make<U>(3);
+
+ T v0 = make<T>(0);
+ T v1 = make<T>(1);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+
+
+ T v6 = make<T>(6);
+ T v7 = make<T>(7);
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_3D = interval<T>::rightopen(v0,v3);
+ interval<T> I1_3D = interval<T>::rightopen(v1,v3);
+ interval<T> I1_8D = interval<T>::rightopen(v1,v8);
+ interval<T> I2_7D = interval<T>::rightopen(v2,v7);
+ interval<T> I2_3D = interval<T>::rightopen(v2,v3);
+ interval<T> I6_7D = interval<T>::rightopen(v6,v7);
+ interval<T> I6_8D = interval<T>::rightopen(v6,v8);
+ interval<T> I6_9D = interval<T>::rightopen(v6,v9);
+
+ std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
+ std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
+ std::pair<interval<T>,U> I1_3D_2(I1_3D, u2);
+ std::pair<interval<T>,U> I1_8D_1(I1_8D, u1);
+ std::pair<interval<T>,U> I2_7D_1(I2_7D, u1);
+ std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
+ std::pair<interval<T>,U> I2_3D_3(I2_3D, u3);
+ std::pair<interval<T>,U> I6_7D_1(I6_7D, u1);
+ std::pair<interval<T>,U> I6_7D_3(I6_7D, u3);
+ std::pair<interval<T>,U> I6_8D_1(I6_8D, u1);
+ std::pair<interval<T>,U> I6_8D_2(I6_8D, u2);
+ std::pair<interval<T>,U> I6_9D_1(I6_9D, u1);
+
+ //--------------------------------------------------------------------------
+ // split_interval_map
+ //--------------------------------------------------------------------------
+ //split_A [0 3) [6 9)
+ // &= [1 8)
+ //split_AB -> [1 3) [6 8)
+ // &= [2 7)
+ // -> [2 3) [6 7)
+ SplitIntervalMapT split_A, split_B, split_AB, split_ab, split_ab2;
+
+ split_A.add(I0_3D_1).add(I6_9D_1);
+ split_AB = split_A;
+ split_AB &= I1_8D;
+ split_ab.add(I1_3D_1).add(I6_8D_1);
+
+ BOOST_CHECK_EQUAL( split_AB, split_ab );
+
+ split_AB = split_A;
+ (split_AB &= I1_8D) &= I2_7D;
+ split_ab2.add(I2_3D_1).add(I6_7D_1);
+
+ BOOST_CHECK_EQUAL( split_AB, split_ab2 );
+
+ //--------------------------------------------------------------------------
+ //split_A [0 3) [6 9)
+ // 1 1
+ // &= 1
+ // 1
+ //split_AB -> [1]
+ // 2
+ // += (1 7)
+ // 2
+ // -> [1](1 7)
+ // 2 2
+ split_A.clear();
+ split_A.add(I0_3D_1).add(I6_9D_1);
+ split_AB = split_A;
+ split_AB &= v1;
+ split_ab.clear();
+ split_ab.add(mapping_pair<T,U>(v1,u1));
+
+ BOOST_CHECK_EQUAL( split_AB, split_ab );
+
+ split_AB = split_A;
+ split_AB &= interval<T>(v1);
+ split_AB += make_pair(interval<T>::open(v1,v7), u1);
+ split_ab2.clear();
+ split_ab2 += make_pair(interval<T>::rightopen(v1,v7), u1);
+
+ BOOST_CHECK_EQUAL( is_element_equal(split_AB, split_ab2), true );
+
+ split_interval_map<T,U> left, right;
+ left. add(IDv(0,2,2));
+ right.add(IDv(0,2,2));
+ BOOST_CHECK_EQUAL( is_element_equal(left, right), true );
+
+ split_interval_set<T> left2, right2;
+ left2. add(I_D(0,2));
+ right2.add(I_D(0,1));
+ is_element_equal(left2, right2);
+ BOOST_CHECK_EQUAL( is_element_equal(left2, right2), false );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_intersect_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef split_interval_set<T> SplitIntervalSetT;
+ U u1 = make<U>(1);
+ U u2 = make<U>(2);
+
+
+ T v0 = make<T>(0);
+ T v1 = make<T>(1);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+ T v6 = make<T>(6);
+
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_3D = interval<T>::rightopen(v0,v3);
+ interval<T> I1_2D = interval<T>::rightopen(v1,v2);
+ interval<T> I1_3D = interval<T>::rightopen(v1,v3);
+ interval<T> I2_3D = interval<T>::rightopen(v2,v3);
+ interval<T> I2_4D = interval<T>::rightopen(v2,v4);
+ interval<T> I5_8D = interval<T>::rightopen(v5,v8);
+ interval<T> I6_8D = interval<T>::rightopen(v6,v8);
+ interval<T> I6_9D = interval<T>::rightopen(v6,v9);
+
+ std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
+ std::pair<interval<T>,U> I1_2D_1(I1_2D, u1);
+ std::pair<interval<T>,U> I1_2D_2(I1_2D, u2);
+ std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
+ std::pair<interval<T>,U> I1_3D_2(I1_3D, u2);
+ std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
+ std::pair<interval<T>,U> I2_3D_2(I2_3D, u2);
+ std::pair<interval<T>,U> I2_4D_1(I2_4D, u1);
+ std::pair<interval<T>,U> I5_8D_1(I5_8D, u1);
+ std::pair<interval<T>,U> I6_8D_1(I6_8D, u1);
+ std::pair<interval<T>,U> I6_8D_2(I6_8D, u2);
+ std::pair<interval<T>,U> I6_9D_1(I6_9D, u1);
+
+ //--------------------------------------------------------------------------
+ // split_interval_set
+ //--------------------------------------------------------------------------
+ //split_A [0 3) [6 9)
+ // 1 1
+ //split_B &= [1 2)[2 4) [5 8)
+ // 1 1 1
+ //split_AB -> [1 2)[2 3) [6 8)
+ // 2 2 2
+ SplitIntervalMapT split_A, split_B, split_AB, split_ab, split_ab_jn;
+ IntervalMapT join_A, join_B, join_AB, join_ab;
+
+ split_A.add(I0_3D_1).add(I6_9D_1);
+ split_B.add(I1_2D_1).add(I2_4D_1).add(I5_8D_1);
+ split_ab.add(I1_2D_2).add(I2_3D_2).add(I6_8D_2);
+ split_ab_jn.add(I1_3D_2).add(I6_8D_2);
+ split_AB = split_A;
+ split_AB &= split_B;
+ BOOST_CHECK_EQUAL( split_AB.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( split_AB, split_ab );
+
+ //split_A [0 3) [6 9)
+ // 1 1
+ //join_B &= [1 4) [5 8)
+ // 1 1
+ //split_AB -> [1 3) [6 8)
+ // 2 2
+ split_AB = split_A;
+ join_B = split_B;
+ split_AB &= join_B;
+
+ BOOST_CHECK_EQUAL( split_AB.iterative_size(), 2 );
+ BOOST_CHECK_EQUAL( split_AB, split_ab_jn );
+}
+
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_intersect2_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef split_interval_set<T> SplitIntervalSetT;
+ U u1 = make<U>(1);
+ U u2 = make<U>(2);
+
+
+ T v0 = make<T>(0);
+ T v1 = make<T>(1);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v5 = make<T>(5);
+ T v6 = make<T>(6);
+
+ T v8 = make<T>(8);
+ T v9 = make<T>(9);
+
+ interval<T> I0_3D = interval<T>::rightopen(v0,v3);
+ interval<T> I1_2D = interval<T>::rightopen(v1,v2);
+ interval<T> I1_3D = interval<T>::rightopen(v1,v3);
+ interval<T> I2_3D = interval<T>::rightopen(v2,v3);
+ interval<T> I2_4D = interval<T>::rightopen(v2,v4);
+ interval<T> I5_8D = interval<T>::rightopen(v5,v8);
+ interval<T> I6_8D = interval<T>::rightopen(v6,v8);
+ interval<T> I6_9D = interval<T>::rightopen(v6,v9);
+
+ std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
+ std::pair<interval<T>,U> I1_2D_1(I1_2D, u1);
+ std::pair<interval<T>,U> I1_2D_2(I1_2D, u2);
+ std::pair<interval<T>,U> I1_3D_1(I1_3D, u1);
+ std::pair<interval<T>,U> I1_3D_2(I1_3D, u2);
+ std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
+ std::pair<interval<T>,U> I2_3D_2(I2_3D, u2);
+ std::pair<interval<T>,U> I2_4D_1(I2_4D, u1);
+ std::pair<interval<T>,U> I5_8D_1(I5_8D, u1);
+ std::pair<interval<T>,U> I6_8D_1(I6_8D, u1);
+ std::pair<interval<T>,U> I6_8D_2(I6_8D, u2);
+ std::pair<interval<T>,U> I6_9D_1(I6_9D, u1);
+
+ //--------------------------------------------------------------------------
+ // split_interval_set
+ //--------------------------------------------------------------------------
+ //split_A [0 3) [6 9)
+ // 1 1
+ //split_B &= [1 2)[2 4) [5 8)
+ //split_AB -> [1 2)[2 3) [6 8)
+ // 1 1 1
+ SplitIntervalMapT split_A, split_AB, split_ab, split_ab_jn;
+ SplitIntervalSetT split_B;
+ IntervalMapT join_A, join_AB, join_ab;
+ IntervalSetT join_B;
+
+ split_A.add(I0_3D_1).add(I6_9D_1);
+ split_B.add(I1_2D).add(I2_4D).add(I5_8D);
+ split_ab.add(I1_2D_1).add(I2_3D_1).add(I6_8D_1);
+ split_ab_jn.add(I1_3D_1).add(I6_8D_1);
+ split_AB = split_A;
+ split_AB &= split_B;
+ BOOST_CHECK_EQUAL( split_AB.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( split_AB, split_ab );
+
+ //split_A [0 3) [6 9)
+ // 1 1
+ //join_B &= [1 4) [5 8)
+ //split_AB -> [1 3) [6 8)
+ // 1 1
+ split_AB = split_A;
+ join_B = split_B;
+ split_AB &= join_B;
+
+ BOOST_CHECK_EQUAL( split_AB.iterative_size(), 2 );
+ BOOST_CHECK_EQUAL( split_AB, split_ab_jn );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_disjoint_4_bicremental_types, T, bicremental_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef split_interval_set<T> SplitIntervalSetT;
+ U u1 = make<U>(1);
+ T v0 = make<T>(0);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v6 = make<T>(6);
+
+ interval<T> I0_2D = interval<T>::rightopen(v0,v2);
+ interval<T> I2_3D = interval<T>::rightopen(v2,v3);
+ interval<T> I3_4D = interval<T>::rightopen(v3,v4);
+ interval<T> I4_4I = interval<T>::closed(v4,v4);
+ interval<T> C4_6D = interval<T>::open(v4,v6);
+ interval<T> I6_6I = interval<T>::closed(v6,v6);
+
+ std::pair<interval<T>,U> I0_2D_1(I0_2D, u1);
+ std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
+ std::pair<interval<T>,U> I3_4D_1(I3_4D, u1);
+ std::pair<interval<T>,U> I4_4I_1(I4_4I, u1);
+ std::pair<interval<T>,U> C4_6D_1(C4_6D, u1);
+ std::pair<interval<T>,U> I6_6I_1(I6_6I, u1);
+
+ //--------------------------------------------------------------------------
+ //split_A: [0 2) [4 4] [6 6]
+ //split_B: [2 3)[3 4) (4 6)
+ SplitIntervalMapT split_A, split_B;
+
+ split_A.add(I0_2D_1).add(I4_4I_1).add(I6_6I_1);
+ split_B.add(I2_3D_1).add(I3_4D_1).add(C4_6D_1);
+
+ IntervalMapT join_A(split_A), join_B(split_B);
+
+ BOOST_CHECK_EQUAL( is_disjoint(split_A, split_B), true );
+ BOOST_CHECK_EQUAL( is_disjoint(split_A, join_B), true );
+
+ BOOST_CHECK_EQUAL( is_disjoint(join_A, split_B), true );
+ BOOST_CHECK_EQUAL( is_disjoint(join_A, join_B), true );
+}
+
+template<class Type>
+struct size_greater_1 : public itl::property<Type>
+{
+ bool operator()(const Type& value)const
+ {
+ return value.first.size() > 1 ;
+ }
+};
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_map_mixed_erase_if_4_integral_types, T, integral_types)
+{
+ typedef int U;
+ typedef interval_map<T,U> IntervalMapT;
+ typedef split_interval_map<T,U> SplitIntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef split_interval_set<T> SplitIntervalSetT;
+ U u1 = make<U>(1);
+ T v0 = make<T>(0);
+ T v2 = make<T>(2);
+ T v3 = make<T>(3);
+ T v4 = make<T>(4);
+ T v6 = make<T>(6);
+
+ interval<T> I0_3D = interval<T>::rightopen(v0,v3);
+ interval<T> I2_3D = interval<T>::rightopen(v2,v3);
+ interval<T> I3_4D = interval<T>::rightopen(v3,v4);
+ interval<T> I4_4I = interval<T>::closed(v4,v4);
+ interval<T> C4_6D = interval<T>::open(v4,v6);
+ interval<T> I6_6I = interval<T>::closed(v6,v6);
+
+ std::pair<interval<T>,U> I0_3D_1(I0_3D, u1);
+ std::pair<interval<T>,U> I2_3D_1(I2_3D, u1);
+ std::pair<interval<T>,U> I3_4D_1(I3_4D, u1);
+ std::pair<interval<T>,U> I4_4I_1(I4_4I, u1);
+ std::pair<interval<T>,U> C4_6D_1(C4_6D, u1);
+ std::pair<interval<T>,U> I6_6I_1(I6_6I, u1);
+
+ //--------------------------------------------------------------------------
+ //split_A: [0 2) [4 4] [6 6]
+ //split_B: [2 3)[3 4) (4 6)
+ SplitIntervalMapT split_A, split_B;
+
+ split_A.add(I0_3D_1).add(I4_4I_1).add(I6_6I_1);
+ split_B.add(I4_4I_1).add(I6_6I_1);
+
+ split_A.erase_if(size_greater_1<typename SplitIntervalMapT::value_type>());
+
+ BOOST_CHECK_EQUAL( split_A, split_B );
+}
+

Added: sandbox/itl/libs/itl/test/test_interval_map_mixed2/vc9_test_interval_map_mixed2.vcproj
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_interval_map_mixed2/vc9_test_interval_map_mixed2.vcproj 2009-06-12 05:00:07 EDT (Fri, 12 Jun 2009)
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_test_interval_map_mixed2"
+ ProjectGUID="{EE61B7EF-EC45-4165-8B49-FD5B8D3B9F9F}"
+ RootNamespace="Test_interval_map_mixed2"
+ 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="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ 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>
+ <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="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ 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="Quelldateien"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\test_interval_map_mixed2.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Headerdateien"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\test_interval_map_shared.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\test_type_lists.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Ressourcendateien"
+ 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>


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