-/*-----------------------------------------------------------------------------+
+/*-----------------------------------------------------------------------------+
Copyright (c) 2008-2009: Joachim Faulhaber
+------------------------------------------------------------------------------+
Distributed under the Boost Software License, Version 1.0.
//- part1: Basic operations and predicates
//------------------------------------------------------------------------------
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_ctor_4_ordered_types()
{
typedef interval_map<T,U> IntervalMapT;
U u1 = unit_element<U>::value();
SplitIntervalMapT split_map(mapping_pair<T,U>(v0,u1));
- //JODO: clang err: ctor ambiguous. Should compile
+ //JODO: clang err: ctor ambiguous. Should compile
//JODO CLANG SplitIntervalMapT split_map(make_pair(v0,u1));
IntervalMapT join_map(split_map);
BOOST_CHECK_EQUAL( hull(split_map).upper(), hull(join_map).upper() );
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_equal_4_ordered_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef typename IntervalMapT::interval_type IntervalT;
T v0 = boost::icl::identity_element<T>::value();
U u1 = unit_element<U>::value();
BOOST_CHECK_EQUAL( is_element_equal(join_single, join_empty), false );
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_assign_4_ordered_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef typename IntervalMapT::interval_type IntervalT;
T v0 = boost::icl::identity_element<T>::value();
T v1 = unit_element<T>::value();
BOOST_CHECK_EQUAL( join_self, join_self );
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_ctor_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_assign_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_equal_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
IntervalMapT join_map;
join_map.add(I1_3D_1).add(I2_4D_1).add(I4_5D_1);
- IntervalMapT join_map2 = join_map;
+ IntervalMapT join_map2 = join_map;
BOOST_CHECK_EQUAL( join_map, join_map2 );
BOOST_CHECK_EQUAL( is_element_equal(join_map, join_map2), true );
- SplitIntervalMapT split_map;
+ SplitIntervalMapT split_map;
split_map.add(I1_3D_1).add(I2_4D_1).add(I4_5D_1);
- SplitIntervalMapT split_map2 = split_map;
+ SplitIntervalMapT split_map2 = split_map;
BOOST_CHECK_EQUAL( split_map, split_map2 );
BOOST_CHECK_EQUAL( is_element_equal(split_map2, split_map), true );
void partial_interval_map_mixed_inclusion_compare_4_bicremental_types()
{
typedef interval_map<T,U,Trt> IntervalMapT;
- typedef typename IntervalMapT::interval_type IntervalT;
//--------------------------------------------------------------------------
// equalities
join_sub_map2.erase(MK_v(1));
BOOST_CHECK_EQUAL( icl::contains(join_sub_map2, MK_v(1)), false );
- split_interval_set<T> split_sub_set1;
- separate_interval_set<T> sep_sub_set1;
- interval_set<T> join_sub_set1;
+ split_interval_set<T> split_sub_set1;
+ separate_interval_set<T> sep_sub_set1;
+ interval_set<T> join_sub_set1;
icl::domain(split_sub_set1, split_sub_map1);
icl::domain(sep_sub_set1, split_sub_map1);
void partial_interval_map_mixed_contains_4_bicremental_types()
{
typedef interval_map<T,U,Trt> IntervalMapT;
- typedef typename IntervalMapT::interval_type IntervalT;
//--------------------------------------------------------------------------
// { 0 1 2 3 4 5 8 9 }
// {[0,2)[2,3](3,6) (7,9]}
join_sub_map2.erase(MK_v(1));
BOOST_CHECK_EQUAL( icl::contains(join_sub_map2, MK_v(1)), false );
- split_interval_set<T> split_sub_set1;
- separate_interval_set<T> sep_sub_set1;
- interval_set<T> join_sub_set1;
+ split_interval_set<T> split_sub_set1;
+ separate_interval_set<T> sep_sub_set1;
+ interval_set<T> join_sub_set1;
icl::domain(split_sub_set1, split_sub_map1);
icl::domain(sep_sub_set1, split_sub_map1);
template <class T, class U>
void interval_map_mixed_add_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
BOOST_CHECK_EQUAL( iterative_size(split_map3), 3 );
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_add2_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_subtract_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_erase_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_erase2_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef interval_set<T> IntervalSetT;
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_insert_erase_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
BOOST_CHECK_EQUAL( is_element_equal(join_X, IntervalMapT()), true );
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_insert_erase2_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef interval_set<T> IntervalSetT;
BOOST_CHECK_EQUAL( is_element_equal(join_X, IntervalMapT()), true );
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_basic_intersect_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
typedef typename IntervalMapT::interval_type IntervalT;
U u1 = make<U>(1);
//split_A [0 3) [6 9)
// &= [1 8)
//split_AB -> [1 3) [6 8)
- // &= [2 7)
+ // &= [2 7)
// -> [2 3) [6 7)
SplitIntervalMapT split_A, split_B, split_AB, split_ab, split_ab2;
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_basic_intersect2_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
typedef typename IntervalMapT::interval_type IntervalT;
U u1 = make<U>(1);
//split_A [0 3) [6 9)
// &= [1 8)
//split_AB -> [1 3) [6 8)
- // &= [2 7)
+ // &= [2 7)
// -> [2 3) [6 7)
SplitIntervalMapT split_A, split_B, split_AB, split_ab, split_ab2;
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_intersect_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
typedef typename IntervalMapT::interval_type IntervalT;
U u1 = make<U>(1);
split_AB &= split_B;
BOOST_CHECK_EQUAL( iterative_size(split_AB), 3 );
BOOST_CHECK_EQUAL( split_AB, split_ab );
-
+
//split_A [0 3) [6 9)
// 1 1
//join_B &= [1 4) [5 8)
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_intersect2_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
typedef interval_set<T> IntervalSetT;
split_AB &= split_B;
BOOST_CHECK_EQUAL( iterative_size(split_AB), 3 );
BOOST_CHECK_EQUAL( split_AB, split_ab );
-
+
//split_A [0 3) [6 9)
// 1 1
//join_B &= [1 4) [5 8)
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_disjoint_4_bicremental_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
typedef typename IntervalMapT::interval_type IntervalT;
U u1 = make<U>(1);
};
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_erase_if_4_integral_types()
-{
+{
typedef interval_map<T,U> IntervalMapT;
typedef split_interval_map<T,U> SplitIntervalMapT;
- typedef interval_set<T> IntervalSetT;
- typedef split_interval_set<T> SplitIntervalSetT;
typedef typename IntervalMapT::interval_type IntervalT;
U u1 = make<U>(1);
//- infix operators
//------------------------------------------------------------------------------
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_infix_plus_overload_4_bicremental_types()
{
typedef interval_map<T,U> IntervalMapT;
- typedef typename IntervalMapT::interval_type IntervalT;
interval_map<T,U> join_a;
split_interval_map<T,U> split_a;
BOOST_CHECK_EQUAL(split_a + join_a, join_a + split_a);
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_infix_pipe_overload_4_bicremental_types()
{
typedef interval_map<T,U> IntervalMapT;
BOOST_CHECK_EQUAL(split_a | join_a, join_a | split_a);
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_infix_minus_overload_4_bicremental_types()
{
typedef interval_map<T,U> IntervalMapT;
BOOST_CHECK_EQUAL(join_a - split_a, join_b);
}
-template <class T, class U>
+template <class T, class U>
void interval_map_mixed_infix_et_overload_4_bicremental_types()
{
typedef interval_map<T,U> IntervalMapT;
#endif // LIBS_ICL_TEST_TEST_ICL_interval_map_mixed_hpp_JOFA_081005__
-
-