|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51256 - in sandbox/itl: boost/itl boost/itl/detail boost/itl_xt boost/validate/gentor libs/itl/doc libs/itl/example/boost_party
From: afojgo_at_[hidden]
Date: 2009-02-14 17:58:12
Author: jofaber
Date: 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
New Revision: 51256
URL: http://svn.boost.org/trac/boost/changeset/51256
Log:
Refactored. Separated design_config, relation_state from notate and moved them to detail.
Removed interval::intersect and replaced calls by op &. Stable {msvc-9.0, partly congcc-4.3-a7}
Added:
sandbox/itl/boost/itl/detail/design_config.hpp (contents, props changed)
sandbox/itl/boost/itl/detail/notate.hpp (contents, props changed)
sandbox/itl/boost/itl/detail/relation_state.hpp (contents, props changed)
Removed:
sandbox/itl/boost/itl/notate.hpp
Text files modified:
sandbox/itl/boost/itl/detail/element_comparer.hpp | 2
sandbox/itl/boost/itl/detail/subset_comparer.hpp | 3 +
sandbox/itl/boost/itl/gregorian.hpp | 15 -------------
sandbox/itl/boost/itl/interval.hpp | 46 ++++++++++++++-------------------------
sandbox/itl/boost/itl/interval_base_map.hpp | 44 +++++++++++++++++++-------------------
sandbox/itl/boost/itl/interval_base_set.hpp | 11 ++++-----
sandbox/itl/boost/itl/interval_map.hpp | 36 ++++++------------------------
sandbox/itl/boost/itl/interval_map_algo.hpp | 2
sandbox/itl/boost/itl/interval_maps.hpp | 3 --
sandbox/itl/boost/itl/interval_morphism.hpp | 4 +-
sandbox/itl/boost/itl/interval_set_algo.hpp | 3 +
sandbox/itl/boost/itl/interval_sets.hpp | 1
sandbox/itl/boost/itl/map.hpp | 9 ++++---
sandbox/itl/boost/itl/map_algo.hpp | 28 -----------------------
sandbox/itl/boost/itl/set.hpp | 2 +
sandbox/itl/boost/itl/set_algo.hpp | 2
sandbox/itl/boost/itl/split_interval_map.hpp | 43 ++++++++++++++----------------------
sandbox/itl/boost/itl/split_interval_set.hpp | 12 +--------
sandbox/itl/boost/itl_xt/enum_bitset.hpp | 2
sandbox/itl/boost/itl_xt/fixtupelconst.hpp | 2
sandbox/itl/boost/itl_xt/list.hpp | 1
sandbox/itl/boost/itl_xt/prefix_set.hpp | 2
sandbox/itl/boost/itl_xt/string_list.hpp | 2
sandbox/itl/boost/itl_xt/string_map.hpp | 2
sandbox/itl/boost/itl_xt/string_sheet.hpp | 2
sandbox/itl/boost/itl_xt/var_tuple.hpp | 2
sandbox/itl/boost/itl_xt/var_tuple_order.hpp | 2
sandbox/itl/boost/validate/gentor/randomgentor.hpp | 2
sandbox/itl/libs/itl/doc/concepts.qbk | 2
sandbox/itl/libs/itl/doc/interface.qbk | 12 +++++-----
sandbox/itl/libs/itl/doc/introduction.qbk | 10 ++++----
sandbox/itl/libs/itl/doc/itl.qbk | 1
sandbox/itl/libs/itl/example/boost_party/boost_party.cpp | 2
33 files changed, 112 insertions(+), 200 deletions(-)
Added: sandbox/itl/boost/itl/detail/design_config.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/detail/design_config.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -0,0 +1,83 @@
+/*-----------------------------------------------------------------------------+
+Author: Joachim Faulhaber
+Copyright (c) 2009-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/*-----------------------------------------------------------------------------+
+Template parameters of major itl class templates can be designed as
+template template parameters or
+template type parameter
+by setting defines in this file.
++-----------------------------------------------------------------------------*/
+#ifndef __itl_design_config_hpp_JOFA_090214__
+#define __itl_design_config_hpp_JOFA_090214__
+
+
+//------------------------------------------------------------------------------
+// Auxiliary macros for denoting template signatures.
+// Purpose:
+// (1) Shorten the lenthy and redundant template signatures.
+// (2) Name anonymous template types according to theirs meaning ...
+// (3) Making easier to refactor by redefinitin of the macros
+// (4) Being able to check template template parameter variants against
+// template type parameter variants.
+
+#define ITL_USE_COMPARE_TEMPLATE_TEMPLATE
+#define ITL_USE_COMBINE_TEMPLATE_TEMPLATE
+#define ITL_USE_SECTION_TEMPLATE_TEMPLATE
+
+//#define ITL_USE_COMPARE_TEMPLATE_TYPE
+//#define ITL_USE_COMBINE_TEMPLATE_TYPE
+//#define ITL_USE_SECTION_TEMPLATE_TYPE
+
+//------------------------------------------------------------------------------
+// template parameter Compare can not be a template type parameter as long as
+// Compare<Interval<DomainT,Compare> >() is called in std::lexicographical_compare
+// implementing operator< for interval_base_{set,map}. see NOTE DESIGN TTP
+#ifdef ITL_USE_COMPARE_TEMPLATE_TEMPLATE
+# define ITL_COMPARE template<class>class
+# define ITL_COMPARE_DOMAIN(itl_compare, domain_type) itl_compare<domain_type>
+# define ITL_COMPARE_INSTANCE(compare_instance, domain_type) compare_instance
+# define ITL_EXCLUSIVE_LESS(interval_type) exclusive_less
+#else//ITL_USE_COMPARE_TEMPLATE_TYPE
+# define ITL_COMPARE class
+# define ITL_COMPARE_DOMAIN(itl_compare, domain_type) itl_compare
+# define ITL_COMPARE_INSTANCE(compare_instance, domain_type) compare_instance<domain_type>
+# define ITL_EXCLUSIVE_LESS(interval_type) exclusive_less<interval_type>
+#endif
+
+//------------------------------------------------------------------------------
+// template parameter Combine could be a template type parameter.
+#ifdef ITL_USE_COMBINE_TEMPLATE_TEMPLATE
+# define ITL_COMBINE template<class>class
+# define ITL_COMBINE_CODOMAIN(itl_combine, codomain_type) itl_combine<codomain_type>
+# define ITL_COMBINE_INSTANCE(compare_instance,codomain_type) compare_instance
+#else//ITL_USE_COMBINE_TEMPLATE_TYPE
+# define ITL_COMBINE class
+# define ITL_COMBINE_CODOMAIN(itl_combine, codomain_type) itl_combine
+# define ITL_COMBINE_INSTANCE(compare_instance,codomain_type) compare_instance<codomain_type>
+#endif
+
+//------------------------------------------------------------------------------
+// template parameter Section could be a template type parameter.
+#ifdef ITL_USE_SECTION_TEMPLATE_TEMPLATE
+# define ITL_SECTION template<class>class
+# define ITL_SECTION_CODOMAIN(itl_intersect, codomain_type) itl_intersect<codomain_type>
+# define ITL_SECTION_INSTANCE(section_instance,codomain_type) section_instance
+#else//ITL_USE_SECTION_TEMPLATE_TYPE
+# define ITL_SECTION class
+# define ITL_SECTION_CODOMAIN(itl_intersect, codomain_type) itl_intersect
+# define ITL_SECTION_INSTANCE(section_instance,codomain_type) section_instance<codomain_type>
+#endif
+
+//------------------------------------------------------------------------------
+#define ITL_ALLOC template<class>class
+
+//------------------------------------------------------------------------------
+
+#endif // __itl_design_config_hpp_JOFA_090214__
+
+
Modified: sandbox/itl/boost/itl/detail/element_comparer.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/element_comparer.hpp (original)
+++ sandbox/itl/boost/itl/detail/element_comparer.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -9,7 +9,7 @@
#define __itl_element_comparer_JOFA_090202_H__
#include <boost/itl/type_traits/is_map.hpp>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl/type_traits/neutron.hpp>
#include <boost/itl/interval.hpp>
Added: sandbox/itl/boost/itl/detail/notate.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/detail/notate.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -0,0 +1,76 @@
+/*----------------------------------------------------------------------------+
+Copyright (c) 2007-2008: Joachim Faulhaber
++-----------------------------------------------------------------------------+
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++-----------------------------------------------------------------------------+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
++----------------------------------------------------------------------------*/
+/*-----------------------------------------------------------------------------
+ Macro definitions for useful and abstract notations e.g. iteration headers
+-----------------------------------------------------------------------------*/
+#ifndef __itl_notate_hpp_JOFA_990119__
+#define __itl_notate_hpp_JOFA_990119__
+
+
+// Iterations over stl or stl-compatible containers:
+#define FORALL(type,iter,obj) for(type::iterator iter=(obj).begin(); (iter)!=(obj).end(); (iter)++)
+#define const_FORALL(type,iter,obj) for(type::const_iterator iter=(obj).begin(); !((iter)==(obj).end()); (iter)++)
+
+#define FORALL_THIS(iter) for(iterator iter=begin(); (iter)!=end(); (iter)++)
+#define const_FORALL_THIS(iter) for(const_iterator iter=this->begin(); (iter)!=this->end(); (iter)++)
+
+// Plain old array iteration (assuming memberfunction VecT::size()!)
+#define FORALL_VEC(idx, vec) for(int idx=0; idx<vec.size(); idx++)
+
+// Parallel iteration
+#define const_FORALL_THIS_2(it, it2, cnt2)\
+ for(const_iterator it=begin(), it2=(cnt2).begin(); (it)!=end() && (it2)!=cnt2.end(); (it)++, (it2)++)
+#define const_FORALL_THIS_PARALLEL(it, it2, cnt2)\
+ for(const_iterator it=begin(), it2=(cnt2).begin(); (it)!=end() && (it2)!=cnt2.end(); (it)++, (it2)++)
+
+// Variants that requires already declared iterators
+#define FOR_ALL(iter,obj) for((iter)=(obj).begin(); (iter)!=(obj).end(); (iter)++)
+#define FOR_ALL_THIS(iter) for((iter)=this->begin(); (iter)!=this->end(); (iter)++)
+
+#define FOR_ALL2(iter1,obj1, iter2,obj2)\
+ for((iter1)=(obj1).begin(), (iter2)=(obj2).begin(); (iter1)!=(obj1).end(); ++(iter1),++(iter2))
+
+// for readability and ease of memory: pair selectors for different contexts
+#define ITERATOR first // x.insert(y).second
+#define WAS_SUCCESSFUL second
+
+#define KEY_VALUE first // for map valuePairs
+#define CONT_VALUE second
+
+// universal and maths
+namespace boost{namespace itl
+{
+ const int UNDEFINED_INDEX = -1;
+}} // namespace itl boost
+
+
+#endif // __itl_notate_hpp_JOFA_990119__
+
+
Added: sandbox/itl/boost/itl/detail/relation_state.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/detail/relation_state.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -0,0 +1,37 @@
+/*-----------------------------------------------------------------------------+
+Author: Joachim Faulhaber
+Copyright (c) 2009-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/*-----------------------------------------------------------------------------+
+States of comparison and inclusion relations as static constants
++-----------------------------------------------------------------------------*/
+#ifndef __itl_relation_state_hpp_JOFA_090214__
+#define __itl_relation_state_hpp_JOFA_090214__
+
+namespace boost{namespace itl
+{
+ namespace comparison
+ {
+ static const int less = -1;
+ static const int equal = 0;
+ static const int greater = 1;
+ }
+
+ namespace inclusion
+ {
+ static const int unrelated = 0;
+ static const int subset = 1;
+ static const int superset = 2;
+ static const int equal = 3;
+ }
+
+
+}} // namespace itl boost
+
+#endif // __itl_relation_state_hpp_JOFA_090214__
+
+
Modified: sandbox/itl/boost/itl/detail/subset_comparer.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/subset_comparer.hpp (original)
+++ sandbox/itl/boost/itl/detail/subset_comparer.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -9,7 +9,8 @@
#define __itl_subset_comparer_JOFA_090202_H__
#include <boost/itl/type_traits/is_map.hpp>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
+#include <boost/itl/detail/relation_state.hpp>
#include <boost/itl/type_traits/neutron.hpp>
#include <boost/itl/interval.hpp>
Modified: sandbox/itl/boost/itl/gregorian.hpp
==============================================================================
--- sandbox/itl/boost/itl/gregorian.hpp (original)
+++ sandbox/itl/boost/itl/gregorian.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -41,9 +41,6 @@
#include <boost/date_time/gregorian/gregorian.hpp>
-//JODO Produce a better compietime error here.
-//JODO (Write Macro to reduce codereplication. Generate line info.) not needed if compile-time error is nifty.
-//JODO Make it complete for all date_time classes. check portability.
#ifdef ITL_NEUTRONS_PROVIDED
#pragma message("error: No neutral element provided for type boost::gregorian::date")
#pragma message(".. please #include <boost/itl/gregorian.hpp> PRIOR TO other itl/* classes")
@@ -90,18 +87,6 @@
// ------------------------------------------------------------------------
- //JODO testing of boost gregorian fails
- // boost::date_time::date_duration<duration_rep_traits> lacks op <<
- //
- //template<class CharType, class CharTraits, class duration_rep_traits>
- //std::basic_ostream<CharType, CharTraits>& operator <<
- //(std::basic_ostream<CharType, CharTraits> &stream,
- // boost::date_time::date_duration<duration_rep_traits> const& x)
- //{
- // return stream << "[date_duration<duration_rep_traits>]";
- //}
-
- //boost::date_time::date_duration<duration_rep_traits>
}} // namespace itl boost
Modified: sandbox/itl/boost/itl/interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval.hpp (original)
+++ sandbox/itl/boost/itl/interval.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -25,7 +25,8 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/assert.hpp>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
+#include <boost/itl/detail/design_config.hpp>
#include <boost/itl/type_traits/neutron.hpp>
#include <boost/itl/type_traits/unon.hpp>
#include <boost/itl/type_traits/is_continuous.hpp>
@@ -477,7 +478,20 @@
//==========================================================================
/** Intersection with the interval <tt>x2</tt>; assign result to <tt>isec</tt> */
- void intersect(interval& isec, const interval& x2)const;
+ // void intersect(interval& isec, const interval& x2)const
+ //{
+ // isec = *this;
+ // isec &= x2;
+ //}
+
+ interval& operator &= (const interval& sectant)
+ {
+ set_lwb(lwb_max(sectant));
+ set_upb(upb_min(sectant));
+ return *this;
+ }
+
+
//==========================================================================
//= Representation
@@ -893,7 +907,6 @@
}
-// JODO THINK URG do borders reverse when lwb_max is used as upb etc. ?
template <class DomainT, ITL_COMPARE Compare>
typename interval<DomainT,Compare>::BoundT interval<DomainT,Compare>::lwb_max(const interval& x2)const
{
@@ -995,15 +1008,6 @@
return *this;
}
-
-template <class DomainT, ITL_COMPARE Compare>
-void interval<DomainT,Compare>::intersect(interval<DomainT,Compare>& isec, const interval<DomainT,Compare>& x2)const
-{
- isec.set_lwb(lwb_max(x2));
- isec.set_upb(upb_min(x2));
-}
-
-
template <class DomainT, ITL_COMPARE Compare>
void interval<DomainT,Compare>::right_subtract(interval<DomainT,Compare>& lsur, const interval<DomainT,Compare>& x2)const
{
@@ -1046,17 +1050,9 @@
return itvRep;
}
-
-// NOTE ------- DISCRETE ONLY ------- DISCRETE ONLY ------- DISCRETE ONLY -------
-// these functions do only compile with discrete DomainT-Types that implement
-// operators ++ and --
-// NOTE: they must be used in any function that is essential to all instances
-// of DomainT
-
template <class DomainT, ITL_COMPARE Compare>
DomainT interval<DomainT,Compare>::first()const
{
- //JODO BOOST_STATIC_ASSERT((!itl::is_continuous<DomainT>::value)); //complains incorrectly sometimes
BOOST_ASSERT((!itl::is_continuous<DomainT>::value));
return is_left(closed_bounded) ? _lwb : succ(_lwb);
}
@@ -1153,15 +1149,7 @@
// operators
// ----------------------------------------------------------------------------
template <class DomainT, ITL_COMPARE Compare>
-itl::interval<DomainT,Compare>& operator &= ( itl::interval<DomainT,Compare>& section,
- const itl::interval<DomainT,Compare>& sectant)
-{
- section.intersect(section, sectant);
- return section;
-}
-
-template <class DomainT, ITL_COMPARE Compare>
-itl::interval<DomainT,Compare> operator & (const itl::interval<DomainT,Compare>& left,
+inline itl::interval<DomainT,Compare> operator & (const itl::interval<DomainT,Compare>& left,
const itl::interval<DomainT,Compare>& right)
{
return itl::interval<DomainT,Compare>(left) &= right;
Modified: sandbox/itl/boost/itl/interval_base_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_map.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -11,7 +11,8 @@
#define __interval_base_map_h_JOFA_990223__
#include <limits>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
+#include <boost/itl/detail/design_config.hpp>
#ifdef USE_CONCEPTS
#include <bits/concepts.h>
@@ -461,12 +462,16 @@
const IntervalSet<DomainT,Compare,Interval,Alloc>& sectant
)const
{
- typedef IntervalSet<DomainT,Compare,Interval,Alloc> set_type;
+ typedef IntervalSet<DomainT,Compare,Interval,Alloc> sectant_type;
if(sectant.empty()) return;
- // THINK JODO optimize using the ordering: if intervalls are beyond borders we can terminate
- typename set_type::const_iterator it = sectant.begin();
- while(it != sectant.end())
+ typename sectant_type::const_iterator common_lwb;
+ typename sectant_type::const_iterator common_upb;
+ if(!Set::common_range(common_lwb, common_upb, sectant, *this))
+ return;
+
+ typename sectant_type::const_iterator it = common_lwb;
+ while(it != common_upb)
add_intersection(section, *it++);
}
@@ -670,7 +675,9 @@
return length;
}
-
+//==============================================================================
+//= Intersection
+//==============================================================================
template
<
@@ -743,8 +750,7 @@
for(typename ImplMapT::const_iterator it=fst_it; it != end_it; it++)
{
- interval_type common_interval;
- (*it).KEY_VALUE.intersect(common_interval, sectant_interval); //JODO refa: reduce intersect variants
+ interval_type common_interval = ((*it).KEY_VALUE) & sectant_interval;
if(!common_interval.empty())
{
@@ -776,19 +782,15 @@
for(typename ImplMapT::const_iterator it=fst_it; it != end_it; it++)
{
- interval_type common_interval;
- (*it).KEY_VALUE.intersect(common_interval, sectant_interval);
-
+ interval_type common_interval = ((*it).KEY_VALUE) & sectant_interval;
if(!common_interval.empty())
section.that()->add( value_type(common_interval, (*it).CONT_VALUE) );
}
}
-
-
-
-
-
+//==============================================================================
+//= Symmetric difference
+//==============================================================================
template
<
@@ -807,7 +809,7 @@
clear();
return *that();
}
- if(Traits::is_total && !Traits::absorbs_neutrons)//JODO
+ if(Traits::is_total && !Traits::absorbs_neutrons)
{
(*that()) += interval_value_pair;
FORALL(typename ImplMapT, it_, _map)
@@ -847,8 +849,6 @@
inverse_codomain_intersect()(common_value, co_value);
erase(common_interval);
add(value_type(common_interval, common_value));
-
- //JODO flip<inverse_codomain_intersect>(value_type(common_interval, co_value));
}
else
subtract(value_type(common_interval, co_value));
@@ -866,7 +866,7 @@
//If span is not empty here, it is not in the set so it shall be added
add(value_type(span, x_value));
- if(Traits::is_total && !Traits::absorbs_neutrons) //JODO
+ if(Traits::is_total && !Traits::absorbs_neutrons)
FORALL(typename ImplMapT, it_, _map)
it_->CONT_VALUE = neutron<codomain_type>::value();
@@ -902,7 +902,7 @@
clear();
return *that();
}
- if(Traits::is_total && !Traits::absorbs_neutrons)//JODO
+ if(Traits::is_total && !Traits::absorbs_neutrons)
{
(*that()) += operand;
FORALL(typename ImplMapT, it_, _map)
@@ -932,7 +932,7 @@
while(it != operand.end())
add(*it++);
- if(Traits::is_total && !Traits::absorbs_neutrons) //JODO
+ if(Traits::is_total && !Traits::absorbs_neutrons)
FORALL(typename ImplMapT, it_, _map)
it_->CONT_VALUE = neutron<codomain_type>::value();
Modified: sandbox/itl/boost/itl/interval_base_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_set.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_set.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -14,7 +14,7 @@
#include <boost/itl/interval_set_algo.hpp>
#include <boost/itl/set.hpp>
#include <boost/itl/interval.hpp>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#define const_FOR_IMPL(iter) for(typename ImplSetT::const_iterator iter=_set.begin(); (iter)!=_set.end(); (iter)++)
#define FOR_IMPL(iter) for(typename ImplSetT::iterator iter=_set.begin(); (iter)!=_set.end(); (iter)++)
@@ -502,11 +502,7 @@
typename ImplSetT::const_iterator end_it = _set.upper_bound(inter_val);
for(typename ImplSetT::const_iterator it=fst_it; it != end_it; it++)
- {
- interval_type isec;
- (*it).intersect(isec, inter_val);
- section.add(isec);
- }
+ section.add((*it) & inter_val);
}
@@ -541,6 +537,9 @@
add_intersection(intersection, *it++);
}
+//==============================================================================
+//= Symmetric difference
+//==============================================================================
template<class SubType,
class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
Modified: sandbox/itl/boost/itl/interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_map.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -217,7 +217,6 @@
{
return !value.KEY_VALUE.empty()
&& !(Traits::absorbs_neutrons && value.CONT_VALUE == codomain_combine::neutron());
- //CL && !(Traits::absorbs_neutrons && value.CONT_VALUE == CodomainT());
}
bool join_left(iterator& it);
@@ -292,7 +291,6 @@
interval_type interval = left_it->KEY_VALUE;
//It has to be a copy, because is location will be erased
- //JODO: Try optimizing inplace.
CodomainT value = left_it->CONT_VALUE;
interval.extend(right_it->KEY_VALUE);
@@ -369,7 +367,7 @@
join_left(insertion.ITERATOR);
- return insertion.ITERATOR; //JODO return value currently unused
+ return insertion.ITERATOR;
}
template <typename DomainT, typename CodomainT, class Traits,
@@ -420,7 +418,7 @@
join_left(insertion.ITERATOR);
- return insertion.ITERATOR; //JODO return value currently unused
+ return insertion.ITERATOR;
}
template <typename DomainT, typename CodomainT, class Traits,
@@ -498,7 +496,6 @@
interval_type fst_itv = (*fst_it).KEY_VALUE;
CodomainT cur_val = (*fst_it).CONT_VALUE;
-
interval_type leadGap; x_itv.right_subtract(leadGap, fst_itv);
// this is a new Interval that is a gap in the current map
//The first collision interval may grow by joining neighbours after insertion
@@ -509,8 +506,7 @@
// handle special case for first
- interval_type interSec;
- fst_itv.intersect(interSec, x_itv);
+ interval_type interSec = fst_itv & x_itv;
CodomainT cmb_val = cur_val;
Combiner()(cmb_val, x_val);
@@ -604,9 +600,7 @@
interval_type lead_gap;
x_rest.right_subtract(lead_gap, cur_itv);
- interval_type common;
- cur_itv.intersect(common, x_rest);
-
+ interval_type common = cur_itv & x_rest;
CodomainT cmb_val = cur_val;
Combiner()(cmb_val, x_val);
@@ -664,8 +658,7 @@
// handle special case for first
- interval_type interSec;
- fst_itv.intersect(interSec, x_itv);
+ interval_type interSec = fst_itv & x_itv;
CodomainT cmb_val = fst_val;
Combiner()(cmb_val, x_val);
@@ -757,8 +750,7 @@
CodomainT cur_val = (*it).CONT_VALUE ;
CodomainT cmb_val = cur_val ;
Combiner()(cmb_val, x_val);
- interval_type interSec;
- cur_itv.intersect(interSec, x_itv);
+ interval_type interSec = cur_itv & x_itv;
this->_map.erase(it);
if(rightResid.empty())
@@ -811,9 +803,6 @@
// handle special case for first
- interval_type interSec;
- fst_itv.intersect(interSec, x_itv);
-
iterator snd_it = fst_it; snd_it++;
if(snd_it == end_it)
{
@@ -886,9 +875,6 @@
join_left(it);
}
- interval_type common;
- cur_itv.intersect(common, x_rest);
-
interval_type end_gap;
x_rest.left_subtract(end_gap, cur_itv);
@@ -926,8 +912,7 @@
// handle special case for first
- interval_type interSec;
- fst_itv.intersect(interSec, x_itv);
+ interval_type interSec = fst_itv & x_itv;
iterator snd_it = fst_it; snd_it++;
if(snd_it == end_it)
@@ -939,7 +924,6 @@
{
this->_map.erase(fst_it);
insert_(value_type(leftResid, fst_val));
- // erased: insert(value_type(interSec, cmb_val));
insert_(value_type(rightResid, fst_val));
}
}
@@ -950,7 +934,6 @@
{
this->_map.erase(fst_it);
insert_(value_type(leftResid, fst_val));
- // erased: insert(value_type(interSec, cmb_val));
}
erase_rest(x_itv, x_val, snd_it, end_it);
@@ -990,13 +973,10 @@
}
else
{
- interval_type interSec;
- cur_itv.intersect(interSec, x_itv);
-
+ interval_type interSec = cur_itv & x_itv;
if(!interSec.empty() && cur_val == x_val)
{
this->_map.erase(it);
- //erased: insert(value_type(interSec, cmb_val));
insert_(value_type(rightResid, cur_val));
}
}
Modified: sandbox/itl/boost/itl/interval_map_algo.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_map_algo.hpp (original)
+++ sandbox/itl/boost/itl/interval_map_algo.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -8,7 +8,7 @@
#ifndef __itl_interval_map_algo_JOFA_081026_H__
#define __itl_interval_map_algo_JOFA_081026_H__
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl/type_traits/neutron.hpp>
namespace boost{namespace itl
Modified: sandbox/itl/boost/itl/interval_maps.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_maps.hpp (original)
+++ sandbox/itl/boost/itl/interval_maps.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -98,7 +98,6 @@
>
class IntervalMap
>
-//JODO boost::enable_if
bool is_disjoint
(
interval_base_map<SubType,DomainT,CodomainT,
@@ -146,7 +145,6 @@
class IntervalMap,
template<class, ITL_COMPARE, template<class,ITL_COMPARE>class, ITL_ALLOC>class IntervalSet
>
-//JODO boost::enable_if
bool is_disjoint
(
const IntervalMap<DomainT,CodomainT,
@@ -191,7 +189,6 @@
class IntervalMap,
template<class, ITL_COMPARE, template<class,ITL_COMPARE>class, ITL_ALLOC>class IntervalSet
>
-//JODO boost::enable_if
bool is_disjoint
(
const IntervalSet<DomainT,Compare,Interval,Alloc>& left,
Modified: sandbox/itl/boost/itl/interval_morphism.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_morphism.hpp (original)
+++ sandbox/itl/boost/itl/interval_morphism.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -28,7 +28,7 @@
#ifndef __itl_interval_morphism_H_JOFA_080315__
#define __itl_interval_morphism_H_JOFA_080315__
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
namespace boost{namespace itl
{
namespace Interval
@@ -41,7 +41,7 @@
const typename IntervalContainerT::key_type& itv = IntervalContainerT::key_value(itv_);
typename IntervalContainerT::codomain_type coval = IntervalContainerT::codomain_value(itv_);
- for(typename IntervalContainerT::domain_type element = itv.first(); element <= itv.last(); element++)
+ for(typename IntervalContainerT::domain_type element = itv.first(); element <= itv.last(); ++element)
{
result.insert(ElementContainerT::make_element(element, coval));
}
Modified: sandbox/itl/boost/itl/interval_set_algo.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_set_algo.hpp (original)
+++ sandbox/itl/boost/itl/interval_set_algo.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -9,7 +9,8 @@
#define __itl_interval_set_algo_JOFA_081005_H__
#include <boost/itl/type_traits/is_map.hpp>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
+#include <boost/itl/detail/relation_state.hpp>
#include <boost/itl/type_traits/neutron.hpp>
#include <boost/itl/interval.hpp>
#include <boost/itl/detail/element_comparer.hpp>
Modified: sandbox/itl/boost/itl/interval_sets.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_sets.hpp (original)
+++ sandbox/itl/boost/itl/interval_sets.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -106,7 +106,6 @@
typedef IntervalSet<DomainT,Compare,Interval,Alloc> operand_type;
const_FORALL(typename operand_type, elem_, operand)
object.erase(*elem_);
- //CL?? object.subtract(*elem_);
return object;
}
Modified: sandbox/itl/boost/itl/map.hpp
==============================================================================
--- sandbox/itl/boost/itl/map.hpp (original)
+++ sandbox/itl/boost/itl/map.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -9,7 +9,8 @@
#define __itl_map_h_JOFA_070519__
#include <string>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
+#include <boost/itl/detail/design_config.hpp>
#include <boost/itl/type_traits/is_map.hpp>
#include <boost/itl/type_traits/has_inverse.hpp>
#include <boost/itl/type_traits/to_string.hpp>
@@ -240,7 +241,6 @@
map& set(const element_type& key_value_pair)
{ (*this)[key_value_pair.KEY_VALUE] = key_value_pair.CONT_VALUE; return *this; }
- //JODO
/** erase the value pair \c pair(key,val) from the map.
Erase only if, the exact value content \c val is stored at key \key. */
size_type erase(const value_type& value);
@@ -570,7 +570,6 @@
const itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>& rhs)
{ return !(lhs == rhs); }
-//JODO comment...
template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
inline bool is_element_equal(const itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>& lhs,
const itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>& rhs)
@@ -584,6 +583,8 @@
inline bool is_protonic_equal (const itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>& lhs,
const itl::map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>& rhs)
{
+ //return Map::lexicographical_protonic_equal(lhs, rhs);
+
//JODO: Efficient implementation.
typedef std::map<DomainT,CodomainT,ITL_COMPARE_DOMAIN(Compare,DomainT),Alloc<DomainT> > base_type;
@@ -592,6 +593,7 @@
lhs0.absorb_neutrons();
rhs0.absorb_neutrons();
return operator==((const base_type&)lhs0, (const base_type&)rhs0);
+
}
/** Strict weak less ordering which is given by the Compare order */
@@ -750,7 +752,6 @@
object.swap(section);
return object;
}
- //CL{ Map::intersect(object, operand); return object; }
}
template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
Modified: sandbox/itl/boost/itl/map_algo.hpp
==============================================================================
--- sandbox/itl/boost/itl/map_algo.hpp (original)
+++ sandbox/itl/boost/itl/map_algo.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -28,7 +28,7 @@
#ifndef __itl_MAPALGO_H_JOFA_080225__
#define __itl_MAPALGO_H_JOFA_080225__
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl/set_algo.hpp>
namespace boost{namespace itl
@@ -63,31 +63,6 @@
return true;
}
- /*CL
- template<class MapType>
- void intersection(MapType& y, const MapType& x1, const MapType& x2)
- {
- MapType tmp;
- typename MapType::const_iterator i1 = x1.begin(), i2;
-
- while(i1 != x1.end())
- {
- i2 = x2.find(i1->first);
- if(i2 != x2.end())
- {
- tmp += *i1;
- if(is_set<typename MapType::codomain_type>::value)
- tmp *= *i2;
- else
- tmp += *i2;
- }
- i1++;
- }
- tmp.swap(y);
- }
- */
-
- // optimized version
template<class MapType>
void intersect(MapType& result, const MapType& x1, const MapType& x2)
{
Deleted: sandbox/itl/boost/itl/notate.hpp
==============================================================================
--- sandbox/itl/boost/itl/notate.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
+++ (empty file)
@@ -1,152 +0,0 @@
-/*----------------------------------------------------------------------------+
-Copyright (c) 2007-2008: Joachim Faulhaber
-+-----------------------------------------------------------------------------+
-Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
-+-----------------------------------------------------------------------------+
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-+----------------------------------------------------------------------------*/
-/*-----------------------------------------------------------------------------
- Macro definitions for useful and abstract notations e.g. iteration headers
------------------------------------------------------------------------------*/
-#ifndef __itl_NOTATE_H_JOFA_990119__
-#define __itl_NOTATE_H_JOFA_990119__
-
-
-// Iterations over stl or stl-compatible containers:
-#define FORALL(type,iter,obj) for(type::iterator iter=(obj).begin(); (iter)!=(obj).end(); (iter)++)
-#define const_FORALL(type,iter,obj) for(type::const_iterator iter=(obj).begin(); !((iter)==(obj).end()); (iter)++)
-
-#define FORALL_THIS(iter) for(iterator iter=begin(); (iter)!=end(); (iter)++)
-#define const_FORALL_THIS(iter) for(const_iterator iter=this->begin(); (iter)!=this->end(); (iter)++)
-
-// Plain old array iteration (assuming memberfunction VecT::size()!)
-#define FORALL_VEC(idx, vec) for(int idx=0; idx<vec.size(); idx++)
-
-// Parallel iteration
-#define const_FORALL_THIS_2(it, it2, cnt2)\
- for(const_iterator it=begin(), it2=(cnt2).begin(); (it)!=end() && (it2)!=cnt2.end(); (it)++, (it2)++)
-#define const_FORALL_THIS_PARALLEL(it, it2, cnt2)\
- for(const_iterator it=begin(), it2=(cnt2).begin(); (it)!=end() && (it2)!=cnt2.end(); (it)++, (it2)++)
-
-// Variants that requires already declared iterators
-#define FOR_ALL(iter,obj) for((iter)=(obj).begin(); (iter)!=(obj).end(); (iter)++)
-#define FOR_ALL_THIS(iter) for((iter)=this->begin(); (iter)!=this->end(); (iter)++)
-
-#define FOR_ALL2(iter1,obj1, iter2,obj2)\
- for((iter1)=(obj1).begin(), (iter2)=(obj2).begin(); (iter1)!=(obj1).end(); ++(iter1),++(iter2))
-
-// for readability and ease of memory: pair selectors for different contexts
-#define ITERATOR first // x.insert(y).second
-#define WAS_SUCCESSFUL second
-
-#define KEY_VALUE first // for map valuePairs
-#define CONT_VALUE second
-
-// universal and maths
-namespace boost{namespace itl
-{
- const int UNDEFINED_INDEX = -1;
-}} // namespace itl boost
-
-//------------------------------------------------------------------------------
-// Auxiliary macros for denoting template signatures.
-// Purpose:
-// (1) Shorten the lenthy and redundant template signatures.
-// (2) Name anonymous template types according to theirs meaning ...
-// (3) Making easier to refactor by redefinitin of the macros
-// (4) Being able to check template template parameter variants against
-// template type parameter variants.
-
-#define ITL_USE_COMPARE_TEMPLATE_TEMPLATE
-#define ITL_USE_COMBINE_TEMPLATE_TEMPLATE
-#define ITL_USE_SECTION_TEMPLATE_TEMPLATE
-
-//------------------------------------------------------------------------------
-// template parameter Compare can not be a template type parameter as long as
-// Compare<Interval<DomainT,Compare> >() is called in std::lexicographical_compare
-// implementing operator< for interval_base_{set,map}. see NOTE DESIGN TTP
-#ifdef ITL_USE_COMPARE_TEMPLATE_TEMPLATE
-# define ITL_COMPARE template<class>class
-# define ITL_COMPARE_DOMAIN(itl_compare, domain_type) itl_compare<domain_type>
-# define ITL_COMPARE_INSTANCE(compare_instance, domain_type) compare_instance
-# define ITL_EXCLUSIVE_LESS(interval_type) exclusive_less
-#else//ITL_USE_COMPARE_TEMPLATE_TYPE
-# define ITL_COMPARE class
-# define ITL_COMPARE_DOMAIN(itl_compare, domain_type) itl_compare
-# define ITL_COMPARE_INSTANCE(compare_instance, domain_type) compare_instance<domain_type>
-# define ITL_EXCLUSIVE_LESS(interval_type) exclusive_less<interval_type>
-#endif
-
-//------------------------------------------------------------------------------
-// template parameter Combine could be a template type parameter.
-#ifdef ITL_USE_COMBINE_TEMPLATE_TEMPLATE
-# define ITL_COMBINE template<class>class
-# define ITL_COMBINE_CODOMAIN(itl_combine, codomain_type) itl_combine<codomain_type>
-# define ITL_COMBINE_INSTANCE(compare_instance,codomain_type) compare_instance
-#else//ITL_USE_COMBINE_TEMPLATE_TYPE
-# define ITL_COMBINE class
-# define ITL_COMBINE_CODOMAIN(itl_combine, codomain_type) itl_combine
-# define ITL_COMBINE_INSTANCE(compare_instance,codomain_type) compare_instance<codomain_type>
-#endif
-
-//------------------------------------------------------------------------------
-// template parameter Section could be a template type parameter.
-#ifdef ITL_USE_SECTION_TEMPLATE_TEMPLATE
-# define ITL_SECTION template<class>class
-# define ITL_SECTION_CODOMAIN(itl_intersect, codomain_type) itl_intersect<codomain_type>
-# define ITL_SECTION_INSTANCE(section_instance,codomain_type) section_instance
-#else//ITL_USE_SECTION_TEMPLATE_TYPE
-# define ITL_SECTION class
-# define ITL_SECTION_CODOMAIN(itl_intersect, codomain_type) itl_intersect
-# define ITL_SECTION_INSTANCE(section_instance,codomain_type) section_instance<codomain_type>
-#endif
-
-//------------------------------------------------------------------------------
-#define ITL_ALLOC template<class>class
-
-//------------------------------------------------------------------------------
-namespace boost{namespace itl
-{
- namespace comparison
- {
- static const int less = -1;
- static const int equal = 0;
- static const int greater = 1;
- }
-
- namespace inclusion
- {
- static const int unrelated = 0;
- static const int subset = 1;
- static const int superset = 2;
- static const int equal = 3;
- }
-
-
-}} // namespace itl boost
-
-#endif // __itl_NOTATE_H_JOFA_990119__
-
-
Modified: sandbox/itl/boost/itl/set.hpp
==============================================================================
--- sandbox/itl/boost/itl/set.hpp (original)
+++ sandbox/itl/boost/itl/set.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -17,6 +17,8 @@
#include <boost/itl/type_traits/is_interval_separator.hpp>
#include <boost/itl/type_traits/absorbs_neutrons.hpp>
#include <boost/itl/type_traits/is_total.hpp>
+#include <boost/itl/detail/notate.hpp>
+#include <boost/itl/detail/design_config.hpp>
#include <boost/itl/set_algo.hpp>
#include <boost/itl/predicates.hpp>
Modified: sandbox/itl/boost/itl/set_algo.hpp
==============================================================================
--- sandbox/itl/boost/itl/set_algo.hpp (original)
+++ sandbox/itl/boost/itl/set_algo.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -30,7 +30,7 @@
#ifndef __itl_set_algo_H_JOFA_990225__
#define __itl_set_algo_H_JOFA_990225__
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl/predicates.hpp>
#include <boost/itl/functors.hpp>
Modified: sandbox/itl/boost/itl/split_interval_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/split_interval_map.hpp (original)
+++ sandbox/itl/boost/itl/split_interval_map.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -199,6 +199,17 @@
this->_map.insert(*it);
}
+ //==========================================================================
+ //= Selection
+ //==========================================================================
+
+ //MEMO DESIGN DECISION: split_interval_map::operator[](interval):
+ // If used for selection will deliver a set of associated
+ // values. It could only implemented for a single key value. But this
+ // would mislead the unexperienced user to hash a split_interval_map into
+ // singular intervals by inapt usage of op[]. So op[] will not be implemented
+ // codomain_type& operator[](const interval_type& interval_of_keys)
+
private:
// The following _suffixed function templates funx_ are implementations
// correspoding unsuffixed function templates funx of the base class.
@@ -354,9 +365,7 @@
// handle special case for first
- interval_type interSec;
- fst_itv.intersect(interSec, x_itv);
-
+ interval_type interSec = fst_itv & x_itv;
CodomainT cmb_val = cur_val;
Combiner()(cmb_val, x_val);
@@ -433,9 +442,7 @@
x_rest.right_subtract(left_gap, cur_itv);
fill_gap<Combiner>(value_type(left_gap, x_val));
- interval_type common;
- cur_itv.intersect(common, x_rest);
-
+ interval_type common = cur_itv & x_rest;
CodomainT cmb_val = cur_val;
Combiner()(cmb_val, x_val);
@@ -485,9 +492,7 @@
// handle special case for first
- interval_type interSec;
- fst_itv.intersect(interSec, x_itv);
-
+ interval_type interSec = fst_itv & x_itv;
CodomainT cmb_val = fst_val;
Combiner()(cmb_val, x_val);
@@ -553,11 +558,9 @@
CodomainT cur_val = (*it).CONT_VALUE ;
CodomainT cmb_val = cur_val ;
Combiner()(cmb_val, x_val);
- interval_type interSec;
- cur_itv.intersect(interSec, x_itv);
this->_map.erase(it);
- fill(value_type(interSec, cmb_val));
+ fill(value_type(cur_itv & x_itv, cmb_val));
fill(value_type(rightResid, cur_val));
}
}
@@ -602,9 +605,6 @@
// handle special case for first
- interval_type interSec;
- fst_itv.intersect(interSec, x_itv);
-
iterator snd_it = fst_it; snd_it++;
if(snd_it == end_it)
{
@@ -657,9 +657,6 @@
x_rest.right_subtract(left_gap, cur_itv);
fill(value_type(left_gap, x_val));
- interval_type common;
- cur_itv.intersect(common, x_rest);
-
interval_type end_gap;
x_rest.left_subtract(end_gap, cur_itv);
fill(value_type(end_gap, x_val));
@@ -696,8 +693,7 @@
// handle special case for first
- interval_type interSec;
- fst_itv.intersect(interSec, x_itv);
+ interval_type interSec = fst_itv & x_itv;
iterator snd_it = fst_it; snd_it++;
if(snd_it == end_it)
@@ -709,7 +705,6 @@
{
this->_map.erase(fst_it);
fill(value_type(leftResid, fst_val));
- // erased: fill(value_type(interSec, cmb_val));
fill(value_type(rightResid, fst_val));
}
}
@@ -720,7 +715,6 @@
{
this->_map.erase(fst_it);
fill(value_type(leftResid, fst_val));
- // erased: fill(value_type(interSec, cmb_val));
}
erase_rest(x_itv, x_val, snd_it, end_it);
@@ -760,13 +754,10 @@
}
else
{
- interval_type interSec;
- cur_itv.intersect(interSec, x_itv);
-
+ interval_type interSec = cur_itv & x_itv;
if(!interSec.empty() && cur_val == x_val)
{
this->_map.erase(it);
- //erased: fill(value_type(interSec, cmb_val));
fill(value_type(rightResid, cur_val));
}
}
Modified: sandbox/itl/boost/itl/split_interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/split_interval_set.hpp (original)
+++ sandbox/itl/boost/itl/split_interval_set.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -248,8 +248,7 @@
interval_type leftResid; cur_itv.right_subtract(leftResid, x);
// handle special case for first
- interval_type interSec;
- cur_itv.intersect(interSec, x);
+ interval_type interSec = cur_itv & x;
iterator snd_it = fst_it; snd_it++;
if(snd_it == end_it)
@@ -295,8 +294,7 @@
// this is a new Interval that is a gap in the current map
add_(newGap);
- interval_type interSec;
- cur_itv.intersect(interSec, x_itv);
+ interval_type interSec = cur_itv & x_itv;
if(nxt_it==end_it)
{
@@ -350,8 +348,6 @@
interval_type leftResid; cur_itv.right_subtract(leftResid, x);
// handle special case for first
- interval_type interSec;
- cur_itv.intersect(interSec, x);
iterator snd_it = fst_it; snd_it++;
if(snd_it == end_it)
@@ -396,16 +392,12 @@
this->_set.erase(it);
else
{
- interval_type interSec; cur_itv.intersect(interSec, x_itv);
this->_set.erase(it);
this->_set.insert(rightResid);
}
}
-
-
-
//==============================================================================
//= Equivalences and Orderings
//==============================================================================
Modified: sandbox/itl/boost/itl_xt/enum_bitset.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/enum_bitset.hpp (original)
+++ sandbox/itl/boost/itl_xt/enum_bitset.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -31,7 +31,7 @@
#define __itl_enum_bitset_JOFA_021204_H__
#include <bitset>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
namespace boost{namespace itl
{
Modified: sandbox/itl/boost/itl_xt/fixtupelconst.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/fixtupelconst.hpp (original)
+++ sandbox/itl/boost/itl_xt/fixtupelconst.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -29,7 +29,7 @@
#ifndef __itl_FixTupelConstT_JOFA_040621_H__
#define __itl_FixTupelConstT_JOFA_040621_H__
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#define FOREACH_VAR(idx) for(VarEnumTD idx=0; idx < varCountV; idx++)
#define FOREACH_VAR_TO(idx, upb) for(VarEnumTD idx=0; idx < upb; idx++)
Modified: sandbox/itl/boost/itl_xt/list.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/list.hpp (original)
+++ sandbox/itl/boost/itl_xt/list.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -39,6 +39,7 @@
#include <list>
#include <algorithm>
#include <boost/assert.hpp>
+#include <boost/itl/detail/design_config.hpp>
#include <boost/itl/type_traits/to_string.hpp>
#include <boost/itl/set_algo.hpp>
#include <boost/itl/predicates.hpp>
Modified: sandbox/itl/boost/itl_xt/prefix_set.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/prefix_set.hpp (original)
+++ sandbox/itl/boost/itl_xt/prefix_set.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -30,7 +30,7 @@
#ifndef __itl_prefix_set_JOFA_040902_H__
#define __itl_prefix_set_JOFA_040902_H__
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl/string_set.hpp>
namespace boost{namespace itl
Modified: sandbox/itl/boost/itl_xt/string_list.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/string_list.hpp (original)
+++ sandbox/itl/boost/itl_xt/string_list.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -38,7 +38,7 @@
#include <string>
#include <list>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl/itl_list.hpp>
namespace boost{namespace itl
Modified: sandbox/itl/boost/itl_xt/string_map.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/string_map.hpp (original)
+++ sandbox/itl/boost/itl_xt/string_map.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -28,7 +28,7 @@
#ifndef __itl_string_map_JOFA_021215_H__
#define __itl_string_map_JOFA_021215_H__
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl/map.hpp>
#include <string>
Modified: sandbox/itl/boost/itl_xt/string_sheet.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/string_sheet.hpp (original)
+++ sandbox/itl/boost/itl_xt/string_sheet.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -31,7 +31,7 @@
#include <iostream>
#include <fstream>
#include <boost/itl/string_list.hpp>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
namespace boost{namespace itl
{
Modified: sandbox/itl/boost/itl_xt/var_tuple.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/var_tuple.hpp (original)
+++ sandbox/itl/boost/itl_xt/var_tuple.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -31,7 +31,7 @@
#ifndef __var_tuple_JOFA_040614_H__
#define __var_tuple_JOFA_040614_H__
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl_xt/fixtupelconst.hpp>
#include <string>
#include <sstream>
Modified: sandbox/itl/boost/itl_xt/var_tuple_order.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/var_tuple_order.hpp (original)
+++ sandbox/itl/boost/itl_xt/var_tuple_order.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -31,7 +31,7 @@
#define __var_tuple_order_JOFA_040620_H__
#include <functional>
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl_xt/fixtupelconst.hpp>
#include <boost/itl_xt/var_tuple.hpp>
#include <boost/itl_xt/var_permutation.hpp>
Modified: sandbox/itl/boost/validate/gentor/randomgentor.hpp
==============================================================================
--- sandbox/itl/boost/validate/gentor/randomgentor.hpp (original)
+++ sandbox/itl/boost/validate/gentor/randomgentor.hpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -10,7 +10,7 @@
#pragma once
-#include <boost/itl/notate.hpp>
+#include <boost/itl/detail/notate.hpp>
#include <boost/itl_xt/numbergentor.hpp>
#include <boost/itl_xt/setgentor.hpp>
#include <boost/itl_xt/mapgentor.hpp>
Modified: sandbox/itl/libs/itl/doc/concepts.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/concepts.qbk (original)
+++ sandbox/itl/libs/itl/doc/concepts.qbk 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -425,7 +425,7 @@
Sometimes this subtle distiction is needed. Then a __penricher__
is the right choice. Also, If we want to give two `itl::Maps`
a common set of keys in order to, say, iterate synchronously
-over both maps, we need __enrichers__.
+over both maps, we need /enrichers/.
[endsect] [/ Map Traits]
Modified: sandbox/itl/libs/itl/doc/interface.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/interface.qbk (original)
+++ sandbox/itl/libs/itl/doc/interface.qbk 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -75,12 +75,12 @@
that all have equal template parameters.
[table Parameters of map class templates
-[[] [elements][mapped values][traits] [order of elements] [aggregation propagation] [intersection propagation] [type of intervals] [memory allocation]]
-[[template parameter] [`class`] [`class`] [`class`] [`template <class>class`] [`template <class>class`] [`template <class, template<class>class> class`][`template <class, template<class>class> class`][`template <class>class`]]
-[[__itv_bmaps__] [`DomainT`][`CodomainT`] [`Traits = neutron_absorber`] [`Compare = std::less`] [`Combine = inplace_plus`] [`Section = itl::inplace_et`] [`Interval = itl::interval`] [`Alloc = std::alloc`]]
-[[__itl_map__] [`DomainT`][`CodomainT`] [`Traits = neutron_absorber`] [`Compare = std::less`] [`Combine = inplace_plus`] [`Section = itl::inplace_et`] [`Alloc = std::alloc`]]
-[[template parameter] [`class`] [`class`] [] [`class`] [] [] [] [`class`]]
-[[=std::map=] [`_Key`] [`_Data`] [] [`_Compare = std::less<_Key>`][] [] [] [`Alloc = std::alloc<_Key>`]]
+[[] [elements][mapped values][traits] [order of elements] [aggregation propagation] [intersection propagation] [type of intervals] [memory allocation]]
+[[template parameter] [`class`] [`class`] [`class`] [`template <class>class`] [`template <class>class`] [`template <class>class`] [`template <class, template<class>class> class`][`template <class>class`]]
+[[__itv_bmaps__] [`DomainT`][`CodomainT`] [`Traits = neutron_absorber`] [`Compare = std::less`] [`Combine = inplace_plus`] [`Section = itl::inplace_et`] [`Interval = itl::interval`] [`Alloc = std::alloc`]]
+[[__itl_map__] [`DomainT`][`CodomainT`] [`Traits = neutron_absorber`] [`Compare = std::less`] [`Combine = inplace_plus`] [`Section = itl::inplace_et`] [`Alloc = std::alloc`]]
+[[template parameter] [`class`] [`class`] [] [`class`] [] [] [] [`class`]]
+[[=std::map=] [`_Key`] [`_Data`] [] [`_Compare = std::less<_Key>`][] [] [] [`Alloc = std::alloc<_Key>`]]
]
Using the following placeholders,
Modified: sandbox/itl/libs/itl/doc/introduction.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/introduction.qbk (original)
+++ sandbox/itl/libs/itl/doc/introduction.qbk 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -52,7 +52,7 @@
TV.switch_on(*telecast);
``
-Working with __itv_sets__ and __itv_maps__ can be
+Working with __itv_bsets__ and __itv_bmaps__ can be
beneficial whenever the elements of
sets appear in contiguous chunks: __itvs__. This is obviously the
case in many problem domains, particularly in fields that deal with
@@ -60,13 +60,13 @@
[h4 Addabitlity and Subtractability]
-Unlike `std::sets` and `maps`, __itv_sets__ and __itv_maps__ implement
-concept `Addable` and `Subtractable`. So __itv_sets__ define an
+Unlike `std::sets` and `maps`, __itv_bsets__ and __itv_bmaps__ implement
+concept `Addable` and `Subtractable`. So __itv_bsets__ define an
`operator +=` that is naturally implemented as ['*set union*] and an
`operator -=` that is consequently implemented as ['*set difference*].
-In the *Itl* __itv_maps__ are addable and subtractable as well.
+In the *Itl* __itv_bmaps__ are addable and subtractable as well.
It turned out to be a very fruitful concept to propagate the
-addition or subtraction to the __itv_map_s__ associated values
+addition or subtraction to the __itv_bmap_s__ associated values
in cases where the insertion of an interval value pair into an
__itv_map__ resulted in a collision of the inserted interval
value pair with interval value pairs, that are already in the
Modified: sandbox/itl/libs/itl/doc/itl.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/itl.qbk (original)
+++ sandbox/itl/libs/itl/doc/itl.qbk 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -28,6 +28,7 @@
[def __itv_bset__ [classref boost::itl::interval_base_set interval_set]]
[def __Itv_bset__ [classref boost::itl::interval_base_set Interval_set]]
[def __itv_bsets__ [classref boost::itl::interval_base_set interval_sets]]
+[def __itv_bset_s__ [classref boost::itl::interval_base_set interval_set's]]
[def __Itv_bsets__ [classref boost::itl::interval_base_set Interval_sets]]
[def __ele_set__ [classref boost::itl::set set]]
Modified: sandbox/itl/libs/itl/example/boost_party/boost_party.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/boost_party/boost_party.cpp (original)
+++ sandbox/itl/libs/itl/example/boost_party/boost_party.cpp 2009-02-14 17:58:09 EST (Sat, 14 Feb 2009)
@@ -68,7 +68,7 @@
typedef interval_map<ptime, GuestSetT> BoostPartyAttendenceHistoryT;
// A party's height shall be defined as the maximum height of all guests ;-)
-typedef interval_map<ptime, int, partial_absorber, less, inplace_max > BoostPartyHeightHistoryT;
+typedef interval_map<ptime, int, partial_absorber, less, inplace_max> BoostPartyHeightHistoryT;
void boost_party()
{
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