|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51065 - in sandbox/itl: boost/itl boost/itl/type_traits boost/validate boost/validate/validater libs/itl/doc libs/itl/test/test_casual libs/validate/example/labat_single
From: afojgo_at_[hidden]
Date: 2009-02-06 15:41:25
Author: jofaber
Date: 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
New Revision: 51065
URL: http://svn.boost.org/trac/boost/changeset/51065
Log:
Refactored. Provided full template parameters for itl container metafunctions.
Stable {msvc-9.0, partly congcc-4.3-a7}
Text files modified:
sandbox/itl/boost/itl/interval_base_map.hpp | 46 +++++++++++++-
sandbox/itl/boost/itl/interval_base_set.hpp | 21 ++++++
sandbox/itl/boost/itl/interval_map.hpp | 68 +++++++++++----------
sandbox/itl/boost/itl/interval_set.hpp | 41 +++++-------
sandbox/itl/boost/itl/map.hpp | 42 ++++++------
sandbox/itl/boost/itl/separate_interval_set.hpp | 48 ++++++---------
sandbox/itl/boost/itl/split_interval_map.hpp | 70 +++++++++++++---------
sandbox/itl/boost/itl/split_interval_set.hpp | 66 +++++++++++----------
sandbox/itl/boost/itl/type_traits/absorbs_neutrons.hpp | 8 +
sandbox/itl/boost/itl/type_traits/is_combinable.hpp | 1
sandbox/itl/boost/itl/type_traits/is_continuous.hpp | 31 ++++++++-
sandbox/itl/boost/itl/type_traits/is_interval_container.hpp | 4
sandbox/itl/boost/itl/type_traits/is_interval_separator.hpp | 8 +
sandbox/itl/boost/itl/type_traits/is_interval_splitter.hpp | 8 +
sandbox/itl/boost/itl/type_traits/is_map.hpp | 2
sandbox/itl/boost/itl/type_traits/is_set.hpp | 2
sandbox/itl/boost/itl/type_traits/is_total.hpp | 8 +
sandbox/itl/boost/validate/typevalidater.h | 2
sandbox/itl/boost/validate/validater/itl_induced_relations.hpp | 9 --
sandbox/itl/libs/itl/doc/interface.qbk | 19 +++--
sandbox/itl/libs/itl/test/test_casual/test_casual.cpp | 24 ++++++-
sandbox/itl/libs/validate/example/labat_single/labat_single.cpp | 123 ---------------------------------------
22 files changed, 313 insertions(+), 338 deletions(-)
Modified: sandbox/itl/boost/itl/interval_base_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_map.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -1534,12 +1534,50 @@
}
-template < //JODO class KeyT, class DataT, class Traits>
+//-----------------------------------------------------------------------------
+// type traits
+//-----------------------------------------------------------------------------
+template
+<
class SubType,
- class DomainT, class CodomainT, class Traits>
-struct is_map<itl::interval_base_map<SubType,DomainT,CodomainT,Traits> >
+ class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc
+>
+struct is_set<itl::interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef is_map<itl::interval_base_map<SubType,DomainT,CodomainT,Traits> > type;
+ typedef is_set<itl::interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+template
+<
+ class SubType,
+ class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc
+>
+struct is_map<itl::interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
+{
+ typedef is_map<itl::interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+template
+<
+ class SubType,
+ class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc
+>
+struct has_inverse<itl::interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
+{
+ typedef has_inverse<itl::interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = has_inverse<CodomainT>::value;
+};
+
+template
+<
+ class SubType,
+ class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc
+>
+struct is_interval_container<itl::interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
+{
+ typedef is_interval_container<itl::interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
static const bool value = true;
};
Modified: sandbox/itl/boost/itl/interval_base_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_set.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_set.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -822,6 +822,27 @@
return stream << "}";
}
+//-----------------------------------------------------------------------------
+// type traits
+//-----------------------------------------------------------------------------
+template<class SubType,
+ class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_set<itl::interval_base_set<SubType,DomainT,Compare,Interval,Alloc> >
+{
+ typedef is_set<itl::interval_base_set<SubType,DomainT,Compare,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+template<class SubType,
+ class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_container<itl::interval_base_set<SubType,DomainT,Compare,Interval,Alloc> >
+{
+ typedef is_interval_container<itl::interval_base_set<SubType,DomainT,Compare,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+
+
}} // namespace itl boost
#endif
Modified: sandbox/itl/boost/itl/interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_map.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -23,7 +23,7 @@
template<class DomainT, class CodomainT, class Traits,
ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section,
- template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+ template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
class split_interval_map;
/// implements a map as a map of intervals - on insertion overlapping intervals are split and associated values are combined.
@@ -1005,56 +1005,60 @@
//-----------------------------------------------------------------------------
// type traits
//-----------------------------------------------------------------------------
-
-template <class KeyT, class DataT, class Traits>
-struct is_set<itl::interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_set<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef is_set<itl::interval_map<KeyT,DataT,Traits> > type;
+ typedef is_set<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
static const bool value = true;
};
-template <class KeyT, class DataT, class Traits>
-struct is_map<itl::interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_map<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef is_map<itl::interval_map<KeyT,DataT,Traits> > type;
+ typedef is_map<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
static const bool value = true;
};
-template <class KeyT, class DataT, class Traits>
-struct has_inverse<itl::interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct has_inverse<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef has_inverse<itl::interval_map<KeyT,DataT,Traits> > type;
- static const bool value = has_inverse<DataT>::value;
+ typedef has_inverse<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = has_inverse<CodomainT>::value;
};
-template <class KeyT, class DataT, class Traits>
-struct is_interval_container<itl::interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_container<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef is_interval_container<itl::interval_map<KeyT,DataT,Traits> > type;
- enum{value = true};
+ typedef is_interval_container<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = true;
};
-template <class KeyT, class DataT, class Traits>
-struct is_interval_splitter<itl::interval_map<KeyT,DataT,Traits> >
-{ enum{value = false}; };
-
-template <class KeyT, class DataT, class Traits>
-struct absorbs_neutrons<itl::interval_map<KeyT,DataT,Traits> >
-{ enum{value = Traits::absorbs_neutrons}; };
-
-template <class KeyT, class DataT, class Traits>
-struct is_total<itl::interval_map<KeyT,DataT,Traits> >
-{ enum{value = Traits::is_total}; };
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct absorbs_neutrons<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
+{
+ typedef absorbs_neutrons<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = Traits::absorbs_neutrons;
+};
-template <class KeyT, class DataT, class Traits>
-struct type_to_string<itl::interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_total<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
+{
+ typedef is_total<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = Traits::is_total;
+};
+
+//-----------------------------------------------------------------------------
+// type representation
+//-----------------------------------------------------------------------------
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct type_to_string<itl::interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
static std::string apply()
{
- return "itv_map<"+ type_to_string<KeyT>::apply() + ","
- + type_to_string<DataT>::apply() + ","
- + type_to_string<Traits>::apply() +">";
+ return "itv_map<"+ type_to_string<DomainT>::apply() + ","
+ + type_to_string<CodomainT>::apply() + ","
+ + type_to_string<Traits>::apply() + ">";
}
};
Modified: sandbox/itl/boost/itl/interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_set.hpp (original)
+++ sandbox/itl/boost/itl/interval_set.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -376,45 +376,40 @@
//-----------------------------------------------------------------------------
// equality of elements
//-----------------------------------------------------------------------------
-template <typename DomainT, template<class,ITL_COMPARE>class Interval,
- ITL_COMPARE Compare, ITL_ALLOC Alloc>
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
inline bool is_element_equal(const interval_set<DomainT,Compare,Interval,Alloc>& lhs,
const interval_set<DomainT,Compare,Interval,Alloc>& rhs)
{
+ // Since both are joining interval sets we can use the simpler Set::lexicographical_equal
return &lhs == &rhs || Set::lexicographical_equal(lhs, rhs);
}
-template <class Type>
-struct is_set<itl::interval_set<Type> >
+//-----------------------------------------------------------------------------
+// type traits
+//-----------------------------------------------------------------------------
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_set<itl::interval_set<DomainT,Compare,Interval,Alloc> >
{
- typedef is_set<itl::interval_set<Type> > type;
+ typedef is_set<itl::interval_set<DomainT,Compare,Interval,Alloc> > type;
static const bool value = true;
};
-template <class Type>
-struct is_interval_container<itl::interval_set<Type> >
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_container<itl::interval_set<DomainT,Compare,Interval,Alloc> >
{
- typedef is_interval_container<itl::interval_set<Type> > type;
- enum{value = true};
+ typedef is_interval_container<itl::interval_set<DomainT,Compare,Interval,Alloc> > type;
+ static const bool value = true;
};
-template <class Type>
-struct is_interval_splitter<itl::interval_set<Type> >
-{ enum{value = false}; };
-
-template <class Type>
-struct absorbs_neutrons<itl::interval_set<Type> >
-{ enum{value = false}; };
-
-template <class Type>
-struct is_total<itl::interval_set<Type> >
-{ enum{value = false}; };
-template <class Type>
-struct type_to_string<itl::interval_set<Type> >
+//-----------------------------------------------------------------------------
+// type representation
+//-----------------------------------------------------------------------------
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct type_to_string<itl::interval_set<DomainT,Compare,Interval,Alloc> >
{
static std::string apply()
- { return "itv_set<"+ type_to_string<Type>::apply() +">"; }
+ { return "itv_set<"+ type_to_string<DomainT>::apply() +">"; }
};
}} // namespace itl boost
Modified: sandbox/itl/boost/itl/map.hpp
==============================================================================
--- sandbox/itl/boost/itl/map.hpp (original)
+++ sandbox/itl/boost/itl/map.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -690,48 +690,48 @@
//-----------------------------------------------------------------------------
// type traits
//-----------------------------------------------------------------------------
- template <class KeyT, class DataT, class Traits>
- struct is_set<itl::map<KeyT,DataT,Traits> >
+ template<class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
+ struct is_set<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> >
{
- typedef is_set<itl::map<KeyT,DataT,Traits> > type;
+ typedef is_set<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> > type;
static const bool value = true;
};
- template <class KeyT, class DataT, class Traits>
- struct is_map<itl::map<KeyT,DataT,Traits> >
+ template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
+ struct is_map<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> >
{
- typedef is_map<itl::map<KeyT,DataT,Traits> > type;
+ typedef is_map<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> > type;
static const bool value = true;
};
- template <class KeyT, class DataT, class Traits>
- struct has_inverse<itl::map<KeyT,DataT,Traits> >
+ template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
+ struct has_inverse<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> >
{
- typedef has_inverse<itl::map<KeyT,DataT,Traits> > type;
- static const bool value = has_inverse<DataT>::value;
+ typedef has_inverse<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> > type;
+ static const bool value = has_inverse<CodomainT>::value;
};
- template <class DomainT, class CodomainT, class Traits>
- struct is_interval_container<itl::map<DomainT,CodomainT,Traits> >
+ template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
+ struct is_interval_container<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> >
{
- typedef is_interval_container<itl::map<DomainT,CodomainT,Traits> > type;
+ typedef is_interval_container<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> > type;
enum{value = true};
};
- template <class DomainT, class CodomainT, class Traits>
- struct is_interval_splitter<itl::map<DomainT,CodomainT,Traits> >
+ template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
+ struct is_interval_splitter<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> >
{ enum{value = false}; };
- template <class DomainT, class CodomainT, class Traits>
- struct absorbs_neutrons<itl::map<DomainT,CodomainT,Traits> >
+ template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
+ struct absorbs_neutrons<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> >
{ enum{value = Traits::absorbs_neutrons}; };
- template <class DomainT, class CodomainT, class Traits>
- struct is_total<itl::map<DomainT,CodomainT,Traits> >
+ template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
+ struct is_total<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> >
{ enum{value = Traits::is_total}; };
- template <class DomainT, class CodomainT, class Traits>
- struct type_to_string<itl::map<DomainT,CodomainT,Traits> >
+ template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
+ struct type_to_string<itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc> >
{
static std::string apply()
{
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-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -258,46 +258,38 @@
add_(rightResid);
}
-
//-----------------------------------------------------------------------------
-// equality of elements
+// type traits
//-----------------------------------------------------------------------------
-
-template <class Type>
-struct is_set<itl::separate_interval_set<Type> >
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_set<itl::separate_interval_set<DomainT,Compare,Interval,Alloc> >
{
- typedef is_set<itl::separate_interval_set<Type> > type;
+ typedef is_set<itl::separate_interval_set<DomainT,Compare,Interval,Alloc> > type;
static const bool value = true;
};
-template <class Type>
-struct is_interval_container<itl::separate_interval_set<Type> >
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_container<itl::separate_interval_set<DomainT,Compare,Interval,Alloc> >
{
- typedef is_interval_container<itl::separate_interval_set<Type> > type;
- enum{value = true};
+ typedef is_interval_container<itl::separate_interval_set<DomainT,Compare,Interval,Alloc> > type;
+ static const bool value = true;
};
-template <class Type>
-struct is_interval_separator<itl::separate_interval_set<Type> >
-{ enum{value = true}; };
-
-template <class Type>
-struct is_interval_splitter<itl::separate_interval_set<Type> >
-{ enum{value = false}; };
-
-template <class Type>
-struct absorbs_neutrons<itl::separate_interval_set<Type> >
-{ enum{value = false}; };
-
-template <class Type>
-struct is_total<itl::separate_interval_set<Type> >
-{ enum{value = false}; };
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_separator<itl::separate_interval_set<DomainT,Compare,Interval,Alloc> >
+{
+ typedef is_interval_separator<itl::separate_interval_set<DomainT,Compare,Interval,Alloc> > type;
+ static const bool value = true;
+};
-template <class Type>
-struct type_to_string<itl::separate_interval_set<Type> >
+//-----------------------------------------------------------------------------
+// type representation
+//-----------------------------------------------------------------------------
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct type_to_string<itl::separate_interval_set<DomainT,Compare,Interval,Alloc> >
{
static std::string apply()
- { return "se_itv_set<"+ type_to_string<Type>::apply() +">"; }
+ { return "se_itv_set<"+ type_to_string<DomainT>::apply() +">"; }
};
}} // namespace itl boost
Modified: sandbox/itl/boost/itl/split_interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/split_interval_map.hpp (original)
+++ sandbox/itl/boost/itl/split_interval_map.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -776,54 +776,64 @@
// type traits
//-----------------------------------------------------------------------------
-template <class KeyT, class DataT, class Traits>
-struct is_set<itl::split_interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_set<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef is_set<itl::split_interval_map<KeyT,DataT,Traits> > type;
+ typedef is_set<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
static const bool value = true;
};
-template <class KeyT, class DataT, class Traits>
-struct is_map<itl::split_interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_map<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef is_map<itl::split_interval_map<KeyT,DataT,Traits> > type;
+ typedef is_map<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
enum{value = true};
};
-template <class KeyT, class DataT, class Traits>
-struct has_inverse<itl::split_interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct has_inverse<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef has_inverse<itl::split_interval_map<KeyT,DataT,Traits> > type;
- static const bool value = has_inverse<DataT>::value;
+ typedef has_inverse<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = has_inverse<CodomainT>::value;
};
-template <class KeyT, class DataT, class Traits>
-struct is_interval_container<itl::split_interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_container<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
- typedef is_interval_container<itl::split_interval_map<KeyT,DataT,Traits> > type;
- enum{value = true};
+ typedef is_interval_container<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_splitter<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
+{
+ typedef is_interval_splitter<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct absorbs_neutrons<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
+{
+ typedef absorbs_neutrons<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = Traits::absorbs_neutrons;
+};
+
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_total<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
+{
+ typedef is_total<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> > type;
+ static const bool value = Traits::is_total;
};
-template <class KeyT, class DataT, class Traits>
-struct is_interval_splitter<itl::split_interval_map<KeyT,DataT,Traits> >
-{ enum{value = true}; };
-
-template <class KeyT, class DataT, class Traits>
-struct absorbs_neutrons<itl::split_interval_map<KeyT,DataT,Traits> >
-{ enum{value = Traits::absorbs_neutrons}; };
-
-template <class KeyT, class DataT, class Traits>
-struct is_total<itl::split_interval_map<KeyT,DataT,Traits> >
-{ enum{value = Traits::is_total}; };
-template <class KeyT, class DataT, class Traits>
-struct type_to_string<itl::split_interval_map<KeyT,DataT,Traits> >
+template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct type_to_string<itl::split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc> >
{
static std::string apply()
{
- return "sp_itv_map<"+ type_to_string<KeyT>::apply() + ","
- + type_to_string<DataT>::apply() + ","
- + type_to_string<Traits>::apply() +">";
+ return "sp_itv_map<"+ type_to_string<DomainT>::apply() + ","
+ + type_to_string<CodomainT>::apply() + ","
+ + type_to_string<Traits>::apply() +">";
}
};
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-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -423,38 +423,40 @@
return Set::lexicographical_equal(lhs, rhs);
}
- template <class Type>
- struct is_set<itl::split_interval_set<Type> >
- {
- typedef is_set<itl::split_interval_set<Type> > type;
- static const bool value = true;
- };
-
- template <class Type>
- struct is_interval_container<itl::split_interval_set<Type> >
- {
- typedef is_interval_container<itl::split_interval_set<Type> > type;
- enum{value = true};
- };
-
- template <class Type>
- struct is_interval_splitter<itl::split_interval_set<Type> >
- { enum{value = true}; };
-
- template <class Type>
- struct absorbs_neutrons<itl::split_interval_set<Type> >
- { enum{value = false}; };
-
- template <class Type>
- struct is_total<itl::split_interval_set<Type> >
- { enum{value = false}; };
-
- template <class Type>
- struct type_to_string<itl::split_interval_set<Type> >
- {
- static std::string apply()
- { return "sp_itv_set<"+ type_to_string<Type>::apply() +">"; }
- };
+//-----------------------------------------------------------------------------
+// type traits
+//-----------------------------------------------------------------------------
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_set<itl::split_interval_set<DomainT,Compare,Interval,Alloc> >
+{
+ typedef is_set<itl::split_interval_set<DomainT,Compare,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_container<itl::split_interval_set<DomainT,Compare,Interval,Alloc> >
+{
+ typedef is_interval_container<itl::split_interval_set<DomainT,Compare,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct is_interval_splitter<itl::split_interval_set<DomainT,Compare,Interval,Alloc> >
+{
+ typedef is_interval_splitter<itl::split_interval_set<DomainT,Compare,Interval,Alloc> > type;
+ static const bool value = true;
+};
+
+//-----------------------------------------------------------------------------
+// type representation
+//-----------------------------------------------------------------------------
+template <class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+struct type_to_string<itl::split_interval_set<DomainT,Compare,Interval,Alloc> >
+{
+ static std::string apply()
+ { return "sp_itv_set<"+ type_to_string<DomainT>::apply() +">"; }
+};
+
}} // namespace itl boost
Modified: sandbox/itl/boost/itl/type_traits/absorbs_neutrons.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/absorbs_neutrons.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/absorbs_neutrons.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -10,9 +10,11 @@
namespace boost{ namespace itl
{
- template <class Type> struct absorbs_neutrons;
-
- template <class Type> struct absorbs_neutrons{ enum {value = false}; };
+ template <class Type> struct absorbs_neutrons
+ {
+ typedef absorbs_neutrons<Type> type;
+ static const bool value = false;
+ };
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/is_combinable.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_combinable.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_combinable.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -14,7 +14,6 @@
#include <boost/mpl/or.hpp>
#include <boost/mpl/not.hpp>
#include <boost/type_traits/is_same.hpp>
-//CL #include <boost/itl/type_traits/is_interval_splitter.hpp>
namespace boost{namespace itl
{
Modified: sandbox/itl/boost/itl/type_traits/is_continuous.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_continuous.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_continuous.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -14,17 +14,38 @@
{
template <class Type> struct is_continuous;
- template<> struct is_continuous<float> { enum {value = true}; };
- template<> struct is_continuous<double> { enum {value = true}; };
- template<> struct is_continuous<std::string> { enum {value = true}; };
+ template<> struct is_continuous<float>
+ {
+ typedef is_continuous<float> type;
+ static const bool value = true;
+ };
+ template<> struct is_continuous<double>
+ {
+ typedef is_continuous<double> type;
+ static const bool value = true;
+ };
+ template<> struct is_continuous<std::string>
+ {
+ typedef is_continuous<std::string> type;
+ static const bool value = true;
+ };
#ifdef ITL_NEEDS_RATIONAL_IS_CONTINUOUS
#define ITL_HAS_RATIONAL_IS_CONTINUOUS
template<class Integral>
- struct is_continuous<boost::rational<Integral> > { enum {value = true}; };
+ struct is_continuous<boost::rational<Integral> >
+ {
+ typedef is_continuous<boost::rational<Integral> > type;
+ static const bool value = true;
+ };
#endif
- template <class Type> struct is_continuous{ enum {value = false}; };
+ template <class Type> struct is_continuous
+ {
+ typedef is_continuous<Type> type;
+ static const bool value = false;
+ };
+
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/is_interval_container.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_interval_container.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_interval_container.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -10,12 +10,10 @@
namespace boost{ namespace itl
{
- template <class Type> struct is_interval_container;
-
template <class Type> struct is_interval_container
{
typedef is_interval_container<Type> type;
- enum {value = false};
+ static const bool value = false;
};
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/is_interval_separator.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_interval_separator.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_interval_separator.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -10,9 +10,11 @@
namespace boost{ namespace itl
{
- template <class Type> struct is_interval_separator;
-
- template <class Type> struct is_interval_separator{ enum {value = false}; };
+ template <class Type> struct is_interval_separator
+ {
+ typedef is_interval_separator<Type> type;
+ static const bool value = false;
+ };
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/is_interval_splitter.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_interval_splitter.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_interval_splitter.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -10,9 +10,11 @@
namespace boost{ namespace itl
{
- template <class Type> struct is_interval_splitter;
-
- template <class Type> struct is_interval_splitter{ enum {value = false}; };
+ template <class Type> struct is_interval_splitter
+ {
+ typedef is_interval_splitter<Type> type;
+ static const bool value = false;
+ };
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/is_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_map.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_map.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -10,8 +10,6 @@
namespace boost{ namespace itl
{
- template <class Type> struct is_map;
-
template <class Type> struct is_map
{
typedef is_map<Type> type;
Modified: sandbox/itl/boost/itl/type_traits/is_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_set.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_set.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -10,8 +10,6 @@
namespace boost{ namespace itl
{
- template <class Type> struct is_set;
-
template <class Type> struct is_set
{
typedef is_set<Type> type;
Modified: sandbox/itl/boost/itl/type_traits/is_total.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_total.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_total.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -10,9 +10,11 @@
namespace boost{ namespace itl
{
- template <class Type> struct is_total;
-
- template <class Type> struct is_total{ enum {value = false}; };
+ template <class Type> struct is_total
+ {
+ typedef is_total<Type> type;
+ static const bool value = false;
+ };
}} // namespace boost itl
Modified: sandbox/itl/boost/validate/typevalidater.h
==============================================================================
--- sandbox/itl/boost/validate/typevalidater.h (original)
+++ sandbox/itl/boost/validate/typevalidater.h 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -126,7 +126,7 @@
switch(_lawChoice.some())
{
case transitivity: return new LawValidater<Transitivity<Type, Relation>, RandomGentor>;
- case antisymmetry: return new LawValidater<Antisymmetry<Type, Relation>, RandomGentor>;
+ case antisymmetry: return new LawValidater<Antisymmetry<Type, Relation, Equality>, RandomGentor>;
case reflexivity: return new LawValidater<Reflexivity <Type, Relation>, RandomGentor>;
default: return NULL;
}
Modified: sandbox/itl/boost/validate/validater/itl_induced_relations.hpp
==============================================================================
--- sandbox/itl/boost/validate/validater/itl_induced_relations.hpp (original)
+++ sandbox/itl/boost/validate/validater/itl_induced_relations.hpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -9,16 +9,7 @@
+----------------------------------------------------------------------------*/
#pragma once
-//CL
-//#include <boost/mpl/bool.hpp>
-//#include <boost/mpl/if.hpp>
-//#include <boost/itl/type_traits/is_continuous.hpp>
-//#include <boost/itl/type_traits/has_inverse.hpp>
#include <boost/itl/functors.hpp>
-//#include <boost/itl/interval_morphism.hpp>
-//#include <boost/validate/laws/set_laws.h>
-//#include <boost/validate/laws/order.h>
-//#include <boost/validate/laws/pushouts.h>
#include <boost/validate/laws/induced_relation.hpp>
#include <boost/validate/lawvalidater.h>
#include <boost/validate/algebra_validater.hpp>
Modified: sandbox/itl/libs/itl/doc/interface.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/interface.qbk (original)
+++ sandbox/itl/libs/itl/doc/interface.qbk 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -435,8 +435,8 @@
[[`T::T()`] [1] [1] [1] [1] [1] [1] [1]]
[[`T::T(const T&)`] [A] [1] [1] [1] [1] [1] [1]]
[[`T::T(const P&)`] [ ] [__eiS] [__bpM] [ ] [ ] [ ] [ ]]
-[[`T::T(const P&,...)`] [3] [ ] [ ] [3] [3] [3] [3]]
-[[`T& T::operator=(const T&)`] [A] [1] [1] [1] [1] [1] [1]]
+[[`T::T(...)`] [3] [ ] [ ] [3] [3] [3] [3]]
+[[`T& T::operator=(const T&)`] [A] [__S] [__M] [1] [1] [1] [1]]
[[`void T::swap(T&)`] [ ] [1] [1] [1] [1] [1] [1]]
[[['*Emptieness, containment*]] [interval][interval\nsets][interval\nmaps][itl::set][itl::map][std::set][std::map]]
[[`void T::clear()`] [1] [1] [1] [1] [1] [1] [1]]
@@ -446,7 +446,7 @@
[[['*Equivalences and Orderings*]][interval][interval\nsets][interval\nmaps][itl::set][itl::map][std::set][std::map]]
[[`bool operator == (const T&, const T&)`] [1] [1] [1] [1] [1] [1] [1]]
[[`bool operator != (const T&, const T&)`] [1] [1] [1] [1] [1] [1] [1]]
-[[`bool is_element_equal(const T&, const T&)`] [ ] [1] [1] [1] [1] [ ] [ ]]
+[[`bool is_element_equal(const T&, const P&)`] [ ] [?] [?] [1] [1] [ ] [ ]]
[[`bool is_protonic_equal(const T&, const T&)`][ ] [ ] [1] [ ] [1] [ ] [ ]]
[[`bool operator < (const T&, const T&)`] [1] [1] [1] [1] [1] [1] [1]]
[[`bool operator > (const T&, const T&)`] [1] [1] [1] [1] [1] [1] [1]]
@@ -468,9 +468,9 @@
[[['*Addition*]] [interval][interval\nsets][interval\nmaps][itl::set][itl::map][std::set][std::map]]
[[`T& T::add(const P&)`] [ ] [__ei] [__bp] [__e] [__b] [ ] [ ]]
[[`T& operator +=( T&, const P&)`] [ ] [__eiS] [__bpM] [__es] [__bm] [ ] [ ]]
-[[`T operator + (const T&, const P&)`] [ ] [__eiS] [__bpM] [__es] [__bm] [ ] [JODO test]]
-[[`T& operator |=( T&, const P&)`] [ ] [__eiS] [__bpM] [__es] [__bm] [ ] [JODO test]]
-[[`T operator | (const T&, const P&)`] [ ] [__eiS] [__bpM] [__es] [__bm] [ ] [JODO test]]
+[[`T operator + (const T&, const P&)`] [ ] [__eiS] [__bpM] [__es] [__bm] [ ] [ ]]
+[[`T& operator |=( T&, const P&)`] [ ] [__eiS] [__bpM] [__es] [__bm] [ ] [ ]]
+[[`T operator | (const T&, const P&)`] [ ] [__eiS] [__bpM] [__es] [__bm] [ ] [ ]]
[[['*Subtraction*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
[[`T& T::subtract(const P&)`] [ ] [__ei] [__bp] [__e] [__b] [ ] [ ]]
[[`T& operator -=( T&, const P&)`] [ ] [__eiS] [__bpM] [__es] [__bm] [ ] [ ]]
@@ -480,12 +480,13 @@
[[`T& T::set(const P&)`] [ ] [ ] [__bp?] [ ] [__b?] [ ] [JODO]]
[[`T& T::erase(const P&)`] [ ] [__eiS][__eiS __bpM][__e] [__b] [?__e] [?__b]]
[[['*Intersection, symmetric difference*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
-[[`void T::intersect(T&, const P&)const`] [__i] [__eiS][__eiS __bpM][ ] [ ] [ ] [ ]]
+[[`void T::intersect(T&, const P&)const`] [__i] [__eiS][__eiS __bpM][ ] [ ] [ ] [JODO remove?]]
[[`void T::add_intersection(T&, const P&)const`][][__eiS][__eiS __bpM][ ] [ ] [ ] [ ]]
[[`T& operator &=(T&, const P&)`] [__i] [__eiS][__eiS __bpM][?__es][?__bm] [ ] [JODO]]
[[`T operator & (const T&, const P&)`] [__i] [__eiS][__eiS __bpM][?__es][?__bm] [ ] [JODO]]
-[[`T& operator ^=(T&, const P&)`] [__i] [__eiS][__eiS __bpM][?__es][?__bm] [ ] [JODO]]
-[[`T operator ^ (const T&, const P&)`] [__i] [__eiS][__eiS __bpM][?__es][?__bm] [ ] [JODO]]
+[[`T& T::flip(const P&)`] [ ] [__ei] [__bp] [__e] [__b] [ ] [ ]]
+[[`T& operator ^=(T&, const P&)`] [ ] [__eiS] [__bpM] [?__es][?__bm] [ ] [JODO]]
+[[`T operator ^ (const T&, const P&)`] [ ] [__eiS] [__bpM] [?__es][?__bm] [ ] [JODO]]
[[['*Iterator related*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
[[`J T::begin()`] [ ] [2] [2] [2] [2] [2] [2]]
[[`J T::end()`] [ ] [2] [2] [2] [2] [2] [2]]
Modified: sandbox/itl/libs/itl/test/test_casual/test_casual.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_casual/test_casual.cpp (original)
+++ sandbox/itl/libs/itl/test/test_casual/test_casual.cpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -31,9 +31,9 @@
BOOST_AUTO_TEST_CASE(subset_test)
{
typedef interval_map<int,int> IntervalMapT;
- typedef split_interval_map<int,int> Splimp;
+ typedef split_interval_map<int,int> SplitIntervalMapT;
- Splimp left, right;
+ SplitIntervalMapT left, right;
left.add(CDv(2,7,5)).add(IIv(9,9,5));
right.add(CDv(-8,-6,2)).add(CIv(2,7,5)).add(CDv(7,9,1)).add(IIv(9,11,5));
BOOST_CHECK_EQUAL(is_contained_in(left,right), true);
@@ -48,10 +48,26 @@
BOOST_AUTO_TEST_CASE(superset_test)
{
typedef interval_map<int,int> IntervalMapT;
- typedef split_interval_map<int,int> Splimp;
+ typedef split_interval_map<int,int> SplitIntervalMapT;
- Splimp left, right;
+ SplitIntervalMapT left, right;
left.add(IDv(-7,-1,1)).add(IIv(8,16,9));
right.add(CDv(-8,-4,1)).add(IIv(8,8,9));
BOOST_CHECK_EQUAL(contains(left,right), true);
}
+
+BOOST_AUTO_TEST_CASE(casual_test)
+{
+ typedef interval_map<int,int> IntervalMapT;
+ typedef split_interval_map<int,int> SplitIntervalMapT;
+
+ SplitIntervalMapT left, right;
+ left.add(IDv(-7,-1,1)).add(IIv(8,16,9));
+ right.add(CDv(-8,-4,1)).add(IIv(8,8,9));
+
+ IntervalMapT join_left;
+ join_left.add(CDv(-8,-4,1));
+ join_left = left;
+
+ BOOST_CHECK_EQUAL(contains(join_left,right), true);
+}
Modified: sandbox/itl/libs/validate/example/labat_single/labat_single.cpp
==============================================================================
--- sandbox/itl/libs/validate/example/labat_single/labat_single.cpp (original)
+++ sandbox/itl/libs/validate/example/labat_single/labat_single.cpp 2009-02-06 15:41:23 EST (Fri, 06 Feb 2009)
@@ -49,132 +49,15 @@
//map_cluster_star_pushout.setTrialsCount(1000);
//map_cluster_star_pushout.run();
- //typedef InplaceSymmetricDifference<split_interval_map<int, int, total_absorber >, std_equal> TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(1000);
- //test_law.run();
-
- //typedef InplaceDistributivity
- // <split_interval_map<int, itl::set<int>, partial_absorber >,
- // inplace_et, inplace_plus, itl::std_equal> TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(1000);
-
- //typedef InplaceNaturalInversion
- // <split_interval_map<int, itl::set<int>, total_absorber >,
- // itl::inplace_plus, itl::protonic_equal> TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(1000);
-
- //typedef InplaceAssociativity
- // <split_interval_map<int, int, total_absorber >, inplace_et> TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(1000);
-
- //typedef InplaceCommutativity
- // <split_interval_map<int, int, total_absorber>, inplace_plus> TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(1000);
-
- //typedef ProtonicEquality
- // <split_interval_map<int, int, partial_enricher > > TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(1000);
-
- //typedef InplaceInverseExistence
- // <split_interval_map<int, int, total_absorber>, inplace_plus> TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(1000);
-
- //typedef InplaceFlip
- // <split_interval_map<int, int, total_enricher > > TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(10000);
-
-
- //-----------------------------------------------------------------------------
- /*
- typedef ElementEqualDefined
- <split_interval_map<int,int> > TestLawT;
+ typedef InplaceFlip
+ <interval_map<int, int, total_enricher > > TestLawT;
LawValidater<TestLawT, RandomGentor> test_law;
- test_law.setTrialsCount(10000);
-
- std::cout << "1Start\n";
- start = ptime(microsec_clock::local_time());
- test_law.run();
- stop = ptime(microsec_clock::local_time());
- std::cout << "Stop. Time elapsed: " << stop - start << endl;
-
- typedef ElementLessDefined
- <split_interval_map<int,int> > TestLaw2T;
- LawValidater<TestLaw2T, RandomGentor> test_law2;
- test_law2.setTrialsCount(10000);
-
- std::cout << "2Start\n";
- start = ptime(microsec_clock::local_time());
- test_law2.run();
- stop = ptime(microsec_clock::local_time());
- std::cout << "Stop. Time elapsed: " << stop - start << endl;
-
- typedef ElementGreaterDefined
- <split_interval_map<int,int> > TestLaw3T;
- LawValidater<TestLaw3T, RandomGentor> test_law3;
- test_law3.setTrialsCount(10000);
-
- std::cout << "3Start\n";
- start = ptime(microsec_clock::local_time());
- test_law3.run();
- stop = ptime(microsec_clock::local_time());
- std::cout << "Stop. Time elapsed: " << stop - start << endl;
- */
//-----------------------------------------------------------------------------
int test_count = 10000;
ptime start, stop;
- //typedef InclusionEqualDefined
- // <split_interval_map<int,int> > TestLaw4T;
- //LawValidater<TestLaw4T, RandomGentor> test_law4;
- //test_law4.setTrialsCount(test_count);
-
- //std::cout << "4Start\n";
- //start = ptime(microsec_clock::local_time());
- //test_law4.run();
- //stop = ptime(microsec_clock::local_time());
- //std::cout << "Stop. Time elapsed: " << stop - start << endl;
-
- //typedef SubsetDefined
- // <split_interval_map<int,int> > TestLaw5T;
- //LawValidater<TestLaw5T, RandomGentor> test_law5;
- //test_law5.setTrialsCount(test_count);
-
- //std::cout << "5Start\n";
- //start = ptime(microsec_clock::local_time());
- //test_law5.run();
- //stop = ptime(microsec_clock::local_time());
- //std::cout << "Stop. Time elapsed: " << stop - start << endl;
-
- //typedef SupersetDefined
- // <split_interval_map<int,int> > TestLaw6T;
- //LawValidater<TestLaw6T, RandomGentor> test_law6;
- //test_law6.setTrialsCount(test_count);
-
- //std::cout << "6Start\n";
- //start = ptime(microsec_clock::local_time());
- //test_law6.run();
- //stop = ptime(microsec_clock::local_time());
- //std::cout << "Stop. Time elapsed: " << stop - start << endl;
-
- //typedef InplaceAssociativity
- // <split_interval_map<int, int, total_absorber>, inplace_et, itl::element_equal> TestLawT;
- //LawValidater<TestLawT, RandomGentor> test_law;
- //test_law.setTrialsCount(10000);
-
- typedef Antisymmetry
- <split_interval_map<int, int, total_enricher >, sub_super_set, element_equal > TestLawT;
- LawValidater<TestLawT, RandomGentor> test_law;
- test_law.setTrialsCount(1000);
-
+ test_law.setTrialsCount(test_count);
std::cout << "Start\n";
start = ptime(microsec_clock::local_time());
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