void dynamic_interval_ctor_4_ordered_types() { typedef typename domain_type_of<interval_traits<IntervalT> >::type T; BOOST_CHECK_EQUAL(IntervalT().lower(), icl::identity_element<T>::value()); BOOST_CHECK_EQUAL(IntervalT().upper(), icl::identity_element<T>::value()); BOOST_CHECK_EQUAL(icl::lower(IntervalT()), icl::identity_element<T>::value()); BOOST_CHECK_EQUAL(icl::upper(IntervalT()), icl::identity_element<T>::value()); IntervalT empty_itv = IntervalT(icl::identity_element<T>::value(), icl::identity_element<T>::value()); BOOST_CHECK_EQUAL(IntervalT(), empty_itv); BOOST_CHECK_EQUAL(IntervalT(), IntervalT(icl::identity_element<T>::value(), icl::identity_element<T>::value())); BOOST_CHECK_EQUAL(IntervalT(), IntervalT(icl::identity_element<T>::value(), icl::identity_element<T>::value(), interval_bounds::right_open())); }
void singelizable_interval_4_bicremental_types() { typedef typename domain_type_of<interval_traits<IntervalT> >::type T; typedef typename icl::size_type_of<T>::type SizeT; //T t_0 = icl::identity_element<T>::value(); SizeT s_1 = icl::unit_element<SizeT>::value(); BOOST_CHECK( is_singelizable<IntervalT>::value ); BOOST_CHECK_EQUAL( icl::cardinality(IntervalT(MK_v(3))), s_1 ); BOOST_CHECK_EQUAL( icl::size(IntervalT(MK_v(4))), s_1 ); BOOST_CHECK_EQUAL( icl::singleton<IntervalT>(MK_v(2)), icl::singleton<IntervalT>(MK_v(2)) ); BOOST_CHECK_EQUAL( icl::contains(IntervalT(MK_v(1)), MK_v(1)), true ); }
void interval_ctor_4_ordered_types() { BOOST_CHECK_EQUAL(icl::is_empty(IntervalT()), true); BOOST_CHECK_EQUAL(icl::cardinality(IntervalT()), icl::identity_element<typename icl::size_type_of<T>::type>::value()); BOOST_CHECK_EQUAL(icl::size(IntervalT()), icl::identity_element<typename icl::size_type_of<T>::type>::value()); BOOST_CHECK_EQUAL( IntervalT(), IntervalT() ); BOOST_CHECK_EQUAL( IntervalT(), IntervalT(IntervalT().lower(), IntervalT().upper()) ); BOOST_CHECK_EQUAL( IntervalT(), IntervalT(icl::lower(IntervalT()), icl::upper(IntervalT())) ); }
void interval_ctor_4_ordered_types() { typedef typename domain_type_of<interval_traits<IntervalT> >::type T; typedef typename icl::size_type_of<T>::type SizeT; T t_0 = icl::identity_element<T>::value(); T t_1 = icl::unit_element<T>::value(); SizeT s_0 = icl::identity_element<SizeT>::value(); SizeT s_1 = icl::unit_element<SizeT>::value(); // Default ctor and emptieness BOOST_CHECK_EQUAL( icl::is_empty(IntervalT()), true ); BOOST_CHECK_EQUAL( icl::cardinality(IntervalT()), s_0 ); BOOST_CHECK_EQUAL( icl::size(IntervalT()), s_0 ); BOOST_CHECK_EQUAL( IntervalT(), IntervalT() ); BOOST_CHECK_EQUAL( IntervalT(), IntervalT(IntervalT().lower(), IntervalT().upper()) ); BOOST_CHECK_EQUAL( IntervalT(), IntervalT(icl::lower(IntervalT()), icl::upper(IntervalT())) ); BOOST_CHECK_EQUAL(icl::cardinality(IntervalT(t_0, t_1)) >= s_1, true); BOOST_CHECK_EQUAL(( icl::contains(IntervalT(t_0, t_1), t_0) || icl::contains(IntervalT(t_0, t_1), t_1)), true); BOOST_CHECK_EQUAL(IntervalT(t_0, t_1).lower(), t_0); BOOST_CHECK_EQUAL(IntervalT(t_0, t_1).upper(), t_1); BOOST_CHECK_EQUAL(lower(icl::construct<IntervalT>(t_0, t_1)), t_0); BOOST_CHECK_EQUAL(upper(icl::construct<IntervalT>(t_0, t_1)), t_1); }
void discrete_interval_ctor__dis_4_dyn_v_sta() // discrete && (dynamic or static) { BOOST_CHECK_EQUAL( IntervalT(MK_v(3)), IntervalT(MK_v(3)) ); BOOST_CHECK_EQUAL( icl::contains(IntervalT(MK_v(1)), MK_v(1)), true ); }