|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65653 - in sandbox/itl: boost/itl boost/itl/concept boost/itl/detail boost/itl/type_traits boost/itl_xt libs/itl/test
From: afojgo_at_[hidden]
Date: 2010-09-28 16:18:04
Author: jofaber
Date: 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
New Revision: 65653
URL: http://svn.boost.org/trac/boost/changeset/65653
Log:
Refactoring: Cleaning up the code, renaming, removing unused code. Stable{msvc-9.0, gcc-3.4.4}
Added:
sandbox/itl/boost/itl/detail/on_absorbtion.hpp (contents, props changed)
Removed:
sandbox/itl/boost/itl/detail/on_neutric.hpp
Text files modified:
sandbox/itl/boost/itl/concept/container.hpp | 18 ++
sandbox/itl/boost/itl/concept/element_map.hpp | 36 +++++
sandbox/itl/boost/itl/concept/interval_associator.hpp | 7 +
sandbox/itl/boost/itl/concept/interval_map.hpp | 70 ++++++------
sandbox/itl/boost/itl/concept/interval_set.hpp | 22 ++-
sandbox/itl/boost/itl/detail/associated_value.hpp | 2
sandbox/itl/boost/itl/detail/interval_map_algo.hpp | 2
sandbox/itl/boost/itl/detail/interval_set_algo.hpp | 2
sandbox/itl/boost/itl/interval_base_map.hpp | 139 ++++--------------------
sandbox/itl/boost/itl/interval_base_set.hpp | 118 +--------------------
sandbox/itl/boost/itl/interval_map.hpp | 10
sandbox/itl/boost/itl/map.hpp | 69 +++++------
sandbox/itl/boost/itl/set.hpp | 21 +--
sandbox/itl/boost/itl/split_interval_map.hpp | 10
sandbox/itl/boost/itl/type_traits/interval_type_default.hpp | 2
sandbox/itl/boost/itl_xt/interval_bitset.hpp | 10
sandbox/itl/libs/itl/test/test_interval_map_mixed.hpp | 217 ++++++++++++++++++++-------------------
sandbox/itl/libs/itl/test/test_interval_map_shared.hpp | 127 ++++++++++++----------
sandbox/itl/libs/itl/test/test_interval_set_mixed.hpp | 12 +-
sandbox/itl/libs/itl/test/test_interval_set_shared.hpp | 81 ++++++++------
sandbox/itl/libs/itl/test/test_itl_interval_shared.hpp | 4
21 files changed, 421 insertions(+), 558 deletions(-)
Modified: sandbox/itl/boost/itl/concept/container.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/container.hpp (original)
+++ sandbox/itl/boost/itl/concept/container.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -9,7 +9,10 @@
#define BOOST_ITL_CONCEPT_CONTAINER_HPP_JOFA_100923
#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
#include <boost/itl/type_traits/is_container.hpp>
+#include <boost/itl/type_traits/is_icl_container.hpp>
namespace boost{ namespace itl
{
@@ -42,12 +45,23 @@
//==============================================================================
template<class Type>
-typename enable_if<is_container<Type>, typename Type::size_type>::type
+typename enable_if<mpl::and_< is_container<Type>
+ , mpl::not_<is_icl_container<Type> > >
+ , std::size_t>::type
iterative_size(const Type& object)
{
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
//==============================================================================
@@ -56,7 +70,7 @@
typename enable_if<is_container<Type>, void>::type
swap(Type& left, Type& right)
{
- left.swap(right); //JODO test
+ left.swap(right);
}
//==============================================================================
Modified: sandbox/itl/boost/itl/concept/element_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/element_map.hpp (original)
+++ sandbox/itl/boost/itl/concept/element_map.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -10,6 +10,7 @@
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
+#include <boost/itl/detail/on_absorbtion.hpp>
#include <boost/itl/type_traits/is_total.hpp>
#include <boost/itl/type_traits/absorbs_neutrons.hpp>
#include <boost/itl/type_traits/is_associative_element_container.hpp>
@@ -156,9 +157,9 @@
//------------------------------------------------------------------------------
template <class Type>
inline typename enable_if<is_element_map<Type>, Type>::type&
-operator -= (Type& object, const typename Type::set_type& subtrahend)
+operator -= (Type& object, const typename Type::set_type& operand)
{
- return Set::erase(object, subtrahend); //JODO
+ return Set::erase(object, operand);
}
template <class Type>
@@ -169,6 +170,31 @@
}
//==============================================================================
+//= Selective Update<ElementMap>
+//==============================================================================
+//------------------------------------------------------------------------------
+//- T& set_at(T&, c P&) T:{m} P:{b}
+//------------------------------------------------------------------------------
+template<class Type>
+inline typename enable_if<is_element_map<Type>, Type>::type&
+set_at(Type& object, const typename Type::element_type& operand)
+{
+ typedef typename Type::iterator iterator;
+ typedef typename Type::codomain_combine codomain_combine;
+ typedef on_absorbtion<Type,codomain_combine,absorbs_neutrons<Type>::value>
+ on_neutron_absorbtion;
+
+ if(!on_neutron_absorbtion::is_absorbable(operand.second))
+ {
+ std::pair<iterator,bool> insertion = object.insert(operand);
+ if(!insertion.second)
+ insertion->second = operand.second;
+ }
+ return object;
+}
+
+
+//==============================================================================
//= Intersection
//==============================================================================
template<class Type>
@@ -253,14 +279,14 @@
inline typename enable_if<is_element_map<Type>, Type>::type
operator & (Type object, const typename Type::key_object_type& operand)
{
- return object &= operand; //JODO test a - (a & s) == a - s
+ return object &= operand;
}
template<class Type>
inline typename enable_if<is_element_map<Type>, Type>::type
operator & (const typename Type::key_object_type& operand, Type object)
{
- return object &= operand; //JODO test a - (s & a) == a - s
+ return object &= operand;
}
//==============================================================================
@@ -302,7 +328,7 @@
, bool>::type
intersects(const Type& object, const typename Type::element_type& operand)
{
- Type intersection; //JODO opti
+ Type intersection;
itl::add_intersection(intersection, object, operand);
return !intersection.empty();
}
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -126,6 +126,13 @@
}
template<class Type>
+inline typename enable_if<is_interval_container<Type>, typename Type::size_type>::type
+size(const Type& object)
+{
+ return itl::cardinality(object);
+}
+
+template<class Type>
typename enable_if<is_interval_container<Type>, typename Type::difference_type>::type
length(const Type& object)
{
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -123,7 +123,6 @@
return Interval_Set::within(sub, super);
}
-
//==============================================================================
//= Addition<IntervalMap>
//==============================================================================
@@ -132,16 +131,16 @@
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_map<Type>, Type>::type&
-add(Type& object, const typename Type::element_type& operand)
+add(Type& object, const typename Type::segment_type& operand)
{
return object.add(operand);
}
template<class Type>
typename enable_if<is_interval_map<Type>, Type>::type&
-add(Type& object, const typename Type::segment_type& operand)
+add(Type& object, const typename Type::element_type& operand)
{
- return object.add(operand);
+ return itl::add(object, make_segment<Type>(operand));
}
//------------------------------------------------------------------------------
@@ -163,16 +162,16 @@
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_map<Type>, Type>::type&
-insert(Type& object, const typename Type::element_type& operand)
+insert(Type& object, const typename Type::segment_type& operand)
{
return object.insert(operand);
}
template<class Type>
-typename enable_if<is_interval_map<Type>, Type>::type&
-insert(Type& object, const typename Type::segment_type& operand)
+inline typename enable_if<is_interval_map<Type>, Type>::type&
+insert(Type& object, const typename Type::element_type& operand)
{
- return object.insert(operand);
+ return itl::insert(object, make_segment<Type>(operand));
}
//------------------------------------------------------------------------------
@@ -195,16 +194,17 @@
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_map<Type>, Type>::type&
-erase(Type& object, const typename Type::domain_type& minuend)
+erase(Type& object, const typename Type::interval_type& operand)
{
- return object.erase(minuend);
+ return object.erase(operand);
}
template<class Type>
typename enable_if<is_interval_map<Type>, Type>::type&
-erase(Type& object, const typename Type::interval_type& minuend)
+erase(Type& object, const typename Type::domain_type& operand)
{
- return object.erase(minuend);
+ typedef typename Type::interval_type interval_type;
+ return itl::erase(object, itl::construct<interval_type>(operand));
}
//------------------------------------------------------------------------------
@@ -212,16 +212,16 @@
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_map<Type>, Type>::type&
-erase(Type& object, const typename Type::element_type& minuend)
+erase(Type& object, const typename Type::segment_type& operand)
{
- return object.erase(minuend);
+ return object.erase(operand);
}
template<class Type>
-typename enable_if<is_interval_map<Type>, Type>::type&
-erase(Type& object, const typename Type::segment_type& minuend)
+inline typename enable_if<is_interval_map<Type>, Type>::type&
+erase(Type& object, const typename Type::element_type& operand)
{
- return object.erase(minuend);
+ return itl::erase(object, make_segment<Type>(operand));
}
//==============================================================================
@@ -231,17 +231,17 @@
//- T& subtract(T&, c P&) T:{M} P:{b p} fragment_types
//------------------------------------------------------------------------------
template<class Type>
-typename enable_if<is_interval_map<Type>, Type>::type&
-subtract(Type& object, const typename Type::element_type& operand)
+typename enable_if<is_interval_map<Type>, Type>::type&
+subtract(Type& object, const typename Type::segment_type& operand)
{
return object.subtract(operand);
}
template<class Type>
-typename enable_if<is_interval_map<Type>, Type>::type&
-subtract(Type& object, const typename Type::segment_type& operand)
+typename enable_if<is_interval_map<Type>, Type>::type&
+subtract(Type& object, const typename Type::element_type& operand)
{
- return object.subtract(operand);
+ return itl::subtract(object, make_segment<Type>(operand));
}
//------------------------------------------------------------------------------
@@ -293,7 +293,8 @@
add_intersection(Type& section, const Type& object,
const typename Type::element_type& operand)
{
- object.add_intersection(section, operand);
+ typedef typename Type::segment_type segment_type;
+ object.add_intersection(section, make_segment<Type>(operand));
}
template<class Type>
@@ -429,7 +430,7 @@
bool>::type
intersects(const Type& object, const OperandT& operand)
{
- Type intersection; //JODO
+ Type intersection;
itl::add_intersection(intersection, left, operand);
return !itl::is_empty(intersection);
}
@@ -443,25 +444,24 @@
return itl::intersects(object, make_segment<Type>(operand));
}
-//------------------------------------------------------------------------------
-//- Symmetric difference flip<Interval_Map> fragment_types
-//------------------------------------------------------------------------------
-//JODO NOTE: typename enable_if< mpl::and_< is_interval_map_right_intra_combinable<Type, OperandT> //JODO =^= fragment_type_of
+//==============================================================================
+//= Symmetric difference<IntervalMap>
+//==============================================================================
//------------------------------------------------------------------------------
//- T& flip(T&, c P&) T:{M} P:{b p} fragment_types
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_map<Type>, Type>::type&
-flip(Type& object, const typename Type::element_type& operand)
+flip(Type& object, const typename Type::segment_type& operand)
{
return object.flip(operand);
}
template<class Type>
-typename enable_if<is_interval_map<Type>, Type>::type&
-flip(Type& object, const typename Type::segment_type& operand)
+inline typename enable_if<is_interval_map<Type>, Type>::type&
+flip(Type& object, const typename Type::element_type& operand)
{
- return object.flip(operand);
+ return itl::flip(object, make_segment<Type>(operand));
}
//------------------------------------------------------------------------------
@@ -495,10 +495,10 @@
typedef typename Type::codomain_type codomain_type;
object += operand;
- ITL_FORALL(typename Type, it_, object) //JODO: neutralisierendes add.
+ ITL_FORALL(typename Type, it_, object)
it_->second = neutron<codomain_type>::value();
- if(mpl::not_<is_interval_splitter<Type> >::value) //JODO
+ if(mpl::not_<is_interval_splitter<Type> >::value)
itl::join(object);
return object;
@@ -556,7 +556,7 @@
//==============================================================================
//= Manipulation by predicates
//==============================================================================
-template<class MapT, class Predicate> //JODO unify with element_map . . .
+template<class MapT, class Predicate>
typename enable_if<is_interval_map<MapT>, MapT>::type&
erase_if(const Predicate& pred, MapT& object)
{
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -63,16 +63,17 @@
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_set<Type>, Type>::type&
-add(Type& object, const typename Type::element_type& operand)
+add(Type& object, const typename Type::segment_type& operand)
{
return object.add(operand);
}
template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-add(Type& object, const typename Type::segment_type& operand)
+inline typename enable_if<is_interval_set<Type>, Type>::type&
+add(Type& object, const typename Type::element_type& operand)
{
- return object.add(operand);
+ typedef typename Type::segment_type segment_type;
+ return itl::add(object, itl::construct<segment_type>(operand));
}
//------------------------------------------------------------------------------
@@ -94,14 +95,14 @@
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_set<Type>, Type>::type&
-insert(Type& object, const typename Type::element_type& operand)
+insert(Type& object, const typename Type::segment_type& operand)
{
return itl::add(object, operand);
}
template<class Type>
typename enable_if<is_interval_set<Type>, Type>::type&
-insert(Type& object, const typename Type::segment_type& operand)
+insert(Type& object, const typename Type::element_type& operand)
{
return itl::add(object, operand);
}
@@ -145,16 +146,17 @@
//------------------------------------------------------------------------------
template<class Type>
typename enable_if<is_interval_set<Type>, Type>::type&
-subtract(Type& object, const typename Type::element_type& operand)
+subtract(Type& object, const typename Type::segment_type& operand)
{
return object.subtract(operand);
}
template<class Type>
-typename enable_if<is_interval_set<Type>, Type>::type&
-subtract(Type& object, const typename Type::segment_type& operand)
+inline typename enable_if<is_interval_set<Type>, Type>::type&
+subtract(Type& object, const typename Type::element_type& operand)
{
- return object.subtract(operand);
+ typedef typename Type::segment_type segment_type;
+ return itl::subtract(object, itl::construct<segment_type>(operand));
}
//==============================================================================
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -16,7 +16,7 @@
namespace boost{namespace itl
{
-template<class Type, class CoType> //JODO Only maps of equal iterability shall match!
+template<class Type, class CoType>
typename enable_if< mpl::and_< is_domain_compare_equal<Type,CoType>
, mpl::and_<is_map<Type>, is_map<CoType> > >,
bool>::type
Modified: sandbox/itl/boost/itl/detail/interval_map_algo.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/interval_map_algo.hpp (original)
+++ sandbox/itl/boost/itl/detail/interval_map_algo.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -29,8 +29,6 @@
{
using namespace segmental;
-//JODO CLEAN UP for: #pragma warning(disable:4127) // conditional expression is constant
-
template<class IntervalMapT>
bool is_joinable(const IntervalMapT& container,
typename IntervalMapT::const_iterator first,
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -174,7 +174,7 @@
}
-template<class LeftT, class RightT> //JODO Codereplication: Unify some more
+template<class LeftT, class RightT>
typename enable_if<is_concept_combinable<is_interval_map, is_interval_map, LeftT, RightT>,
bool>::type
within(const LeftT& sub, const RightT& super)
Added: sandbox/itl/boost/itl/detail/on_absorbtion.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/detail/on_absorbtion.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -0,0 +1,43 @@
+/*-----------------------------------------------------------------------------+
+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_TYPE_TRAITS_ON_ABSORBTION_HPP_JOFA_100915
+#define BOOST_ITL_TYPE_TRAITS_ON_ABSORBTION_HPP_JOFA_100915
+
+namespace boost{ namespace itl
+{
+
+template<class Type, class Combiner, bool absorbs_neutrons>
+struct on_absorbtion;
+
+template<class Type, class Combiner>
+struct on_absorbtion<Type, Combiner, false>
+{
+ typedef on_absorbtion type;
+ typedef typename Type::codomain_type codomain_type;
+
+ static bool is_absorbable(const codomain_type&){ return false; }
+};
+
+template<class Type, class Combiner>
+struct on_absorbtion<Type, Combiner, true>
+{
+ typedef on_absorbtion type;
+ typedef typename Type::codomain_type codomain_type;
+ typedef typename Type::codomain_combine codomain_combine;
+
+ static bool is_absorbable(const codomain_type& co_value)
+ {
+ return co_value == Combiner::neutron();
+ }
+};
+
+}} // namespace boost itl
+
+#endif
+
+
Deleted: sandbox/itl/boost/itl/detail/on_neutric.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/on_neutric.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
+++ (empty file)
@@ -1,43 +0,0 @@
-/*-----------------------------------------------------------------------------+
-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_TYPE_TRAITS_ON_NEUTRIC_HPP_JOFA_100915
-#define BOOST_ITL_TYPE_TRAITS_ON_NEUTRIC_HPP_JOFA_100915
-
-namespace boost{ namespace itl
-{
-
-template<class Type, class Combiner, bool absorbs_neutrons>
-struct on_neutric; //JODO rename
-
-template<class Type, class Combiner>
-struct on_neutric<Type, Combiner, false>
-{
- typedef on_neutric type;
- typedef typename Type::codomain_type codomain_type;
-
- static bool is_absorbable(const codomain_type&){ return false; }
-};
-
-template<class Type, class Combiner>
-struct on_neutric<Type, Combiner, true>
-{
- typedef on_neutric type;
- typedef typename Type::codomain_type codomain_type;
- typedef typename Type::codomain_combine codomain_combine;
-
- static bool is_absorbable(const codomain_type& co_value)
- {
- return co_value == Combiner::neutron();
- }
-};
-
-}} // namespace boost itl
-
-#endif
-
-
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -17,7 +17,7 @@
#include <boost/itl/detail/notate.hpp>
#include <boost/itl/detail/design_config.hpp>
-#include <boost/itl/detail/on_neutric.hpp> //JODO rename
+#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>
@@ -133,8 +133,7 @@
<has_set_semantics<codomain_type>
, ITL_SECTION_CODOMAIN(Section,CodomainT)
, codomain_combine
- >::type codomain_intersect; //JODO extra metafunction?
- //JODO What, if codomain is not a set but the user want's to use a special intersection functor?
+ >::type codomain_intersect;
/// Inverse Combine functor for codomain value intersection
@@ -191,7 +190,7 @@
/// element const reverse iterator: Depreciated, see documentation.
typedef boost::itl::element_iterator<const_reverse_iterator> element_const_reverse_iterator;
- typedef typename on_neutric<type, codomain_combine,
+ typedef typename on_absorbtion<type, codomain_combine,
Traits::absorbs_neutrons>::type on_codomain_absorbtion;
public:
@@ -242,63 +241,22 @@
/** is the map empty? */
bool empty()const { return itl::is_empty(*that()); }
-
- /** Does the map contain some object \c sub of type \c CoType */
- template<class CoType>
- bool contains(const CoType& sub)const
- {
- return itl::contains(*that(), sub);
- }
-
- /** Is <tt>*this</tt> container within <tt>super</tt>? */
- template<class CoType>
- bool within(const CoType& super)const
- {
- return itl::within(*that(), super);
- }
-
//==========================================================================
//= Size
//==========================================================================
-
- /** Number of elements in the map (cardinality). */
- size_type cardinality()const
- {
- return itl::cardinality(*that());
- }
-
/** An interval map's size is it's cardinality */
size_type size()const
{
return itl::cardinality(*that());
}
- /** The length of the interval container which is the sum of interval lengths */
- difference_type length()const
- {
- return itl::length(*that());
- }
-
- /** Number of intervals which is also the size of the
- iteration over the object */
- size_t interval_count()const
- {
- return itl::interval_count(*that());
- }
-
/** Size of the iteration over this container */
- size_t iterative_size()const
+ std::size_t iterative_size()const
{
return _map.size();
}
//==========================================================================
- //= Range
- //==========================================================================
-
- //JODO remove lower, upper, first, last from the interface of all interval containers and docs
-
- //==========================================================================
//= Selection
//==========================================================================
@@ -308,7 +266,7 @@
return _map.find(interval_type(key));
}
- const_iterator find(const key_type& key)const
+ const_iterator find(const interval_type& key)const
{
return _map.find(key);
}
@@ -321,7 +279,6 @@
: it_->second;
}
-
//==========================================================================
//= Addition
//==========================================================================
@@ -329,7 +286,7 @@
/** Addition of a key value pair to the map */
SubType& add(const element_type& key_value_pair)
{
- return add(make_segment<type>(key_value_pair));
+ return itl::add(*that(), key_value_pair);
}
/** Addition of an interval value pair to the map. */
@@ -350,11 +307,10 @@
//==========================================================================
//= Subtraction
//==========================================================================
-
/** Subtraction of a key value pair from the map */
SubType& subtract(const element_type& key_value_pair)
{
- return subtract(make_segment<type>(key_value_pair));
+ return itl::subtract(*that(), key_value_pair);
}
/** Subtraction of an interval value pair from the map. */
@@ -371,7 +327,7 @@
/** Insertion of a \c key_value_pair into the map. */
SubType& insert(const element_type& key_value_pair)
{
- return insert(make_segment<type>(key_value_pair));
+ return itl::insert(*that(), key_value_pair);
}
/** Insertion of an \c interval_value_pair into the map. */
@@ -401,15 +357,13 @@
return itl::set_at(*that(), interval_value_pair);
}
-
//==========================================================================
//= Erasure
//==========================================================================
-
/** Erase a \c key_value_pair from the map. */
SubType& erase(const element_type& key_value_pair)
{
- erase(make_segment<type>(key_value_pair));
+ itl::erase(*that(), key_value_pair);
return *that();
}
@@ -419,7 +373,7 @@
/** Erase a key value pair for \c key. */
SubType& erase(const domain_type& key)
{
- return erase(interval_type(key));
+ return itl::erase(*that(), key);
}
/** Erase all value pairs within the range of the
@@ -437,13 +391,6 @@
//==========================================================================
//= Intersection
//==========================================================================
-
- /** The intersection of \c key_value_pair and \c *this map is added to \c section. */
- void add_intersection(SubType& section, const element_type& key_value_pair)const
- {
- add_intersection(section, make_segment<type>(key_value_pair));
- }
-
/** The intersection of \c interval_value_pair and \c *this map is added to \c section. */
void add_intersection(SubType& section, const segment_type& interval_value_pair)const
{
@@ -451,50 +398,21 @@
::add_intersection(section, *that(), interval_value_pair);
}
- /** Returns \c true, if element \c key is found in \c *this map.
- Complexity: logarithmic. */
- bool intersects(const domain_type& key)const
- {
- return itl::intersects(*that(), key);
- }
-
- /** Returns \c true, if \c inter_val intersects with \c *this map.
- Complexity: Logarithmic in iterative size. */
- bool intersects(const interval_type& inter_val)const
- {
- return itl::intersects(*that(), inter_val);
- }
-
- /** Returns \c true, if \c key_value_pair is found in \c *this map.
- Complexity: logarithmic. */
- bool intersects(const element_type& key_value_pair)const
- {
- return itl::intersects(*that(), key_value_pair);
- }
-
- /** Returns \c true, if \c interval_value_pair intersects with \c *this map:
- Complexity: Linear in iterative_size. */
- bool intersects(const segment_type& interval_value_pair)const
- {
- return itl::intersects(*that(), interval_value_pair);
- }
-
//==========================================================================
//= Symmetric difference
//==========================================================================
-
/** If \c *this map contains \c key_value_pair it is erased, otherwise it is added. */
SubType& flip(const element_type& key_value_pair)
{
- return flip(make_segment<type>(key_value_pair));
+ return itl::flip(*that(), key_value_pair);
}
/** If \c *this map contains \c interval_value_pair it is erased, otherwise it is added. */
SubType& flip(const segment_type& interval_value_pair)
{
- return
on_total_absorbable<SubType, Traits::is_total, Traits::absorbs_neutrons>
::flip(*that(), interval_value_pair);
+ return *that();
}
//==========================================================================
@@ -610,7 +528,7 @@
{
// inter_val is not conained in this map. Insertion will be successful
BOOST_ASSERT(this->_map.find(inter_val) == this->_map.end());
- BOOST_ASSERT((!on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(co_val)));
+ BOOST_ASSERT((!on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(co_val)));
return this->_map.insert(prior_, value_type(inter_val, version<Combiner>()(co_val)));
}
@@ -620,7 +538,7 @@
const codomain_type& co_val )
{
// Never try to insert a neutron into a neutron absorber here:
- BOOST_ASSERT((!(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(co_val))));
+ BOOST_ASSERT((!(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(co_val))));
iterator inserted_
= this->_map.insert(prior_, value_type(inter_val, Combiner::neutron()));
@@ -763,8 +681,8 @@
template<class Type>
struct on_total_absorbable<Type, true, true>
{
- static Type& flip(Type& object, const typename Type::segment_type& operand)
- { itl::clear(object); return object; }
+ static void flip(Type& object, const typename Type::segment_type& operand)
+ { itl::clear(object); }
};
template<class Type>
@@ -773,16 +691,14 @@
typedef typename Type::segment_type segment_type;
typedef typename Type::codomain_type codomain_type;
- static Type& flip(Type& object, const segment_type& operand)
+ static void flip(Type& object, const segment_type& operand)
{
object += operand;
- ITL_FORALL(typename Type, it_, object) //JODO: neutralisierendes add.
+ ITL_FORALL(typename Type, it_, object)
it_->second = neutron<codomain_type>::value();
- if(mpl::not_<is_interval_splitter<Type> >::value) //JODO
+ if(mpl::not_<is_interval_splitter<Type> >::value)
itl::join(object);
-
- return object;
}
};
@@ -797,7 +713,7 @@
typedef typename Type::set_type set_type;
typedef typename Type::inverse_codomain_intersect inverse_codomain_intersect;
- static Type& flip(Type& object, const segment_type& interval_value_pair)
+ static void flip(Type& object, const segment_type& interval_value_pair)
{
// That which is common shall be subtracted
// That which is not shall be added
@@ -851,7 +767,6 @@
//finally rewrite the common segments
itl::erase(object, eraser);
object += intersection;
- return object;
}
};
//--------------------------------------------------------------------------
@@ -988,15 +903,15 @@
interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
::_add(const segment_type& addend)
{
- typedef typename on_neutric<type,Combiner,
- absorbs_neutrons<type>::value>::type on_neutric_;
+ typedef typename on_absorbtion<type,Combiner,
+ absorbs_neutrons<type>::value>::type on_absorbtion_;
const interval_type& inter_val = addend.first;
if(itl::is_empty(inter_val))
return this->_map.end();
const codomain_type& co_val = addend.second;
- if(on_neutric_::is_absorbable(co_val))
+ if(on_absorbtion_::is_absorbable(co_val))
return this->_map.end();
std::pair<iterator,bool> insertion
@@ -1026,15 +941,15 @@
interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
::_add(iterator prior_, const segment_type& addend)
{
- typedef typename on_neutric<type,Combiner,
- absorbs_neutrons<type>::value>::type on_neutric_;
+ typedef typename on_absorbtion<type,Combiner,
+ absorbs_neutrons<type>::value>::type on_absorbtion_;
const interval_type& inter_val = addend.first;
if(itl::is_empty(inter_val))
return prior_;
const codomain_type& co_val = addend.second;
- if(on_neutric_::is_absorbable(co_val))
+ if(on_absorbtion_::is_absorbable(co_val))
return prior_;
std::pair<iterator,bool> insertion
@@ -1124,7 +1039,7 @@
return;
const codomain_type& co_val = minuend.second;
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(co_val))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(co_val))
return;
std::pair<iterator, iterator> exterior = this->_map.equal_range(inter_val);
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -6,8 +6,8 @@
(See accompanying file LICENCE.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
+-----------------------------------------------------------------------------*/
-#ifndef __interval_base_set_h_JOFA_990223__
-#define __interval_base_set_h_JOFA_990223__
+#ifndef BOOST_ITL_INTERVAL_BASE_SET_H_JOFA_990223
+#define BOOST_ITL_INTERVAL_BASE_SET_H_JOFA_990223
#include <limits>
#include <boost/itl/type_traits/interval_type_default.hpp>
@@ -17,8 +17,8 @@
#include <boost/itl/detail/interval_set_algo.hpp>
#include <boost/itl/set.hpp>
#include <boost/itl/interval.hpp>
-#include <boost/itl/rightopen_interval.hpp> //JODO inclusion and customization of interval types
-#include <boost/itl/continuous_interval.hpp> //JODO inclusion and customization of interval types
+#include <boost/itl/rightopen_interval.hpp>
+#include <boost/itl/continuous_interval.hpp>
#include <boost/itl/detail/notate.hpp>
#include <boost/itl/detail/element_iterator.hpp>
@@ -35,7 +35,6 @@
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&);
@@ -229,7 +228,7 @@
/// element const reverse iterator: Depreciated, see documentation.
typedef boost::itl::element_iterator<const_reverse_iterator> element_const_reverse_iterator;
- enum { fineness = 4 };
+ BOOST_STATIC_CONSTANT(int, fineness = 0);
public:
//==========================================================================
@@ -254,58 +253,20 @@
//==========================================================================
//= Containedness
//==========================================================================
-
/** sets the container empty */
void clear() { itl::clear(*that()); }
/** is the container empty? */
bool empty()const { return itl::is_empty(*that()); }
-
- /** Does the set contain some object \c sub of type \c CoType */
- template<class CoType>
- bool contains(const CoType& sub)const
- {
- return itl::contains(*that(), sub);
- }
-
- /** Is <tt>*this</tt> container within <tt>super</tt>? */
- template<class CoType>
- bool within(const CoType& super)const
- {
- return itl::within(*that(), super);
- }
-
-
-
//==========================================================================
//= Size
//==========================================================================
-
- /** Number of elements in the set (cardinality).
- Infinite for continuous domain datatyps */
- size_type cardinality()const
- {
- return itl::cardinality(*that());
- }
-
/** An interval set's size is it's cardinality */
size_type size()const
{
return itl::cardinality(*that());
}
- /** The length of the interval container which is the sum of interval lengths */
- difference_type length()const
- {
- return itl::length(*that());
- }
-
- /** Number of intervals which is also the size of the iteration over the object */
- std::size_t interval_count()const
- {
- return itl::interval_count(*that());
- }
-
/** Size of the iteration over this container */
std::size_t iterative_size()const
{
@@ -313,12 +274,6 @@
}
//==========================================================================
- //= Range
- //==========================================================================
-
- //JODO remove lower, upper, first, last from the interface of all interval containers and docs
-
- //==========================================================================
//= Selection
//==========================================================================
@@ -340,7 +295,7 @@
/** Add a single element \c key to the set */
SubType& add(const element_type& key)
{
- return add(itl::construct<segment_type>(key));
+ return itl::add(*that(), key);
}
/** Add an interval of elements \c inter_val to the set */
@@ -365,7 +320,7 @@
/** Subtract a single element \c key from the set */
SubType& subtract(const element_type& key)
{
- return subtract(itl::construct<interval_type>(key));
+ return itl::subtract(*that(), key);
}
/** Subtract an interval of elements \c inter_val from the set */
@@ -423,60 +378,9 @@
_set.erase(first, past);
}
-
- //==========================================================================
- //= Intersection
- //==========================================================================
-
- /** The intersection of \c key in \c *this set is added to \c section.
- The function can be used as a find function. */
- void add_intersection(SubType& section, const element_type& key)const
- {
- itl::add_intersection(section, *that(), key);
- }
-
- /** The intersection of \c inter_val in \c *this set is added to \c section. */
- void add_intersection(SubType& section, const segment_type& inter_val)const
- {
- itl::add_intersection(section, *that(), inter_val);
- }
-
-
- /** The intersection of set \c sectant with \c *this set is added to \c section. */
- template
- <
- template<class DomT, ITL_COMPARE Comp,
- ITL_INTERVAL2(ITL_COMPARE) Interv, ITL_ALLOC Allc>
- class IntervalSet
- >
- void add_intersection
- (
- SubType& section,
- const IntervalSet<DomainT,Compare,Interval,Alloc>& operand
- )const
- {
- itl::add_intersection(section, *that(), operand);
- }
-
-
- /** Returns \c true, if element \c key is found in \c *this map.
- Complexity: logarithmic. */
- bool intersects(const element_type& key)const
- {
- return itl::intersects(*that(), key);
- }
-
- /** Returns \c true, if \c inter_val intersects with \c *this map.
- Complexity: logarithmic. */
- bool intersects(const interval_type& inter_val)const
- {
- return itl::intersects(*that(), inter_val);
- }
-
//==========================================================================
//= Symmetric difference
//==========================================================================
-
/** If \c *this set contains \c key it is erased, otherwise it is added. */
SubType& flip(const element_type& key)
{
@@ -489,14 +393,6 @@
return itl::flip(*that(), inter_val);
}
- /** The intersection of \c *this and \c operand is erased from \c *this.
- The complemenary elements are added to \c *this. */
- template<class SubType2>
- SubType& flip(const interval_base_set<SubType2,DomainT,Compare,Interval,Alloc>& operand)
- {
- return itl::flip(*that(), operand); //JODO remove this
- }
-
//==========================================================================
//= Iterator related
//==========================================================================
Modified: sandbox/itl/boost/itl/interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_map.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -131,7 +131,7 @@
template<class Combiner>
void handle_left_combined(iterator it_)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
this->_map.erase(it_);
else
segmental::join_left(*this, it_);
@@ -140,7 +140,7 @@
template<class Combiner>
void handle_combined(iterator it_)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
this->_map.erase(it_);
else
segmental::join_neighbours(*this, it_);
@@ -149,7 +149,7 @@
template<class Combiner>
void handle_preceeded_combined(iterator prior_, iterator& it_)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
{
this->_map.erase(it_);
it_ = prior_;
@@ -161,7 +161,7 @@
template<class Combiner>
void handle_succeeded_combined(iterator it_, iterator next_)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
{
this->_map.erase(it_);
segmental::join_right(*this, next_);
@@ -185,7 +185,7 @@
void gap_insert_at(iterator& it_, iterator prior_,
const interval_type& end_gap, const codomain_type& co_val)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
{
this->_map.erase(it_);
it_ = this->template gap_insert<Combiner>(prior_, end_gap, co_val);
Modified: sandbox/itl/boost/itl/map.hpp
==============================================================================
--- sandbox/itl/boost/itl/map.hpp (original)
+++ sandbox/itl/boost/itl/map.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -24,7 +24,7 @@
#include <boost/itl/detail/notate.hpp>
#include <boost/itl/detail/design_config.hpp>
#include <boost/itl/detail/concept_check.hpp>
-#include <boost/itl/detail/on_neutric.hpp>
+#include <boost/itl/detail/on_absorbtion.hpp>
#include <boost/itl/type_traits/is_map.hpp>
#include <boost/itl/type_traits/absorbs_neutrons.hpp>
#include <boost/itl/type_traits/is_total.hpp>
@@ -126,8 +126,7 @@
<has_set_semantics<codomain_type>
, ITL_SECTION_CODOMAIN(Section,CodomainT)
, codomain_combine
- >::type codomain_intersect; //JODO extra metafuction?
- //JODO What, if codomain is not a set but the user want's to use a special intersection functor?
+ >::type codomain_intersect;
typedef typename inverse<codomain_intersect>::type inverse_codomain_intersect;
typedef typename base_type::value_compare value_compare;
@@ -136,7 +135,7 @@
BOOST_STATIC_CONSTANT(bool,
total_invertible = (mpl::and_<is_total<type>, has_inverse<codomain_type> >::value));
- typedef on_neutric<type,codomain_combine,Traits::absorbs_neutrons>
+ typedef on_absorbtion<type,codomain_combine,Traits::absorbs_neutrons>
on_neutron_absorbtion;
public:
@@ -241,7 +240,7 @@
/** \c iterative_size() yields the number of elements that is visited
throu complete iteration. For interval sets \c iterative_size() is
different from \c size(). */
- size_t iterative_size()const { return size(); } //JODO
+ std::size_t iterative_size()const { return base_type::size(); }
//==========================================================================
//= Selection
@@ -314,14 +313,15 @@
/** With <tt>key_value_pair = (k,v)</tt> set value \c v for key \c k */
map& set(const element_type& key_value_pair)
{
- (*this)[key_value_pair.first] = key_value_pair.second; //JODO absorbs_neutrons?
- return *this;
+ return itl::set_at(*this, key_value_pair);
}
/** erase \c key_value_pair from the map.
Erase only if, the exact value content \c val is stored for the given key. */
size_type erase(const element_type& key_value_pair)
- { return itl::erase(*this, key_value_pair); }
+ {
+ return itl::erase(*this, key_value_pair);
+ }
//==========================================================================
//= Intersection
@@ -334,11 +334,11 @@
}
/** Returns true, if there is an intersection of \c operand and \c *this map. */
- template<class OperandT>
- bool intersects(const OperandT& operand)const
- {
- return itl::intersects(*this, operand);
- }
+ //CL template<class OperandT>
+ //bool intersects(const OperandT& operand)const
+ //{
+ // return itl::intersects(*this, operand);
+ //}
//==========================================================================
//= Symmetric difference
@@ -346,7 +346,8 @@
map& flip(const element_type& operand)
{
- return on_total_absorbable<type,_total,_absorbs>::flip(*this, operand);
+ on_total_absorbable<type,_total,_absorbs>::flip(*this, operand);
+ return *this;
}
private:
@@ -483,8 +484,8 @@
struct on_total_absorbable<Type, true, true>
{
typedef typename Type::element_type element_type;
- static Type& flip(Type& object, const typename Type::element_type&)
- { itl::clear(object); return object; }
+ static void flip(Type& object, const typename Type::element_type&)
+ { itl::clear(object); }
};
template<class Type>
@@ -493,13 +494,11 @@
typedef typename Type::element_type element_type;
typedef typename Type::codomain_type codomain_type;
- static Type& flip(Type& object, const element_type& operand)
+ static void flip(Type& object, const element_type& operand)
{
object.add(operand);
- ITL_FORALL(typename Type, it_, object)//JODO URG sollte man vorher abfangen
+ ITL_FORALL(typename Type, it_, object)
it_->second = neutron<codomain_type>::value();
-
- return object;
}
};
@@ -511,14 +510,12 @@
typedef typename Type::iterator iterator;
typedef typename Type::inverse_codomain_intersect inverse_codomain_intersect;
- static Type& flip(Type& object, const element_type& operand)
+ static void flip(Type& object, const element_type& operand)
{
std::pair<iterator,bool> insertion = object.insert(operand);
if(!insertion.second)
on_codomain_model<Type, has_set_semantics<codomain_type>::value, true>
::subtract(object, insertion.first, operand.second);
-
- return object; //JODO return of Type& not necessary
}
};
@@ -530,14 +527,12 @@
typedef typename Type::iterator iterator;
typedef typename Type::inverse_codomain_intersect inverse_codomain_intersect;
- static Type& flip(Type& object, const element_type& operand)
+ static void flip(Type& object, const element_type& operand)
{
std::pair<iterator,bool> insertion = object.insert(operand);
if(!insertion.second)
on_codomain_model<Type, has_set_semantics<codomain_type>::value, false>
::subtract(object, insertion.first, operand.second);
-
- return object; //JODO return of Type& not necessary
}
};
@@ -559,11 +554,11 @@
map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>
::_add(const element_type& addend)
{
- typedef typename on_neutric
- <type,Combiner,absorbs_neutrons<type>::value>::type on_neutric_;
+ typedef typename on_absorbtion
+ <type,Combiner,absorbs_neutrons<type>::value>::type on_absorbtion_;
const codomain_type& co_val = addend.second;
- if(on_neutric_::is_absorbable(co_val))
+ if(on_absorbtion_::is_absorbable(co_val))
return *this;
std::pair<iterator,bool> insertion
@@ -574,7 +569,7 @@
iterator it = insertion.first;
Combiner()((*it).second, co_val);
- if(on_neutric_::is_absorbable((*it).second))
+ if(on_absorbtion_::is_absorbable((*it).second))
erase(it);
}
return *this;
@@ -587,11 +582,11 @@
map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>
::_add(iterator prior_, const value_type& addend)
{
- typedef typename on_neutric
- <type,Combiner,absorbs_neutrons<type>::value>::type on_neutric_;
+ typedef typename on_absorbtion
+ <type,Combiner,absorbs_neutrons<type>::value>::type on_absorbtion_;
const codomain_type& co_val = addend.second;
- if(on_neutric_::is_absorbable(co_val))
+ if(on_absorbtion_::is_absorbable(co_val))
return end();
iterator inserted_
@@ -599,7 +594,7 @@
value_type(addend.first, Combiner::neutron()));
Combiner()(inserted_->second, addend.second);
- if(on_neutric_::is_absorbable(inserted_->second))
+ if(on_absorbtion_::is_absorbable(inserted_->second))
{
erase(inserted_);
return end();
@@ -617,14 +612,14 @@
map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>&
map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>::_subtract(const value_type& minuend)
{
- typedef typename on_neutric
- <type,Combiner,absorbs_neutrons<type>::value>::type on_neutric_;
+ typedef typename on_absorbtion
+ <type,Combiner,absorbs_neutrons<type>::value>::type on_absorbtion_;
iterator it_ = find(minuend.first);
if(it_ != end())
{
Combiner()(it_->second, minuend.second);
- if(on_neutric_::is_absorbable(it_->second))
+ if(on_absorbtion_::is_absorbable(it_->second))
erase(it_);
}
return *this;
Modified: sandbox/itl/boost/itl/set.hpp
==============================================================================
--- sandbox/itl/boost/itl/set.hpp (original)
+++ sandbox/itl/boost/itl/set.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -172,9 +172,9 @@
/** \c iterative_size() yields the number of elements that is visited
throu complete iteration. For interval sets \c iterative_size() is
different from \c size(). */
- size_t iterative_size()const { return size(); }
+ std::size_t iterative_size()const { return base_type::size(); }
- size_t cardinality()const { return size(); }
+ size_t cardinality()const { return base_type::size(); }
//==========================================================================
//= Addition, subtraction
@@ -192,28 +192,21 @@
{ return itl::subtract(*this, element); }
//==========================================================================
- //= Insertion, erasure
- //==========================================================================
-
- //JODO
-
- //==========================================================================
//= Intersection, symmetric difference
//==========================================================================
-
/** Add \c element to \c section, if \c element is in \c *this set */
- void add_intersection(set& section, const element_type& element)const
- { itl::add_intersection(section, *this, element); }
+ //CL . . . void add_intersection(set& section, const element_type& element)const
+ //{ itl::add_intersection(section, *this, element); }
/** The intersection of set \c sectant with \c *this set is added
to \c section. */
- void add_intersection(set& section, const set& sectant)const
- { itl::add_intersection(section, *this, sectant); }
+ //void add_intersection(set& section, const set& sectant)const
+ //{ itl::add_intersection(section, *this, sectant); }
/** Returns true, if there is an intersection of \c element and \c *this set.
Functions \c intersects and \c contains are identical on arguments
of type \c element_type. Complexity: Logarithmic in container size. */
- bool intersects(const element_type& element)const { return contains(element); }
+ //bool intersects(const element_type& element)const { return contains(element); }
/** If \c *this set contains \c element it is erased, otherwise it is added. */
set& flip(const element_type& element)
Modified: sandbox/itl/boost/itl/split_interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/split_interval_map.hpp (original)
+++ sandbox/itl/boost/itl/split_interval_map.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -105,21 +105,21 @@
template<class Combiner>
void handle_left_combined(iterator it_)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
this->_map.erase(it_);
}
template<class Combiner>
void handle_combined(iterator it_)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
this->_map.erase(it_);
}
template<class Combiner>
void handle_preceeded_combined(iterator prior_, iterator& it_)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
{
this->_map.erase(it_);
it_ = prior_;
@@ -129,7 +129,7 @@
template<class Combiner>
void handle_succeeded_combined(iterator it_, iterator)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
this->_map.erase(it_);
}
@@ -139,7 +139,7 @@
void gap_insert_at(iterator& it_, iterator prior_,
const interval_type& end_gap, const codomain_type& co_val)
{
- if(on_neutric<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_neutrons>::is_absorbable(it_->second))
{
this->_map.erase(it_);
it_ = this->template gap_insert<Combiner>(prior_, end_gap, co_val);
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -24,7 +24,7 @@
typedef rightopen_interval<DomainT,Compare> type;
#else
typedef
- typename mpl::if_< is_continuous<DomainT> //JODO add Traits to choose between static and dynamic intervals
+ typename mpl::if_< is_continuous<DomainT>
, continuous_interval<DomainT,Compare>
, discrete_interval<DomainT,Compare> >::type type;
#endif
Modified: sandbox/itl/boost/itl_xt/interval_bitset.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/interval_bitset.hpp (original)
+++ sandbox/itl/boost/itl_xt/interval_bitset.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -148,17 +148,17 @@
interval_bitset& intersect(const element_type& rhs) {return segment_apply(&interval_bitset::intersect_,interval_type(rhs));}
interval_bitset& flip (const element_type& rhs) {return segment_apply(&interval_bitset::flip_, interval_type(rhs));}
- void clear(){ ITL_FUN_CALL(clear, _map); }
- bool empty()const{ return ITL_FUN_REN(empty, is_empty, _map); }
+ void clear() { itl::clear(_map); }
+ bool empty()const { return itl::is_empty(_map); }
size_type cardinality()const;
size_type size()const { return cardinality(); }
- size_type interval_count()const { return _map.interval_count(); }
+ size_type interval_count()const { return interval_count(_map); }
size_type iterative_size()const { return _map.iterative_size(); }
bool contains(element_type element)const{ return _map(element>>shift).contains(element & mask); }
bool contains(const segment_type& segment)const;
- bool contains(const interval_bitset& sub)const { return _map.contains(sub._map); }
- bool contained_in(const interval_bitset& super)const{ return _map.contained_in(super._map); }
+ bool contains(const interval_bitset& sub)const { return itl::contains(_map, sub._map); }
+ bool contained_in(const interval_bitset& super)const{ return itl::within(_map, super._map); }
void show_segments()const;
void show_matrix(const char off_on[2] = " 1")const;
Modified: sandbox/itl/libs/itl/test/test_interval_map_mixed.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_map_mixed.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_map_mixed.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -132,7 +132,7 @@
SplitIntervalMapT split_map;
split_map.add(I1_3D_1).add(I2_4D_1).add(I4_5D_1);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 4 );
IntervalMapT join_map(split_map);
}
@@ -162,10 +162,10 @@
SplitIntervalMapT split_map;
split_map.add(I1_3D_1).add(I2_4D_1).add(I4_5D_1);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 4 );
IntervalMapT join_map;
join_map = split_map;
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map), 3 );
}
@@ -232,11 +232,12 @@
itl::domain(sep_set, split_map);
itl::domain(join_set, split_map);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
- BOOST_CHECK_EQUAL( split_set.iterative_size(), 4 );
- BOOST_CHECK_EQUAL( sep_set.iterative_size(), 4 );
- BOOST_CHECK_EQUAL( join_set.iterative_size(), 2 );
+ iterative_size(split_map);
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(split_set), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(sep_set), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(join_set), 2 );
BOOST_CHECK_EQUAL( inclusion_compare(split_map, join_map), inclusion::equal );
BOOST_CHECK_EQUAL( inclusion_compare(join_map, split_map), inclusion::equal );
@@ -264,12 +265,12 @@
// ->2 ->1 ->1 ->2
split_interval_map<T,U,Trt> split_sub_map1 = split_map;
split_sub_map1.erase(MK_v(2));
- BOOST_CHECK_EQUAL( call::contains(split_sub_map1, MK_v(2)), false );
+ BOOST_CHECK_EQUAL( itl::contains(split_sub_map1, MK_v(2)), false );
interval_map<T,U,Trt> join_sub_map2;
join_sub_map2 = split_map;
join_sub_map2.erase(MK_v(1));
- BOOST_CHECK_EQUAL( call::contains(join_sub_map2, MK_v(1)), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_sub_map2, MK_v(1)), false );
split_interval_set<T> split_sub_set1;
separate_interval_set<T> sep_sub_set1;
@@ -352,42 +353,42 @@
itl::domain(sep_set, split_map);
itl::domain(join_set, split_map);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
- BOOST_CHECK_EQUAL( split_set.iterative_size(), 4 );
- BOOST_CHECK_EQUAL( sep_set.iterative_size(), 4 );
- BOOST_CHECK_EQUAL( join_set.iterative_size(), 2 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(split_set), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(sep_set), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(join_set), 2 );
// Key types
- BOOST_CHECK_EQUAL( call::contains(split_map, MK_v(0)), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, MK_v(5)), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, MK_v(9)), true );
-
- BOOST_CHECK_EQUAL( call::contains(split_map, I_D(2,3)), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, I_D(0,6)), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, I_D(0,7)), false );
- BOOST_CHECK_EQUAL( call::contains(join_map, I_D(2,3)), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, I_D(0,6)), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, I_D(0,7)), false );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, MK_v(0)), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, MK_v(5)), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, MK_v(9)), true );
+
+ BOOST_CHECK_EQUAL( itl::contains(split_map, I_D(2,3)), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, I_D(0,6)), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, I_D(0,7)), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, I_D(2,3)), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, I_D(0,6)), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, I_D(0,7)), false );
// Map types
- BOOST_CHECK_EQUAL( call::contains(join_map, K_v(1,2)), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, K_v(5,1)), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, K_v(9,2)), true );
-
- BOOST_CHECK_EQUAL( call::contains(split_map, IDv(2,6,1)), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, IDv(1,6,1)), false );
- BOOST_CHECK_EQUAL( call::contains(split_map, IIv(8,9,2)), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, IIv(8,9,3)), false );
- BOOST_CHECK_EQUAL( call::contains(join_map, IDv(2,6,1)), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, IDv(1,6,1)), false );
- BOOST_CHECK_EQUAL( call::contains(join_map, IIv(8,9,2)), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, IIv(8,9,3)), false );
-
- BOOST_CHECK_EQUAL( call::contains(split_map, join_map), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, split_map), true );
- BOOST_CHECK_EQUAL( call::within(split_map, join_map), true );
- BOOST_CHECK_EQUAL( call::within(join_map, split_map), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, K_v(1,2)), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, K_v(5,1)), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, K_v(9,2)), true );
+
+ BOOST_CHECK_EQUAL( itl::contains(split_map, IDv(2,6,1)), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, IDv(1,6,1)), false );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, IIv(8,9,2)), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, IIv(8,9,3)), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, IDv(2,6,1)), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, IDv(1,6,1)), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, IIv(8,9,2)), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, IIv(8,9,3)), false );
+
+ BOOST_CHECK_EQUAL( itl::contains(split_map, join_map), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, split_map), true );
+ BOOST_CHECK_EQUAL( itl::within(split_map, join_map), true );
+ BOOST_CHECK_EQUAL( itl::within(join_map, split_map), true );
//--------------------------------------------------------------------------
// inclusions
@@ -398,12 +399,12 @@
// ->2 ->1 ->1 ->2
split_interval_map<T,U,Trt> split_sub_map1 = split_map;
split_sub_map1.erase(MK_v(2));
- BOOST_CHECK_EQUAL( call::contains(split_sub_map1, MK_v(2)), false );
+ BOOST_CHECK_EQUAL( itl::contains(split_sub_map1, MK_v(2)), false );
interval_map<T,U,Trt> join_sub_map2;
join_sub_map2 = split_map;
join_sub_map2.erase(MK_v(1));
- BOOST_CHECK_EQUAL( call::contains(join_sub_map2, MK_v(1)), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_sub_map2, MK_v(1)), false );
split_interval_set<T> split_sub_set1;
separate_interval_set<T> sep_sub_set1;
@@ -413,22 +414,22 @@
itl::domain(sep_sub_set1, split_sub_map1);
itl::domain(join_sub_set1, split_sub_map1);
- BOOST_CHECK_EQUAL( call::within(split_sub_map1, split_map), true );
- BOOST_CHECK_EQUAL( call::within(join_sub_map2, split_map), true );
- BOOST_CHECK_EQUAL( call::within(split_sub_map1, join_map ), true );
- BOOST_CHECK_EQUAL( call::within(join_sub_map2, join_map ), true );
-
- BOOST_CHECK_EQUAL( call::contains(split_map, split_sub_map1), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, join_sub_map2), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, split_sub_map1), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, join_sub_map2), true );
-
- BOOST_CHECK_EQUAL( call::contains(split_map, split_sub_set1), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, sep_sub_set1), true );
- BOOST_CHECK_EQUAL( call::contains(split_map, join_sub_set1), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, split_sub_set1), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, sep_sub_set1), true );
- BOOST_CHECK_EQUAL( call::contains(join_map, join_sub_set1), true );
+ BOOST_CHECK_EQUAL( itl::within(split_sub_map1, split_map), true );
+ BOOST_CHECK_EQUAL( itl::within(join_sub_map2, split_map), true );
+ BOOST_CHECK_EQUAL( itl::within(split_sub_map1, join_map ), true );
+ BOOST_CHECK_EQUAL( itl::within(join_sub_map2, join_map ), true );
+
+ BOOST_CHECK_EQUAL( itl::contains(split_map, split_sub_map1), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, join_sub_map2), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, split_sub_map1), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, join_sub_map2), true );
+
+ BOOST_CHECK_EQUAL( itl::contains(split_map, split_sub_set1), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, sep_sub_set1), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, join_sub_set1), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, split_sub_set1), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, sep_sub_set1), true );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, join_sub_set1), true );
split_interval_map<T,U,Trt> split_unrel_map11 = split_sub_map1;
split_unrel_map11.set(CIv(7,9,1));
@@ -438,20 +439,20 @@
join_unrel_map21.set(K_v(0,1));
BOOST_CHECK_EQUAL( join_unrel_map21(MK_v(0)), MK_u(1) );
- BOOST_CHECK_EQUAL( call::contains(split_unrel_map11, split_map), false );
- BOOST_CHECK_EQUAL( call::contains(join_unrel_map21, split_map), false );
- BOOST_CHECK_EQUAL( call::contains(split_unrel_map11, join_map), false );
- BOOST_CHECK_EQUAL( call::contains(join_unrel_map21, join_map), false );
-
- BOOST_CHECK_EQUAL( call::within(split_unrel_map11, split_map), false );
- BOOST_CHECK_EQUAL( call::within(join_unrel_map21, split_map), false );
- BOOST_CHECK_EQUAL( call::within(split_unrel_map11, join_map), false );
- BOOST_CHECK_EQUAL( call::within(join_unrel_map21, join_map), false );
-
- BOOST_CHECK_EQUAL( call::contains(split_map, split_unrel_map11), false );
- BOOST_CHECK_EQUAL( call::contains(split_map, join_unrel_map21), false );
- BOOST_CHECK_EQUAL( call::contains(join_map, split_unrel_map11), false );
- BOOST_CHECK_EQUAL( call::contains(join_map, join_unrel_map21), false );
+ BOOST_CHECK_EQUAL( itl::contains(split_unrel_map11, split_map), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_unrel_map21, split_map), false );
+ BOOST_CHECK_EQUAL( itl::contains(split_unrel_map11, join_map), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_unrel_map21, join_map), false );
+
+ BOOST_CHECK_EQUAL( itl::within(split_unrel_map11, split_map), false );
+ BOOST_CHECK_EQUAL( itl::within(join_unrel_map21, split_map), false );
+ BOOST_CHECK_EQUAL( itl::within(split_unrel_map11, join_map), false );
+ BOOST_CHECK_EQUAL( itl::within(join_unrel_map21, join_map), false );
+
+ BOOST_CHECK_EQUAL( itl::contains(split_map, split_unrel_map11), false );
+ BOOST_CHECK_EQUAL( itl::contains(split_map, join_unrel_map21), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, split_unrel_map11), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_map, join_unrel_map21), false );
}
@@ -487,18 +488,18 @@
SplitIntervalMapT split_map;
split_map.add(I1_3D_1).add(I2_4D_1);
split_map += I4_5D_1;
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 4 );
IntervalMapT join_map;
join_map += split_map;
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map), 3 );
IntervalMapT join_map3;
join_map3.add(v1_1).add(v3_1);
join_map3 += v5_1;
- BOOST_CHECK_EQUAL( join_map3.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map3), 3 );
SplitIntervalMapT split_map3;
split_map3 += join_map3;
- BOOST_CHECK_EQUAL( split_map3.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map3), 3 );
}
template <class T, class U>
@@ -530,18 +531,18 @@
SplitIntervalMapT split_map;
split_map.add(I1_3D_1).add(I2_4D_1);
split_map |= I4_5D_1;
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 4 );
IntervalMapT join_map;
join_map |= split_map;
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map), 3 );
IntervalMapT join_map3;
join_map3.add(v1_1).add(v3_1);
join_map3 |= v5_1;
- BOOST_CHECK_EQUAL( join_map3.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map3), 3 );
SplitIntervalMapT split_map3;
split_map3 |= join_map3;
- BOOST_CHECK_EQUAL( split_map3.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map3), 3 );
}
@@ -582,11 +583,11 @@
SplitIntervalMapT split_map;
split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 7 );
IntervalMapT join_map;
join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map), 5 );
// Make maps to be subtracted
SplitIntervalMapT split_sub;
@@ -604,8 +605,8 @@
split_diff -= split_sub;
join_diff -= split_sub;
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 7 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(split_diff), 7 );
+ BOOST_CHECK_EQUAL( iterative_size(join_diff), 5 );
BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
@@ -620,8 +621,8 @@
split_diff -= join_sub;
join_diff -= join_sub;
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 7 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(split_diff), 7 );
+ BOOST_CHECK_EQUAL( iterative_size(join_diff), 5 );
BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
@@ -666,11 +667,11 @@
SplitIntervalMapT split_map;
split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 7 );
IntervalMapT join_map;
join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map), 5 );
// Make sets to be erased
SplitIntervalMapT split_sub;
@@ -688,8 +689,8 @@
erase(split_diff, split_sub);
erase(join_diff, split_sub);
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 6 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(split_diff), 6 );
+ BOOST_CHECK_EQUAL( iterative_size(join_diff), 5 );
BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
@@ -704,8 +705,8 @@
erase(split_diff, join_sub);
erase(join_diff, join_sub);
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 6 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(split_diff), 6 );
+ BOOST_CHECK_EQUAL( iterative_size(join_diff), 5 );
BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
@@ -752,11 +753,11 @@
SplitIntervalMapT split_map;
split_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( split_map.iterative_size(), 7 );
+ BOOST_CHECK_EQUAL( iterative_size(split_map), 7 );
IntervalMapT join_map;
join_map.add(I0_4D_1).add(I2_6D_1).add(I5_7D_1).add(I7_8D_1).add(I8_9I_1);
- BOOST_CHECK_EQUAL( join_map.iterative_size(), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(join_map), 5 );
// Make sets to be erased
SplitIntervalSetT split_sub;
@@ -776,8 +777,8 @@
erase(split_diff, split_sub);
erase(join_diff, split_sub);
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 5 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(split_diff), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(join_diff), 4 );
BOOST_CHECK_EQUAL( is_element_equal(split_diff, split_diff), true );
BOOST_CHECK_EQUAL( is_element_equal(split_diff, join_diff), true );
@@ -787,8 +788,8 @@
split_diff2 -= split_sub;
join_diff2 -= split_sub;
- BOOST_CHECK_EQUAL( split_diff2.iterative_size(), 5 );
- BOOST_CHECK_EQUAL( join_diff2.iterative_size(), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(split_diff2), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(join_diff2), 4 );
BOOST_CHECK_EQUAL( is_element_equal(split_diff2, split_diff2), true );
BOOST_CHECK_EQUAL( is_element_equal(split_diff2, join_diff2), true );
@@ -805,8 +806,8 @@
erase(split_diff, join_sub);
erase(join_diff, join_sub);
- BOOST_CHECK_EQUAL( split_diff.iterative_size(), 5 );
- BOOST_CHECK_EQUAL( join_diff.iterative_size(), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(split_diff), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(join_diff), 4 );
BOOST_CHECK_EQUAL( is_element_equal(join_diff, join_diff), true );
BOOST_CHECK_EQUAL( is_element_equal(join_diff, split_diff), true );
@@ -816,8 +817,8 @@
split_diff2 -= join_sub;
join_diff2 -= join_sub;
- BOOST_CHECK_EQUAL( split_diff2.iterative_size(), 5 );
- BOOST_CHECK_EQUAL( join_diff2.iterative_size(), 4 );
+ BOOST_CHECK_EQUAL( iterative_size(split_diff2), 5 );
+ BOOST_CHECK_EQUAL( iterative_size(join_diff2), 4 );
BOOST_CHECK_EQUAL( is_element_equal(join_diff2, join_diff2), true );
BOOST_CHECK_EQUAL( is_element_equal(join_diff2, split_diff2), true );
@@ -1294,7 +1295,7 @@
split_ab_jn.add(I1_3D_2).add(I6_8D_2);
split_AB = split_A;
split_AB &= split_B;
- BOOST_CHECK_EQUAL( split_AB.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(split_AB), 3 );
BOOST_CHECK_EQUAL( split_AB, split_ab );
//split_A [0 3) [6 9)
@@ -1307,7 +1308,7 @@
join_B = split_B;
split_AB &= join_B;
- BOOST_CHECK_EQUAL( split_AB.iterative_size(), 2 );
+ BOOST_CHECK_EQUAL( iterative_size(split_AB), 2 );
BOOST_CHECK_EQUAL( split_AB, split_ab_jn );
}
@@ -1378,7 +1379,7 @@
split_ab_jn.add(I1_3D_1).add(I6_8D_1);
split_AB = split_A;
split_AB &= split_B;
- BOOST_CHECK_EQUAL( split_AB.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(split_AB), 3 );
BOOST_CHECK_EQUAL( split_AB, split_ab );
//split_A [0 3) [6 9)
@@ -1390,7 +1391,7 @@
join_B = split_B;
split_AB &= join_B;
- BOOST_CHECK_EQUAL( split_AB.iterative_size(), 2 );
+ BOOST_CHECK_EQUAL( iterative_size(split_AB), 2 );
BOOST_CHECK_EQUAL( split_AB, split_ab_jn );
}
Modified: sandbox/itl/libs/itl/test/test_interval_map_shared.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_map_shared.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_map_shared.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -42,10 +42,13 @@
//empty set
//-------------------------------------------------------------------------
BOOST_CHECK_EQUAL(IntervalMapT().empty(), true);
- BOOST_CHECK_EQUAL(IntervalMapT().cardinality(), neutron<size_T>::value());
+ BOOST_CHECK_EQUAL(itl::is_empty(IntervalMapT()), true);
+ BOOST_CHECK_EQUAL(cardinality(IntervalMapT()), neutron<size_T>::value());
BOOST_CHECK_EQUAL(IntervalMapT().size(), neutron<size_T>::value());
- BOOST_CHECK_EQUAL(IntervalMapT().interval_count(), 0);
+ BOOST_CHECK_EQUAL(itl::size(IntervalMapT()), neutron<size_T>::value());
+ BOOST_CHECK_EQUAL(interval_count(IntervalMapT()), 0);
BOOST_CHECK_EQUAL(IntervalMapT().iterative_size(), 0);
+ BOOST_CHECK_EQUAL(iterative_size(IntervalMapT()), 0);
BOOST_CHECK_EQUAL(IntervalMapT(), IntervalMapT());
IntervalT mt_interval = neutron<IntervalT >::value();
@@ -134,27 +137,28 @@
BOOST_CHECK_EQUAL(hull(single_I0_1I_u1).upper(), I0_1I.upper());
//contains predicate
- BOOST_CHECK_EQUAL(call::contains(single_I0_0I_u1, v0), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_0I_u1, v0_u1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_0I_u1, I0_0I_u1), true);
-
- BOOST_CHECK_EQUAL(call::contains(single_I1_1I_u1, v1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I1_1I_u1, v1_u1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I1_1I_u1, I1_1I_u1), true);
-
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I_u1, v0), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I_u1, I0_1I_u1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I_u1, v1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I_u1, I1_1I_u1), true);
-
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I_u1, single_I0_0I_u1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I_u1, single_I1_1I_u1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I_u1, single_I0_1I_u1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_0I_u1, v0), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_0I_u1, v0_u1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_0I_u1, I0_0I_u1), true);
+
+ BOOST_CHECK_EQUAL(itl::contains(single_I1_1I_u1, v1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I1_1I_u1, v1_u1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I1_1I_u1, I1_1I_u1), true);
+
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I_u1, v0), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I_u1, I0_1I_u1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I_u1, v1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I_u1, I1_1I_u1), true);
+
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I_u1, single_I0_0I_u1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I_u1, single_I1_1I_u1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I_u1, single_I0_1I_u1), true);
- BOOST_CHECK_EQUAL(single_I0_0I_u1.cardinality(), unon<size_T>::value());
+ BOOST_CHECK_EQUAL(cardinality(single_I0_0I_u1), unon<size_T>::value());
BOOST_CHECK_EQUAL(single_I0_0I_u1.size(), unon<size_T>::value());
- BOOST_CHECK_EQUAL(single_I0_0I_u1.interval_count(), 1);
+ BOOST_CHECK_EQUAL(interval_count(single_I0_0I_u1), 1);
BOOST_CHECK_EQUAL(single_I0_0I_u1.iterative_size(), 1);
+ BOOST_CHECK_EQUAL(iterative_size(single_I0_0I_u1), 1);
}
@@ -200,10 +204,11 @@
_I4_4I_u2.insert(I4_4I_u2).insert(I4_4I_u2);
BOOST_CHECK_EQUAL( _I4_4I_u2, _I4_4I_u2_1 );
- BOOST_CHECK_EQUAL( _I4_4I_u2.cardinality(), unon<typename IntervalMapT::size_type>::value() );
+ BOOST_CHECK_EQUAL( cardinality(_I4_4I_u2), unon<typename IntervalMapT::size_type>::value() );
BOOST_CHECK_EQUAL( _I4_4I_u2.size(), unon<typename IntervalMapT::size_type>::value() );
- BOOST_CHECK_EQUAL( _I4_4I_u2.interval_count(), 1 );
+ BOOST_CHECK_EQUAL( interval_count(_I4_4I_u2), 1 );
BOOST_CHECK_EQUAL( _I4_4I_u2.iterative_size(), 1 );
+ BOOST_CHECK_EQUAL( iterative_size(_I4_4I_u2), 1 );
BOOST_CHECK_EQUAL( hull(_I4_4I_u2).lower(), v4 );
BOOST_CHECK_EQUAL( hull(_I4_4I_u2).upper(), v4 );
@@ -304,10 +309,11 @@
IntervalMapT is_1_3_5;
is_1_3_5.add(v1_u1).add(v3_u1).add(v5_u1);
- BOOST_CHECK_EQUAL( is_1_3_5.cardinality(), s3 );
+ BOOST_CHECK_EQUAL( cardinality(is_1_3_5), s3 );
BOOST_CHECK_EQUAL( is_1_3_5.size(), s3 );
- BOOST_CHECK_EQUAL( is_1_3_5.interval_count(), 3 );
+ BOOST_CHECK_EQUAL( interval_count(is_1_3_5), 3 );
BOOST_CHECK_EQUAL( is_1_3_5.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(is_1_3_5), 3 );
}
template <template<class T, class U,
@@ -340,12 +346,13 @@
IntervalMapT is_1_3_5;
is_1_3_5.add(v1_u1).add(v3_u1).add(v5_u1);
- BOOST_CHECK_EQUAL( is_1_3_5.cardinality(), s3 );
+ BOOST_CHECK_EQUAL( cardinality(is_1_3_5), s3 );
BOOST_CHECK_EQUAL( is_1_3_5.size(), s3 );
- is_1_3_5.length();
- BOOST_CHECK_EQUAL( is_1_3_5.length(), d0 );
- BOOST_CHECK_EQUAL( is_1_3_5.interval_count(), 3 );
+ itl::length(is_1_3_5);
+ BOOST_CHECK_EQUAL( itl::length(is_1_3_5), d0 );
+ BOOST_CHECK_EQUAL( interval_count(is_1_3_5), 3 );
BOOST_CHECK_EQUAL( is_1_3_5.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(is_1_3_5), 3 );
IntervalMapT is_123_5;
@@ -357,9 +364,9 @@
is_123_5 += typename IntervalMapT::value_type(IntervalT::open(v1,v3),u1);
//USASO: unsatisfctory solution 2: not implementing mapping_type version of o=
- BOOST_CHECK_EQUAL( is_123_5.cardinality(), itl::infinity<size_T>::value() );
+ BOOST_CHECK_EQUAL( cardinality(is_123_5), itl::infinity<size_T>::value() );
BOOST_CHECK_EQUAL( is_123_5.size(), itl::infinity<size_T>::value() );
- BOOST_CHECK_EQUAL( is_123_5.length(), d2 );
+ BOOST_CHECK_EQUAL( itl::length(is_123_5), d2 );
}
@@ -397,8 +404,10 @@
gap_set.add(C0_2D_u1).add(C2_4D_u1);
iso_map -= gap_set;
- BOOST_CHECK_EQUAL( iso_map.cardinality(), static_cast<size_T>(3) );
+ BOOST_CHECK_EQUAL( cardinality(iso_map), static_cast<size_T>(3) );
BOOST_CHECK_EQUAL( iso_map.iterative_size(), static_cast<std::size_t>(3) );
+ BOOST_CHECK_EQUAL( iterative_size(iso_map), static_cast<std::size_t>(3) );
+ BOOST_CHECK_EQUAL( iterative_size(iso_map), static_cast<std::size_t>(3) );
IntervalMapT iso_map2;
iso_map2.add(I0_4I_u1);
@@ -432,21 +441,21 @@
typedef typename IntervalMapT::interval_type IntervalT;
typedef typename IntervalMapT::set_type IntervalSetT;
IntervalMapT itv_map; itv_map.add(K_v(3,1));
- BOOST_CHECK_EQUAL( call::contains(itv_map, MK_v(3)), true );
- BOOST_CHECK_EQUAL( call::contains(itv_map, K_v(3,1)), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, MK_v(3)), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, K_v(3,1)), true );
- BOOST_CHECK_EQUAL( call::contains(IntervalMapT().add(K_v(3,1)), K_v(3,1)), true );
- BOOST_CHECK_EQUAL( call::contains(IntervalMapT().add(K_v(3,1)), MK_v(3)), true );
- BOOST_CHECK_EQUAL( call::contains(IntervalMapT().insert(K_v(3,1)), K_v(3,1)), true );
+ BOOST_CHECK_EQUAL( itl::contains(IntervalMapT().add(K_v(3,1)), K_v(3,1)), true );
+ BOOST_CHECK_EQUAL( itl::contains(IntervalMapT().add(K_v(3,1)), MK_v(3)), true );
+ BOOST_CHECK_EQUAL( itl::contains(IntervalMapT().insert(K_v(3,1)), K_v(3,1)), true );
itv_map.clear();
- BOOST_CHECK_EQUAL( call::contains((itv_map += IIv(3,7,1)), IIv(3,7,1)), true );
- BOOST_CHECK_EQUAL( call::contains(itv_map, IIv(3,7,2)), false );
- BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(3,7)), true );
- BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(4,6)), true );
- BOOST_CHECK_EQUAL( call::contains((itv_map += CIv(7,9,1)),IIv(3,9,1)), true );
- BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(4,8)), true );
- BOOST_CHECK_EQUAL( call::contains((itv_map += IIv(11,12,1)), IIv(3,12,1)), false );
- BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(4,11)), false );
+ BOOST_CHECK_EQUAL( itl::contains((itv_map += IIv(3,7,1)), IIv(3,7,1)), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, IIv(3,7,2)), false );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, I_I(3,7)), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, I_I(4,6)), true );
+ BOOST_CHECK_EQUAL( itl::contains((itv_map += CIv(7,9,1)),IIv(3,9,1)), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, I_I(4,8)), true );
+ BOOST_CHECK_EQUAL( itl::contains((itv_map += IIv(11,12,1)), IIv(3,12,1)), false );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, I_I(4,11)), false );
IntervalMapT itv_map0 = itv_map;
@@ -454,10 +463,10 @@
IntervalMapT itv_map2(IIv(5,8,1));
itv_map2.add(K_v(9,1)).add(K_v(11,1));
itv_map += itv_map2;
- BOOST_CHECK_EQUAL( call::contains(itv_map, itv_map2), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, itv_map2), true );
IntervalSetT itv_set2;
itl::domain(itv_set2, itv_map2);
- BOOST_CHECK_EQUAL( call::contains(itv_map, itv_set2), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, itv_set2), true );
}
template <template<class T, class U,
@@ -477,27 +486,27 @@
IntervalMapT itv_map;
itv_map.add(IDv(1,3,1));
- BOOST_CHECK_EQUAL( call::contains(itv_map, MK_v(0)), false );
- BOOST_CHECK_EQUAL( call::contains(itv_map, MK_v(2)), true );
- BOOST_CHECK_EQUAL( call::contains(itv_map, MK_v(3)), false );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, MK_v(0)), false );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, MK_v(2)), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, MK_v(3)), false );
itv_map.add(IDv(3,6,2));
- BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(0,0)), false );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, I_I(0,0)), false );
contains(itv_map, I_I(2,4));
- BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(2,4)), true );
- BOOST_CHECK_EQUAL( call::contains(itv_map, I_I(6,6)), false );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, I_I(2,4)), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, I_I(6,6)), false );
itv_map.add(IDv(8,9,2));
IntervalSetT itv_set;
itv_set.add(C_I(1,2)).add(C_D(2,6)).add(I_I(8,8));
- BOOST_CHECK_EQUAL( call::contains(itv_map, itv_set), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, itv_set), true );
itv_set.add(I_I(1,4));
- BOOST_CHECK_EQUAL( call::contains(itv_map, itv_set), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, itv_set), true );
itv_set.add(I_I(1,4));
- BOOST_CHECK_EQUAL( call::contains(itv_map, itv_set), true );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, itv_set), true );
itv_set.add(I_I(7,7));
- BOOST_CHECK_EQUAL( call::contains(itv_map, itv_set), false );
+ BOOST_CHECK_EQUAL( itl::contains(itv_map, itv_set), false );
}
@@ -1138,9 +1147,9 @@
IntervalMapT map_a;
map_a.add(CDv(1,3,1)).add(IDv(8,9,1)).add(IIv(6,11,3));
- BOOST_CHECK_EQUAL( call::contains(map_a.set(CDv(2,10,4)), CDv(2,10,4)), true );
- BOOST_CHECK_EQUAL( call::contains(map_a.set(K_v(4,5)), K_v(4,5)), true );
- BOOST_CHECK_EQUAL( call::contains(map_a.set(K_v(4,5)).set(CDv(3,5,6)), CDv(3,5,6)), true );
+ BOOST_CHECK_EQUAL( itl::contains(map_a.set(CDv(2,10,4)), CDv(2,10,4)), true );
+ BOOST_CHECK_EQUAL( itl::contains(map_a.set(K_v(4,5)), K_v(4,5)), true );
+ BOOST_CHECK_EQUAL( itl::contains(map_a.set(K_v(4,5)).set(CDv(3,5,6)), CDv(3,5,6)), true );
}
Modified: sandbox/itl/libs/itl/test/test_interval_set_mixed.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_set_mixed.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_set_mixed.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -245,15 +245,15 @@
split_interval_set<T> split_set;
split_set.add(I_D(0,4)).add(I_D(4,8));
- BOOST_CHECK_EQUAL( call::contains(split_set, MK_v(4)), true );
- BOOST_CHECK_EQUAL( call::contains(split_set, C_D(2,5)), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_set, MK_v(4)), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_set, C_D(2,5)), true );
interval_set<T> join_set_gap4(split_set.erase(MK_v(4)));
- BOOST_CHECK_EQUAL( call::contains(join_set_gap4, MK_v(4)), false );
- BOOST_CHECK_EQUAL( call::contains(join_set_gap4, C_D(2,5)), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_set_gap4, MK_v(4)), false );
+ BOOST_CHECK_EQUAL( itl::contains(join_set_gap4, C_D(2,5)), false );
- BOOST_CHECK_EQUAL( call::contains(split_set, split_set), true );
- BOOST_CHECK_EQUAL( call::contains(split_set, join_set_gap4), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_set, split_set), true );
+ BOOST_CHECK_EQUAL( itl::contains(split_set, join_set_gap4), true );
}
Modified: sandbox/itl/libs/itl/test/test_interval_set_shared.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_set_shared.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_set_shared.hpp 2010-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -37,13 +37,15 @@
//empty set
//-------------------------------------------------------------------------
BOOST_CHECK_EQUAL(IntervalSet<T>().empty(), true);
- BOOST_CHECK_EQUAL(IntervalSet<T>().cardinality(), neutron<size_T>::value());
+ BOOST_CHECK_EQUAL(itl::is_empty(IntervalSet<T>()), true);
+ BOOST_CHECK_EQUAL(cardinality(IntervalSet<T>()), neutron<size_T>::value());
BOOST_CHECK_EQUAL(IntervalSet<T>().size(), neutron<size_T>::value());
- BOOST_CHECK_EQUAL(IntervalSet<T>().interval_count(), 0);
+ BOOST_CHECK_EQUAL(interval_count(IntervalSet<T>()), 0);
BOOST_CHECK_EQUAL(IntervalSet<T>().iterative_size(), 0);
+ BOOST_CHECK_EQUAL(iterative_size(IntervalSet<T>()), 0);
BOOST_CHECK_EQUAL(IntervalSet<T>(), IntervalSet<T>());
- IntervalT mt_interval = neutron<IntervalT >::value();
+ IntervalT mt_interval = neutron<IntervalT>::value();
BOOST_CHECK_EQUAL(mt_interval, IntervalT());
IntervalSet<T> mt_set = neutron<IntervalSet<T> >::value();
BOOST_CHECK_EQUAL(mt_set, IntervalSet<T>());
@@ -121,24 +123,25 @@
BOOST_CHECK_EQUAL(hull(single_I0_1I).upper(), I0_1I.upper());
//contains predicate
- BOOST_CHECK_EQUAL(call::contains(single_I0_0I, v0), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_0I, I0_0I), true);
- BOOST_CHECK_EQUAL(call::contains(single_I1_1I, v1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I1_1I, I1_1I), true);
-
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I, v0), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I, I0_1I), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I, v1), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I, I1_1I), true);
-
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I, single_I0_0I), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I, single_I1_1I), true);
- BOOST_CHECK_EQUAL(call::contains(single_I0_1I, single_I0_1I), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_0I, v0), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_0I, I0_0I), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I1_1I, v1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I1_1I, I1_1I), true);
+
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I, v0), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I, I0_1I), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I, v1), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I, I1_1I), true);
+
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I, single_I0_0I), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I, single_I1_1I), true);
+ BOOST_CHECK_EQUAL(itl::contains(single_I0_1I, single_I0_1I), true);
- BOOST_CHECK_EQUAL(single_I0_0I.cardinality(), unon<size_T>::value());
+ BOOST_CHECK_EQUAL(cardinality(single_I0_0I), unon<size_T>::value());
BOOST_CHECK_EQUAL(single_I0_0I.size(), unon<size_T>::value());
- BOOST_CHECK_EQUAL(single_I0_0I.interval_count(), 1);
+ BOOST_CHECK_EQUAL(interval_count(single_I0_0I), 1);
BOOST_CHECK_EQUAL(single_I0_0I.iterative_size(), 1);
+ BOOST_CHECK_EQUAL(iterative_size(single_I0_0I), 1);
}
@@ -176,10 +179,11 @@
(_I4_4I_1 += v4) += I4_4I;
BOOST_CHECK_EQUAL( _I4_4I, _I4_4I_1 );
- BOOST_CHECK_EQUAL( _I4_4I.cardinality(), unon<typename IntervalSet<T>::size_type>::value() );
+ BOOST_CHECK_EQUAL( cardinality(_I4_4I), unon<typename IntervalSet<T>::size_type>::value() );
BOOST_CHECK_EQUAL( _I4_4I.size(), unon<typename IntervalSet<T>::size_type>::value() );
- BOOST_CHECK_EQUAL( _I4_4I.interval_count(), 1 );
+ BOOST_CHECK_EQUAL( interval_count(_I4_4I), 1 );
BOOST_CHECK_EQUAL( _I4_4I.iterative_size(), 1 );
+ BOOST_CHECK_EQUAL( iterative_size(_I4_4I), 1 );
BOOST_CHECK_EQUAL( hull(_I4_4I).lower(), v4 );
BOOST_CHECK_EQUAL( hull(_I4_4I).upper(), v4 );
@@ -263,9 +267,10 @@
IntervalSet<T> is_1_3_5;
is_1_3_5.add(v1).add(v3).add(v5);
- BOOST_CHECK_EQUAL( is_1_3_5.cardinality(), s3 );
+ BOOST_CHECK_EQUAL( cardinality(is_1_3_5), s3 );
BOOST_CHECK_EQUAL( is_1_3_5.size(), s3 );
- BOOST_CHECK_EQUAL( is_1_3_5.interval_count(), 3 );
+ BOOST_CHECK_EQUAL( interval_count(is_1_3_5), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(is_1_3_5), 3 );
BOOST_CHECK_EQUAL( is_1_3_5.iterative_size(), 3 );
}
@@ -293,11 +298,12 @@
IntervalSet<T> is_1_3_5;
is_1_3_5.add(v1).add(v3).add(v5);
- BOOST_CHECK_EQUAL( is_1_3_5.cardinality(), s3 );
+ BOOST_CHECK_EQUAL( cardinality(is_1_3_5), s3 );
BOOST_CHECK_EQUAL( is_1_3_5.size(), s3 );
- BOOST_CHECK_EQUAL( is_1_3_5.length(), d0 );
- BOOST_CHECK_EQUAL( is_1_3_5.interval_count(), 3 );
+ BOOST_CHECK_EQUAL( itl::length(is_1_3_5), d0 );
+ BOOST_CHECK_EQUAL( interval_count(is_1_3_5), 3 );
BOOST_CHECK_EQUAL( is_1_3_5.iterative_size(), 3 );
+ BOOST_CHECK_EQUAL( iterative_size(is_1_3_5), 3 );
@@ -305,9 +311,9 @@
is_123_5 = is_1_3_5;
is_123_5 += IntervalT::open(v1,v3);
- BOOST_CHECK_EQUAL( is_123_5.cardinality(), itl::infinity<size_T>::value() );
+ BOOST_CHECK_EQUAL( cardinality(is_123_5), itl::infinity<size_T>::value() );
BOOST_CHECK_EQUAL( is_123_5.size(), itl::infinity<size_T>::value() );
- BOOST_CHECK_EQUAL( is_123_5.length(), d2 );
+ BOOST_CHECK_EQUAL( itl::length(is_123_5), d2 );
}
@@ -339,8 +345,9 @@
BOOST_CHECK_EQUAL( true, true );
iso_set -= gap_set;
- BOOST_CHECK_EQUAL( iso_set.cardinality(), static_cast<size_T>(3) );
+ BOOST_CHECK_EQUAL( cardinality(iso_set), static_cast<size_T>(3) );
BOOST_CHECK_EQUAL( iso_set.iterative_size(), static_cast<std::size_t>(3) );
+ BOOST_CHECK_EQUAL( iterative_size(iso_set), static_cast<std::size_t>(3) );
IntervalSet<T> iso_set2;
iso_set2.add(I0_4I);
@@ -424,11 +431,11 @@
T v9 = make<T>(9);
T v11 = make<T>(11);
IntervalSet<T> is(v1);
- BOOST_CHECK_EQUAL( call::contains(is, v1), true );
+ BOOST_CHECK_EQUAL( itl::contains(is, v1), true );
- BOOST_CHECK_EQUAL( IntervalSet<T>().add(make<T>(2)).contains(make<T>(2)), true );
- BOOST_CHECK_EQUAL( IntervalSet<T>().insert(make<T>(2)).contains(make<T>(2)), true );
- BOOST_CHECK_EQUAL( (is += IntervalT(v3,v7)).contains(IntervalT(v3,v7)), true );
+ BOOST_CHECK_EQUAL( itl::contains(IntervalSet<T>().add(make<T>(2)), make<T>(2)), true );
+ BOOST_CHECK_EQUAL( itl::contains(IntervalSet<T>().insert(make<T>(2)), make<T>(2)), true );
+ BOOST_CHECK_EQUAL( itl::contains((is += IntervalT(v3,v7)), IntervalT(v3,v7)), true );
IntervalSet<T> is0 = is;
@@ -475,12 +482,12 @@
BOOST_CHECK_EQUAL( disjoint(section, complement), true );
BOOST_CHECK_EQUAL( all, all2 );
- BOOST_CHECK_EQUAL( call::contains(all, left), true );
- BOOST_CHECK_EQUAL( call::contains(all, right), true );
- BOOST_CHECK_EQUAL( call::contains(all, complement), true );
+ BOOST_CHECK_EQUAL( itl::contains(all, left), true );
+ BOOST_CHECK_EQUAL( itl::contains(all, right), true );
+ BOOST_CHECK_EQUAL( itl::contains(all, complement), true );
- BOOST_CHECK_EQUAL( call::contains(left, section), true );
- BOOST_CHECK_EQUAL( call::contains(right, section), true );
+ BOOST_CHECK_EQUAL( itl::contains(left, section), true );
+ BOOST_CHECK_EQUAL( itl::contains(right, section), true );
BOOST_CHECK_EQUAL( within(left, all), true );
BOOST_CHECK_EQUAL( within(right, all), true );
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-09-28 16:17:54 EDT (Tue, 28 Sep 2010)
@@ -56,8 +56,8 @@
BOOST_CHECK_EQUAL( I4_4I.lower(), v4 );
BOOST_CHECK_EQUAL( I4_4I.upper(), v4 );
- BOOST_CHECK_EQUAL( call::contains(I4_4I, v4), true );
- BOOST_CHECK_EQUAL( call::contains(I4_4I, I4_4I), true );
+ BOOST_CHECK_EQUAL( itl::contains(I4_4I, v4), true );
+ BOOST_CHECK_EQUAL( itl::contains(I4_4I, I4_4I), true );
BOOST_CHECK_EQUAL( within(I4_4I, I4_4I), true );
BOOST_CHECK_EQUAL( I4_4I, I4_4I );
BOOST_CHECK_EQUAL( cardinality(I4_4I), unon<typename interval<T>::size_type>::value() );
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