|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65777 - in sandbox/itl: boost/itl boost/itl/concept boost/itl/concept/interval boost/itl/detail boost/itl/type_traits boost/validate/driver boost/validate/gentor boost/validate/validater libs/itl/test libs/itl/test/fastest_itl_interval_ libs/itl/test/test_casual_ libs/itl/test/test_itl_interval_ libs/validate/example libs/validate/example/boostcon_abelian_monoids_ libs/validate/example/boostcon_law_validater_ libs/validate/example/de_morgan_ libs/validate/example/labat_bit_collector_ libs/validate/example/labat_collector_ libs/validate/example/labat_itl_morphic_ libs/validate/example/labat_itl_set_ libs/validate/example/labat_itv_bitset_ libs/validate/example/labat_map_copy_conformity_ libs/validate/example/labat_map_order_ libs/validate/example/labat_set_copy_conformity_ libs/validate/example/labat_set_order_ libs/validate/example/labat_signed_quantifier_ libs/validate/example/labat_single_ libs/validate/example/labat_sorted_assoc_bitset_ libs/validate/example/labat_sorted_assoc_bitset_back_ libs/validate/example/labat_sorted_assoc_map_ libs/validate/example/labat_sorted_assoc_map_back_ libs/validate/example/labat_sorted_assoc_set_ libs/validate/example/labat_sorted_assoc_set_back_ libs/validate/example/labat_unsigned_quantifier_ libs/validate/example/labat_val_relations_
From: afojgo_at_[hidden]
Date: 2010-10-05 19:02:23
Author: jofaber
Date: 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
New Revision: 65777
URL: http://svn.boost.org/trac/boost/changeset/65777
Log:
Refactoring: Cleaning up the code, renaming, removing dependencies to old interval implementation.
std::set is now model of concept element_set. Added tests for intervals. Stable{msvc-9.0, gcc-3.4.4}
Added:
sandbox/itl/boost/itl/leftopen_interval.hpp (contents, props changed)
sandbox/itl/boost/itl/open_interval.hpp (contents, props changed)
sandbox/itl/libs/itl/test/test_icl_continuous_interval.hpp (contents, props changed)
sandbox/itl/libs/itl/test/test_icl_discrete_interval.hpp (contents, props changed)
sandbox/itl/libs/itl/test/test_icl_dynamic_interval.hpp (contents, props changed)
sandbox/itl/libs/itl/test/test_icl_interval.hpp (contents, props changed)
sandbox/itl/libs/itl/test/test_icl_static_interval.hpp (contents, props changed)
Text files modified:
sandbox/itl/boost/itl/closed_interval.hpp | 40 +-
sandbox/itl/boost/itl/concept/container.hpp | 9
sandbox/itl/boost/itl/concept/element_associator.hpp | 80 +++--
sandbox/itl/boost/itl/concept/element_set.hpp | 8
sandbox/itl/boost/itl/concept/interval.hpp | 557 ++++++++++++++++++++++++++++++++++-----
sandbox/itl/boost/itl/concept/interval/base.hpp | 2
sandbox/itl/boost/itl/concept/interval_associator.hpp | 31 +
sandbox/itl/boost/itl/concept/interval_bounds.hpp | 2
sandbox/itl/boost/itl/concept/interval_map.hpp | 8
sandbox/itl/boost/itl/concept/interval_set.hpp | 36 +-
sandbox/itl/boost/itl/continuous_interval.hpp | 1
sandbox/itl/boost/itl/detail/associated_value.hpp | 4
sandbox/itl/boost/itl/detail/design_config.hpp | 2
sandbox/itl/boost/itl/detail/element_iterator.hpp | 8
sandbox/itl/boost/itl/detail/exclusive_less_than.hpp | 2
sandbox/itl/boost/itl/detail/interval_set_algo.hpp | 2
sandbox/itl/boost/itl/detail/set_algo.hpp | 61 ++--
sandbox/itl/boost/itl/detail/subset_comparer.hpp | 13
sandbox/itl/boost/itl/gregorian.hpp | 7
sandbox/itl/boost/itl/interval_base_map.hpp | 16
sandbox/itl/boost/itl/interval_base_set.hpp | 105 -------
sandbox/itl/boost/itl/interval_set.hpp | 6
sandbox/itl/boost/itl/map.hpp | 2
sandbox/itl/boost/itl/ptime.hpp | 15
sandbox/itl/boost/itl/rational.hpp | 19 +
sandbox/itl/boost/itl/rightopen_interval.hpp | 8
sandbox/itl/boost/itl/set.hpp | 17 +
sandbox/itl/boost/itl/type_traits/codomain_type_of.hpp | 7
sandbox/itl/boost/itl/type_traits/difference_type_of.hpp | 36 ++
sandbox/itl/boost/itl/type_traits/domain_type_of.hpp | 1
sandbox/itl/boost/itl/type_traits/element_type_of.hpp | 59 ++++
sandbox/itl/boost/itl/type_traits/given.hpp | 34 ++
sandbox/itl/boost/itl/type_traits/has_dynamic_bounds.hpp | 23 -
sandbox/itl/boost/itl/type_traits/interval_type_default.hpp | 15
sandbox/itl/boost/itl/type_traits/is_asymmetric_interval.hpp | 4
sandbox/itl/boost/itl/type_traits/is_combinable.hpp | 12
sandbox/itl/boost/itl/type_traits/is_container.hpp | 16 +
sandbox/itl/boost/itl/type_traits/is_discrete.hpp | 3
sandbox/itl/boost/itl/type_traits/is_element_container.hpp | 6
sandbox/itl/boost/itl/type_traits/is_interval.hpp | 65 ++++
sandbox/itl/boost/itl/type_traits/is_key_container_of.hpp | 49 +++
sandbox/itl/boost/itl/type_traits/is_numeric.hpp | 50 ++
sandbox/itl/boost/itl/type_traits/unon.hpp | 1
sandbox/itl/boost/itl/type_traits/value_size.hpp | 3
sandbox/itl/boost/validate/driver/collector_driver.hpp | 18
sandbox/itl/boost/validate/driver/itl_set_driver.hpp | 4
sandbox/itl/boost/validate/driver/map_order_driver.hpp | 12
sandbox/itl/boost/validate/driver/set_order_driver.hpp | 4
sandbox/itl/boost/validate/gentor/randomgentor.hpp | 131 +++++++++
sandbox/itl/boost/validate/validater/sorted_associative_back_validater.hpp | 8
sandbox/itl/boost/validate/validater/sorted_associative_validater.hpp | 3
sandbox/itl/libs/itl/test/Jamfile.v2 | 2
sandbox/itl/libs/itl/test/fastest_itl_interval_/fastest_itl_interval.cpp | 89 ++++++
sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp | 51 +++
sandbox/itl/libs/itl/test/test_itl_interval.hpp | 19 +
sandbox/itl/libs/itl/test/test_itl_interval_/test_itl_interval.cpp | 87 +++++
sandbox/itl/libs/itl/test/test_itl_interval_shared.hpp | 35 ++
sandbox/itl/libs/itl/test/test_type_lists.hpp | 30 ++
sandbox/itl/libs/itl/test/test_value_maker.hpp | 5
sandbox/itl/libs/validate/example/boostcon_abelian_monoids_/vc9_boostcon_abelian_monoids.vcproj | 6
sandbox/itl/libs/validate/example/boostcon_law_validater_/vc9_boostcon_law_validater.vcproj | 6
sandbox/itl/libs/validate/example/de_morgan_/vc9_de_morgan.vcproj | 6
sandbox/itl/libs/validate/example/labat_bit_collector_/vc9_labat_bit_collector.vcproj | 2
sandbox/itl/libs/validate/example/labat_collector_/vc9_labat_collector.vcproj | 2
sandbox/itl/libs/validate/example/labat_itl_morphic_/vc9_labat_itl_morphic.vcproj | 2
sandbox/itl/libs/validate/example/labat_itl_set_/vc9_labat_itl_set.vcproj | 2
sandbox/itl/libs/validate/example/labat_itv_bitset_/vc9_labat_itv_bitset.vcproj | 2
sandbox/itl/libs/validate/example/labat_map_copy_conformity_/vc9_labat_map_copy_conformity.vcproj | 2
sandbox/itl/libs/validate/example/labat_map_order_/vc9_labat_map_order.vcproj | 2
sandbox/itl/libs/validate/example/labat_set_copy_conformity_/vc9_labat_set_copy_conformity.vcproj | 2
sandbox/itl/libs/validate/example/labat_set_order_/vc9_labat_set_order.vcproj | 2
sandbox/itl/libs/validate/example/labat_signed_quantifier_/vc9_labat_signed_quantifier.vcproj | 2
sandbox/itl/libs/validate/example/labat_single_/vc9_labat_single.vcproj | 2
sandbox/itl/libs/validate/example/labat_sorted_assoc_bitset_/vc9_labat_sorted_assoc_bitset.vcproj | 2
sandbox/itl/libs/validate/example/labat_sorted_assoc_bitset_back_/vc9_labat_sorted_assoc_bitset_back.vcproj | 2
sandbox/itl/libs/validate/example/labat_sorted_assoc_map_/vc9_labat_sorted_assoc_map.vcproj | 2
sandbox/itl/libs/validate/example/labat_sorted_assoc_map_back_/vc9_labat_sorted_assoc_map_back.vcproj | 2
sandbox/itl/libs/validate/example/labat_sorted_assoc_set_/vc9_labat_sorted_assoc_set.vcproj | 2
sandbox/itl/libs/validate/example/labat_sorted_assoc_set_back_/vc9_labat_sorted_assoc_set_back.vcproj | 2
sandbox/itl/libs/validate/example/labat_unsigned_quantifier_/vc9_labat_unsigned_quantifier.vcproj | 2
sandbox/itl/libs/validate/example/labat_val_relations_/vc9_labat_val_relations.vcproj | 2
sandbox/itl/libs/validate/example/vc9_validate_examples.sln | 6
82 files changed, 1546 insertions(+), 459 deletions(-)
Modified: sandbox/itl/boost/itl/closed_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/closed_interval.hpp (original)
+++ sandbox/itl/boost/itl/closed_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -55,15 +55,15 @@
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
}
- domain_type lower()const{ return _lwb; }
- domain_type upper()const{ return _upb; }
+ DomainT lower()const{ return _lwb; }
+ DomainT upper()const{ return _upb; }
- domain_type first()const{ return _lwb; }
- domain_type last() const{ return _upb; }
+ DomainT first()const{ return _lwb; }
+ DomainT last() const{ return _upb; }
private:
- domain_type _lwb;
- domain_type _upb;
+ DomainT _lwb;
+ DomainT _upb;
};
@@ -80,20 +80,32 @@
//==============================================================================
-//= Type traits
+//=T closed_interval -> concept intervals
//==============================================================================
-template <class DomainT, ITL_COMPARE Compare>
-struct is_interval<closed_interval<DomainT,Compare> >
+template<class DomainT, ITL_COMPARE Compare>
+struct interval_traits< itl::closed_interval<DomainT, Compare> >
{
- typedef is_interval<closed_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
+ typedef DomainT domain_type;
+ typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
+ typedef itl::closed_interval<DomainT, Compare> interval_type;
+
+ static interval_type construct(const domain_type& lo, const domain_type& up)
+ {
+ return interval_type(lo, up);
+ }
+
+ static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
+ static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
};
+//==============================================================================
+//= Type traits
+//==============================================================================
template <class DomainT, ITL_COMPARE Compare>
-struct has_static_bounds<closed_interval<DomainT,Compare> >
+struct interval_bound_type< closed_interval<DomainT,Compare> >
{
- typedef has_static_bounds<closed_interval<DomainT,Compare> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
+ typedef interval_bound_type type;
+ BOOST_STATIC_CONSTANT(unsigned char, value = interval_bounds::static_closed);
};
template <class DomainT, ITL_COMPARE Compare>
Modified: sandbox/itl/boost/itl/concept/container.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/container.hpp (original)
+++ sandbox/itl/boost/itl/concept/container.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -53,15 +53,6 @@
return object.size();
}
-template<class Type>
-typename enable_if<mpl::and_< is_container<Type>
- , is_icl_container<Type> >
- , std::size_t>::type
-iterative_size(const Type& object)
-{
- return object.iterative_size();
-}
-
//==============================================================================
//= Swap
//==============================================================================
Modified: sandbox/itl/boost/itl/concept/element_associator.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/element_associator.hpp (original)
+++ sandbox/itl/boost/itl/concept/element_associator.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -16,14 +16,17 @@
namespace boost{ namespace itl
{
-//JODO Declaration forwarding for gcc-3.4.4
-template <class Type>
-typename enable_if<is_element_set<Type>, Type>::type&
-add(Type& object, const typename Type::element_type& operand);
//==============================================================================
//= Size
//==============================================================================
+template<class Type>
+typename enable_if<is_element_container<Type>, std::size_t>::type
+iterative_size(const Type& object)
+{
+ return object.size();
+}
+
template<class Type>
typename enable_if<is_associative_element_container<Type>, typename Type::size_type>::type
size(const Type& object)
@@ -48,7 +51,7 @@
/** Checks if a key is in the associative container */
template<class Type>
typename enable_if<is_associative_element_container<Type>, bool>::type
-within(const typename Type::domain_type& key, const Type& super)
+within(const typename Type::key_type& key, const Type& super)
{
return !(super.find(key) == super.end());
}
@@ -91,7 +94,7 @@
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_associative_element_container<Type>, bool>::type
-contains(const Type& super, const typename Type::domain_type& key)
+contains(const Type& super, const typename Type::key_type& key)
{
return itl::within(key, super);
}
@@ -148,26 +151,36 @@
);
}
+template<class LeftT, class RightT>
+typename enable_if<is_concept_equivalent<is_element_container,LeftT, RightT>,
+ int>::type
+inclusion_compare(const LeftT& left, const RightT& right)
+{
+ return Set::subset_compare(left, right,
+ left.begin(), left.end(),
+ right.begin(), right.end());
+}
+
//==============================================================================
//= Addition
//==============================================================================
template <class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type&
-operator += (Type& object, const typename Type::element_type& operand)
+operator += (Type& object, const typename Type::value_type& operand)
{
return itl::add(object, operand);
}
template <class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator + (Type object, const typename Type::element_type& operand)
+operator + (Type object, const typename Type::value_type& operand)
{
return object += operand;
}
template <class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator + (const typename Type::element_type& operand, Type object)
+operator + (const typename Type::value_type& operand, Type object)
{
return object += operand;
}
@@ -176,7 +189,14 @@
inline typename enable_if<is_associative_element_container<Type>, Type>::type
operator += (Type& object, const Type& operand)
{
- return Set::add(object, operand);
+ if(&object == &operand)
+ return object;
+
+ typename Type::iterator prior_ = object.end();
+ ITL_const_FORALL(typename Type, it_, operand)
+ prior_ = itl::add(object, prior_, *it_);
+
+ return object;
}
template <class Type>
@@ -189,21 +209,21 @@
//==============================================================================
template <class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type&
-operator |= (Type& object, const typename Type::element_type& operand)
+operator |= (Type& object, const typename Type::value_type& operand)
{
return itl::add(object, operand);
}
template <class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator | (Type object, const typename Type::element_type& operand)
+operator | (Type object, const typename Type::value_type& operand)
{
return object += operand;
}
template <class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator | (const typename Type::element_type& operand, Type object)
+operator | (const typename Type::value_type& operand, Type object)
{
return object += operand;
}
@@ -212,7 +232,8 @@
inline typename enable_if<is_associative_element_container<Type>, Type>::type&
operator |= (Type& object, const Type& operand)
{
- return Set::add(object, operand);
+ return object += operand;
+ //CL return Set::add(object, operand);
}
template <class Type>
@@ -232,7 +253,7 @@
template<class Type>
typename enable_if<is_associative_element_container<Type>,
std::pair<typename Type::iterator,bool> >::type
-insert(Type& object, const typename Type::element_type& operand)
+insert(Type& object, const typename Type::value_type& operand)
{
return object.insert(operand);
}
@@ -241,7 +262,7 @@
typename enable_if<is_associative_element_container<Type>,
typename Type::iterator>::type
insert(Type& object, typename Type::iterator prior,
- const typename Type::element_type& operand)
+ const typename Type::value_type& operand)
{
return object.insert(prior, operand);
}
@@ -268,7 +289,7 @@
//==============================================================================
template<class Type>
typename enable_if<is_associative_element_container<Type>, typename Type::size_type>::type
-erase(Type& object, const typename Type::domain_type& key_value)
+erase(Type& object, const typename Type::key_type& key_value)
{
typedef typename Type::size_type size_type;
typename Type::iterator it_ = object.find(key_value);
@@ -297,14 +318,14 @@
//==============================================================================
template <class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type&
-operator -= (Type& object, const typename Type::element_type& operand)
+operator -= (Type& object, const typename Type::value_type& operand)
{
return itl::subtract(object, operand);
}
template <class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator - (Type object, const typename Type::element_type& operand)
+operator - (Type object, const typename Type::value_type& operand)
{
return object -= operand;
}
@@ -336,7 +357,7 @@
template<class Type>
inline typename enable_if<is_associative_element_container<Type>, void>::type
add_intersection(Type& section, const Type& object,
- const typename Type::domain_type& operand)
+ const typename Type::key_type& operand)
{
typedef typename Type::const_iterator const_iterator;
const_iterator it_ = object.find(operand);
@@ -350,10 +371,10 @@
template<class Type>
inline typename enable_if<is_associative_element_container<Type>, void>::type
add_intersection(Type& section, const Type& object,
- const typename Type::key_object_type& operand)
+ const typename key_container_type_of<Type>::type& operand)
{
- typedef typename Type::key_object_type key_object_type;
- typedef typename key_object_type::const_iterator const_iterator;
+ typedef typename key_container_type_of<Type>::type key_container_type;
+ typedef typename key_container_type::const_iterator const_iterator;
const_iterator common_lwb_, common_upb_;
if(!Set::common_range(common_lwb_, common_upb_, operand, object))
return;
@@ -368,7 +389,7 @@
//------------------------------------------------------------------------------
template<class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type&
-operator &= (Type& object, const typename Type::domain_type& operand)
+operator &= (Type& object, const typename Type::key_type& operand)
{
Type section;
add_intersection(section, object, operand);
@@ -378,27 +399,28 @@
template<class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator & (Type object, const typename Type::domain_type& operand)
+operator & (Type object, const typename Type::key_type& operand)
{
return object &= operand;
}
template<class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator & (const typename Type::domain_type& operand, Type object)
+operator & (const typename Type::key_type& operand, Type object)
{
return object &= operand;
}
template<class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type&
-operator &= (Type& object, const typename Type::key_object_type& operand)
+operator &= (Type& object, const typename key_container_type_of<Type>::type& operand)
{
Type section;
add_intersection(section, object, operand);
object.swap(section);
return object;
}
+
//------------------------------------------------------------------------------
template<class Type, class CoType>
@@ -413,14 +435,14 @@
//==============================================================================
template<class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator ^ (Type object, const typename Type::element_type& operand)
+operator ^ (Type object, const typename Type::value_type& operand)
{
return itl::flip(object, operand);
}
template<class Type>
inline typename enable_if<is_associative_element_container<Type>, Type>::type
-operator ^ (const typename Type::element_type& operand, Type object)
+operator ^ (const typename Type::value_type& operand, Type object)
{
return itl::flip(object, operand);
}
Modified: sandbox/itl/boost/itl/concept/element_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/element_set.hpp (original)
+++ sandbox/itl/boost/itl/concept/element_set.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -24,7 +24,7 @@
value is added to the data value already found in the map. */
template <class Type>
typename enable_if<is_element_set<Type>, Type>::type&
-add(Type& object, const typename Type::element_type& operand)
+add(Type& object, const typename Type::value_type& operand)
{
object.insert(operand);
return object;
@@ -35,7 +35,7 @@
template <class Type>
typename enable_if<is_element_set<Type>, typename Type::iterator>::type
add(Type& object, typename Type::iterator prior,
- const typename Type::element_type& operand)
+ const typename Type::value_type& operand)
{
return object.insert(prior, operand);
}
@@ -47,7 +47,7 @@
subtraced from the data value stored in the map. */
template<class Type>
typename enable_if<is_element_set<Type>, Type>::type&
-subtract(Type& object, const typename Type::element_type& operand)
+subtract(Type& object, const typename Type::value_type& operand)
{
object.erase(operand);
return object;
@@ -86,7 +86,7 @@
//==============================================================================
template<class Type>
inline typename enable_if<is_element_set<Type>, Type>::type&
-flip(Type& object, const typename Type::element_type& operand)
+flip(Type& object, const typename Type::value_type& operand)
{
typedef typename Type::iterator iterator;
std::pair<iterator,bool> insertion = object.insert(operand);
Modified: sandbox/itl/boost/itl/concept/interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -8,6 +8,7 @@
#ifndef BOOST_ITL_CONCEPT_INTERVAL_HPP_JOFA_100323
#define BOOST_ITL_CONCEPT_INTERVAL_HPP_JOFA_100323
+#include <boost/assert.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/or.hpp>
@@ -21,11 +22,12 @@
#include <boost/itl/type_traits/succ_pred.hpp>
#include <boost/itl/type_traits/is_numeric.hpp>
#include <boost/itl/type_traits/is_discrete.hpp>
+#include <boost/itl/type_traits/is_continuous.hpp>
#include <boost/itl/type_traits/is_asymmetric_interval.hpp>
#include <boost/itl/type_traits/is_universal_interval.hpp>
#include <boost/itl/type_traits/is_discrete_interval.hpp>
#include <boost/itl/type_traits/is_continuous_interval.hpp>
-#include <boost/itl/type_traits/has_dynamic_bounds.hpp>
+
#include <boost/itl/concept/interval_bounds.hpp>
#include <boost/itl/interval_traits.hpp>
#include <boost/itl/dynamic_interval_traits.hpp>
@@ -58,8 +60,8 @@
domain_equal(const typename interval_traits<Type>::domain_type& left,
const typename interval_traits<Type>::domain_type& right)
{
- return !(typename interval_traits<Type>::domain_compare()(left, right))
- && !(typename interval_traits<Type>::domain_compare()(right, left));
+ typedef typename interval_traits<Type>::domain_compare domain_compare;
+ return !(domain_compare()(left, right)) && !(domain_compare()(right, left));
}
//==============================================================================
@@ -72,7 +74,7 @@
, is_discrete<typename interval_traits<Type>::domain_type> >
, Type
>::type
-construct(const typename interval_traits<Type>::domain_type& value)
+singleton(const typename interval_traits<Type>::domain_type& value)
{
//ASSERT: This always creates an interval with exactly one element
return interval_traits<Type>::construct(value, itl::succ(value));
@@ -85,37 +87,29 @@
, is_discrete<typename interval_traits<Type>::domain_type> >
, Type
>::type
-construct(const typename interval_traits<Type>::domain_type& value)
+singleton(const typename interval_traits<Type>::domain_type& value)
{
//ASSERT: This always creates an interval with exactly one element
- BOOST_ASSERT(given<is_numeric<Type>::value>
- ::then((std::numeric_limits<Type>::min)() < value));
+ typedef typename interval_traits<Type>::domain_type domain_type;
+ BOOST_ASSERT((numeric_minimum<domain_type, is_numeric<domain_type>::value >::is_less_than(value) ));
+
return interval_traits<Type>::construct(itl::pred(value), value);
}
template<class Type>
-typename enable_if
-<
- mpl::and_< is_static_open<Type>
- , is_discrete<typename interval_traits<Type>::domain_type> >
- , Type
->::type
-construct(const typename interval_traits<Type>::domain_type& value)
+typename enable_if<is_discrete_static_open<Type>, Type>::type
+singleton(const typename interval_traits<Type>::domain_type& value)
{
//ASSERT: This always creates an interval with exactly one element
- BOOST_ASSERT(given<is_numeric<Type>::value>
- ::then((std::numeric_limits<Type>::min)() < value));
+ typedef typename interval_traits<Type>::domain_type domain_type;
+ BOOST_ASSERT((numeric_minimum<domain_type, is_numeric<domain_type>::value >::is_less_than(value)));
+
return interval_traits<Type>::construct(itl::pred(value), itl::succ(value));
}
template<class Type>
-typename enable_if
-<
- mpl::and_< is_static_closed<Type>
- , is_discrete<typename interval_traits<Type>::domain_type> >
- , Type
->::type
-construct(const typename interval_traits<Type>::domain_type& value)
+typename enable_if<is_discrete_static_closed<Type>, Type>::type
+singleton(const typename interval_traits<Type>::domain_type& value)
{
//ASSERT: This always creates an interval with exactly one element
return interval_traits<Type>::construct(value, value);
@@ -123,7 +117,7 @@
template<class Type>
typename enable_if<has_dynamic_bounds<Type>, Type>::type
-construct(const typename interval_traits<Type>::domain_type& value)
+singleton(const typename interval_traits<Type>::domain_type& value)
{
return dynamic_interval_traits<Type>::construct(value, value, interval_bounds::closed());
}
@@ -140,9 +134,18 @@
return interval_traits<Type>::construct(low, up);
}
+template<class Type>
+typename enable_if<has_symmetric_bounds<Type>, Type>::type
+construct(const typename interval_traits<Type>::domain_type& low,
+ const typename interval_traits<Type>::domain_type& up,
+ interval_bounds bounds = interval_bounds::right_open()) //JODO URG 3rd param for dynamic only
+{
+ return interval_traits<Type>::construct(low, up);
+}
+
template<class Type>
-typename enable_if<is_dynamic_bounded<Type>, Type>::type
+typename enable_if<has_dynamic_bounds<Type>, Type>::type
construct(const typename interval_traits<Type>::domain_type& low,
const typename interval_traits<Type>::domain_type& up,
interval_bounds bounds = interval_bounds::right_open())
@@ -153,7 +156,7 @@
//- construct form bounded values ----------------------------------------------
template<class Type>
-typename enable_if<is_dynamic_bounded<Type>, Type>::type
+typename enable_if<has_dynamic_bounds<Type>, Type>::type
construct(const typename Type::bounded_domain_type& low,
const typename Type::bounded_domain_type& up)
{
@@ -162,15 +165,85 @@
template<class Type>
typename enable_if<is_interval<Type>, Type>::type
-span(const typename interval_traits<Type>::domain_type& lhs,
- const typename interval_traits<Type>::domain_type& rhs)
+span(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
+{
+ if(interval_traits<Type>::domain_compare(left,right))
+ return construct<Type>(left, right);
+ else
+ return construct<Type>(right, left);
+}
+
+
+//==============================================================================
+template<class Type>
+typename enable_if<is_static_rightopen<Type>, Type>::type
+hull(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
{
- if(interval_traits<Type>::domain_compare(lhs,rhs))
- return construct(lhs, rhs);
+ if(interval_traits<Type>::domain_compare(left,right))
+ return construct<Type>(left, succ(right));
else
- return construct(rhs, lhs);
+ return construct<Type>(right, succ(left));
}
+template<class Type>
+typename enable_if<is_static_leftopen<Type>, Type>::type
+hull(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
+{
+ typedef typename interval_traits<Type>::domain_type domain_type;
+ if(interval_traits<Type>::domain_compare(left,right))
+ {
+ BOOST_ASSERT((numeric_minimum<domain_type, is_numeric<domain_type>::value >::is_less_than(left) ));
+ return construct<Type>(pred(left), right);
+ }
+ else
+ {
+ BOOST_ASSERT((numeric_minimum<domain_type, is_numeric<domain_type>::value >::is_less_than(right) ));
+ return construct<Type>(pred(right), left);
+ }
+}
+
+template<class Type>
+typename enable_if<is_static_closed<Type>, Type>::type
+hull(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
+{
+ if(interval_traits<Type>::domain_compare(left,right))
+ return construct<Type>(left, right);
+ else
+ return construct<Type>(right, left);
+}
+
+template<class Type>
+typename enable_if<is_static_open<Type>, Type>::type
+hull(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
+{
+ typedef typename interval_traits<Type>::domain_type domain_type;
+ if(interval_traits<Type>::domain_compare(left,right))
+ {
+ BOOST_ASSERT((numeric_minimum<domain_type, is_numeric<domain_type>::value >::is_less_than(left) ));
+ return construct<Type>(pred(left), succ(right));
+ }
+ else
+ {
+ BOOST_ASSERT((numeric_minimum<domain_type, is_numeric<domain_type>::value >::is_less_than(right) ));
+ return construct<Type>(pred(right), succ(left));
+ }
+}
+
+template<class Type>
+typename enable_if<has_dynamic_bounds<Type>, Type>::type
+hull(const typename interval_traits<Type>::domain_type& left,
+ const typename interval_traits<Type>::domain_type& right)
+{
+ if(interval_traits<Type>::domain_compare(left,right))
+ return construct<Type>(left, right, interval_bounds::closed());
+ else
+ return construct<Type>(right, left, interval_bounds::closed());
+}
//==============================================================================
//= Selection
@@ -240,8 +313,9 @@
, typename interval_traits<Type>::domain_type>::type
last(const Type& object)
{
- BOOST_ASSERT(given<is_numeric<Type>::value>
- ::then((std::numeric_limits<Type>::min)() < upper(object)));
+ typedef typename interval_traits<Type>::domain_type domain_type;
+ BOOST_ASSERT((numeric_minimum<domain_type, is_numeric<domain_type>::value>
+ ::is_less_than(upper(object)) ));
return pred(upper(object));
}
@@ -250,35 +324,69 @@
typename interval_traits<Type>::domain_type>::type
last(const Type& object)
{
+ typedef typename interval_traits<Type>::domain_type domain_type;
+ BOOST_ASSERT((numeric_minimum<domain_type, is_numeric<domain_type>::value>
+ ::is_less_than_or(upper(object), is_right_closed(object.bounds())) ));
return is_right_closed(object.bounds()) ?
upper(object) :
pred(upper(object));
}
+//- last_next ------------------------------------------------------------------
+template<class Type>
+inline typename
+enable_if< mpl::and_< mpl::or_<is_static_leftopen<Type>, is_static_closed<Type> >
+ , is_discrete<typename interval_traits<Type>::domain_type> >
+ , typename interval_traits<Type>::domain_type>::type
+last_next(const Type& object)
+{
+ return succ(upper(object));
+}
+
+template<class Type>
+inline typename
+enable_if< mpl::and_< mpl::or_<is_static_rightopen<Type>, is_static_open<Type> >
+ , is_discrete<typename interval_traits<Type>::domain_type> >
+ , typename interval_traits<Type>::domain_type>::type
+last_next(const Type& object)
+{
+ typedef typename interval_traits<Type>::domain_type domain_type;
+ return upper(object); // NOTE: last_next is implemented to avoid calling pred(object)
+} // For unsigned integral types this may cause underflow.
+
+template<class Type>
+inline typename enable_if<is_discrete_interval<Type>,
+ typename interval_traits<Type>::domain_type>::type
+last_next(const Type& object)
+{
+ return is_right_closed(object.bounds()) ?
+ succ(upper(object)):
+ upper(object) ;
+}
+
//------------------------------------------------------------------------------
template<class Type>
-typename enable_if<is_dynamic_bounded<Type>,
+typename enable_if<has_dynamic_bounds<Type>,
typename Type::bounded_domain_type>::type
bounded_lower(const Type& object)
{
return typename
- Type::bounded_domain_type(lower(object),
- object.bounds().left());
+ Type::bounded_domain_type(lower(object), object.bounds().left());
}
template<class Type>
-typename enable_if<is_dynamic_bounded<Type>,
+typename enable_if<has_dynamic_bounds<Type>,
typename Type::bounded_domain_type>::type
reverse_bounded_lower(const Type& object)
{
return typename
Type::bounded_domain_type(lower(object),
- object.bounds().reverse_left());
+ object.bounds().reverse_left());
}
template<class Type>
-typename enable_if<is_dynamic_bounded<Type>,
+typename enable_if<has_dynamic_bounds<Type>,
typename Type::bounded_domain_type>::type
bounded_upper(const Type& object)
{
@@ -288,13 +396,13 @@
}
template<class Type>
-typename enable_if<is_dynamic_bounded<Type>,
+typename enable_if<has_dynamic_bounds<Type>,
typename Type::bounded_domain_type>::type
reverse_bounded_upper(const Type& object)
{
return typename
Type::bounded_domain_type(upper(object),
- object.bounds().reverse_right());
+ object.bounds().reverse_right());
}
@@ -311,6 +419,21 @@
}
template<class Type>
+typename boost::enable_if<is_static_closed<Type>, bool>::type
+is_empty(const Type& object)
+{
+ return domain_less<Type>(upper(object), lower(object));
+}
+
+template<class Type>
+typename boost::enable_if<is_static_open<Type>, bool>::type
+is_empty(const Type& object)
+{
+ return domain_less_equal<Type>(upper(object), succ(lower(object)));
+}
+
+
+template<class Type>
typename boost::enable_if<is_universal_interval<Type>, bool>::type
is_empty(const Type& object)
{
@@ -349,8 +472,9 @@
template<class Type>
typename boost::enable_if<is_interval<Type>, bool>::type
contains(const Type& super, const typename interval_traits<Type>::domain_type& element)
-{
- return contains(super,Type(element));
+{
+ return domain_less_equal<Type>(super.lower(), element)
+ && domain_less_equal<Type>(element, super.upper());
}
//- within ---------------------------------------------------------------------
@@ -369,39 +493,98 @@
/** Maximal element of <tt>left</tt> is less than the minimal element of
<tt>right</tt> */
template<class Type>
-typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
+inline typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
- return domain_less_equal<Type>(upper(left), lower(right));
+ return itl::is_empty(left) || itl::is_empty(right)
+ || domain_less_equal<Type>(upper(left), lower(right));
}
template<class Type>
-typename boost::enable_if<is_universal_interval<Type>, bool>::type
+inline typename boost::enable_if<is_universal_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
return left.exclusive_less(right);
}
+template<class Type>
+inline typename boost::enable_if<is_discrete_interval<Type>, bool>::type
+exclusive_less(const Type& left, const Type& right)
+{
+ return itl::is_empty(left) || itl::is_empty(right)
+ || domain_less<Type>(last(left), first(right));
+}
template<class Type>
-typename boost::enable_if<is_discrete_interval<Type>, bool>::type
+inline typename boost::
+enable_if<has_symmetric_bounds<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
- return domain_less<Type>(last(left), first(right));
+ return itl::is_empty(left) || itl::is_empty(right)
+ || domain_less<Type>(last(left), first(right));
}
template<class Type>
-typename boost::enable_if<is_continuous_interval<Type>, bool>::type
+inline typename boost::enable_if<is_continuous_interval<Type>, bool>::type
exclusive_less(const Type& left, const Type& right)
{
- return domain_less<Type>(left.upper(), right.lower())
+ return itl::is_empty(left) || itl::is_empty(right)
+ || domain_less<Type>(left.upper(), right.lower())
|| ( domain_equal<Type>(left.upper(), right.lower())
&& inner_bounds(left,right) != interval_bounds::open() );
}
+
+namespace non_empty
+{
+
+ template<class Type>
+ inline typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
+ exclusive_less(const Type& left, const Type& right)
+ {
+ BOOST_ASSERT(!(itl::is_empty(left) || itl::is_empty(right)));
+ return domain_less_equal<Type>(upper(left), lower(right));
+ }
+
+ template<class Type>
+ inline typename boost::enable_if<is_universal_interval<Type>, bool>::type
+ exclusive_less(const Type& left, const Type& right)
+ {
+ return left.exclusive_less(right);
+ }
+
+ template<class Type>
+ inline typename boost::enable_if<is_discrete_interval<Type>, bool>::type
+ exclusive_less(const Type& left, const Type& right)
+ {
+ BOOST_ASSERT(!(itl::is_empty(left) || itl::is_empty(right)));
+ return domain_less<Type>(last(left), first(right));
+ }
+
+ template<class Type>
+ inline typename boost::
+ enable_if<has_symmetric_bounds<Type>, bool>::type
+ exclusive_less(const Type& left, const Type& right)
+ {
+ BOOST_ASSERT(!(itl::is_empty(left) || itl::is_empty(right)));
+ return domain_less<Type>(last(left), first(right));
+ }
+
+ template<class Type>
+ inline typename boost::enable_if<is_continuous_interval<Type>, bool>::type
+ exclusive_less(const Type& left, const Type& right)
+ {
+ BOOST_ASSERT(!(itl::is_empty(left) || itl::is_empty(right)));
+ return domain_less <Type>(left.upper(), right.lower())
+ || ( domain_equal<Type>(left.upper(), right.lower())
+ && inner_bounds(left,right) != interval_bounds::open() );
+ }
+
+} //namespace non_empty
+
//------------------------------------------------------------------------------
template<class Type>
-typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
+typename boost::enable_if<has_static_bounds<Type>, bool>::type
lower_less(const Type& left, const Type& right)
{
return domain_less<Type>(left.lower(), right.lower());
@@ -434,7 +617,7 @@
//------------------------------------------------------------------------------
template<class Type>
-typename boost::enable_if<is_asymmetric_interval<Type>, bool>::type
+typename boost::enable_if<has_static_bounds<Type>, bool>::type
upper_less(const Type& left, const Type& right)
{
return domain_less<Type>(left.upper(), right.upper());
@@ -517,6 +700,13 @@
}
template<class Type>
+typename boost::enable_if<has_symmetric_bounds<Type>, bool>::type
+lower_equal(const Type& left, const Type& right)
+{
+ return domain_equal<Type>(first(left), first(right));
+}
+
+template<class Type>
typename boost::enable_if<is_discrete_interval<Type>, bool>::type
lower_equal(const Type& left, const Type& right)
{
@@ -548,6 +738,13 @@
}
template<class Type>
+typename boost::enable_if<has_symmetric_bounds<Type>, bool>::type
+upper_equal(const Type& left, const Type& right)
+{
+ return domain_equal<Type>(last(left), last(right));
+}
+
+template<class Type>
typename boost::enable_if<is_discrete_interval<Type>, bool>::type
upper_equal(const Type& left, const Type& right)
{
@@ -581,22 +778,29 @@
//- operator == ----------------------------------------------------------------
template<class Type>
typename boost::enable_if<is_interval<Type>, bool>::type
-operator == (const Type& lhs, const Type& rhs)
+operator == (const Type& left, const Type& right)
{
- return (itl::is_empty(lhs) && itl::is_empty(rhs))
- || (lower_equal(lhs,rhs) && upper_equal(lhs,rhs));
+ return (itl::is_empty(left) && itl::is_empty(right))
+ || (lower_equal(left,right) && upper_equal(left,right));
+}
+
+template<class Type>
+typename boost::enable_if<is_interval<Type>, bool>::type
+operator != (const Type& left, const Type& right)
+{
+ return !(left == right);
}
//- operator < -----------------------------------------------------------------
template<class Type>
typename boost::enable_if<is_interval<Type>, bool>::type
-operator < (const Type& lhs, const Type& rhs)
+operator < (const Type& left, const Type& right)
{
- if(itl::is_empty(lhs))
- return !itl::is_empty(rhs);
+ if(itl::is_empty(left))
+ return !itl::is_empty(right);
else
- return lower_less(lhs,rhs)
- || (lower_equal(lhs,rhs) && upper_less(lhs,rhs));
+ return lower_less(left,right)
+ || (lower_equal(left,right) && upper_less(left,right));
}
@@ -610,6 +814,13 @@
}
template<class Type>
+typename boost::enable_if<has_symmetric_bounds<Type>, bool>::type
+touches(const Type& left, const Type& right)
+{
+ return domain_equal<Type>(last_next(left), first(right));
+}
+
+template<class Type>
typename boost::enable_if<is_universal_interval<Type>, bool>::type
touches(const Type& left, const Type& right)
{
@@ -658,10 +869,10 @@
cardinality(const Type& object)
{
typedef typename size_type_of<interval_traits<Type> >::type SizeT;
- return (last(object) + itl::unon<SizeT>::value()) - first(object);
+ return itl::is_empty(object) ? neutron<SizeT>::value()
+ : last_next(object) - first(object);
}
-
template<class Type>
typename boost::enable_if<is_continuous_asymmetric<Type>,
typename size_type_of<interval_traits<Type> >::type>::type
@@ -680,10 +891,19 @@
cardinality(const Type& object)
{
typedef typename size_type_of<interval_traits<Type> >::type SizeT;
- return (last(object) + itl::unon<SizeT>::value()) - first(object);
+ return itl::is_empty(object) ? neutron<SizeT>::value()
+ : last_next(object) - first(object);
}
-
+template<class Type>
+typename boost::enable_if<has_symmetric_bounds<Type>,
+ typename size_type_of<interval_traits<Type> >::type>::type
+cardinality(const Type& object)
+{
+ typedef typename size_type_of<interval_traits<Type> >::type SizeT;
+ return itl::is_empty(object) ? neutron<SizeT>::value()
+ : last_next(object) - first(object);
+}
@@ -702,7 +922,9 @@
typename difference_type_of<interval_traits<Type> >::type>::type
length(const Type& object)
{
- return upper(object) - lower(object);
+ typedef typename difference_type_of<interval_traits<Type> >::type DiffT;
+ return itl::is_empty(object) ? neutron<DiffT>::value()
+ : upper(object) - lower(object);
}
template<class Type>
@@ -711,8 +933,8 @@
length(const Type& object)
{
typedef typename difference_type_of<interval_traits<Type> >::type DiffT;
- return (last(object) + itl::unon<DiffT>::value())
- - first(object);
+ return itl::is_empty(object) ? neutron<DiffT>::value()
+ : last_next(object) - first(object);
}
template<class Type>
@@ -720,17 +942,19 @@
typename difference_type_of<interval_traits<Type> >::type>::type
length(const Type& object)
{
- return upper(object) - lower(object);
+ typedef typename difference_type_of<interval_traits<Type> >::type DiffT;
+ return itl::is_empty(object) ? neutron<DiffT>::value()
+ : upper(object) - lower(object);
}
template<class Type>
-inline typename boost::enable_if<is_discrete_asymmetric<Type>,
+inline typename boost::enable_if<is_discrete_static<Type>,
typename difference_type_of<interval_traits<Type> >::type>::type
length(const Type& object)
{
typedef typename difference_type_of<interval_traits<Type> >::type DiffT;
- return (last(object) + itl::unon<DiffT>::value())
- - first(object);
+ return itl::is_empty(object) ? neutron<DiffT>::value()
+ : last_next(object) - first(object);
}
//==============================================================================
@@ -739,9 +963,12 @@
//- hull -----------------------------------------------------------------------
/** \c hull returns the smallest interval containing \c left and \c right. */
template<class Type>
-typename boost::enable_if<is_asymmetric_interval<Type>, Type>::type
+//CL typename boost::enable_if<is_asymmetric_interval<Type>, Type>::type
+typename boost::enable_if<has_static_bounds<Type>, Type>::type
hull(Type left, const Type& right)
{
+ typedef typename interval_traits<Type>::domain_compare domain_compare;
+
if(itl::is_empty(right))
return left;
else if(itl::is_empty(left))
@@ -750,8 +977,8 @@
return
construct<Type>
(
- (std::min)(lower(left), lower(right), interval_traits<Type>::domain_compare()),
- (std::max)(upper(left), upper(right), interval_traits<Type>::domain_compare())
+ (std::min)(lower(left), lower(right), domain_compare()),
+ (std::max)(upper(left), upper(right), domain_compare())
);
}
@@ -802,6 +1029,26 @@
}
template<class Type>
+typename boost::enable_if<is_static_closed<Type>, Type>::type
+left_subtract(Type right, const Type& left_minuend)
+{
+ if(exclusive_less(left_minuend, right))
+ return right;
+
+ return construct<Type>(succ(upper(left_minuend)), upper(right));
+}
+
+template<class Type>
+typename boost::enable_if<is_static_open<Type>, Type>::type
+left_subtract(Type right, const Type& left_minuend)
+{
+ if(exclusive_less(left_minuend, right))
+ return right;
+
+ return construct<Type>(pred(upper(left_minuend)), upper(right));
+}
+
+template<class Type>
typename boost::enable_if<is_universal_interval<Type>, Type>::type
left_subtract(Type right, const Type& left_minuend)
{
@@ -839,6 +1086,28 @@
}
template<class Type>
+typename boost::enable_if<is_static_closed<Type>, Type>::type
+right_subtract(Type left, const Type& right_minuend)
+{
+ if(exclusive_less(left, right_minuend))
+ return left;
+ else if(lower_less_equal(right_minuend, left))
+ return neutron<Type>::value();
+
+ return construct<Type>(lower(left), pred(lower(right_minuend)));
+}
+
+template<class Type>
+typename boost::enable_if<is_static_open<Type>, Type>::type
+right_subtract(Type left, const Type& right_minuend)
+{
+ if(exclusive_less(left, right_minuend))
+ return left;
+
+ return construct<Type>(lower(left), succ(lower(right_minuend)));
+}
+
+template<class Type>
typename boost::enable_if<is_universal_interval<Type>, Type>::type
right_subtract(Type left, const Type& right_minuend)
{
@@ -865,14 +1134,33 @@
typename boost::enable_if<is_asymmetric_interval<Type>, Type>::type
operator & (Type left, const Type& right)
{
+ typedef typename interval_traits<Type>::domain_compare domain_compare;
+
+ if(itl::is_empty(left) || itl::is_empty(right))
+ return neutron<Type>::value();
+ else
+ return
+ construct<Type>
+ (
+ (std::max)(itl::lower(left), itl::lower(right), domain_compare()),
+ (std::min)(itl::upper(left), itl::upper(right), domain_compare())
+ );
+}
+
+template<class Type>
+typename boost::enable_if<has_symmetric_bounds<Type>, Type>::type
+operator & (Type left, const Type& right)
+{
+ typedef typename interval_traits<Type>::domain_compare domain_compare;
+
if(itl::is_empty(left) || itl::is_empty(right))
return neutron<Type>::value();
else
return
construct<Type>
(
- (std::max)(itl::lower(left), itl::lower(right), interval_traits<Type>::domain_compare()),
- (std::min)(itl::upper(left), itl::upper(right), interval_traits<Type>::domain_compare())
+ (std::max)(itl::lower(left), itl::lower(right), domain_compare()),
+ (std::min)(itl::upper(left), itl::upper(right), domain_compare())
);
}
@@ -903,7 +1191,8 @@
typename boost::enable_if<is_interval<Type>, bool>::type
intersects(const Type& left, const Type& right)
{
- return !(exclusive_less(left,right) || exclusive_less(right,left));
+ return !( itl::is_empty(left) || itl::is_empty(right)
+ || exclusive_less(left,right) || exclusive_less(right,left));
}
//- disjoint -------------------------------------------------------------------
@@ -911,17 +1200,125 @@
typename boost::enable_if<is_interval<Type>, bool>::type
disjoint(const Type& left, const Type& right)
{
- return exclusive_less(left,right) || exclusive_less(right,left);
+ return itl::is_empty(left) || itl::is_empty(right)
+ || exclusive_less(left,right) || exclusive_less(right,left);
}
-//------------------------------------------------------------------------------
+//==============================================================================
+//= Complement
+//==============================================================================
+
+template<class Type>
+typename boost::enable_if<is_asymmetric_interval<Type>, Type>::type
+inner_complement(const Type& left, const Type& right)
+{
+ if(itl::is_empty(left) || itl::is_empty(right))
+ return neutron<Type>::value();
+ else if(exclusive_less(left, right))
+ return construct<Type>(upper(left), lower(right));
+ else if(exclusive_less(right, left))
+ return construct<Type>(upper(right), lower(left));
+ else
+ return neutron<Type>::value();
+}
+
+template<class Type>
+typename boost::enable_if<is_discrete_static_closed<Type>, Type>::type
+inner_complement(const Type& left, const Type& right)
+{
+ if(itl::is_empty(left) || itl::is_empty(right))
+ return neutron<Type>::value();
+ else if(exclusive_less(left, right))
+ return construct<Type>(succ(upper(left)), pred(lower(right)));
+ else if(exclusive_less(right, left))
+ return construct<Type>(succ(upper(right)), pred(lower(left)));
+ else
+ return neutron<Type>::value();
+}
+
+template<class Type>
+typename boost::enable_if<is_discrete_static_open<Type>, Type>::type
+inner_complement(const Type& left, const Type& right)
+{
+ if(itl::is_empty(left) || itl::is_empty(right))
+ return neutron<Type>::value();
+ else if(exclusive_less(left, right))
+ return construct<Type>(last(left), first(right));
+ else if(exclusive_less(right, left))
+ return construct<Type>(last(right), first(left));
+ else
+ return neutron<Type>::value();
+}
+
+template<class Type>
+typename boost::enable_if<has_dynamic_bounds<Type>, Type>::type
+inner_complement(const Type& left, const Type& right)
+{
+ if(itl::is_empty(left) || itl::is_empty(right))
+ return neutron<Type>::value();
+ else if(exclusive_less(left, right))
+ return right_subtract(left_subtract(hull(left, right), left), right);
+ else if(exclusive_less(right, left))
+ return right_subtract(left_subtract(hull(right, left), right), left);
+ else
+ return neutron<Type>::value();
+}
+
+//==============================================================================
+//= Distance
+//==============================================================================
+template<class Type>
+typename boost::
+enable_if< mpl::and_< is_interval<Type>
+ , has_difference<typename interval_traits<Type>::domain_type>
+ , is_discrete<typename interval_traits<Type>::domain_type>
+ >
+ , typename difference_type_of<interval_traits<Type> >::type>::type
+distance(const Type& x1, const Type& x2)
+{
+ typedef typename difference_type_of<interval_traits<Type> >::type difference_type;
+
+ if(itl::is_empty(x1) || itl::is_empty(x2))
+ return itl::neutron<difference_type>::value();
+ else if(domain_less<Type>(last(x1), first(x2)))
+ return static_cast<difference_type>(pred(first(x2) - last(x1)));
+ else if(domain_less<Type>(last(x2), first(x1)))
+ return static_cast<difference_type>(pred(first(x1) - last(x2)));
+ else
+ return itl::neutron<difference_type>::value();
+}
+
+template<class Type>
+typename boost::
+enable_if< mpl::and_< is_interval<Type>
+ , has_difference<typename interval_traits<Type>::domain_type>
+ , is_continuous<typename interval_traits<Type>::domain_type>
+ >
+ , typename difference_type_of<interval_traits<Type> >::type>::type
+distance(const Type& x1, const Type& x2)
+{
+ typedef typename difference_type_of<interval_traits<Type> >::type DiffT;
+
+ if(itl::is_empty(x1) || itl::is_empty(x2))
+ return itl::neutron<DiffT>::value();
+ else if(domain_less<Type>(upper(x1), lower(x2)))
+ return x2.lower() - x1.upper();
+ else if(domain_less<Type>(upper(x2), lower(x1)))
+ return lower(x1) - upper(x2);
+ else
+ return itl::neutron<DiffT>::value();
+}
+
+//==============================================================================
+//= Streaming
+//==============================================================================
template<class CharType, class CharTraits, class Type>
typename boost::enable_if<is_interval<Type>,
std::basic_ostream<CharType, CharTraits> >::type&
operator << (std::basic_ostream<CharType, CharTraits> &stream, Type const& object)
{
if(boost::itl::is_empty(object))
- return stream << "[)";
+ return stream << "[)"; //JODO
else
return stream << "[" << interval_traits<Type>::lower(object) << ","
<< interval_traits<Type>::upper(object) << ")";
Modified: sandbox/itl/boost/itl/concept/interval/base.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval/base.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval/base.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -19,7 +19,7 @@
{
typedef typename Type::interval_type interval_type;
typedef typename Type::segment_type segment_type;
- return segment_type(itl::construct<interval_type>(element.key), element.data);
+ return segment_type(itl::singleton<interval_type>(element.key), element.data);
}
namespace segmental
Modified: sandbox/itl/boost/itl/concept/interval_associator.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval_associator.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval_associator.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -11,6 +11,11 @@
#include <boost/itl/type_traits/domain_type_of.hpp>
#include <boost/itl/type_traits/interval_type_of.hpp>
#include <boost/itl/type_traits/is_combinable.hpp>
+#include <boost/itl/detail/set_algo.hpp>
+#include <boost/itl/detail/map_algo.hpp>
+#include <boost/itl/detail/interval_set_algo.hpp>
+#include <boost/itl/detail/interval_map_algo.hpp>
+#include <boost/itl/concept/interval.hpp>
namespace boost{ namespace itl
{
@@ -88,15 +93,16 @@
right.begin(), right.end());
}
-template<class LeftT, class RightT>
-typename enable_if<is_concept_equivalent<is_element_container,LeftT, RightT>,
- int>::type
-inclusion_compare(const LeftT& left, const RightT& right)
-{
- return Set::subset_compare(left, right,
- left.begin(), left.end(),
- right.begin(), right.end());
-}
+//CL
+//template<class LeftT, class RightT>
+//typename enable_if<is_concept_equivalent<is_element_container,LeftT, RightT>,
+// int>::type
+//inclusion_compare(const LeftT& left, const RightT& right)
+//{
+// return Set::subset_compare(left, right,
+// left.begin(), left.end(),
+// right.begin(), right.end());
+//}
//------------------------------------------------------------------------------
template<class LeftT, class RightT>
@@ -110,6 +116,13 @@
//==============================================================================
//= Size<IntervalSet|IntervalMap>
//==============================================================================
+template<class Type>
+typename enable_if<is_interval_container<Type>, std::size_t>::type
+iterative_size(const Type& object)
+{
+ return object.iterative_size();
+}
+
template<class Type>
typename enable_if
< mpl::and_< is_interval_container<Type>
Modified: sandbox/itl/boost/itl/concept/interval_bounds.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval_bounds.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval_bounds.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -9,7 +9,7 @@
#define BOOST_ITL_CONCEPT_INTERVAL_BOUNDS_HPP_JOFA_100927
#include <boost/itl/interval_bounds.hpp>
-#include <boost/itl/type_traits/has_dynamic_bounds.hpp>
+//CL #include <boost/itl/type_traits/has_dynamic_bounds.hpp>
namespace boost{namespace itl
{
Modified: sandbox/itl/boost/itl/concept/interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval_map.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval_map.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -15,10 +15,16 @@
#include <boost/itl/concept/map_value.hpp>
#include <boost/itl/detail/interval_map_algo.hpp>
+#include <boost/itl/concept/interval.hpp>
namespace boost{ namespace itl
{
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type&
+join(Type&);
+
+
//==============================================================================
//= Containedness<IntervalMap>
//==============================================================================
@@ -204,7 +210,7 @@
erase(Type& object, const typename Type::domain_type& operand)
{
typedef typename Type::interval_type interval_type;
- return itl::erase(object, itl::construct<interval_type>(operand));
+ return itl::erase(object, itl::singleton<interval_type>(operand));
}
//------------------------------------------------------------------------------
Modified: sandbox/itl/boost/itl/concept/interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval_set.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval_set.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -9,7 +9,9 @@
#define BOOST_ITL_CONCEPT_INTERVAL_SET_HPP_JOFA_100920
#include <boost/itl/type_traits/is_combinable.hpp>
-
+#include <boost/itl/detail/set_algo.hpp>
+#include <boost/itl/detail/interval_set_algo.hpp>
+#include <boost/itl/concept/interval.hpp>
namespace boost{ namespace itl
{
@@ -73,7 +75,7 @@
add(Type& object, const typename Type::element_type& operand)
{
typedef typename Type::segment_type segment_type;
- return itl::add(object, itl::construct<segment_type>(operand));
+ return itl::add(object, itl::singleton<segment_type>(operand));
}
//------------------------------------------------------------------------------
@@ -119,44 +121,44 @@
}
//==============================================================================
-//= Erasure<IntervalSet>
+//= Subtraction<IntervalSet>
//==============================================================================
//------------------------------------------------------------------------------
-//- T& erase(T&, c P&) T:{S} P:{e i} fragment_types
+//- T& subtract(T&, c P&) T:{S} P:{e i} fragment_type
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_set<Type>, Type>::type&
-erase(Type& object, const typename Type::segment_type& minuend)
+subtract(Type& object, const typename Type::segment_type& operand)
{
- return itl::subtract(object, minuend);
+ return object.subtract(operand);
}
template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-erase(Type& object, const typename Type::element_type& minuend)
+inline typename enable_if<is_interval_set<Type>, Type>::type&
+subtract(Type& object, const typename Type::element_type& operand)
{
- return itl::subtract(object, minuend);
+ typedef typename Type::segment_type segment_type;
+ return itl::subtract(object, itl::singleton<segment_type>(operand));
}
//==============================================================================
-//= Subtraction<IntervalSet>
+//= Erasure<IntervalSet>
//==============================================================================
//------------------------------------------------------------------------------
-//- T& subtract(T&, c P&) T:{S} P:{e i} fragment_type
+//- T& erase(T&, c P&) T:{S} P:{e i} fragment_types
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_set<Type>, Type>::type&
-subtract(Type& object, const typename Type::segment_type& operand)
+erase(Type& object, const typename Type::segment_type& minuend)
{
- return object.subtract(operand);
+ return itl::subtract(object, minuend);
}
template<class Type>
-inline typename enable_if<is_interval_set<Type>, Type>::type&
-subtract(Type& object, const typename Type::element_type& operand)
+typename enable_if<is_interval_set<Type>, Type>::type&
+erase(Type& object, const typename Type::element_type& minuend)
{
- typedef typename Type::segment_type segment_type;
- return itl::subtract(object, itl::construct<segment_type>(operand));
+ return itl::subtract(object, minuend);
}
//==============================================================================
Modified: sandbox/itl/boost/itl/continuous_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/continuous_interval.hpp (original)
+++ sandbox/itl/boost/itl/continuous_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -12,6 +12,7 @@
#include <boost/static_assert.hpp>
#include <boost/concept/assert.hpp>
#include <boost/itl/detail/concept_check.hpp>
+#include <boost/itl/concept/container.hpp>
#include <boost/itl/type_traits/value_size.hpp>
#include <boost/itl/type_traits/type_to_string.hpp>
#include <boost/itl/type_traits/is_continuous.hpp>
Modified: sandbox/itl/boost/itl/detail/associated_value.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/associated_value.hpp (original)
+++ sandbox/itl/boost/itl/detail/associated_value.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -17,7 +17,7 @@
{
template<class Type, class CoType>
-typename enable_if< mpl::and_< is_domain_compare_equal<Type,CoType>
+typename enable_if< mpl::and_< is_key_compare_equal<Type,CoType>
, mpl::and_<is_map<Type>, is_map<CoType> > >,
bool>::type
co_equal(typename Type::const_iterator left_, typename CoType::const_iterator right_,
@@ -27,7 +27,7 @@
}
template<class Type, class CoType>
-typename enable_if< mpl::and_< is_domain_compare_equal<Type,CoType>
+typename enable_if< mpl::and_< is_key_compare_equal<Type,CoType>
, mpl::not_<mpl::and_<is_map<Type>, is_map<CoType> > > >,
bool>::type
co_equal(typename Type::const_iterator, typename CoType::const_iterator,
Modified: sandbox/itl/boost/itl/detail/design_config.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/design_config.hpp (original)
+++ sandbox/itl/boost/itl/detail/design_config.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -151,7 +151,7 @@
//JODO find proper solution here
#ifdef ITL_NEW_INTERVAL_IMPL
# ifdef ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS
-# define ITL_discrt_INTERVAL_DEF itl::rightopen_interval
+# define ITL_discrt_INTERVAL_DEF itl::closed_interval
# define ITL_contin_INTERVAL_DEF itl::rightopen_interval
# else
# define ITL_discrt_INTERVAL_DEF itl::discrete_interval
Modified: sandbox/itl/boost/itl/detail/element_iterator.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/element_iterator.hpp (original)
+++ sandbox/itl/boost/itl/detail/element_iterator.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -105,7 +105,7 @@
{
typedef ITL_INTERVAL_TYPE(Interval,DomainT,Compare) segment_type;
typedef segment_type interval_type;
- typedef typename interval_type::domain_type domain_type;
+ typedef typename interval_traits<interval_type>::domain_type domain_type;
typedef domain_type type;
typedef domain_type codomain_type;
typedef domain_type transit_type;
@@ -116,7 +116,7 @@
{
typedef std::pair<ITL_INTERVAL_TYPE(Interval,DomainT,Compare), CodomainT> segment_type;
typedef ITL_INTERVAL_TYPE(Interval,DomainT,Compare) interval_type;
- typedef typename interval_type::domain_type domain_type;
+ typedef typename interval_traits<interval_type>::domain_type domain_type;
typedef CodomainT codomain_type;
typedef std::pair<domain_type, codomain_type> type;
typedef mapped_reference<domain_type, codomain_type> transit_type;
@@ -192,7 +192,7 @@
typedef segment_adapter type;
typedef ITL_INTERVAL_TYPE(Interval,DomainT,Compare) segment_type;
typedef segment_type interval_type;
- typedef typename interval_type::domain_type domain_type;
+ typedef typename interval_traits<interval_type>::domain_type domain_type;
typedef domain_type codomain_type;
typedef domain_type element_type;
typedef domain_type& transit_type;
@@ -217,7 +217,7 @@
{
typedef segment_adapter type;
typedef ITL_INTERVAL_TYPE(Interval,DomainT,Compare) interval_type;
- typedef typename interval_type::domain_type domain_type;
+ typedef typename interval_traits<interval_type>::domain_type domain_type;
typedef CodomainT codomain_type;
typedef std::pair<domain_type, codomain_type> element_type;
typedef mapped_reference<domain_type, CodomainT> transit_type;
Modified: sandbox/itl/boost/itl/detail/exclusive_less_than.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/exclusive_less_than.hpp (original)
+++ sandbox/itl/boost/itl/detail/exclusive_less_than.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -20,7 +20,7 @@
/** Operator <tt>operator()</tt> implements a strict weak ordering on intervals. */
bool operator()(const IntervalT& left, const IntervalT& right)const
{
- return itl::exclusive_less(left, right);
+ return itl::non_empty::exclusive_less(left, right);
}
};
Modified: sandbox/itl/boost/itl/detail/interval_set_algo.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/interval_set_algo.hpp (original)
+++ sandbox/itl/boost/itl/detail/interval_set_algo.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -235,7 +235,7 @@
{
typedef typename Type::interval_type interval_type;
interval_type right_interval = key_value<Type>(right_);
- ((typename Type::base_type&)object).erase(right_); //JODO
+ object.erase(right_);
const_cast<interval_type&>(key_value<Type>(left_))
= hull(key_value<Type>(left_), right_interval);
}
Modified: sandbox/itl/boost/itl/detail/set_algo.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/set_algo.hpp (original)
+++ sandbox/itl/boost/itl/detail/set_algo.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -63,36 +63,37 @@
return true;
}
-template<class ObjectT>
-ObjectT& add(ObjectT& result, const ObjectT& x2)
-{
- if(&result == &x2)
- return result;
-
- typedef typename ObjectT::const_iterator Object_const_iterator;
- typename ObjectT::iterator prior_ = result.end();
- for(Object_const_iterator x2_ = x2.begin(); x2_ != x2.end(); x2_++)
- prior_ = add(result, prior_, *x2_);
-
- return result;
-}
-
-
-template<class ObjectT, class CoObjectT>
-ObjectT& subtract(ObjectT& result, const CoObjectT& x2)
-{
- typename CoObjectT::const_iterator common_lwb_, common_upb_;
- if(!common_range(common_lwb_, common_upb_, x2, result))
- return result;
-
- typename CoObjectT::const_iterator x2_ = common_lwb_;
- typename ObjectT::iterator common_;
-
- while(x2_ != common_upb_)
- result.subtract(*x2_++);
-
- return result;
-}
+//CL . . .
+//template<class ObjectT>
+//ObjectT& add(ObjectT& result, const ObjectT& x2)
+//{
+// if(&result == &x2)
+// return result;
+//
+// typedef typename ObjectT::const_iterator Object_const_iterator;
+// typename ObjectT::iterator prior_ = result.end();
+// for(Object_const_iterator x2_ = x2.begin(); x2_ != x2.end(); x2_++)
+// prior_ = itl::add(result, prior_, *x2_);
+//
+// return result;
+//}
+//
+//
+//template<class ObjectT, class CoObjectT>
+//ObjectT& subtract(ObjectT& result, const CoObjectT& x2)
+//{
+// typename CoObjectT::const_iterator common_lwb_, common_upb_;
+// if(!common_range(common_lwb_, common_upb_, x2, result))
+// return result;
+//
+// typename CoObjectT::const_iterator x2_ = common_lwb_;
+// typename ObjectT::iterator common_;
+//
+// while(x2_ != common_upb_)
+// result.subtract(*x2_++);
+//
+// return result;
+//}
template<class ObjectT, class CoObjectT>
ObjectT& erase(ObjectT& result, const CoObjectT& x2)
Modified: sandbox/itl/boost/itl/detail/subset_comparer.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/subset_comparer.hpp (original)
+++ sandbox/itl/boost/itl/detail/subset_comparer.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -13,6 +13,7 @@
#include <boost/itl/detail/notate.hpp>
#include <boost/itl/detail/relation_state.hpp>
#include <boost/itl/type_traits/neutron.hpp>
+#include <boost/itl/type_traits/codomain_type_of.hpp>
#include <boost/itl/type_traits/is_concept_equivalent.hpp>
#include <boost/itl/type_traits/is_element_container.hpp>
#include <boost/itl/concept/interval_set_value.hpp>
@@ -118,8 +119,8 @@
int co_compare(LeftIterT& left, RightIterT& right)
{
using namespace boost::mpl;
- typedef typename LeftT::codomain_type LeftCodomainT;
- typedef typename RightT::codomain_type RightCodomainT;
+ typedef typename codomain_type_of<LeftT>::type LeftCodomainT;
+ typedef typename codomain_type_of<RightT>::type RightCodomainT;
return
if_<
@@ -146,7 +147,7 @@
restrict_result(superset);
return stop;
}
- else if(typename LeftT::domain_compare()(key_value<LeftT>(left), key_value<RightT>(right)))
+ else if(typename LeftT::key_compare()(key_value<LeftT>(left), key_value<RightT>(right)))
{ // left: *left . . *joint_ left could be superset
// right: *right ... if joint_ exists
restrict_result(superset);
@@ -156,7 +157,7 @@
{
LeftIterT joint_ = _left.lower_bound(key_value<RightT>(right));
if( joint_ == _left.end()
- || typename LeftT::domain_compare()(key_value<RightT>(right), key_value<LeftT>(joint_)))
+ || typename LeftT::key_compare()(key_value<RightT>(right), key_value<LeftT>(joint_)))
{
_result = unrelated;
return stop;
@@ -165,7 +166,7 @@
left = joint_;
}
}
- else if(typename LeftT::domain_compare()(key_value<RightT>(right), key_value<LeftT>(left)))
+ else if(typename LeftT::key_compare()(key_value<RightT>(right), key_value<LeftT>(left)))
{ // left: *left left could be subset
// right:*right . . .*joint_ if *joint_ exists
restrict_result(subset);
@@ -175,7 +176,7 @@
{
RightIterT joint_ = _right.lower_bound(key_value<LeftT>(left));
if( joint_ == _right.end()
- || typename LeftT::domain_compare()(key_value<LeftT>(left), key_value<RightT>(joint_)))
+ || typename LeftT::key_compare()(key_value<LeftT>(left), key_value<RightT>(joint_)))
{
_result = unrelated;
return stop;
Modified: sandbox/itl/boost/itl/gregorian.hpp
==============================================================================
--- sandbox/itl/boost/itl/gregorian.hpp (original)
+++ sandbox/itl/boost/itl/gregorian.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -54,6 +54,13 @@
};
template<>
+ struct has_difference<boost::gregorian::date>
+ {
+ typedef has_difference type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
struct difference_type_of<boost::gregorian::date>
{ typedef boost::gregorian::date_duration type; };
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 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -18,11 +18,15 @@
#include <boost/itl/detail/notate.hpp>
#include <boost/itl/detail/design_config.hpp>
#include <boost/itl/detail/on_absorbtion.hpp>
-#include <boost/itl/type_traits/is_interval_splitter.hpp>
-#include <boost/itl/map.hpp>
-#include <boost/itl/interval_base_set.hpp>
#include <boost/itl/detail/interval_map_algo.hpp>
+#include <boost/itl/concept/interval/base.hpp>
+#include <boost/itl/concept/interval_set.hpp>
+#include <boost/itl/concept/interval_map.hpp>
+#include <boost/itl/concept/interval_associator.hpp>
+
+#include <boost/itl/type_traits/is_interval_splitter.hpp>
+#include <boost/itl/map.hpp>
#define const_FOR_IMPLMAP(iter) for(typename ImplMapT::const_iterator iter=_map.begin(); (iter)!=_map.end(); (iter)++)
#define FOR_IMPLMAP(iter) for(typename ImplMapT::iterator iter=_map.begin(); (iter)!=_map.end(); (iter)++)
@@ -30,12 +34,6 @@
namespace boost{namespace itl
{
-#ifdef BOOST_MSVC
-#pragma warning(push)
-#pragma warning(disable:4127) // conditional expression is constant
-#endif
-
-
template<class DomainT, class CodomainT>
struct mapping_pair
{
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 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -18,6 +18,12 @@
#include <boost/itl/type_traits/is_interval_splitter.hpp>
#include <boost/itl/detail/interval_set_algo.hpp>
#include <boost/itl/detail/exclusive_less_than.hpp>
+
+#include <boost/itl/concept/interval/base.hpp>
+#include <boost/itl/concept/interval_set.hpp>
+#include <boost/itl/concept/interval_map.hpp>
+#include <boost/itl/concept/interval_associator.hpp>
+
#include <boost/itl/rightopen_interval.hpp>
#include <boost/itl/continuous_interval.hpp>
#include <boost/itl/set.hpp>
@@ -31,103 +37,6 @@
namespace boost{namespace itl
{
-//JODO Forward 4 gcc-3.4.4 -----------------------------------------------------
-
-template<class Type, class OperandT>
-typename enable_if<has_same_concept<is_interval_set, Type, OperandT>, bool>::type
-contains(const Type& super, const OperandT& sub);
-
-template<class Type>
-typename enable_if<is_interval_container<Type>, std::size_t>::type
-interval_count(const Type&);
-
-template<class Type>
-typename enable_if
-< mpl::and_< is_interval_container<Type>
- , is_discrete<typename Type::domain_type> >
-, typename Type::size_type
->::type
-cardinality(const Type&);
-
-template<class Type>
-typename enable_if
-< mpl::and_< is_interval_container<Type>
- , mpl::not_<is_discrete<typename Type::domain_type> > >
-, typename Type::size_type
->::type
-cardinality(const Type&);
-
-template<class Type>
-typename enable_if<is_interval_container<Type>, typename Type::difference_type>::type
-length(const Type&);
-
-template<class Type>
-typename enable_if<is_interval_set<Type>, bool>::type
-contains(const Type& super, const typename Type::segment_type&);
-
-template<class Type>
-typename enable_if<is_interval_set<Type>, bool>::type
-contains(const Type& super, const typename Type::element_type&);
-
-//- add ------------------------------------------------------------------------
-template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-add(Type&, const typename Type::element_type&);
-
-template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-add(Type&, const typename Type::segment_type&);
-
-template<class Type>
-typename enable_if<is_interval_set<Type>, typename Type::iterator>::type
-add(Type&, typename Type::iterator,
- const typename Type::segment_type&);
-
-
-template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-subtract(Type&, const typename Type::element_type&);
-
-template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-subtract(Type&, const typename Type::segment_type&);
-
-//------------------------------------------------------------------------------
-template<class Type>
-typename enable_if<is_interval_set<Type>, void>::type
-add_intersection(Type&, const Type&, const typename Type::element_type&);
-
-template<class Type>
-typename enable_if<is_interval_set<Type>, void>::type
-add_intersection(Type&, const Type&, const typename Type::segment_type&);
-
-template<class Type, class OperandT>
-typename enable_if<mpl::and_<is_interval_set<Type>,
- combines_right_to_interval_set<Type, OperandT> >,
- void>::type
-add_intersection(Type&, const Type&, const OperandT&);
-
-//------------------------------------------------------------------------------
-template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-flip(Type&, const typename Type::element_type&);
-
-template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-flip(Type&, const typename Type::segment_type&);
-
-template<class Type, class OperandT>
-typename enable_if<is_concept_compatible<is_interval_set, Type, OperandT>, Type>::type&
-flip(Type&, const OperandT&);
-
-//------------------------------------------------------------------------------
-template<class Type>
-typename enable_if<is_interval_container<Type>, Type>::type&
-join(Type&);
-
-//JODO Forward 4 gcc-3.4.4 -----------------------------------------------------
-
-
/** \brief Implements a set as a set of intervals (base class) */
template
<
@@ -293,7 +202,7 @@
/** Find the interval value pair, that contains element \c key */
const_iterator find(const element_type& key)const
{
- return this->_set.find(itl::construct<segment_type>(key));
+ return this->_set.find(itl::singleton<segment_type>(key));
}
const_iterator find(const segment_type& segment)const
Modified: sandbox/itl/boost/itl/interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_set.hpp (original)
+++ sandbox/itl/boost/itl/interval_set.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -10,14 +10,8 @@
#define BOOST_ITL_INTERVAL_SET_HPP_JOFA_990223
#include <boost/assert.hpp>
-#include <boost/itl/rightopen_interval.hpp> //JODO REV?
#include <boost/itl/type_traits/is_interval_joiner.hpp>
#include <boost/itl/interval_base_set.hpp>
-#include <boost/itl/concept/interval/base.hpp>
-#include <boost/itl/concept/interval_set.hpp>
-#include <boost/itl/concept/interval_map.hpp>
-#include <boost/itl/concept/interval_associator.hpp>
-
namespace boost{namespace itl
{
Added: sandbox/itl/boost/itl/leftopen_interval.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/leftopen_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -0,0 +1,130 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2010-2010: 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)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_LEFTOPEN_INTERVAL_HPP_JOFA_100930
+#define BOOST_ITL_LEFTOPEN_INTERVAL_HPP_JOFA_100930
+
+#include <functional>
+#include <boost/concept/assert.hpp>
+#include <boost/itl/type_traits/value_size.hpp>
+#include <boost/itl/type_traits/type_to_string.hpp>
+#include <boost/itl/interval_bounds.hpp> //JODO CL leftopen_interval ought to be independent on this,
+#include <boost/itl/concept/interval.hpp>
+
+namespace boost{namespace itl
+{
+
+template <class DomainT,
+ ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
+class leftopen_interval
+{
+public:
+ typedef leftopen_interval<DomainT,Compare> type;
+ typedef DomainT domain_type;
+
+public:
+ //==========================================================================
+ //= Construct, copy, destruct
+ //==========================================================================
+ /** Default constructor; yields an empty interval <tt>(0,0]</tt>. */
+ leftopen_interval()
+ : _lwb(neutron<DomainT>::value()), _upb(neutron<DomainT>::value())
+ {
+ BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
+ BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
+ }
+
+ //NOTE: Compiler generated copy constructor is used
+
+ /** Constructor for a left-open singleton interval <tt>(val-1,val]</tt> */
+ explicit leftopen_interval(const DomainT& val)
+ : _lwb(pred(val)), _upb(val)
+ {
+ BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
+ BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
+ // Only for discrete types this ctor creates an interval containing
+ // a single element only.
+ BOOST_STATIC_ASSERT((itl::is_discrete<DomainT>::value));
+ BOOST_ASSERT((numeric_minimum<DomainT, is_numeric<DomainT>::value >::is_less_than(val) ));
+ }
+
+ /** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
+ leftopen_interval(const DomainT& low, const DomainT& up) :
+ _lwb(low), _upb(up)
+ {
+ BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
+ BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
+ }
+
+ DomainT lower()const{ return _lwb; }
+ DomainT upper()const{ return _upb; }
+
+private:
+ DomainT _lwb;
+ DomainT _upb;
+};
+
+
+template<class CharType, class CharTraits, class DomainT, ITL_COMPARE Compare>
+std::basic_ostream<CharType, CharTraits>& operator <<
+ (std::basic_ostream<CharType, CharTraits> &stream,
+ leftopen_interval<DomainT,Compare> const& object)
+{
+ if(boost::itl::is_empty(object))
+ return stream << "(]";
+ else
+ return stream << "(" << object.lower() << "," << object.upper()<< "]";
+}
+
+//==============================================================================
+//=T leftopen_interval -> concept intervals
+//==============================================================================
+template<class DomainT, ITL_COMPARE Compare>
+struct interval_traits< itl::leftopen_interval<DomainT, Compare> >
+{
+ typedef DomainT domain_type;
+ typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
+ typedef itl::leftopen_interval<DomainT, Compare> interval_type;
+
+ static interval_type construct(const domain_type& lo, const domain_type& up)
+ {
+ return interval_type(lo, up);
+ }
+
+ static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
+ static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
+};
+
+
+//==============================================================================
+//= Type traits
+//==============================================================================
+template <class DomainT, ITL_COMPARE Compare>
+struct interval_bound_type< leftopen_interval<DomainT,Compare> >
+{
+ typedef interval_bound_type type;
+ BOOST_STATIC_CONSTANT(unsigned char, value = interval_bounds::static_leftopen);
+};
+
+template <class DomainT, ITL_COMPARE Compare>
+struct type_to_string<itl::leftopen_interval<DomainT,Compare> >
+{
+ static std::string apply()
+ { return "(I]<"+ type_to_string<DomainT>::apply() +">"; }
+};
+
+template<class DomainT, ITL_COMPARE Compare>
+struct value_size<itl::leftopen_interval<DomainT,Compare> >
+{
+ static std::size_t apply(const itl::leftopen_interval<DomainT>& value)
+ { return 2; }
+};
+
+}} // namespace itl boost
+
+#endif
+
Modified: sandbox/itl/boost/itl/map.hpp
==============================================================================
--- sandbox/itl/boost/itl/map.hpp (original)
+++ sandbox/itl/boost/itl/map.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -52,12 +52,10 @@
template<>
inline std::string type_to_string<partial_absorber>::apply() { return "@0"; }
-
struct partial_enricher
{
enum { absorbs_neutrons = false };
enum { is_total = false };
-
};
template<>
Added: sandbox/itl/boost/itl/open_interval.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/open_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -0,0 +1,130 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2010-2010: 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)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_OPEN_INTERVAL_HPP_JOFA_100930
+#define BOOST_ITL_OPEN_INTERVAL_HPP_JOFA_100930
+
+#include <functional>
+#include <boost/concept/assert.hpp>
+#include <boost/itl/type_traits/value_size.hpp>
+#include <boost/itl/type_traits/type_to_string.hpp>
+#include <boost/itl/interval_bounds.hpp> //JODO CL open_interval ought to be independent on this,
+#include <boost/itl/concept/interval.hpp>
+
+namespace boost{namespace itl
+{
+
+template <class DomainT,
+ ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
+class open_interval
+{
+public:
+ typedef open_interval<DomainT,Compare> type;
+ typedef DomainT domain_type;
+
+public:
+ //==========================================================================
+ //= Construct, copy, destruct
+ //==========================================================================
+ /** Default constructor; yields an empty interval <tt>(0,0)</tt>. */
+ open_interval()
+ : _lwb(neutron<DomainT>::value()), _upb(neutron<DomainT>::value())
+ {
+ BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
+ BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
+ }
+
+ //NOTE: Compiler generated copy constructor is used
+
+ /** Constructor for an open singleton interval <tt>(val-1,val+1)</tt> */
+ explicit open_interval(const DomainT& val)
+ : _lwb(pred(val)), _upb(succ(val))
+ {
+ BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
+ BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
+ // Only for discrete types this ctor creates an interval containing
+ // a single element only.
+ BOOST_STATIC_ASSERT((itl::is_discrete<DomainT>::value));
+ BOOST_ASSERT((numeric_minimum<DomainT, is_numeric<DomainT>::value >::is_less_than(val) ));
+ }
+
+ /** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
+ open_interval(const DomainT& low, const DomainT& up) :
+ _lwb(low), _upb(up)
+ {
+ BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
+ BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
+ }
+
+ DomainT lower()const{ return _lwb; }
+ DomainT upper()const{ return _upb; }
+
+private:
+ DomainT _lwb;
+ DomainT _upb;
+};
+
+
+template<class CharType, class CharTraits, class DomainT, ITL_COMPARE Compare>
+std::basic_ostream<CharType, CharTraits>& operator <<
+ (std::basic_ostream<CharType, CharTraits> &stream,
+ open_interval<DomainT,Compare> const& object)
+{
+ if(boost::itl::is_empty(object))
+ return stream << "()";
+ else
+ return stream << "(" << object.lower() << "," << object.upper()<< ")";
+}
+
+//==============================================================================
+//=T open_interval -> concept intervals
+//==============================================================================
+template<class DomainT, ITL_COMPARE Compare>
+struct interval_traits< itl::open_interval<DomainT, Compare> >
+{
+ typedef DomainT domain_type;
+ typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
+ typedef itl::open_interval<DomainT, Compare> interval_type;
+
+ static interval_type construct(const domain_type& lo, const domain_type& up)
+ {
+ return interval_type(lo, up);
+ }
+
+ static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); };
+ static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); };
+};
+
+
+//==============================================================================
+//= Type traits
+//==============================================================================
+template <class DomainT, ITL_COMPARE Compare>
+struct interval_bound_type< open_interval<DomainT,Compare> >
+{
+ typedef interval_bound_type type;
+ BOOST_STATIC_CONSTANT(unsigned char, value = interval_bounds::static_open);
+};
+
+template <class DomainT, ITL_COMPARE Compare>
+struct type_to_string<itl::open_interval<DomainT,Compare> >
+{
+ static std::string apply()
+ { return "(I)<"+ type_to_string<DomainT>::apply() +">"; }
+};
+
+template<class DomainT, ITL_COMPARE Compare>
+struct value_size<itl::open_interval<DomainT,Compare> >
+{
+ static std::size_t apply(const itl::open_interval<DomainT>& value)
+ { return 2; }
+};
+
+}} // namespace itl boost
+
+#endif
+
Modified: sandbox/itl/boost/itl/ptime.hpp
==============================================================================
--- sandbox/itl/boost/itl/ptime.hpp (original)
+++ sandbox/itl/boost/itl/ptime.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -52,12 +52,23 @@
}
template<>
+ struct has_difference<boost::posix_time::ptime>
+ {
+ typedef has_difference type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
struct difference_type_of<boost::posix_time::ptime>
- { typedef boost::posix_time::time_duration type; };
+ {
+ typedef boost::posix_time::time_duration type;
+ };
template<>
struct size_type_of<boost::posix_time::ptime>
- { typedef boost::posix_time::time_duration type; };
+ {
+ typedef boost::posix_time::time_duration type;
+ };
// ------------------------------------------------------------------------
boost::posix_time::ptime operator ++(boost::posix_time::ptime& x)
Modified: sandbox/itl/boost/itl/rational.hpp
==============================================================================
--- sandbox/itl/boost/itl/rational.hpp (original)
+++ sandbox/itl/boost/itl/rational.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -28,20 +28,35 @@
#include <boost/itl/type_traits/is_continuous.hpp>
#include <boost/itl/type_traits/has_inverse.hpp>
+#include <boost/itl/type_traits/is_numeric.hpp>
namespace boost{namespace itl
{
template<class Integral>
+ struct is_numeric<boost::rational<Integral> >
+ {
+ typedef is_numeric type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<class Integral>
struct is_continuous<boost::rational<Integral> >
{
- typedef is_continuous<boost::rational<Integral> > type;
+ typedef is_continuous type;
BOOST_STATIC_CONSTANT(bool, value = true);
};
template<class Integral>
+ struct is_discrete<boost::rational<Integral> >
+ {
+ typedef is_discrete type;
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+
+ template<class Integral>
struct has_inverse<boost::rational<Integral> >
{
- typedef has_inverse<boost::rational<Integral> > type;
+ typedef has_inverse type;
BOOST_STATIC_CONSTANT(bool, value = (is_signed<Integral>::value));
};
Modified: sandbox/itl/boost/itl/rightopen_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/rightopen_interval.hpp (original)
+++ sandbox/itl/boost/itl/rightopen_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -44,13 +44,15 @@
//NOTE: Compiler generated copy constructor is used
- /** Constructor for a closed singleton interval <tt>[val,val]</tt> */
+ /** Constructor for a singleton interval <tt>[val,val+1)</tt> */
explicit rightopen_interval(const DomainT& val)
: _lwb(val), _upb(succ(val))
{
BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept<DomainT>));
BOOST_CONCEPT_ASSERT((LessThanComparableConcept<DomainT>));
- BOOST_STATIC_ASSERT((!itl::is_continuous<DomainT>::value));
+ // Only for discrete types this ctor creates an interval containing
+ // a single element only.
+ BOOST_STATIC_ASSERT((itl::is_discrete<DomainT>::value));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
@@ -70,7 +72,7 @@
};
-template<class CharType, class CharTraits, class DomainT, ITL_COMPARE Compare>
+template<class CharType, class CharTraits, class DomainT, ITL_COMPARE Compare>//JODO CL sollte ja nicht nötig sein
std::basic_ostream<CharType, CharTraits>& operator <<
(std::basic_ostream<CharType, CharTraits> &stream,
rightopen_interval<DomainT,Compare> const& object)
Modified: sandbox/itl/boost/itl/set.hpp
==============================================================================
--- sandbox/itl/boost/itl/set.hpp (original)
+++ sandbox/itl/boost/itl/set.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -218,6 +218,23 @@
{ return "set<"+ type_to_string<Type>::apply() +">"; }
};
+//-----------------------------------------------------------------------------
+//JODO move
+template <class Type>
+struct is_set<std::set<Type> >
+{
+ typedef is_set<std::set<Type> > type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+
+template <class Type>
+struct type_to_string<std::set<Type> >
+{
+ static std::string apply()
+ { return "set_<"+ type_to_string<Type>::apply() +">"; }
+};
+
}} // namespace itl boost
Modified: sandbox/itl/boost/itl/type_traits/codomain_type_of.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/codomain_type_of.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/codomain_type_of.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -8,6 +8,7 @@
#ifndef BOOST_ITL_TYPE_TRAITS_CODOMAIN_TYPE_OF_HPP_JOFA_100829
#define BOOST_ITL_TYPE_TRAITS_CODOMAIN_TYPE_OF_HPP_JOFA_100829
+#include <set>
#include <boost/mpl/has_xxx.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/itl/type_traits/no_type.hpp>
@@ -46,6 +47,12 @@
get_codomain_type<Type, has_codomain_type<Type>::value>::type type;
};
+ template <class DomainT, class Compare, class Alloc>
+ struct codomain_type_of<std::set<DomainT,Compare,Alloc> >
+ {
+ typedef typename std::set<DomainT,Compare,Alloc>::value_type type;
+ };
+
}} // namespace boost itl
#endif
Modified: sandbox/itl/boost/itl/type_traits/difference_type_of.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/difference_type_of.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/difference_type_of.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -8,9 +8,43 @@
#ifndef BOOST_ITL_TYPE_TRAITS_DIFFERENCE_TYPE_OF_HPP_JOFA_080911
#define BOOST_ITL_TYPE_TRAITS_DIFFERENCE_TYPE_OF_HPP_JOFA_080911
+#include <boost/config.hpp> // For macro BOOST_STATIC_CONSTANT
+#include <boost/itl/type_traits/no_type.hpp>
+#include <boost/itl/type_traits/is_numeric.hpp>
+
namespace boost{ namespace itl
{
- template <class Type> struct difference_type_of{ typedef Type type; };
+ //--------------------------------------------------------------------------
+ template<class Type>
+ struct has_difference
+ {
+ typedef has_difference type;
+ BOOST_STATIC_CONSTANT(bool, value = is_numeric<Type>::value);
+ };
+
+ //--------------------------------------------------------------------------
+ template <class Type, bool has_difference>
+ struct get_difference_type;
+
+ template <class Type>
+ struct get_difference_type<Type, false>
+ {
+ typedef no_type type;
+ };
+
+ template <class Type>
+ struct get_difference_type<Type, true>
+ {
+ typedef Type type;
+ };
+
+ //--------------------------------------------------------------------------
+ template<class Type>
+ struct difference_type_of
+ {
+ typedef typename
+ get_difference_type<Type, has_difference<Type>::value>::type type;
+ };
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/domain_type_of.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/domain_type_of.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/domain_type_of.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -24,6 +24,7 @@
: mpl::bool_<detail::has_domain_type<Type>::value>
{};
+
template <class Type, bool has_domain_type>
struct get_domain_type;
Modified: sandbox/itl/boost/itl/type_traits/element_type_of.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/element_type_of.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/element_type_of.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -17,8 +17,11 @@
namespace detail
{
BOOST_MPL_HAS_XXX_TRAIT_DEF(element_type)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(key_type)
}
+ //--------------------------------------------------------------------------
template <class Type>
struct has_element_type
: mpl::bool_<detail::has_element_type<Type>::value>
@@ -46,6 +49,62 @@
get_element_type<Type, has_element_type<Type>::value>::type type;
};
+ //--------------------------------------------------------------------------
+ template <class Type>
+ struct has_value_type
+ : mpl::bool_<detail::has_value_type<Type>::value>
+ {};
+
+ template <class Type, bool has_value_type>
+ struct get_value_type;
+
+ template <class Type>
+ struct get_value_type<Type, false>
+ {
+ typedef no_type type;
+ };
+
+ template <class Type>
+ struct get_value_type<Type, true>
+ {
+ typedef typename Type::value_type type;
+ };
+
+ template <class Type>
+ struct value_type_of
+ {
+ typedef typename
+ get_value_type<Type, has_value_type<Type>::value>::type type;
+ };
+
+ //--------------------------------------------------------------------------
+ template <class Type>
+ struct has_key_type
+ : mpl::bool_<detail::has_key_type<Type>::value>
+ {};
+
+ template <class Type, bool has_key_type>
+ struct get_key_type;
+
+ template <class Type>
+ struct get_key_type<Type, false>
+ {
+ typedef no_type type;
+ };
+
+ template <class Type>
+ struct get_key_type<Type, true>
+ {
+ typedef typename Type::key_type type;
+ };
+
+ template <class Type>
+ struct key_type_of
+ {
+ typedef typename
+ get_key_type<Type, has_key_type<Type>::value>::type type;
+ };
+
}} // namespace boost itl
#endif
Modified: sandbox/itl/boost/itl/type_traits/given.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/given.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/given.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -8,11 +8,39 @@
#ifndef BOOST_ITL_TYPE_TRAITS_GIVEN_HPP_JOFA_100929
#define BOOST_ITL_TYPE_TRAITS_GIVEN_HPP_JOFA_100929
+#include <boost/itl/type_traits/unon.hpp>
+
namespace boost{ namespace itl
{
- template<bool fact> struct given;
- template<> struct given<false>{static bool then(bool) { return true;}};
- template<> struct given<true> {static bool then(bool fact){ return fact;}};
+ //CL
+ //template<bool Fact> struct given;
+ //template<> struct given<false>{static bool then(bool) { return true;}};
+ //template<> struct given<true> {static bool then(bool Fact){ return Fact;}};
+
+ template<bool Fact, class Type = bool> struct given_;
+
+ template<class Fact, class Type = bool> struct given
+ {
+ static Type then(const Type& success, const Type& fail = unon<Type>::value())
+ {
+ return given_<Fact::value, Type>::then(success, fail);
+ }
+ };
+
+ //-----------------------------------------------------------------------------
+ template<class Type>
+ struct given_<false, Type>
+ {
+ static Type then(const Type& success, const Type& fail = unon<Type>::value())
+ { return fail; }
+ };
+
+ template<class Type>
+ struct given_<true, Type>
+ {
+ static Type then(const Type& success, const Type& fail = unon<Type>::value())
+ { return success; }
+ };
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/has_dynamic_bounds.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/has_dynamic_bounds.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/has_dynamic_bounds.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -9,25 +9,18 @@
#define BOOST_ITL_TYPE_TRAITS_HAS_DYNAMIC_BOUNDS_HPP_JOFA_100327
#include <boost/itl/interval_bounds.hpp>
-#include <boost/itl/type_traits/is_interval.hpp>
+//CL #include <boost/itl/type_traits/is_interval.hpp>
namespace boost{ namespace itl
{
-template <class Type> struct has_dynamic_bounds
-{
- typedef has_dynamic_bounds<Type> type;
- BOOST_STATIC_CONSTANT(bool,
- value = (interval_bound_type<Type>::value == interval_bounds::dynamic));
-};
-
-template <class Type> struct is_dynamic_bounded //JODO rearrange for all those predicates.
-{
- typedef is_dynamic_bounded<Type> type;
- BOOST_STATIC_CONSTANT(bool,
- value = (mpl::and_<is_interval<Type>, has_dynamic_bounds<Type> >::value)
- );
-};
+//JODO remive file
+//CL
+//template <class Type> struct is_dynamic_bounded //JODO rearrange for all those predicates.
+//{
+// typedef is_dynamic_bounded<Type> type;
+// BOOST_STATIC_CONSTANT(bool, value = has_dynamic_bounds<Type>::value );
+//};
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/interval_type_default.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/interval_type_default.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/interval_type_default.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -13,7 +13,11 @@
#include <boost/itl/continuous_interval.hpp>
#include <boost/itl/discrete_interval.hpp>
#include <boost/itl/rightopen_interval.hpp>
+#include <boost/itl/leftopen_interval.hpp>
+#include <boost/itl/closed_interval.hpp>
+#include <boost/itl/open_interval.hpp>
#include <boost/itl/type_traits/is_continuous.hpp>
+#include <boost/itl/type_traits/is_discrete.hpp>
namespace boost{ namespace itl
{
@@ -21,12 +25,15 @@
struct interval_type_default
{
#ifdef ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS
- typedef rightopen_interval<DomainT,Compare> type;
+ typedef
+ typename mpl::if_< is_discrete<DomainT>
+ , closed_interval<DomainT,Compare>
+ , rightopen_interval<DomainT,Compare> >::type type;
#else
typedef
- typename mpl::if_< is_continuous<DomainT>
- , continuous_interval<DomainT,Compare>
- , discrete_interval<DomainT,Compare> >::type type;
+ typename mpl::if_< is_discrete<DomainT>
+ , discrete_interval<DomainT,Compare>
+ , continuous_interval<DomainT,Compare> >::type type;
#endif
};
Modified: sandbox/itl/boost/itl/type_traits/is_asymmetric_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_asymmetric_interval.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_asymmetric_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -31,7 +31,7 @@
BOOST_STATIC_CONSTANT(bool,
value = (mpl::and_<
is_asymmetric_interval<Type>
- , is_continuous<typename Type::domain_type>
+ , is_continuous<typename domain_type_of<interval_traits<Type> >::type>
>::value)
);
};
@@ -42,7 +42,7 @@
BOOST_STATIC_CONSTANT(bool,
value = (mpl::and_<
is_asymmetric_interval<Type>
- , mpl::not_<is_continuous<typename Type::domain_type> >
+ , mpl::not_<is_continuous<typename domain_type_of<interval_traits<Type> >::type> >
>::value)
);
};
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 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -43,12 +43,12 @@
//NOTE: Equality of compare order implies the equality of the domain_types
template<class LeftT, class RightT>
-struct is_domain_compare_equal
+struct is_key_compare_equal
{
- typedef is_domain_compare_equal<LeftT, RightT> type;
+ typedef is_key_compare_equal<LeftT, RightT> type;
BOOST_STATIC_CONSTANT(bool, value =
- (is_same<typename LeftT::domain_compare,
- typename RightT::domain_compare>::value)
+ (is_same<typename LeftT::key_compare,
+ typename RightT::key_compare>::value)
);
};
@@ -57,7 +57,7 @@
{
typedef is_codomain_type_equal<LeftT, RightT> type;
BOOST_STATIC_CONSTANT(bool, value =
- (mpl::and_<is_domain_compare_equal<LeftT, RightT>,
+ (mpl::and_<is_key_compare_equal<LeftT, RightT>,
is_codomain_equal<LeftT, RightT> >::value)
);
};
@@ -87,7 +87,7 @@
(mpl::and_<
LeftConcept<LeftT>
, RightConcept<RightT>
- , is_domain_compare_equal<LeftT, RightT>
+ , is_key_compare_equal<LeftT, RightT>
>::value)
);
};
Modified: sandbox/itl/boost/itl/type_traits/is_container.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_container.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_container.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -12,13 +12,14 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
+#include <boost/itl/type_traits/element_type_of.hpp>
+#include <boost/itl/type_traits/segment_type_of.hpp>
#include <boost/itl/type_traits/is_map.hpp>
namespace boost{ namespace itl
{
namespace detail
{
- BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type)
BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator)
BOOST_MPL_HAS_XXX_TRAIT_DEF(size_type)
BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
@@ -33,6 +34,19 @@
detail::has_reference<Type>::value>
{};
+ template <class Type>
+ struct is_std_set
+ {
+ typedef is_std_set type;
+ BOOST_STATIC_CONSTANT(bool,
+ value = (mpl::and_< is_container<Type>
+ , detail::has_key_type<Type>
+ , is_same< typename key_type_of<Type>::type
+ , typename value_type_of<Type>::type >
+ , mpl::not_<detail::has_segment_type<Type> >
+ >::value )
+ );
+ };
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/is_discrete.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_discrete.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_discrete.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -23,7 +23,8 @@
typedef is_discrete type;
BOOST_STATIC_CONSTANT(bool,
value = (mpl::and_< boost::detail::is_incrementable<Type>
- , mpl::not_<is_floating_point<Type> > >::value)
+ , mpl::not_<is_floating_point<Type> >
+ >::value)
);
};
Modified: sandbox/itl/boost/itl/type_traits/is_element_container.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_element_container.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_element_container.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -11,6 +11,7 @@
#include <boost/mpl/and.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/not.hpp>
+#include <boost/itl/type_traits/is_container.hpp>
#include <boost/itl/type_traits/is_interval_container.hpp>
#include <boost/itl/type_traits/is_set.hpp>
@@ -30,7 +31,10 @@
{
typedef is_element_set<Type> type;
BOOST_STATIC_CONSTANT(bool, value =
- (mpl::and_<is_set<Type>, mpl::not_<is_interval_container<Type> > >::value)
+ (mpl::or_< mpl::and_< is_set<Type>
+ , mpl::not_<is_interval_container<Type> > >
+ , is_std_set<Type>
+ >::value)
);
};
Modified: sandbox/itl/boost/itl/type_traits/is_interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_interval.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -9,6 +9,8 @@
#define BOOST_ITL_TYPE_TRAITS_IS_INTERVAL_HPP_JOFA_100327
#include <boost/itl/interval_bounds.hpp>
+#include <boost/itl/interval_traits.hpp>
+//CL #include <boost/itl/type_traits/has_dynamic_bounds.hpp>
namespace boost{ namespace itl
{
@@ -35,6 +37,13 @@
value = (interval_bound_type<Type>::value < interval_bounds::dynamic));
};
+template <class Type> struct has_dynamic_bounds //JODO rearrange for all those predicates.
+{
+ typedef has_dynamic_bounds<Type> type;
+ BOOST_STATIC_CONSTANT(bool,
+ value = (interval_bound_type<Type>::value == interval_bounds::dynamic));
+};
+
template <class Type> struct has_asymmetric_bounds
{
typedef has_asymmetric_bounds<Type> type;
@@ -44,6 +53,26 @@
|| bounds == interval_bounds::static_rightopen));
};
+template <class Type> struct has_symmetric_bounds
+{
+ typedef has_symmetric_bounds<Type> type;
+ BOOST_STATIC_CONSTANT(unsigned char, bounds = (interval_bound_type<Type>::value));
+ BOOST_STATIC_CONSTANT(bool,
+ value = ( bounds == interval_bounds::static_closed
+ || bounds == interval_bounds::static_open));
+};
+
+//------------------------------------------------------------------------------
+template <class Type> struct is_discrete_static
+{
+ typedef is_discrete_static type;
+ typedef typename interval_traits<Type>::domain_type domain_type;
+ BOOST_STATIC_CONSTANT(bool,
+ value = (mpl::and_< has_static_bounds<Type>
+ , is_discrete<domain_type> >::value) );
+};
+
+//------------------------------------------------------------------------------
template <class Type> struct is_static_rightopen
{
typedef is_static_rightopen<Type> type;
@@ -60,18 +89,50 @@
template <class Type> struct is_static_open
{
- typedef is_static_leftopen<Type> type;
+ typedef is_static_open<Type> type;
BOOST_STATIC_CONSTANT(bool,
value = (interval_bound_type<Type>::value == interval_bounds::static_open));
};
template <class Type> struct is_static_closed
{
- typedef is_static_leftopen<Type> type;
+ typedef is_static_closed<Type> type;
BOOST_STATIC_CONSTANT(bool,
value = (interval_bound_type<Type>::value == interval_bounds::static_closed));
};
+template <class Type> struct is_discrete_static_closed
+{
+ typedef is_static_closed<Type> type;
+ typedef typename interval_traits<Type>::domain_type domain_type;
+
+ BOOST_STATIC_CONSTANT( bool,
+ value = (mpl::and_< is_static_closed<Type>
+ , is_discrete<domain_type> >::value) );
+};
+
+template <class Type> struct is_discrete_static_open
+{
+ typedef is_static_closed<Type> type;
+ typedef typename interval_traits<Type>::domain_type domain_type;
+
+ BOOST_STATIC_CONSTANT( bool,
+ value = (mpl::and_< is_static_open<Type>
+ , is_discrete<domain_type> >::value) );
+};
+
+template <class Type> struct is_singelizable
+{
+ typedef is_singelizable type;
+ typedef typename interval_traits<Type>::domain_type domain_type;
+
+ BOOST_STATIC_CONSTANT(bool,
+ value =
+ (mpl::or_< has_dynamic_bounds<Type>
+ , is_discrete<domain_type>
+ >::value)
+ );
+};
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/is_key_container_of.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_key_container_of.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_key_container_of.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -13,14 +13,58 @@
namespace boost{ namespace itl
{
+ //--------------------------------------------------------------------------
+ namespace detail
+ {
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(key_object_type)
+ }
+
+ //--------------------------------------------------------------------------
+ template <class Type>
+ struct has_key_object_type
+ : mpl::bool_<detail::has_key_object_type<Type>::value>
+ {};
+
+ template <class Type, bool HasKeyContainerType, bool IsSet>
+ struct get_key_object_type;
+
+ template <class Type>
+ struct get_key_object_type<Type, false, false>
+ {
+ typedef Type no_type;
+ };
+
+ template <class Type>
+ struct get_key_object_type<Type, false, true>
+ {
+ typedef Type type;
+ };
+
+ template <class Type, bool IsSet>
+ struct get_key_object_type<Type, true, IsSet>
+ {
+ typedef typename Type::key_object_type type;
+ };
+ template <class Type>
+ struct key_container_type_of
+ {
+ typedef typename
+ get_key_object_type
+ < Type
+ , has_key_object_type<Type>::value
+ , mpl::or_<is_set<Type>, is_map<Type> >::value
+ >::type type;
+ };
+
+ //--------------------------------------------------------------------------
template<class KeyT, class ObjectT>
struct is_strict_key_container_of // set is_strict_key_container_of map
{
typedef is_strict_key_container_of<KeyT, ObjectT> type;
BOOST_STATIC_CONSTANT(bool, value =
(mpl::and_< is_map<ObjectT>
- , is_same<typename ObjectT::key_object_type, KeyT> >::value)
+ , is_same<KeyT, typename key_container_type_of<ObjectT>::type> >::value)
);
};
@@ -30,12 +74,13 @@
typedef is_key_container_of<KeyT, ObjectT> type;
BOOST_STATIC_CONSTANT(bool, value =
(mpl::or_< is_strict_key_container_of<KeyT, ObjectT>
- , mpl::and_< is_container<ObjectT> //JODO is_itl_associative_container
+ , mpl::and_< mpl::or_<is_set<ObjectT>, is_map<ObjectT> >
, is_same<ObjectT, KeyT> > >::value)
);
};
+
}} // namespace boost itl
#endif
Modified: sandbox/itl/boost/itl/type_traits/is_numeric.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_numeric.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_numeric.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -8,23 +8,53 @@
#ifndef BOOST_ITL_TYPE_TRAITS_IS_NUMERIC_HPP_JOFA_100322
#define BOOST_ITL_TYPE_TRAITS_IS_NUMERIC_HPP_JOFA_100322
-#include <string>
+#include <limits>
#include <complex>
namespace boost{ namespace itl
{
- template <class Type> struct is_numeric
- {
- typedef is_numeric type;
- BOOST_STATIC_CONSTANT(bool, value = (0 < std::numeric_limits<Type>::digits));
- };
- template <class Type>
- struct is_numeric<std::complex<Type> >
+template <class Type> struct is_numeric
+{
+ typedef is_numeric type;
+ BOOST_STATIC_CONSTANT(bool, value = (0 < std::numeric_limits<Type>::digits));
+};
+
+template <class Type>
+struct is_numeric<std::complex<Type> >
+{
+ typedef is_numeric type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+//--------------------------------------------------------------------------
+//JODO move
+namespace aux
+{
+ template<class Type> struct functions
{
- typedef is_numeric type;
- BOOST_STATIC_CONSTANT(bool, value = true);
+ typedef bool (*Type_to_bool)(const Type&);
};
+};
+
+template<class Type, bool Enable = false> struct numeric_minimum;
+
+template<class Type>
+struct numeric_minimum<Type, false>
+{
+ static bool is_less_than(Type){ return true; }
+ static bool is_less_than_or(Type, bool){ return true; }
+};
+
+template<class Type>
+struct numeric_minimum<Type, true>
+{
+ static bool is_less_than(Type value)
+ { return (std::numeric_limits<Type>::min)() < value; }
+
+ static bool is_less_than_or(Type value, bool cond)
+ { return cond || is_less_than(value); }
+};
}} // namespace boost itl
Modified: sandbox/itl/boost/itl/type_traits/unon.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/unon.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/unon.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -16,6 +16,7 @@
{
template <class Type> struct unon{ static Type value(); };
+ template<> inline bool unon<bool>::value() { return true; }
template<> inline float unon<float>::value() { return 1.0; }
template<> inline double unon<double>::value() { return 1.0; }
template<> inline long double unon<long double>::value()
Modified: sandbox/itl/boost/itl/type_traits/value_size.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/value_size.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/value_size.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -16,7 +16,6 @@
template <typename Type>
Type abs(Type val) { return val < 0 ? -val : val; }
-
/// static class template for the size of a type's value
/** This function is needed to be able to order values according
to their size. This is used to e.g. prefer simple test
@@ -42,7 +41,7 @@
template <typename Type>
inline std::size_t value_size<Type>::apply(const Type& value)
-{ return static_cast<int>(value.iterative_size()); }
+{ return itl::iterative_size(value); }
Modified: sandbox/itl/boost/validate/driver/collector_driver.hpp
==============================================================================
--- sandbox/itl/boost/validate/driver/collector_driver.hpp (original)
+++ sandbox/itl/boost/validate/driver/collector_driver.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -103,27 +103,27 @@
//-----------------------------------------------------------------
case RootType::itl_map: {
switch(neutronizerChoice) {
- case NeutronHandlerType::partial_absorber: return new collector_validater<itl::map<int,itl::set<int> > >;
- case NeutronHandlerType::partial_enricher: return new collector_validater<itl::map<int,itl::set<int>,partial_enricher> >;
- //case NeutronHandlerType::total_absorber : return new collector_validater<itl::map<int,itl::set<int>,total_absorber > >;
+ case NeutronHandlerType::partial_absorber: return new collector_validater<itl::map<int,std::set<int> > >;
+ case NeutronHandlerType::partial_enricher: return new collector_validater<itl::map<int,std::set<int>,partial_enricher> >;
+ //case NeutronHandlerType::total_absorber : return new collector_validater<itl::map<int,std::set<int>,total_absorber > >;
default: return choiceError(ITL_LOCATION("\nRootType::itl_map: neutronizerChoice:\n"), neutronizerChoice, _neutronizerChoice);
}//switch neutronizerChoice
}//case itl_map
//-----------------------------------------------------------------
case RootType::interval_map: {
switch(neutronizerChoice) {
- case NeutronHandlerType::partial_absorber: return new collector_validater<interval_map<double,itl::set<int> > >;
- case NeutronHandlerType::partial_enricher: return new collector_validater<interval_map<int,itl::set<int>,partial_enricher> >;
- //case NeutronHandlerType::total_absorber : return new collector_validater<interval_map<int,itl::set<int>,total_absorber > >;
+ case NeutronHandlerType::partial_absorber: return new collector_validater<interval_map<double,std::set<int> > >;
+ case NeutronHandlerType::partial_enricher: return new collector_validater<interval_map<int,std::set<int>,partial_enricher> >;
+ //case NeutronHandlerType::total_absorber : return new collector_validater<interval_map<int,std::set<int>,total_absorber > >;
default: return choiceError(ITL_LOCATION("\nRootType::interval_map: neutronizerChoice:\n"), neutronizerChoice, _neutronizerChoice);
}//switch neutronizerChoice
}//case interval_map
//-----------------------------------------------------------------
case RootType::split_interval_map: {
switch(neutronizerChoice) {
- case NeutronHandlerType::partial_absorber: return new collector_validater<split_interval_map<int,itl::set<int> > >;
- case NeutronHandlerType::partial_enricher: return new collector_validater<split_interval_map<double,itl::set<int>,partial_enricher> >;
- //case NeutronHandlerType::total_absorber : return new collector_validater<split_interval_map<int,itl::set<int>,total_absorber > >;
+ case NeutronHandlerType::partial_absorber: return new collector_validater<split_interval_map<int,std::set<int> > >;
+ case NeutronHandlerType::partial_enricher: return new collector_validater<split_interval_map<double,std::set<int>,partial_enricher> >;
+ //case NeutronHandlerType::total_absorber : return new collector_validater<split_interval_map<int,std::set<int>,total_absorber > >;
default: return choiceError(ITL_LOCATION("\nRootType::split_interval_map: neutronizerChoice:\n"), neutronizerChoice, _neutronizerChoice);
}//switch neutronizerChoice
}//case split_interval_map
Modified: sandbox/itl/boost/validate/driver/itl_set_driver.hpp
==============================================================================
--- sandbox/itl/boost/validate/driver/itl_set_driver.hpp (original)
+++ sandbox/itl/boost/validate/driver/itl_set_driver.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -68,8 +68,8 @@
{
case RootType::itl_set: {
switch(domainChoice) {
- case DomainType::Int: return new itl_set_validater<itl::set<int> >;
- case DomainType::Double: return new itl_set_validater<itl::set<double> >;
+ case DomainType::Int: return new itl_set_validater<std::set<int> >;
+ case DomainType::Double: return new itl_set_validater<std::set<double> >;
default: return choiceError(ITL_LOCATION("\nRootType::itl_set: domainChoice:\n"),
domainChoice, _domainChoice);
}
Modified: sandbox/itl/boost/validate/driver/map_order_driver.hpp
==============================================================================
--- sandbox/itl/boost/validate/driver/map_order_driver.hpp (original)
+++ sandbox/itl/boost/validate/driver/map_order_driver.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -105,7 +105,7 @@
switch(codomainChoice) {
case CodomainType::Nat: return new itl_order_validater<itl::map<int,nat,total_enricher> >;
case CodomainType::Int: return new itl_order_validater<itl::map<int,int,partial_absorber> >;
- case CodomainType::set_int: return new itl_order_validater<itl::map<int,itl::set<int>,partial_enricher> >;
+ case CodomainType::set_int: return new itl_order_validater<itl::map<int,std::set<int>,partial_enricher> >;
default: return choiceError(ITL_LOCATION("\nRootType::itl_map: codomainChoice:\n"),
codomainChoice, _codomainChoice);
}//switch codomain
@@ -114,7 +114,7 @@
switch(codomainChoice) {
case CodomainType::Nat: return new itl_order_validater<itl::map<double,nat,partial_enricher> >;
case CodomainType::Int: return new itl_order_validater<itl::map<double,int,total_absorber> >;
- case CodomainType::set_int: return new itl_order_validater<itl::map<double,itl::set<int>,partial_absorber> >;
+ case CodomainType::set_int: return new itl_order_validater<itl::map<double,std::set<int>,partial_absorber> >;
default: return choiceError(ITL_LOCATION("\nRootType::itl_map: codomainChoice:\n"),
codomainChoice, _codomainChoice);
}//switch codomain
@@ -130,7 +130,7 @@
switch(codomainChoice) {
case CodomainType::Nat: return new itl_order_validater<interval_map<int,nat,partial_absorber> >;
case CodomainType::Int: return new itl_order_validater<interval_map<int,int,total_enricher> >;
- case CodomainType::set_int: return new itl_order_validater<interval_map<int,itl::set<int>,total_absorber> >;
+ case CodomainType::set_int: return new itl_order_validater<interval_map<int,std::set<int>,total_absorber> >;
default: return choiceError(ITL_LOCATION("\nRootType::interval_map: codomainChoice:\n"),
codomainChoice, _codomainChoice);
}// switch codomain
@@ -138,7 +138,7 @@
switch(codomainChoice) {
case CodomainType::Nat: return new itl_order_validater<interval_map<double,nat,total_absorber> >;
case CodomainType::Int: return new itl_order_validater<interval_map<double,int,partial_enricher> >;
- case CodomainType::set_int: return new itl_order_validater<interval_map<double,itl::set<int>,total_enricher> >;
+ case CodomainType::set_int: return new itl_order_validater<interval_map<double,std::set<int>,total_enricher> >;
default: return choiceError(ITL_LOCATION("\nRootType::interval_map: codomainChoice:\n"),
codomainChoice, _codomainChoice);
}// switch codomain
@@ -153,7 +153,7 @@
switch(codomainChoice) {
case CodomainType::Nat: return new itl_order_validater<split_interval_map<int,nat,total_enricher> >;
case CodomainType::Int: return new itl_order_validater<split_interval_map<int,int,partial_absorber> >;
- case CodomainType::set_int: return new itl_order_validater<split_interval_map<int,itl::set<int>,partial_enricher> >;
+ case CodomainType::set_int: return new itl_order_validater<split_interval_map<int,std::set<int>,partial_enricher> >;
default: return choiceError(ITL_LOCATION("\nRootType::split_interval_map: codomainChoice:\n"),
codomainChoice, _codomainChoice);
}
@@ -161,7 +161,7 @@
switch(codomainChoice) {
case CodomainType::Nat: return new itl_order_validater<split_interval_map<double,nat,partial_enricher> >;
case CodomainType::Int: return new itl_order_validater<split_interval_map<double,int,total_absorber> >;
- case CodomainType::set_int: return new itl_order_validater<split_interval_map<double,itl::set<int>,partial_absorber> >;
+ case CodomainType::set_int: return new itl_order_validater<split_interval_map<double,std::set<int>,partial_absorber> >;
default: return choiceError(ITL_LOCATION("\nRootType::split_interval_map: codomainChoice:\n"),
codomainChoice, _codomainChoice);
}
Modified: sandbox/itl/boost/validate/driver/set_order_driver.hpp
==============================================================================
--- sandbox/itl/boost/validate/driver/set_order_driver.hpp (original)
+++ sandbox/itl/boost/validate/driver/set_order_driver.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -100,8 +100,8 @@
{
case RootType::itl_set: {
switch(domainChoice) {
- case DomainType::Int: return new itl_order_validater<itl::set<int> >;
- case DomainType::Double: return new itl_order_validater<itl::set<double> >;
+ case DomainType::Int: return new itl_order_validater<std::set<int> >;
+ case DomainType::Double: return new itl_order_validater<std::set<double> >;
default: return choiceError(ITL_LOCATION("\nRootType::itl_set: domainChoice:\n"),
domainChoice, _domainChoice);
}
Modified: sandbox/itl/boost/validate/gentor/randomgentor.hpp
==============================================================================
--- sandbox/itl/boost/validate/gentor/randomgentor.hpp (original)
+++ sandbox/itl/boost/validate/gentor/randomgentor.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -118,6 +118,10 @@
public SetGentorT<itl::set<DomainT> > {};
template <class DomainT>
+ class RandomGentor<std::set<DomainT> > :
+ public SetGentorT<std::set<DomainT> > {};
+
+ template <class DomainT>
class RandomGentor<itl::interval_set<DomainT> > :
public SetGentorT<itl::interval_set<DomainT> > {};
@@ -141,6 +145,10 @@
class RandomGentor<itl::map<DomainT,itl::set<int>,Neutronizer> > :
public MapGentorT<itl::map<DomainT,itl::set<int>,Neutronizer> > {};
+ template <class DomainT, class Neutronizer>
+ class RandomGentor<itl::map<DomainT,std::set<int>,Neutronizer> > :
+ public MapGentorT<itl::map<DomainT,std::set<int>,Neutronizer> > {};
+
template <class DomainT, class BitsT, class Neutronizer,
ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section>
class RandomGentor<itl::map<DomainT,itl::bits<BitsT>,Neutronizer,Compare,Combine,Section> > :
@@ -156,6 +164,10 @@
class RandomGentor<interval_map<DomainT,itl::set<int>,Neutronizer> > :
public MapGentorT<interval_map<DomainT,itl::set<int>,Neutronizer> > {};
+ template <class DomainT, class Neutronizer>
+ class RandomGentor<interval_map<DomainT,std::set<int>,Neutronizer> > :
+ public MapGentorT<interval_map<DomainT,std::set<int>,Neutronizer> > {};
+
template <class DomainT, class CodomainT, class Neutronizer>
class RandomGentor<interval_map<DomainT,CodomainT,Neutronizer> > :
public MapGentorT<interval_map<DomainT,CodomainT,Neutronizer> > {};
@@ -165,6 +177,10 @@
class RandomGentor<split_interval_map<DomainT,itl::set<int>,Neutronizer> > :
public MapGentorT<split_interval_map<DomainT,itl::set<int>,Neutronizer> > {};
+ template <class DomainT, class Neutronizer>
+ class RandomGentor<split_interval_map<DomainT,std::set<int>,Neutronizer> > :
+ public MapGentorT<split_interval_map<DomainT,std::set<int>,Neutronizer> > {};
+
template <class DomainT, class CodomainT, class Neutronizer>
class RandomGentor<split_interval_map<DomainT,CodomainT,Neutronizer> > :
public MapGentorT<split_interval_map<DomainT,CodomainT,Neutronizer> > {};
@@ -491,6 +507,31 @@
}
};
+ //--------------------------------------------------------------------------
+ template <>
+ struct Calibrater<std::set<int>, RandomGentor>
+ {
+ static void apply(RandomGentor<std::set<int> >& gentor)
+ {
+ gentor.setRangeOfSampleSize(GentorProfileSgl::it()->range_ContainerSize());
+ NumberGentorT<int>* intGentor = new NumberGentorT<int>;
+ intGentor->setRange(GentorProfileSgl::it()->range_int());
+ gentor.setDomainGentor(intGentor);
+ }
+ };
+
+ template <>
+ struct Calibrater<std::set<double>, RandomGentor>
+ {
+ static void apply(RandomGentor<std::set<double> >& gentor)
+ {
+ gentor.setRangeOfSampleSize(GentorProfileSgl::it()->range_ContainerSize());
+ NumberGentorT<double>* elemGentor = new NumberGentorT<double>;
+ elemGentor->setRange(GentorProfileSgl::it()->range_double());
+ gentor.setDomainGentor(elemGentor);
+ }
+ };
+
//----------------------------------------------------------------------------
// itl::{,separate,split}_interval_set<NumericDomainT>
//----------------------------------------------------------------------------
@@ -584,6 +625,31 @@
}
};
+ template <typename NumericDomainT, class Neutronizer>
+ struct Calibrater<itl::map<NumericDomainT,std::set<int>,Neutronizer>, RandomGentor>
+ {
+ static void apply(RandomGentor<itl::map<NumericDomainT,std::set<int>,Neutronizer> >& gentor)
+ {
+ // Set the range within which the sizes of the generated object varies.
+ gentor.setRangeOfSampleSize(GentorProfileSgl::it()->range_ContainerSize());
+
+ // If it is a container: (Create and) Pass the generator(s) for their contents
+ // NumberGentorT<int> intGentor;
+ NumberGentorT<NumericDomainT>* domainGentor = new NumberGentorT<NumericDomainT>;
+ domainGentor->setRange(GentorProfileSgl_numeric_range<NumericDomainT>::get());
+
+ SetGentorT<std::set<int> >* codomainGentor = new SetGentorT<std::set<int> >;
+ NumberGentorT<int>* elementGentor = new NumberGentorT<int>;
+ elementGentor->setRange(GentorProfileSgl_numeric_range<int>::get());
+
+ codomainGentor->setDomainGentor(elementGentor);
+ codomainGentor->setRangeOfSampleSize(GentorProfileSgl::it()->range_ContainerSize());
+
+ gentor.setDomainGentor(domainGentor);
+ gentor.setCodomainGentor(codomainGentor);
+ }
+ };
+
template <typename NumericDomainT, typename NumericCodomainT, class Neutronizer>
struct Calibrater<itl::map<NumericDomainT,NumericCodomainT,Neutronizer>, RandomGentor>
{
@@ -658,6 +724,38 @@
}
};
+ template <class NumericDomainT, class Neutronizer,
+ ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section,
+ ITL_INTERVAL(ITL_COMPARE) Interval>
+ struct Calibrater<interval_map<NumericDomainT,std::set<int>,
+ Neutronizer,Compare,Combine,Section,
+ Interval >, RandomGentor>
+ {
+ static void apply(RandomGentor<interval_map<NumericDomainT,std::set<int>,
+ Neutronizer,Compare,Combine,Section,
+ Interval > >& gentor)
+ {
+ // Set the range within which the sizes of the generated object varies.
+ gentor.setRangeOfSampleSize(GentorProfileSgl::it()->range_ContainerSize());
+
+ ItvGentorT<NumericDomainT, ITL_INTERVAL_TYPE(Interval,NumericDomainT,Compare) >* itvGentor
+ = new ItvGentorT<NumericDomainT, ITL_INTERVAL_TYPE(Interval,NumericDomainT,Compare) >;
+ interval<NumericDomainT> valRange = GentorProfileSgl_numeric_range<NumericDomainT>::get();
+ itvGentor->setValueRange(valRange.lower(), valRange.upper());
+ itvGentor->setMaxIntervalLength(GentorProfileSgl::it()->maxIntervalLength());
+
+ SetGentorT<std::set<int> >* codomainGentor = new SetGentorT<std::set<int> >;
+ NumberGentorT<int>* elementGentor = new NumberGentorT<int>;
+ elementGentor->setRange(GentorProfileSgl::it()->range_int());
+
+ codomainGentor->setDomainGentor(elementGentor);
+ codomainGentor->setRangeOfSampleSize(GentorProfileSgl::it()->range_codomain_ContainerSize());
+
+ gentor.setDomainGentor(itvGentor);
+ gentor.setCodomainGentor(codomainGentor);
+ }
+ };
+
template <typename NumericDomainT, typename NumericCodomainT, class Neutronizer,
ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section,
ITL_INTERVAL(ITL_COMPARE) Interval>
@@ -724,6 +822,39 @@
}
};
+ template <class NumericDomainT, class Neutronizer,
+ ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section,
+ ITL_INTERVAL(ITL_COMPARE) Interval>
+ struct Calibrater<split_interval_map<NumericDomainT,std::set<int>,
+ Neutronizer,Compare,Combine,Section,
+ Interval >, RandomGentor>
+ {
+ static void apply(RandomGentor<split_interval_map<NumericDomainT,std::set<int>,
+ Neutronizer,Compare,Combine,Section,
+ Interval > >& gentor)
+ {
+ gentor.setRangeOfSampleSize(GentorProfileSgl::it()->range_ContainerSize());
+
+ // If it is a container: (Create and) Pass the generator(s) for their contents
+ // NumberGentorT<int> intGentor;
+ ItvGentorT<NumericDomainT, ITL_INTERVAL_TYPE(Interval,NumericDomainT,Compare) >* itvGentor
+ = new ItvGentorT<NumericDomainT, ITL_INTERVAL_TYPE(Interval,NumericDomainT,Compare) >;
+ interval<NumericDomainT> valRange = GentorProfileSgl_numeric_range<NumericDomainT>::get();
+ itvGentor->setValueRange(valRange.lower(), valRange.upper());
+ itvGentor->setMaxIntervalLength(GentorProfileSgl::it()->maxIntervalLength());
+
+ SetGentorT<std::set<int> >* codomainGentor = new SetGentorT<std::set<int> >;
+ NumberGentorT<int>* elementGentor = new NumberGentorT<int>;
+ elementGentor->setRange(GentorProfileSgl::it()->range_int());
+
+ codomainGentor->setDomainGentor(elementGentor);
+ codomainGentor->setRangeOfSampleSize(GentorProfileSgl::it()->range_codomain_ContainerSize());
+
+ gentor.setDomainGentor(itvGentor);
+ gentor.setCodomainGentor(codomainGentor);
+ }
+ };
+
template <typename NumericDomainT, typename NumericCodomainT, class Neutronizer,
ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section,
ITL_INTERVAL(ITL_COMPARE) Interval>
Modified: sandbox/itl/boost/validate/validater/sorted_associative_back_validater.hpp
==============================================================================
--- sandbox/itl/boost/validate/validater/sorted_associative_back_validater.hpp (original)
+++ sandbox/itl/boost/validate/validater/sorted_associative_back_validater.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -26,10 +26,10 @@
class sorted_associative_back_validater : public concept_validater
{
public:
- typedef typename Type::atomized_type atomic_type;
- typedef typename atomic_type::value_type value_type;
- typedef typename Type::domain_type domain_type;
- typedef typename Type::codomain_type codomain_type;
+ typedef typename Type::atomized_type atomic_type;
+ typedef typename atomic_type::value_type value_type;
+ typedef typename domain_type_of<Type>::type domain_type;
+ typedef typename Type::codomain_type codomain_type;
typedef typename mpl::if_< is_interval_map<Type>
, std::pair<domain_type, codomain_type>
Modified: sandbox/itl/boost/validate/validater/sorted_associative_validater.hpp
==============================================================================
--- sandbox/itl/boost/validate/validater/sorted_associative_validater.hpp (original)
+++ sandbox/itl/boost/validate/validater/sorted_associative_validater.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -30,7 +30,8 @@
public:
typedef typename Type::atomized_type atomic_type;
typedef typename atomic_type::value_type value_type;
- typedef typename Type::domain_type domain_type;
+ //CL typedef typename Type::domain_type domain_type;
+ typedef typename domain_type_of<Type>::type domain_type;
typedef typename Type::codomain_type codomain_type;
typedef typename mpl::if_< is_interval_map<Type>
Modified: sandbox/itl/libs/itl/test/Jamfile.v2
==============================================================================
--- sandbox/itl/libs/itl/test/Jamfile.v2 (original)
+++ sandbox/itl/libs/itl/test/Jamfile.v2 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -17,7 +17,7 @@
test-suite "itl"
:
# interval
- #[ run fastest_itl_interval_/fastest_itl_interval.cpp ]
+ [ run fastest_itl_interval_/fastest_itl_interval.cpp ]
# sets
[ run fastest_interval_set_/fastest_interval_set.cpp ]
Modified: sandbox/itl/libs/itl/test/fastest_itl_interval_/fastest_itl_interval.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/fastest_itl_interval_/fastest_itl_interval.cpp (original)
+++ sandbox/itl/libs/itl/test/fastest_itl_interval_/fastest_itl_interval.cpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -20,11 +20,94 @@
using namespace boost::itl;
#include "../test_itl_interval_shared.hpp"
-#include "../test_itl_interval.hpp"
+#include "../test_icl_interval.hpp"
+#include "../test_icl_dynamic_interval.hpp"
+#include "../test_icl_discrete_interval.hpp"
+#include "../test_icl_continuous_interval.hpp"
+#include "../test_icl_static_interval.hpp"
+
+#include <boost/itl/rightopen_interval.hpp>
+#include <boost/itl/leftopen_interval.hpp>
+#include <boost/itl/closed_interval.hpp>
+#include <boost/itl/open_interval.hpp>
+
+#include <boost/itl/discrete_interval.hpp>
+#include <boost/itl/continuous_interval.hpp>
+
+//==============================================================================
+//= Traits
+//==============================================================================
+BOOST_AUTO_TEST_CASE
+(fastest_itl_discrete_interval_traits)
+{ discrete_interval_traits<discrete_type_1, discrete_interval<discrete_type_1> >(); }
+
+//==============================================================================
+
+//- sta.asy.{dis|con} ----------------------------------------------------------
+BOOST_AUTO_TEST_CASE
+(fastest_itl_rightopen_interval_ctor_4_ordered_types)
+{ interval_ctor_4_ordered_types<rightopen_interval<ordered_type_1> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_rightopen_interval_4_ordered_types)
+{ singelizable_interval_4_ordered_types<rightopen_interval<discrete_type_1> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_rightopen_interval_4_bicremental_types)
+{ singelizable_interval_4_bicremental_types<rightopen_interval<discrete_type_2> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_leftopen_interval_ctor_4_ordered_types)
+{ interval_ctor_4_ordered_types<leftopen_interval<ordered_type_2> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_leftopen_interval_4_ordered_types_singelizable)
+{ singelizable_interval_4_ordered_types<leftopen_interval<signed_discrete_type_1> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_leftopen_interval_4_bicremental_types)
+{ singelizable_interval_4_bicremental_types<leftopen_interval<discrete_type_4> >(); }
+
+
+//- dyn.dis --------------------------------------------------------------------
+BOOST_AUTO_TEST_CASE
+(fastest_itl_discrete_interval_ctor_4_discrete_types_base)
+{ interval_ctor_4_ordered_types<discrete_interval<discrete_type_1> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_discrete_interval_ctor_4_discrete_types_dynamic)
+{ dynamic_interval_ctor_4_ordered_types<discrete_interval<discrete_type_2> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_discrete_interval_4_ordered_types)
+{ singelizable_interval_4_ordered_types<discrete_interval<discrete_type_3> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_discrete_interval_4_bicremental_types)
+{ singelizable_interval_4_bicremental_types<discrete_interval<discrete_type_3> >(); }
+
+//- dyn.con --------------------------------------------------------------------
+BOOST_AUTO_TEST_CASE
+(fastest_itl_continuous_interval_ctor_4_continuous_types_base)
+{ interval_ctor_4_ordered_types<continuous_interval<continuous_type_1> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_continuous_interval_ctor_4_continuous_types_dynamic)
+{ dynamic_interval_ctor_4_ordered_types<continuous_interval<continuous_type_2> >(); }
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_continuous_interval_4_continuous_types_singelizable)
+{ singelizable_interval_4_ordered_types<continuous_interval<continuous_type_3> >(); }
+
+//------------------------------------------------------------------------------
+
+BOOST_AUTO_TEST_CASE
+(fastest_itl_distant_intervals_4_discrete_types)
+{ distant_intervals_4_discrete_types<discrete_type_1, std::less>(); }
BOOST_AUTO_TEST_CASE
-(fastest_itl_interval_ctor_4_ordered_types)
-{ interval_ctor_4_ordered_types<ordered_type_1, >(); }
+(fastest_itl_distant_intervals_4_numeric_continuous_types)
+{ distant_intervals_4_numeric_continuous_types<numeric_continuous_type_1, std::less>(); }
/*
BOOST_AUTO_TEST_CASE
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 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -27,9 +27,11 @@
#include <boost/itl/interval_map.hpp>
#include <boost/itl/split_interval_map.hpp>
#include <boost/itl/detail/element_iterator.hpp>
+#include <boost/itl/ptime.hpp>
#include <boost/itl/type_traits/is_key_container_of.hpp>
#include <boost/itl/type_traits/codomain_type_of.hpp>
#include <boost/itl/type_traits/is_icl_container.hpp>
+#include <boost/itl/type_traits/given.hpp>
#include <boost/itl_xt/detail/bit_element_iterator.hpp>
@@ -198,6 +200,28 @@
}
*/
+typedef bool (*void_2_bool)();
+bool callit(){ cout << "called\n"; return true; }
+bool nope(){ cout << "nope\n"; return false; }
+
+//template<class Type> struct functions
+//{
+// typedef bool (*Type_to_bool)(Type);
+//};
+//
+//template<class Type>
+//bool minimum_is_less_than(Type value)
+//{
+// cout << "minimum_is_less_than\n";
+// return (numeric_limits<Type>::min)() < value;
+//}
+//
+//template<class Type>
+//bool always_true(Type)
+//{
+// cout << "always_true\n";
+// return true;
+//}
BOOST_AUTO_TEST_CASE(casual)
{
@@ -247,7 +271,30 @@
BOOST_CHECK_EQUAL((is_floating_point<double>::value), true);
BOOST_CHECK_EQUAL((is_floating_point<float>::value), true);
- //BOOST_CHECK_EQUAL(xx, true);
-
+
+ BOOST_CHECK( (is_same<key_type_of<std::set<int> >::type, int>::value) );
+ BOOST_CHECK( (is_same<value_type_of<std::set<int> >::type, int>::value) );
+
+ BOOST_CHECK_EQUAL( is_std_set<std::set<int> >::value, true );
+ BOOST_CHECK_EQUAL( is_std_set<interval_set<int> >::value, false);
+ BOOST_CHECK_EQUAL((is_std_set<std::map<int,int> >::value), false);
+ BOOST_CHECK_EQUAL( is_element_set<std::set<int> >::value, true );
+ BOOST_CHECK_EQUAL( is_interval_set<std::set<int> >::value, false );
+
+ std::set<int> set_a, set_b, set_c;
+ itl::add(set_a, 1);
+ itl::add(set_a, 5);
+ set_b = set_a;
+ set_b += 7;
+ set_c += 3;
+ set_b += set_c;
+ cout << set_a << endl;
+ cout << set_b << endl;
+ add_intersection(set_c, set_a, set_b);
+ cout << set_c << endl;
+ itl::within(set_a, set_b);
+
+ itl::map<int,int> a, b;
+ within(a & b, a);
}
Added: sandbox/itl/libs/itl/test/test_icl_continuous_interval.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_icl_continuous_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -0,0 +1,80 @@
+/*-----------------------------------------------------------------------------+
+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)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_TEST_ICL_INTERVAL_CONTINUOUS_HPP_JOFA_100930
+#define BOOST_ITL_TEST_ICL_INTERVAL_CONTINUOUS_HPP_JOFA_100930
+
+template <class T, class IntervalT>
+void interval_ctor_4_ordered_types()
+{
+ BOOST_CHECK_EQUAL(itl::is_empty(IntervalT()), true);
+ BOOST_CHECK_EQUAL(itl::cardinality(IntervalT()), itl::neutron<typename itl::size_type_of<T>::type>::value());
+ BOOST_CHECK_EQUAL(itl::size(IntervalT()), itl::neutron<typename itl::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(itl::lower(IntervalT()), itl::upper(IntervalT())) );
+}
+
+
+template <class T, ITL_COMPARE Compare>
+void distant_intervals_4_numeric_continuous_types()
+{
+ typedef rightopen_interval<T,Compare> L__D; // L__D for [..)
+ typedef leftopen_interval<T,Compare> C__I; // C__I for (..]
+ typedef continuous_interval<T,Compare> IntervalT;
+
+ BOOST_CHECK( is_interval<L__D>::value );
+ BOOST_CHECK( has_difference<typename interval_traits<L__D>::domain_type>::value );
+ BOOST_CHECK( is_continuous<typename interval_traits<L__D>::domain_type>::value );
+ BOOST_CHECK( (is_same<typename interval_traits<L__D>::domain_type, T>::value) );
+
+ typedef typename difference_type_of<T>::type DiffT;
+
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,0,4), MK_I(L__D,8,9));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,7,8), MK_I(L__D,2,3));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,2,4), MK_I(L__D,4,6));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,3,7), MK_I(L__D,5,8));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,7,9), MK_I(L__D,0,4));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,0,0), MK_I(L__D,0,0));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,1,0), MK_I(L__D,2,0));
+
+ test_inner_complement<T,Compare,C__I>(MK_I(C__I,1,5), MK_I(C__I,4,9));
+ test_inner_complement<T,Compare,C__I>(MK_I(C__I,4,6), MK_I(C__I,1,3));
+ test_inner_complement<T,Compare,C__I>(MK_I(C__I,0,2), MK_I(C__I,4,6));
+ test_inner_complement<T,Compare,C__I>(MK_I(C__I,0,2), MK_I(C__I,0,6));
+
+ //--------------------------------------------------------------------------
+ test_inner_complement<T,Compare,IntervalT>(I_D(0,4), I_D(8,9));
+ test_inner_complement<T,Compare,IntervalT>(I_D(7,8), I_D(2,3));
+ test_inner_complement<T,Compare,IntervalT>(I_D(2,4), I_D(4,6));
+ test_inner_complement<T,Compare,IntervalT>(I_D(3,7), I_D(5,8));
+ test_inner_complement<T,Compare,IntervalT>(I_D(7,9), I_D(0,4));
+ test_inner_complement<T,Compare,IntervalT>(I_D(0,0), I_D(0,0));
+ test_inner_complement<T,Compare,IntervalT>(I_D(1,0), I_D(2,0));
+
+ test_inner_complement<T,Compare,IntervalT>(C_I(1,5), C_I(4,9));
+ test_inner_complement<T,Compare,IntervalT>(C_I(4,6), C_I(1,3));
+ test_inner_complement<T,Compare,IntervalT>(C_I(0,2), C_I(4,6));
+ test_inner_complement<T,Compare,IntervalT>(C_I(0,2), C_I(0,6));
+
+ test_inner_complement<T,Compare,IntervalT>(I_I(7,9), I_I(0,5));
+ test_inner_complement<T,Compare,IntervalT>(I_I(0,9), I_I(2,5));
+
+ test_inner_complement<T,Compare,IntervalT>(C_D(6,9), C_D(1,4));
+ test_inner_complement<T,Compare,IntervalT>(C_D(1,3), C_D(1,4));
+ test_inner_complement<T,Compare,IntervalT>(C_D(1,3), C_D(6,8));
+ test_inner_complement<T,Compare,IntervalT>(C_D(1,7), C_D(1,6));
+ test_inner_complement<T,Compare,IntervalT>(C_D(1,1), C_D(1,1));
+ test_inner_complement<T,Compare,IntervalT>(C_D(3,0), C_D(4,0));
+ test_inner_complement<T,Compare,IntervalT>(C_D(0,2), C_D(4,6));
+ test_inner_complement<T,Compare,IntervalT>(C_D(0,2), C_D(0,6));
+}
+
+
+
+#endif // BOOST_ITL_TEST_ICL_INTERVAL_CONTINUOUS_HPP_JOFA_100930
Added: sandbox/itl/libs/itl/test/test_icl_discrete_interval.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_icl_discrete_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -0,0 +1,97 @@
+/*-----------------------------------------------------------------------------+
+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)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_TEST_ICL_DISCRETE_INTERVAL_HPP_JOFA_100930
+#define BOOST_ITL_TEST_ICL_DISCRETE_INTERVAL_HPP_JOFA_100930
+
+
+template <class T, class IntervalT>
+void discrete_interval_traits()
+{
+ //JODO gcc? BOOST_CHECK_EQUAL(is_interval<IntervalT>::value, true);
+ //JODO..
+}
+
+template <class T, class IntervalT>
+void discrete_interval_ctor__dis_4_dyn_v_sta() // discrete && (dynamic or static)
+{
+ BOOST_CHECK_EQUAL( IntervalT(MK_v(3)), IntervalT(MK_v(3)) );
+ //JODO BOOST_CHECK_EQUAL( itl::contains(IntervalT(MK_v(0)), MK_v(0)), true ); nicht für alle (l,u]
+ BOOST_CHECK_EQUAL( itl::contains(IntervalT(MK_v(1)), MK_v(1)), true );
+}
+
+template <class T, ITL_COMPARE Compare>
+void distant_intervals_4_discrete_types()
+{
+ typedef rightopen_interval<T,Compare> L__D; // L__D for [..)
+ typedef leftopen_interval<T,Compare> C__I; // C__I for (..]
+ typedef closed_interval<T,Compare> L__I; // L__I for [..]
+ typedef open_interval<T,Compare> C__D; // C__D for (..)
+ typedef discrete_interval<T,Compare> IntervalT;
+
+ BOOST_CHECK( is_interval<L__D>::value );
+ BOOST_CHECK( has_difference<typename interval_traits<L__D>::domain_type>::value );
+ BOOST_CHECK( is_discrete<typename interval_traits<L__D>::domain_type>::value );
+ BOOST_CHECK( (is_same<typename interval_traits<L__D>::domain_type, T>::value) );
+
+ typedef typename difference_type_of<T>::type DiffT;
+
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,0,4), MK_I(L__D,8,9));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,7,8), MK_I(L__D,2,3));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,2,4), MK_I(L__D,4,6));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,3,7), MK_I(L__D,5,8));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,7,9), MK_I(L__D,0,4));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,0,0), MK_I(L__D,0,0));
+ test_inner_complement<T,Compare,L__D>(MK_I(L__D,1,0), MK_I(L__D,2,0));
+
+ test_inner_complement<T,Compare,C__I>(MK_I(C__I,1,5), MK_I(C__I,4,9));
+ test_inner_complement<T,Compare,C__I>(MK_I(C__I,4,6), MK_I(C__I,1,3));
+ test_inner_complement<T,Compare,C__I>(MK_I(C__I,0,2), MK_I(C__I,4,6));
+ test_inner_complement<T,Compare,C__I>(MK_I(C__I,0,2), MK_I(C__I,0,6));
+
+ test_inner_complement<T,Compare,L__I>(MK_I(L__I,7,9), MK_I(L__I,0,5));
+ test_inner_complement<T,Compare,L__I>(MK_I(L__I,0,9), MK_I(L__I,2,5));
+
+ test_inner_complement<T,Compare,C__D>(MK_I(C__D,6,9), MK_I(C__D,1,4));
+ test_inner_complement<T,Compare,C__D>(MK_I(C__D,1,3), MK_I(C__D,1,4));
+ test_inner_complement<T,Compare,C__D>(MK_I(C__D,1,3), MK_I(C__D,6,8));
+ test_inner_complement<T,Compare,C__D>(MK_I(C__D,1,7), MK_I(C__D,1,6));
+ test_inner_complement<T,Compare,C__D>(MK_I(C__D,1,1), MK_I(C__D,1,1));
+ test_inner_complement<T,Compare,C__D>(MK_I(C__D,3,0), MK_I(C__D,4,0));
+ test_inner_complement<T,Compare,C__D>(MK_I(C__D,0,2), MK_I(C__D,4,6));
+ test_inner_complement<T,Compare,C__D>(MK_I(C__D,0,2), MK_I(C__D,0,6));
+
+ //--------------------------------------------------------------------------
+ test_inner_complement<T,Compare,IntervalT>(I_D(0,4), I_D(8,9));
+ test_inner_complement<T,Compare,IntervalT>(I_D(7,8), I_D(2,3));
+ test_inner_complement<T,Compare,IntervalT>(I_D(2,4), I_D(4,6));
+ test_inner_complement<T,Compare,IntervalT>(I_D(3,7), I_D(5,8));
+ test_inner_complement<T,Compare,IntervalT>(I_D(7,9), I_D(0,4));
+ test_inner_complement<T,Compare,IntervalT>(I_D(0,0), I_D(0,0));
+ test_inner_complement<T,Compare,IntervalT>(I_D(1,0), I_D(2,0));
+
+ test_inner_complement<T,Compare,IntervalT>(C_I(1,5), C_I(4,9));
+ test_inner_complement<T,Compare,IntervalT>(C_I(4,6), C_I(1,3));
+ test_inner_complement<T,Compare,IntervalT>(C_I(0,2), C_I(4,6));
+ test_inner_complement<T,Compare,IntervalT>(C_I(0,2), C_I(0,6));
+
+ test_inner_complement<T,Compare,IntervalT>(I_I(7,9), I_I(0,5));
+ test_inner_complement<T,Compare,IntervalT>(I_I(0,9), I_I(2,5));
+
+ test_inner_complement<T,Compare,IntervalT>(C_D(6,9), C_D(1,4));
+ test_inner_complement<T,Compare,IntervalT>(C_D(1,3), C_D(1,4));
+ test_inner_complement<T,Compare,IntervalT>(C_D(1,3), C_D(6,8));
+ test_inner_complement<T,Compare,IntervalT>(C_D(1,7), C_D(1,6));
+ test_inner_complement<T,Compare,IntervalT>(C_D(1,1), C_D(1,1));
+ test_inner_complement<T,Compare,IntervalT>(C_D(3,0), C_D(4,0));
+ test_inner_complement<T,Compare,IntervalT>(C_D(0,2), C_D(4,6));
+ test_inner_complement<T,Compare,IntervalT>(C_D(0,2), C_D(0,6));
+
+}
+
+
+#endif // BOOST_ITL_TEST_ICL_DISCRETE_INTERVAL_HPP_JOFA_100930
Added: sandbox/itl/libs/itl/test/test_icl_dynamic_interval.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_icl_dynamic_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -0,0 +1,28 @@
+/*-----------------------------------------------------------------------------+
+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)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_TEST_ICL_DYNAMIC_INTERVAL_HPP_JOFA_100930
+#define BOOST_ITL_TEST_ICL_DYNAMIC_INTERVAL_HPP_JOFA_100930
+
+template <class IntervalT>
+void dynamic_interval_ctor_4_ordered_types()
+{
+ typedef typename domain_type_of<interval_traits<IntervalT> >::type T;
+
+ BOOST_CHECK_EQUAL(IntervalT().lower(), itl::neutron<T>::value());
+ BOOST_CHECK_EQUAL(IntervalT().upper(), itl::neutron<T>::value());
+ BOOST_CHECK_EQUAL(itl::lower(IntervalT()), itl::neutron<T>::value());
+ BOOST_CHECK_EQUAL(itl::upper(IntervalT()), itl::neutron<T>::value());
+
+ IntervalT itv = IntervalT(itl::neutron<T>::value(), itl::neutron<T>::value());
+ BOOST_CHECK_EQUAL(IntervalT(), IntervalT(itl::neutron<T>::value(), itl::neutron<T>::value()));
+ BOOST_CHECK_EQUAL(IntervalT(), IntervalT(itl::neutron<T>::value(), itl::neutron<T>::value(), interval_bounds::right_open()));
+}
+
+
+
+#endif // BOOST_ITL_TEST_ICL_DYNAMIC_INTERVAL_HPP_JOFA_100930
Added: sandbox/itl/libs/itl/test/test_icl_interval.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_icl_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -0,0 +1,90 @@
+/*-----------------------------------------------------------------------------+
+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)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_TEST_ICL_INTERVAL_HPP_JOFA_100930
+#define BOOST_ITL_TEST_ICL_INTERVAL_HPP_JOFA_100930
+
+// NOTE: ordered_types is the largest class of types that is admissable as
+// domain parameters for intervals and interval containers.
+// bicremental_types is a smaller class of types used for testing instead of
+// ordered types, because they can be generated in a simple
+// way using the functions of test_value_maker.hpp.
+
+template <class IntervalT>
+void interval_ctor_4_ordered_types()
+{
+ typedef typename domain_type_of<interval_traits<IntervalT> >::type T;
+ typedef typename itl::size_type_of<T>::type SizeT;
+ T t_0 = itl::neutron<T>::value();
+ T t_1 = itl::unon<T>::value();
+ SizeT s_0 = itl::neutron<SizeT>::value();
+ SizeT s_1 = itl::unon<SizeT>::value();
+
+ // Default ctor and emptieness
+ BOOST_CHECK_EQUAL( itl::is_empty(IntervalT()), true );
+ BOOST_CHECK_EQUAL( itl::cardinality(IntervalT()), s_0 );
+ BOOST_CHECK_EQUAL( itl::size(IntervalT()), s_0 );
+
+ BOOST_CHECK_EQUAL( IntervalT(), IntervalT() );
+ BOOST_CHECK_EQUAL( IntervalT(), IntervalT(IntervalT().lower(), IntervalT().upper()) );
+ BOOST_CHECK_EQUAL( IntervalT(), IntervalT(itl::lower(IntervalT()), itl::upper(IntervalT())) );
+
+ BOOST_CHECK_EQUAL(itl::cardinality(IntervalT(t_0, t_1)) >= s_1, true);
+ BOOST_CHECK_EQUAL(( itl::contains(IntervalT(t_0, t_1), t_0)
+ || itl::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(itl::construct<IntervalT>(t_0, t_1)), t_0);
+ BOOST_CHECK_EQUAL(upper(itl::construct<IntervalT>(t_0, t_1)), t_1);
+}
+
+
+template <class IntervalT>
+void singelizable_interval_4_ordered_types()
+{
+ // Singleton ctor and singleness
+ // LAW: !is_asymmetric_continuous(IntervalT) => size(singleton(x))==1
+ // LAW: This law applies to all discrete and to dynamic continuous intervals
+ // LAW: No singletons can be constructed for static continuous rightopen and leftopen intervals
+ typedef typename domain_type_of<interval_traits<IntervalT> >::type T;
+ typedef typename itl::size_type_of<T>::type SizeT;
+ T t_0 = itl::neutron<T>::value();
+ T t_1 = itl::unon<T>::value();
+ SizeT s_1 = itl::unon<SizeT>::value();
+
+ //JODO gcc BOOST_CHECK_EQUAL( itl::is_singelizable<IntervalT>::value, true );
+
+ BOOST_CHECK_EQUAL( itl::cardinality(itl::singleton<IntervalT>(t_0)), s_1 );
+ BOOST_CHECK_EQUAL( itl::size(itl::singleton<IntervalT>(t_0)), s_1 );
+ BOOST_CHECK_EQUAL( itl::cardinality(itl::singleton<IntervalT>(t_1)), s_1 );
+ BOOST_CHECK_EQUAL( itl::size(itl::singleton<IntervalT>(t_1)), s_1 );
+
+ BOOST_CHECK_EQUAL( itl::contains(itl::singleton<IntervalT>(t_0), t_0), true );
+ BOOST_CHECK_EQUAL( itl::contains(itl::singleton<IntervalT>(t_1), t_1), true );
+}
+
+template <class IntervalT>
+void singelizable_interval_4_bicremental_types()
+{
+ typedef typename domain_type_of<interval_traits<IntervalT> >::type T;
+ typedef typename itl::size_type_of<T>::type SizeT;
+ //T t_0 = itl::neutron<T>::value();
+ SizeT s_1 = itl::unon<SizeT>::value();
+
+ //JODO gcc BOOST_CHECK_EQUAL( itl::is_singelizable<IntervalT>::value, true );
+
+ BOOST_CHECK_EQUAL( itl::cardinality(IntervalT(MK_v(3))), s_1 );
+ BOOST_CHECK_EQUAL( itl::size(IntervalT(MK_v(4))), s_1 );
+ BOOST_CHECK_EQUAL( itl::singleton<IntervalT>(MK_v(2)), itl::singleton<IntervalT>(MK_v(2)) );
+ //JODO BOOST_CHECK_EQUAL( itl::contains(IntervalT(MK_v(0)), MK_v(0)), true ); nicht für alle (l,u]
+ BOOST_CHECK_EQUAL( itl::contains(IntervalT(MK_v(1)), MK_v(1)), true );
+}
+
+
+
+#endif // BOOST_ITL_TEST_ICL_INTERVAL_HPP_JOFA_100930
Added: sandbox/itl/libs/itl/test/test_icl_static_interval.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_icl_static_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -0,0 +1,24 @@
+/*-----------------------------------------------------------------------------+
+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)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ITL_TEST_ICL_STATIC_INTERVAL_HPP_JOFA_100930
+#define BOOST_ITL_TEST_ICL_STATIC_INTERVAL_HPP_JOFA_100930
+
+template <class T, class IntervalT>
+void static_interval_ctor_4_ordered_types()
+{
+ BOOST_CHECK_EQUAL(itl::is_empty(IntervalT()), true);
+ BOOST_CHECK_EQUAL(itl::cardinality(IntervalT()), itl::neutron<typename itl::size_type_of<T>::type>::value());
+ BOOST_CHECK_EQUAL(itl::size(IntervalT()), itl::neutron<typename itl::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(itl::lower(IntervalT()), itl::upper(IntervalT())) );
+}
+
+
+#endif // BOOST_ITL_TEST_ICL_STATIC_INTERVAL_HPP_JOFA_100930
Modified: sandbox/itl/libs/itl/test/test_itl_interval.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_itl_interval.hpp (original)
+++ sandbox/itl/libs/itl/test/test_itl_interval.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -11,20 +11,30 @@
template <class T, class IntervalT>
void interval_ctor_4_ordered_types()
{
+ T lower_bound = given<mpl::or_<is_static_rightopen<IntervalT>, is_static_open<IntervalT> >, T>
+ ::then(neutron<T>::value(), unon<T>::value());
+
+ typedef typename domain_type_of<IntervalT>::type Dom1T;
+ typedef typename domain_type_of<interval_traits<IntervalT> >::type Dom2T;
+ BOOST_CHECK_EQUAL(is_same<Dom1T, Dom2T>::value, true);
+
+
// An empty interval is defined as the closed interval [1,0]
BOOST_CHECK_EQUAL(itl::is_empty(IntervalT()), true);
BOOST_CHECK_EQUAL(itl::cardinality(IntervalT()), itl::neutron<typename itl::size_type_of<T>::type>::value());
BOOST_CHECK_EQUAL(itl::size(IntervalT()), itl::neutron<typename itl::size_type_of<T>::type>::value());
- BOOST_CHECK_EQUAL(IntervalT().lower(), itl::unon<T>::value());
+ BOOST_CHECK_EQUAL(IntervalT().lower(), lower_bound);
BOOST_CHECK_EQUAL(IntervalT().upper(), itl::neutron<T>::value());
- BOOST_CHECK_EQUAL(itl::lower(IntervalT()), itl::unon<T>::value());
+ BOOST_CHECK_EQUAL(itl::lower(IntervalT()), lower_bound);
BOOST_CHECK_EQUAL(itl::upper(IntervalT()), itl::neutron<T>::value());
- //BOOST_CHECK_EQUAL(IntervalT(), IntervalT());
- //BOOST_CHECK_EQUAL(IntervalT(), IntervalT(itl::unon<T>::value(), itl::neutron<T>::value()));
+ BOOST_CHECK_EQUAL(IntervalT(), IntervalT());
+ BOOST_CHECK_EQUAL(IntervalT(), IntervalT(lower_bound, itl::neutron<T>::value()));
+
//BOOST_CHECK_EQUAL(IntervalT(), IntervalT(itl::unon<T>::value(), itl::neutron<T>::value(), closed_bounded));
}
+/*JODO
template <class T>
void interval_ctor_4_bicremental_types()
{
@@ -409,6 +419,7 @@
diff_2.left_subtract(I0_3D);
BOOST_CHECK_EQUAL( diff_2, I4_7D );
}
+*/
/*JODO
template <class T>
Modified: sandbox/itl/libs/itl/test/test_itl_interval_/test_itl_interval.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_itl_interval_/test_itl_interval.cpp (original)
+++ sandbox/itl/libs/itl/test/test_itl_interval_/test_itl_interval.cpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -22,14 +22,90 @@
using namespace unit_test;
using namespace boost::itl;
-
#include "../test_itl_interval_shared.hpp"
-#include "../test_itl_interval.hpp"
+#include "../test_icl_interval.hpp"
+#include "../test_icl_dynamic_interval.hpp"
+#include "../test_icl_discrete_interval.hpp"
+#include "../test_icl_continuous_interval.hpp"
+#include "../test_icl_static_interval.hpp"
+
+#include <boost/itl/rightopen_interval.hpp>
+#include <boost/itl/leftopen_interval.hpp>
+#include <boost/itl/closed_interval.hpp>
+#include <boost/itl/open_interval.hpp>
+
+#include <boost/itl/discrete_interval.hpp>
+#include <boost/itl/continuous_interval.hpp>
+
+//- sta.asy.{dis|con} ----------------------------------------------------------
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_rightopen_interval_ctor_4_ordered_types, T, ordered_types)
+{ interval_ctor_4_ordered_types<rightopen_interval<T> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_rightopen_interval_4_ordered_types, T, discrete_types)
+{ singelizable_interval_4_ordered_types<rightopen_interval<T> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_rightopen_interval_4_bicremental_types, T, discrete_types)
+{ singelizable_interval_4_bicremental_types<rightopen_interval<T> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_leftopen_interval_ctor_4_ordered_types, T, ordered_types)
+{ interval_ctor_4_ordered_types<leftopen_interval<T> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_leftopen_interval_4_ordered_types_singelizable, T, signed_discrete_types)
+{ singelizable_interval_4_ordered_types<leftopen_interval<T> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_leftopen_interval_4_bicremental_types, T, discrete_types)
+{ singelizable_interval_4_bicremental_types<leftopen_interval<T> >(); }
+
+//------------------------------------------------------------------------------
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_distant_intervals_4_discrete_types, T, discrete_types)
+{ distant_intervals_4_discrete_types<T, std::less>(); }
BOOST_AUTO_TEST_CASE_TEMPLATE
-(test_itl_interval_ctor_4_ordered_types, T, ordered_types)
-{ interval_ctor_4_ordered_types<T>(); }
+(test_itl_distant_intervals_4_numeric_continuous_types, T, numeric_continuous_types)
+{ distant_intervals_4_numeric_continuous_types<T, std::less>(); }
+
+/*
+//- dyn.dis --------------------------------------------------------------------
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_discrete_interval_ctor_4_discrete_types_base)
+{ interval_ctor_4_ordered_types<discrete_interval<discrete_type_1> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_discrete_interval_ctor_4_discrete_types_dynamic)
+{ dynamic_interval_ctor_4_ordered_types<discrete_interval<discrete_type_2> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_discrete_interval_4_ordered_types)
+{ singelizable_interval_4_ordered_types<discrete_interval<discrete_type_3> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_discrete_interval_4_bicremental_types)
+{ singelizable_interval_4_bicremental_types<discrete_interval<discrete_type_3> >(); }
+
+//- dyn.con --------------------------------------------------------------------
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_continuous_interval_ctor_4_continuous_types_base)
+{ interval_ctor_4_ordered_types<continuous_interval<continuous_type_1> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_continuous_interval_ctor_4_continuous_types_dynamic)
+{ dynamic_interval_ctor_4_ordered_types<continuous_interval<continuous_type_2> >(); }
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_continuous_interval_4_continuous_types_singelizable)
+{ singelizable_interval_4_ordered_types<continuous_interval<continuous_type_3> >(); }
+*/
+
+/*
BOOST_AUTO_TEST_CASE_TEMPLATE
(test_itl_interval_ctor_4_bicremental_types, T, bicremental_types)
{ interval_ctor_4_bicremental_types<T>(); }
@@ -38,7 +114,7 @@
(test_itl_interval_ctor_4_integral_types, T, integral_types)
{ interval_ctor_4_integral_types<T>(); }
-BOOST_AUTO_TEST_CASE
+BOOST_AUTO_TEST_CASE_TEMPLATE
(test_itl_interval_ctor_specific)
{ interval_ctor_specific(); }
@@ -73,6 +149,7 @@
BOOST_AUTO_TEST_CASE_TEMPLATE
(test_itl_interval_subtract_4_bicremental_types, T, bicremental_types)
{ interval_subtract_4_bicremental_types<T>(); }
+*/
/*JODO
BOOST_AUTO_TEST_CASE_TEMPLATE
Modified: sandbox/itl/libs/itl/test/test_itl_interval_shared.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_itl_interval_shared.hpp (original)
+++ sandbox/itl/libs/itl/test/test_itl_interval_shared.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -10,7 +10,7 @@
#include <boost/itl/interval_set.hpp>
-
+/*CL after check
template <class T, ITL_COMPARE Compare,
ITL_INTERVAL(ITL_COMPARE) Interval>
void interval_ctor_4_ordered_types()
@@ -142,6 +142,8 @@
// BOOST_CHECK_EQUAL( C3_7D, C3_7D );
//}
+*/
+
template <class DomainT, ITL_COMPARE Compare,
ITL_INTERVAL(ITL_COMPARE) Interval>
@@ -156,6 +158,7 @@
BOOST_CHECK_EQUAL(itl::length(inner_complement(itv2,itv1)), itl::distance(itv1,itv2));
BOOST_CHECK_EQUAL(itl::length(inner_complement(itv2,itv1)), itl::distance(itv2,itv1));
+ IntervalT in_comp = inner_complement(itv1,itv2);
ItvSetT itvset, inner_comp;
itvset.add(itv1).add(itv2);
ItvSetT hullset = ItvSetT(hull(itvset));
@@ -166,9 +169,35 @@
BOOST_CHECK_EQUAL(inner_complement(itv1,itv2), inner_comp_itv);
BOOST_CHECK_EQUAL(inner_complement(itv2,itv1), inner_comp_itv);
- BOOST_CHECK_EQUAL(inner_comp.length(), itl::distance(itv1,itv2));
- BOOST_CHECK_EQUAL(inner_comp.length(), itl::distance(itv2,itv1));
+ BOOST_CHECK_EQUAL(itl::length(inner_comp), itl::distance(itv1,itv2));
+ BOOST_CHECK_EQUAL(itl::length(inner_comp), itl::distance(itv2,itv1));
+
+ BOOST_CHECK(itl::disjoint(itv1, in_comp));
+ BOOST_CHECK(itl::disjoint(itv2, in_comp));
+
+ IntervalT itv1_comp = hull(itv1, in_comp);
+ IntervalT itv2_comp = hull(itv2, in_comp);
+
+ if(!itl::is_empty(in_comp))
+ {
+ BOOST_CHECK(itl::intersects(itv1_comp, in_comp));
+ BOOST_CHECK(itl::intersects(itv2_comp, in_comp));
+
+ BOOST_CHECK_EQUAL(itv1_comp & itv2_comp, in_comp);
+ BOOST_CHECK_EQUAL( itl::is_empty(itv1_comp & itv2_comp), itl::disjoint(itv1_comp, itv2_comp));
+ BOOST_CHECK_EQUAL(!itl::is_empty(itv1_comp & itv2_comp), itl::intersects(itv1_comp, itv2_comp));
+ }
}
+template <class IntervalT>
+void test_inner_complement_(const IntervalT& itv1, const IntervalT& itv2)
+{
+ typedef typename interval_traits<IntervalT>::domain_type DomainT;
+ // For the test of plain interval types we assume that std::less is
+ // the compare functor
+ test_inner_complement<DomainT, std::less, IntervalT>(itv1, itv2);
+}
+
+
#endif // __test_itl_interval_shared_hpp_JOFA_100306__
Modified: sandbox/itl/libs/itl/test/test_type_lists.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_type_lists.hpp (original)
+++ sandbox/itl/libs/itl/test/test_type_lists.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -39,6 +39,18 @@
typedef short bicremental_type_7;
typedef float bicremental_type_8;
+typedef ::boost::mpl::list<
+ short, int, long, long long
+ ,float, double, long double
+ ,boost::rational<int>
+> signed_bicremental_types;
+
+typedef int signed_bicremental_type_1;
+typedef double signed_bicremental_type_2;
+typedef boost::rational<int> signed_bicremental_type_3;
+typedef short signed_bicremental_type_4;
+typedef float signed_bicremental_type_5;
+
//DBG short list for debugging
typedef ::boost::mpl::list<
int
@@ -80,6 +92,24 @@
typedef unsigned int discrete_type_5;
typedef ::boost::mpl::list<
+ short, int, long
+> signed_discrete_types;
+
+typedef int signed_discrete_type_1;
+typedef short signed_discrete_type_2;
+typedef long signed_discrete_type_3;
+
+typedef ::boost::mpl::list<
+ float, double, long double
+ ,boost::rational<int>
+> numeric_continuous_types;
+
+typedef double numeric_continuous_type_1;
+typedef float numeric_continuous_type_2;
+typedef boost::rational<int> numeric_continuous_type_3;
+typedef long double numeric_continuous_type_4;
+
+typedef ::boost::mpl::list<
float, double, long double
,boost::rational<int>
,std::string
Modified: sandbox/itl/libs/itl/test/test_value_maker.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_value_maker.hpp (original)
+++ sandbox/itl/libs/itl/test/test_value_maker.hpp 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -131,8 +131,9 @@
}
};
+
// Very short value denotation for intervals
-// Assumption typename T existes in scope
+// Assumption typename T and IntervalT exists in scope
//I_I : [a,b]
#define I_I(low,up) IntervalT::closed (make<T>(low), make<T>(up))
//I_D : [a,b)
@@ -142,6 +143,8 @@
//C_D : (a,b)
#define C_D(low,up) IntervalT::open (make<T>(low), make<T>(up))
+#define MK_I(ItvT,low,up) ItvT(make<T>(low), make<T>(up))
+
#define MK_v(key) make<T>(key)
#define MK_u(key) make<U>(key)
Modified: sandbox/itl/libs/validate/example/boostcon_abelian_monoids_/vc9_boostcon_abelian_monoids.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/boostcon_abelian_monoids_/vc9_boostcon_abelian_monoids.vcproj (original)
+++ sandbox/itl/libs/validate/example/boostcon_abelian_monoids_/vc9_boostcon_abelian_monoids.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -182,11 +182,11 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath="..\..\src\gentor\gentorprofile.cpp"
+ RelativePath="..\boostcon_abelian_monoids_\boostcon_abelian_monoids.cpp"
>
</File>
<File
- RelativePath="..\boostcon_abelian_monoids_\boostcon_abelian_monoids.cpp"
+ RelativePath="..\..\src\gentor\gentorprofile.cpp"
>
</File>
</Filter>
Modified: sandbox/itl/libs/validate/example/boostcon_law_validater_/vc9_boostcon_law_validater.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/boostcon_law_validater_/vc9_boostcon_law_validater.vcproj (original)
+++ sandbox/itl/libs/validate/example/boostcon_law_validater_/vc9_boostcon_law_validater.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -119,7 +119,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -181,11 +181,11 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath="..\..\src\gentor\gentorprofile.cpp"
+ RelativePath="..\boostcon_law_validater_\boostcon_law_validater.cpp"
>
</File>
<File
- RelativePath="..\boostcon_law_validater_\boostcon_law_validater.cpp"
+ RelativePath="..\..\src\gentor\gentorprofile.cpp"
>
</File>
</Filter>
Modified: sandbox/itl/libs/validate/example/de_morgan_/vc9_de_morgan.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/de_morgan_/vc9_de_morgan.vcproj (original)
+++ sandbox/itl/libs/validate/example/de_morgan_/vc9_de_morgan.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -119,7 +119,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -181,11 +181,11 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath="..\..\src\gentor\gentorprofile.cpp"
+ RelativePath="..\de_morgan_\de_morgan.cpp"
>
</File>
<File
- RelativePath="..\de_morgan_\de_morgan.cpp"
+ RelativePath="..\..\src\gentor\gentorprofile.cpp"
>
</File>
</Filter>
Modified: sandbox/itl/libs/validate/example/labat_bit_collector_/vc9_labat_bit_collector.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_bit_collector_/vc9_labat_bit_collector.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_bit_collector_/vc9_labat_bit_collector.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_collector_/vc9_labat_collector.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_collector_/vc9_labat_collector.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_collector_/vc9_labat_collector.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_itl_morphic_/vc9_labat_itl_morphic.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_itl_morphic_/vc9_labat_itl_morphic.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_itl_morphic_/vc9_labat_itl_morphic.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_itl_set_/vc9_labat_itl_set.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_itl_set_/vc9_labat_itl_set.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_itl_set_/vc9_labat_itl_set.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_itv_bitset_/vc9_labat_itv_bitset.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_itv_bitset_/vc9_labat_itv_bitset.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_itv_bitset_/vc9_labat_itv_bitset.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_map_copy_conformity_/vc9_labat_map_copy_conformity.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_map_copy_conformity_/vc9_labat_map_copy_conformity.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_map_copy_conformity_/vc9_labat_map_copy_conformity.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_map_order_/vc9_labat_map_order.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_map_order_/vc9_labat_map_order.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_map_order_/vc9_labat_map_order.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_set_copy_conformity_/vc9_labat_set_copy_conformity.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_set_copy_conformity_/vc9_labat_set_copy_conformity.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_set_copy_conformity_/vc9_labat_set_copy_conformity.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_set_order_/vc9_labat_set_order.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_set_order_/vc9_labat_set_order.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_set_order_/vc9_labat_set_order.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_signed_quantifier_/vc9_labat_signed_quantifier.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_signed_quantifier_/vc9_labat_signed_quantifier.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_signed_quantifier_/vc9_labat_signed_quantifier.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_single_/vc9_labat_single.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_single_/vc9_labat_single.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_single_/vc9_labat_single.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -119,7 +119,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_sorted_assoc_bitset_/vc9_labat_sorted_assoc_bitset.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_sorted_assoc_bitset_/vc9_labat_sorted_assoc_bitset.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_sorted_assoc_bitset_/vc9_labat_sorted_assoc_bitset.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_sorted_assoc_bitset_back_/vc9_labat_sorted_assoc_bitset_back.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_sorted_assoc_bitset_back_/vc9_labat_sorted_assoc_bitset_back.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_sorted_assoc_bitset_back_/vc9_labat_sorted_assoc_bitset_back.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_sorted_assoc_map_/vc9_labat_sorted_assoc_map.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_sorted_assoc_map_/vc9_labat_sorted_assoc_map.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_sorted_assoc_map_/vc9_labat_sorted_assoc_map.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_sorted_assoc_map_back_/vc9_labat_sorted_assoc_map_back.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_sorted_assoc_map_back_/vc9_labat_sorted_assoc_map_back.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_sorted_assoc_map_back_/vc9_labat_sorted_assoc_map_back.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_sorted_assoc_set_/vc9_labat_sorted_assoc_set.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_sorted_assoc_set_/vc9_labat_sorted_assoc_set.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_sorted_assoc_set_/vc9_labat_sorted_assoc_set.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_sorted_assoc_set_back_/vc9_labat_sorted_assoc_set_back.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_sorted_assoc_set_back_/vc9_labat_sorted_assoc_set_back.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_sorted_assoc_set_back_/vc9_labat_sorted_assoc_set_back.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_unsigned_quantifier_/vc9_labat_unsigned_quantifier.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_unsigned_quantifier_/vc9_labat_unsigned_quantifier.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_unsigned_quantifier_/vc9_labat_unsigned_quantifier.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/labat_val_relations_/vc9_labat_val_relations.vcproj
==============================================================================
--- sandbox/itl/libs/validate/example/labat_val_relations_/vc9_labat_val_relations.vcproj (original)
+++ sandbox/itl/libs/validate/example/labat_val_relations_/vc9_labat_val_relations.vcproj 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ITL_USE_STATIC_INTERVAL_BORDER_DEFAULTS"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Modified: sandbox/itl/libs/validate/example/vc9_validate_examples.sln
==============================================================================
--- sandbox/itl/libs/validate/example/vc9_validate_examples.sln (original)
+++ sandbox/itl/libs/validate/example/vc9_validate_examples.sln 2010-10-05 19:02:05 EDT (Tue, 05 Oct 2010)
@@ -45,8 +45,6 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_boostcon_abelian_monoids", "boostcon_abelian_monoids_\vc9_boostcon_abelian_monoids.vcproj", "{BF42574F-66E2-42DD-90D9-3A8FCE6F4733}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_fastest_itl_map", "..\..\itl\test\fastest_itl_map_\vc9_fastest_itl_map.vcproj", "{DD9C9854-3882-42B9-BFA1-C6CEBFCE309B}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -141,10 +139,6 @@
{BF42574F-66E2-42DD-90D9-3A8FCE6F4733}.Debug|Win32.Build.0 = Debug|Win32
{BF42574F-66E2-42DD-90D9-3A8FCE6F4733}.Release|Win32.ActiveCfg = Release|Win32
{BF42574F-66E2-42DD-90D9-3A8FCE6F4733}.Release|Win32.Build.0 = Release|Win32
- {DD9C9854-3882-42B9-BFA1-C6CEBFCE309B}.Debug|Win32.ActiveCfg = Debug|Win32
- {DD9C9854-3882-42B9-BFA1-C6CEBFCE309B}.Debug|Win32.Build.0 = Debug|Win32
- {DD9C9854-3882-42B9-BFA1-C6CEBFCE309B}.Release|Win32.ActiveCfg = Release|Win32
- {DD9C9854-3882-42B9-BFA1-C6CEBFCE309B}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
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