|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51016 - in sandbox/itl: boost/itl boost/itl/detail boost/validate boost/validate/laws libs/itl/build/win32 libs/itl/doc libs/itl/test libs/itl/test/test_casual libs/itl/test/test_interval_map_mixed libs/itl/test/test_interval_set libs/itl/test/test_interval_set_laws libs/itl/test/test_interval_set_mixed libs/itl/test/test_separate_interval_set libs/itl/test/test_split_interval_set libs/validate/example/labat_single libs/validate/src/gentor
From: afojgo_at_[hidden]
Date: 2009-02-04 14:38:00
Author: jofaber
Date: 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
New Revision: 51016
URL: http://svn.boost.org/trac/boost/changeset/51016
Log:
Added tests, refactored. Added tests for quantifiers.
Faster version of subset superset functions. Stable {msvc-9.0}
Added:
sandbox/itl/boost/itl/detail/
sandbox/itl/boost/itl/detail/element_comparer.hpp (contents, props changed)
sandbox/itl/boost/itl/detail/subset_comparer.hpp (contents, props changed)
sandbox/itl/boost/validate/laws/element_order.hpp (contents, props changed)
sandbox/itl/boost/validate/laws/subset_order.hpp (contents, props changed)
sandbox/itl/libs/itl/test/test_casual/
sandbox/itl/libs/itl/test/test_casual/test_casual.cpp (contents, props changed)
sandbox/itl/libs/itl/test/test_casual/vc9_test_casual.vcproj (contents, props changed)
sandbox/itl/libs/itl/test/test_interval_set_laws/
sandbox/itl/libs/itl/test/test_interval_set_laws/test_interval_set_laws.cpp (contents, props changed)
sandbox/itl/libs/itl/test/test_interval_set_laws/test_interval_set_laws_shared.cpp (contents, props changed)
sandbox/itl/libs/itl/test/test_interval_set_laws/vc9_test_interval_set_laws.vcproj (contents, props changed)
Text files modified:
sandbox/itl/boost/itl/interval.hpp | 11 +
sandbox/itl/boost/itl/interval_base_map.hpp | 1
sandbox/itl/boost/itl/interval_base_set.hpp | 46 +++++-
sandbox/itl/boost/itl/interval_map.hpp | 1
sandbox/itl/boost/itl/interval_maps.hpp | 143 +++++++++++++++++++++
sandbox/itl/boost/itl/interval_set.hpp | 2
sandbox/itl/boost/itl/interval_set_algo.hpp | 267 ++++++++-------------------------------
sandbox/itl/boost/itl/interval_sets.hpp | 36 ++++
sandbox/itl/boost/itl/notate.hpp | 17 ++
sandbox/itl/boost/itl/predicates.hpp | 8
sandbox/itl/boost/itl/separate_interval_set.hpp | 2
sandbox/itl/boost/itl/set.hpp | 15 ++
sandbox/itl/boost/itl/split_interval_map.hpp | 1
sandbox/itl/boost/itl/split_interval_set.hpp | 2
sandbox/itl/boost/validate/laws/order.h | 6
sandbox/itl/boost/validate/typevalidater.h | 2
sandbox/itl/libs/itl/build/win32/vc9_all.sln | 12 +
sandbox/itl/libs/itl/doc/interface.qbk | 102 ++++++++++----
sandbox/itl/libs/itl/doc/itl.qbk | 1
sandbox/itl/libs/itl/test/test_interval_map_mixed/test_interval_map_mixed.cpp | 12 +
sandbox/itl/libs/itl/test/test_interval_set/test_interval_set_shared.cpp | 4
sandbox/itl/libs/itl/test/test_interval_set_mixed/test_interval_set_mixed.cpp | 16 ++
sandbox/itl/libs/itl/test/test_interval_set_shared.hpp | 44 ++++++
sandbox/itl/libs/itl/test/test_separate_interval_set/test_separate_interval_set_shared.cpp | 4
sandbox/itl/libs/itl/test/test_split_interval_set/test_split_interval_set_shared.cpp | 4
sandbox/itl/libs/itl/test/test_type_lists.hpp | 6
sandbox/itl/libs/validate/example/labat_single/labat_single.cpp | 81 +++++++++++
sandbox/itl/libs/validate/src/gentor/gentorprofile.cpp | 37 ++--
28 files changed, 593 insertions(+), 290 deletions(-)
Added: sandbox/itl/boost/itl/detail/element_comparer.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/detail/element_comparer.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,215 @@
+/*----------------------------------------------------------------------------+
+Copyright (c) 2008-2008: 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 __itl_element_comparer_JOFA_090202_H__
+#define __itl_element_comparer_JOFA_090202_H__
+
+#include <boost/itl/type_traits/is_map.hpp>
+#include <boost/itl/notate.hpp>
+#include <boost/itl/type_traits/neutron.hpp>
+#include <boost/itl/interval.hpp>
+
+namespace boost{namespace itl
+{
+
+namespace Interval_Set
+{
+
+template<class LeftT, class RightT>
+class element_comparer
+{
+public:
+ typedef typename LeftT::const_iterator LeftIterT;
+ typedef typename RightT::const_iterator RightIterT;
+
+ element_comparer(const LeftT& left,
+ const RightT& right,
+ const LeftIterT& left_end,
+ const RightIterT& right_end)
+ : _left(left), _right(right),
+ _left_end(left_end), _right_end(right_end),
+ _compare_codomain(false), _result(equal)
+ {}
+
+ enum{nextboth, nextleft, nextright, stop};
+
+ enum
+ {
+ less = comparison::less,
+ equal = comparison::equal,
+ greater = comparison::greater
+ };
+
+ void set_compare_codomain(bool truth=true)
+ { _compare_codomain = truth; }
+
+ bool compare_codomain()const { return _compare_codomain; }
+
+ int result()const{ return _result; }
+
+ bool covalues_are_equal(LeftIterT& left, RightIterT& right)
+ {
+ if(LeftT::codomain_value(left) < RightT::codomain_value(right))
+ _result = less;
+ if(RightT::codomain_value(right) < LeftT::codomain_value(left))
+ _result = greater;
+ return _result == equal;
+ }
+
+ int proceed(LeftIterT& left, RightIterT& right)
+ {
+ if(LeftT::key_value(left).upper_less(RightT::key_value(right)))
+ {
+ _prior_left = left;
+ ++left;
+ return nextleft;
+ }
+ else if(RightT::key_value(right).upper_less(LeftT::key_value(left)))
+ {
+ _prior_right = right;
+ ++right;
+ return nextright;
+ }
+ else
+ {
+ ++left;
+ ++right;
+ return nextboth;
+ }
+ }
+
+ int next_both(LeftIterT& left, RightIterT& right)
+ {
+ if(left == _left_end)
+ {
+ _result = (right == _right_end) ? equal : less;
+ return stop;
+ }
+
+ // left != _left_end
+ if(right == _right_end)
+ {
+ _result = greater;
+ return stop;
+ }
+
+ // The starting intervals have to begin equally
+ if(LeftT::key_value(left).lower_less(RightT::key_value(right)))
+ { // left: same A... = sameA...
+ // right:same B.. = sameB...
+ _result = less;
+ return stop;
+ }
+
+ if(LeftT::key_value(right).lower_less(RightT::key_value(left)))
+ { // left: same B.. = sameB...
+ // right:same A... = sameA...
+ _result = greater;
+ return stop;
+ }
+
+ if(compare_codomain() && !covalues_are_equal(left, right))
+ return stop;
+
+ return proceed(left, right);
+ }
+
+ int next_left(LeftIterT& left, RightIterT& right)
+ {
+ if(left == _left_end)
+ { // left: same
+ // right:sameA...
+ _result = less;
+ return stop;
+ }
+
+ if(!LeftT::key_value(_prior_left).touches(LeftT::key_value(left)))
+ { // left: same B = sameB...
+ // right:sameA = sameA...
+ _result = greater;
+ return stop;
+ }
+
+ if(compare_codomain() && !covalues_are_equal(left, right))
+ return stop;
+
+ return proceed(left, right);
+ }
+
+ int next_right(LeftIterT& left, RightIterT& right)
+ {
+ if(right == _right_end)
+ { // left: sameA...
+ // right:same
+ _result = greater;
+ return stop;
+ }
+
+ if(!RightT::key_value(_prior_right).touches(RightT::key_value(right)))
+ {
+ // left: sameA... = sameA...
+ // right:same B.. = sameB...
+ _result = less;
+ return stop;
+ }
+
+ if(compare_codomain() && !covalues_are_equal(left, right))
+ return stop;
+
+ return proceed(left, right);
+ }
+
+private:
+ const LeftT& _left;
+ const RightT& _right;
+ LeftIterT _left_end;
+ RightIterT _right_end;
+ bool _compare_codomain;
+ LeftIterT _prior_left;
+ RightIterT _prior_right;
+ int _result;
+};
+
+
+
+template<class LeftT, class RightT>
+int element_compare
+(
+ const LeftT& left, //sub
+ const RightT& right, //super
+ typename LeftT::const_iterator left_begin,
+ typename LeftT::const_iterator left_end,
+ typename RightT::const_iterator right_begin,
+ typename RightT::const_iterator right_end
+)
+{
+ typedef element_comparer<LeftT,RightT> Step;
+ Step step(left, right, left_end, right_end);
+ step.set_compare_codomain(is_map<LeftT>::value && is_map<RightT>::value);
+
+ typename LeftT::const_iterator left_ = left_begin;
+ typename RightT::const_iterator right_ = right_begin;
+
+ int state = Step::nextboth;
+ while(state != Step::stop)
+ {
+ switch(state){
+ case Step::nextboth: state = step.next_both (left_, right_); break;
+ case Step::nextleft: state = step.next_left (left_, right_); break;
+ case Step::nextright: state = step.next_right(left_, right_); break;
+ }
+ }
+ return step.result();
+}
+
+
+} // namespace Interval_Set
+
+}} // namespace itl boost
+
+#endif
+
Added: sandbox/itl/boost/itl/detail/subset_comparer.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/itl/detail/subset_comparer.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,324 @@
+/*----------------------------------------------------------------------------+
+Copyright (c) 2008-2008: 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 __itl_subset_comparer_JOFA_090202_H__
+#define __itl_subset_comparer_JOFA_090202_H__
+
+#include <boost/itl/type_traits/is_map.hpp>
+#include <boost/itl/notate.hpp>
+#include <boost/itl/type_traits/neutron.hpp>
+#include <boost/itl/interval.hpp>
+
+namespace boost{namespace itl
+{
+
+namespace Interval_Set
+{
+
+template<class LeftT, class RightT>
+class subset_comparer
+{
+public:
+ typedef typename LeftT::const_iterator LeftIterT;
+ typedef typename RightT::const_iterator RightIterT;
+
+ subset_comparer(const LeftT& left,
+ const RightT& right,
+ const LeftIterT& left_end,
+ const RightIterT& right_end)
+ : _left(left), _right(right),
+ _left_end(left_end), _right_end(right_end),
+ _compare_codomain(false), _result(equal)
+ {}
+
+ enum{nextboth, nextleft, nextright, stop};
+
+ enum
+ {
+ unrelated = inclusion::unrelated,
+ subset = inclusion::subset, // left is_subset_of right
+ superset = inclusion::superset, // left is_superset_of right
+ equal = inclusion::equal // equal = subset | superset
+ };
+
+ void set_compare_codomain(bool truth=true)
+ { _compare_codomain = truth; }
+
+ bool compare_codomain()const { return _compare_codomain; }
+
+ int result()const{ return _result; }
+
+ bool covalues_are_equal(LeftIterT& left, RightIterT& right)
+ {
+ if(left == _left_end)//CL
+ {
+ cout << "l: " << _left << endl;
+ cout << "r: " << _right << endl;
+ int dummy = 1;
+ }
+ if(right == _right_end)//CL
+ {
+ cout << "l: " << _left << endl;
+ cout << "r: " << _right << endl;
+ int dummy = 2;
+ }
+
+ if(LeftT::codomain_value(left) == RightT::codomain_value(right))
+ return true;
+
+ _result = unrelated;
+ return false;
+ }
+
+ int restrict_result(int state) { return _result &= state; }
+
+ int proceed(LeftIterT& left, RightIterT& right)
+ {
+ if(left == _left_end)//CL
+ {
+ cout << "l: " << _left << endl;
+ cout << "r: " << _right << endl;
+ int dummy = 1;
+ }
+ if(right == _right_end)//CL
+ {
+ cout << "l: " << _left << endl;
+ cout << "r: " << _right << endl;
+ int dummy = 2;
+ }
+
+
+ if(LeftT::key_value(left).upper_less(RightT::key_value(right)))
+ { // left ..)
+ // right .....)
+ _prior_left = left;
+ ++left;
+ return nextleft;
+ }
+ else if(RightT::key_value(right).upper_less(LeftT::key_value(left)))
+ { // left .....)
+ // right ..)
+ _prior_right = right;
+ ++right;
+ return nextright;
+ }
+ else//LeftT::key_value(left).upper_equal(RightT::key_value(right))
+ { // left ..)
+ // right ..)
+ ++left;
+ ++right;
+ return nextboth;
+ }
+ }
+
+ int next_both(LeftIterT& left, RightIterT& right)
+ {
+ if(left == _left_end && right == _right_end)
+ return stop;
+ else if(left == _left_end)
+ { // left: ....end left could be subset
+ // right:....[..
+ restrict_result(subset);
+ return stop;
+ }
+ else if(right == _right_end)
+ { // left: ....[.. left could be superset
+ // right:....end
+ restrict_result(superset);
+ return stop;
+ }
+ else if(LeftT::key_value(left).exclusive_less(RightT::key_value(right)))
+ { // left: [..) . . .[---) left could be superset
+ // right: [..).... if [---) exists
+ restrict_result(superset);
+ if(unrelated == _result)
+ return stop;
+ else
+ {
+ LeftIterT joint_ = _left.lower_bound(RightT::key_value(right));
+ if(joint_ == _left.end())
+ {
+ _result = unrelated;
+ return stop;
+ }
+ else
+ {
+ left = joint_;
+ return nextboth;
+ }
+ }
+ }
+ else if(RightT::key_value(right).exclusive_less(LeftT::key_value(left)))
+ { // left: [.. left could be subset
+ // right:....) . . .[---) if [---) exists
+ restrict_result(subset);
+ if(unrelated == _result)
+ return stop;
+ else
+ {
+ RightIterT joint_ = _right.lower_bound(LeftT::key_value(left));
+ if(joint_ == _right.end())
+ {
+ _result = unrelated;
+ return stop;
+ }
+ else
+ {
+ right = joint_;
+ return nextboth;
+ }
+ }
+ }
+
+ // left and right have intervals with nonempty intersection:
+ if(compare_codomain() && !covalues_are_equal(left, right))
+ return stop;
+
+ // examine left borders only. Right borders are checked in proceed
+ if(LeftT::key_value(left).lower_less(RightT::key_value(right)))
+ { // left: ....[... left could be superset
+ // right:.... [..
+ if(unrelated == restrict_result(superset))
+ return stop;
+ }
+ else if(LeftT::key_value(right).lower_less(RightT::key_value(left)))
+ { // left: .... [.. left can be subset
+ // right:....[...
+ if(unrelated == restrict_result(subset))
+ return stop;
+ }
+ //else LeftT::key_value(right).lower_equal(RightT::key_value(left))
+ // left: ....[.. both can be equal
+ // right:....[..
+ // nothing to do: proceed
+
+ return proceed(left, right);
+ }
+
+ int next_left(LeftIterT& left, RightIterT& right)
+ {
+ if(left == _left_end)
+ { // left: ..)end left could be subset
+ // right:......)
+ restrict_result(subset);
+ return stop;
+ }
+ else if(!LeftT::key_value(_prior_left).touches(LeftT::key_value(left)))
+ { // left: ..) [..
+ // right:.........)
+ if(RightT::key_value(right).lower_less(LeftT::key_value(left)))
+ { // ..) [.. left could be subset
+ // ..........)
+ if(unrelated == restrict_result(subset))
+ return stop;
+ }
+ //else ..) [...
+ // [..
+ if(compare_codomain() && !LeftT::key_value(left).is_disjoint(RightT::key_value(right))
+ && !covalues_are_equal(left, right))
+ return stop;
+ }
+ else
+ { // left: ..)[.. left could be subset
+ // right:.......)
+ if(compare_codomain() && !LeftT::key_value(left).is_disjoint(RightT::key_value(right))
+ && !covalues_are_equal(left, right))
+ return stop;
+ }
+
+ return proceed(left, right);
+ }
+
+
+ int next_right(LeftIterT& left, RightIterT& right)
+ {
+ if(right == _right_end)
+ { // left: ......) left could be superset
+ // right:..)end
+ restrict_result(superset);
+ return stop;
+ }
+ else if(!RightT::key_value(_prior_right).touches(RightT::key_value(right)))
+ { // left: .........)
+ // right:..) [..
+ if(LeftT::key_value(left).lower_less(RightT::key_value(right)))
+ { // [....) left could be superset
+ // ..) [..
+ if(unrelated == restrict_result(superset))
+ return stop;
+ }
+ //else [....)
+ // ..) [..
+ if(compare_codomain() && !LeftT::key_value(left).is_disjoint(RightT::key_value(right))
+ && !covalues_are_equal(left, right))
+ return stop;
+ }
+ else
+ {
+ if(compare_codomain() && !LeftT::key_value(left).is_disjoint(RightT::key_value(right))
+ && !covalues_are_equal(left, right))
+ return stop;
+ }
+
+ return proceed(left, right);
+ }
+
+private:
+ const LeftT& _left;
+ const RightT& _right;
+ LeftIterT _left_end;
+ RightIterT _right_end;
+ bool _compare_codomain;
+ LeftIterT _prior_left;
+ RightIterT _prior_right;
+ int _result;
+};
+
+
+
+
+
+//------------------------------------------------------------------------------
+// Subset/superset comparison on ranges of two interval container
+//------------------------------------------------------------------------------
+template<class LeftT, class RightT>
+int subset_compare
+(
+ const LeftT& left, //sub
+ const RightT& right, //super
+ typename LeftT::const_iterator left_begin,
+ typename LeftT::const_iterator left_end,
+ typename RightT::const_iterator right_begin,
+ typename RightT::const_iterator right_end
+)
+{
+ typedef subset_comparer<LeftT,RightT> Step;
+ Step step(left, right, left_end, right_end);
+ step.set_compare_codomain(is_map<LeftT>::value && is_map<RightT>::value);
+
+ typename LeftT::const_iterator left_ = left_begin;
+ typename RightT::const_iterator right_ = right_begin;
+
+ int state = Step::nextboth;
+ while(state != Step::stop)
+ {
+ switch(state){
+ case Step::nextboth: state = step.next_both(left_, right_); break;
+ case Step::nextleft: state = step.next_left(left_, right_); break;
+ case Step::nextright: state = step.next_right(left_, right_); break;
+ }
+ }
+ return step.result();
+}
+
+
+} // namespace Interval_Set
+
+}} // namespace itl boost
+
+#endif
+
Modified: sandbox/itl/boost/itl/interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval.hpp (original)
+++ sandbox/itl/boost/itl/interval.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -328,11 +328,22 @@
class interval
{
public:
+ typedef interval<DomainT,Compare> type;
/// Domain type or element type
typedef DomainT domain_type;
+ typedef DomainT codomain_type;
+ typedef DomainT element_type;
+ typedef type segment_type;
+
+ typedef DomainT key_type;
+ typedef DomainT data_type;
+ typedef DomainT value_type;
+ typedef type interval_type;
+
/// Compare order on the data
typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
+ typedef domain_compare key_compare;
/// The difference type of an interval which is sometimes different form the domain_type
typedef typename itl::difference<DomainT>::type difference_type;
Modified: sandbox/itl/boost/itl/interval_base_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_map.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -183,6 +183,7 @@
typedef Interval<DomainT,Compare> interval_type;
typedef std::pair<interval_type,CodomainT> interval_mapping_type;
+ typedef std::pair<interval_type,CodomainT> segment_type;
/// The difference type of an interval which is sometimes different form the domain_type
typedef typename interval_type::difference_type difference_type;
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -131,6 +131,8 @@
/// The interval type of the set
typedef Interval<DomainT,Compare> interval_type;
+ /// The segment type of the set
+ typedef interval_type segment_type;
/// The difference type of an interval which is sometimes different form the data_type
typedef typename interval_type::difference_type difference_type;
@@ -219,12 +221,27 @@
bool contains(const interval_type& x)const
{ return that()->contains_(x); }
- /** Does <tt>*this</tt> container contain <tt>sub</tt>? */
bool contains(const interval_base_set& sub)const
{ return sub.contained_in(*this); }
+ /** Does <tt>*this</tt> container contain <tt>sub</tt>? */
+ template
+ <
+ template<class DomT, ITL_COMPARE Comp,
+ template<class DomT2,ITL_COMPARE>class Interv, ITL_ALLOC Allc>
+ class IntervalSet
+ >
+ bool contains(const IntervalSet<DomainT,Compare,Interval,Alloc>& sub)const
+ { return sub.contained_in(*that()); }
+
/** Is <tt>*this</tt> contained in <tt>super</tt>? */
- bool contained_in(const interval_base_set& super)const;
+ template
+ <
+ template<class DomT, ITL_COMPARE Comp,
+ template<class DomT2,ITL_COMPARE>class Interv, ITL_ALLOC Allc>
+ class IntervalSet
+ >
+ bool contained_in(const IntervalSet<DomainT,Compare,Interval,Alloc>& super)const;
/** @name E: Bounds and other selectors
*/
@@ -524,13 +541,16 @@
}
-template
-<
- class SubType, class DomainT,
- ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc
->
+template<class SubType,
+ class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
+ template
+ <
+ template<class DomT, ITL_COMPARE Comp,
+ template<class DomT2,ITL_COMPARE>class Interv, ITL_ALLOC Allc>
+ class IntervalSet
+ >
bool interval_base_set<SubType,DomainT,Compare,Interval,Alloc>
- ::contained_in(const interval_base_set& x2)const
+ ::contained_in(const IntervalSet<DomainT,Compare,Interval,Alloc>& x2)const
{
// The empty set is subset of every set
if(empty())
@@ -643,11 +663,13 @@
template
<
class SubType,
- class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
- template
- <template<class DomT, ITL_COMPARE Comp, template<class DomT2,ITL_COMPARE>class Interv, ITL_ALLOC Allc>
- class IntervalSet
+ class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc
>
+ template
+ <
+ template<class DomT, ITL_COMPARE Comp, template<class DomT2,ITL_COMPARE>class Interv, ITL_ALLOC Allc>
+ class IntervalSet
+ >
SubType& interval_base_set<SubType,DomainT,Compare,Interval,Alloc>
::flip(const IntervalSet<DomainT,Compare,Interval,Alloc>& operand)
{
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -139,6 +139,7 @@
typedef typename base_type::iterator iterator;
typedef typename base_type::value_type value_type;
typedef typename base_type::element_type element_type;
+ typedef typename base_type::segment_type segment_type;
typedef typename base_type::domain_mapping_type domain_mapping_type;
typedef typename base_type::interval_mapping_type interval_mapping_type;
typedef typename base_type::ImplMapT ImplMapT;
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -206,6 +206,149 @@
return Interval_Set::is_element_equal(left, right);
}
+template
+<
+ class DomainT, class CodomainT, class Traits,
+ ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class LeftIntervalMap,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class RightIntervalMap
+>
+bool is_element_less
+(
+ const LeftIntervalMap <DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& left,
+ const RightIntervalMap<DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& right
+)
+{
+ return Interval_Set::is_element_less(left, right);
+}
+
+template
+<
+ class DomainT, class CodomainT, class Traits,
+ ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class LeftIntervalMap,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class RightIntervalMap
+>
+bool is_element_greater
+(
+ const LeftIntervalMap <DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& left,
+ const RightIntervalMap<DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& right
+)
+{
+ return Interval_Set::is_element_greater(left, right);
+}
+
+//-----------------------------------------------------------------------------
+// is_inclusion_equal
+//-----------------------------------------------------------------------------
+template
+<
+ class DomainT, class CodomainT, class Traits,
+ ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class LeftIntervalMap,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class RightIntervalMap
+>
+bool is_inclusion_equal
+(
+ const LeftIntervalMap <DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& left,
+ const RightIntervalMap<DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& right
+)
+{
+ return Interval_Set::is_inclusion_equal(left, right);
+}
+
+template
+<
+ class DomainT, class CodomainT, class Traits,
+ ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class LeftIntervalMap,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class RightIntervalMap
+>
+bool is_contained_in
+(
+ const LeftIntervalMap <DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& left,
+ const RightIntervalMap<DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& right
+)
+{
+ return Interval_Set::is_contained_in(left, right);
+}
+
+template
+<
+ class DomainT, class CodomainT, class Traits,
+ ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class LeftIntervalMap,
+ template
+ <
+ class, class, class,
+ ITL_COMPARE, ITL_COMBINE, ITL_SECTION, template<class,ITL_COMPARE>class, ITL_ALLOC
+ >
+ class RightIntervalMap
+>
+bool contains
+(
+ const LeftIntervalMap <DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& left,
+ const RightIntervalMap<DomainT,CodomainT,
+ Traits,Compare,Combine,Section,Interval,Alloc>& right
+)
+{
+ return Interval_Set::contains(left, right);
+}
+
//-----------------------------------------------------------------------------
// is_protonic_equal
//-----------------------------------------------------------------------------
Modified: sandbox/itl/boost/itl/interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_set.hpp (original)
+++ sandbox/itl/boost/itl/interval_set.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -131,6 +131,8 @@
typedef DomainT element_type;
/// The interval type of the set
typedef Interval<DomainT,Compare> interval_type;
+ /// The segment type of the set
+ typedef interval_type segment_type;
/// Comparison functor for domain values
typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -12,6 +12,8 @@
#include <boost/itl/notate.hpp>
#include <boost/itl/type_traits/neutron.hpp>
#include <boost/itl/interval.hpp>
+#include <boost/itl/detail/element_comparer.hpp>
+#include <boost/itl/detail/subset_comparer.hpp>
namespace boost{namespace itl
{
@@ -67,235 +69,82 @@
namespace Interval_Set
{
+//------------------------------------------------------------------------------
+// Lexicographical comparison on ranges of two interval container
+//------------------------------------------------------------------------------
+
template<class LeftT, class RightT>
-class interval_sequence_tracker
+bool is_element_equal(const LeftT& left, const RightT& right)
{
-public:
- typedef typename LeftT::const_iterator LeftIterT;
- typedef typename RightT::const_iterator RightIterT;
-
- interval_sequence_tracker(const LeftT& left,
- const RightT& right,
- const LeftIterT& left_end,
- const RightIterT& right_end)
- : _left(left), _right(right),
- _left_end(left_end), _right_end(right_end),
- _compare_codomain(false), _result(result_is_equal)
- {
- _scope = enclosure(_left) & enclosure(_right);
- }
-
- enum{firstboth, nextboth, nextleft, nextright, leftaligned, stop};
- enum{result_is_less = -1, result_is_equal = 0, result_is_greater = 1};
-
- void set_compare_codomain(bool truth=true)
- { _compare_codomain = truth; }
-
- bool compare_codomain()const { return _compare_codomain; }
-
- int result()const{ return _result; }
-
- bool covalues_are_equal(LeftIterT& left, RightIterT& right)
- {
- if(LeftT::codomain_value(left) < RightT::codomain_value(right))
- _result = result_is_less;
- if(RightT::codomain_value(right) < LeftT::codomain_value(left))
- _result = result_is_greater;
- return _result == result_is_equal;
- }
-
- int proceed(LeftIterT& left, RightIterT& right)
- {
- if(LeftT::key_value(left).upper_equal(RightT::key_value(right)))
- {
- ++left;
- ++right;
- return nextboth;
- }
- else if(LeftT::key_value(left).upper_less(RightT::key_value(right)))
- {
- _prior_left = left;
- ++left;
- return nextleft;
- }
- else
- {
- _prior_right = right;
- ++right;
- return nextright;
- }
- }
-
- int next_both(LeftIterT& left, RightIterT& right)
- {
- if(left == _left_end)
- {
- _result = (right == _right_end) ? result_is_equal : result_is_less;
- return stop;
- }
-
- // left != _left_end
- if(right == _right_end)
- {
- _result = result_is_greater;
- return stop;
- }
-
- // Two matching intervals for left and right
- // if they both start at or before the _scope, they are
- // assumed to be leftaligned.
- if(!( LeftT::key_value(left).lower_less_equal(_scope)
- && RightT::key_value(right).lower_less_equal(_scope)))
- {
- // The starting intervals have to begin equally
- if(LeftT::key_value(left).lower_less(RightT::key_value(right)))
- { // left: same A... = sameA...
- // right:same B.. = sameB...
- _result = result_is_less;
- return stop;
- }
-
- if(LeftT::key_value(right).lower_less(RightT::key_value(left)))
- { // left: same B.. = sameB...
- // right:same A... = sameA...
- _result = result_is_greater;
- return stop;
- }
-
- if(compare_codomain() && covalues_are_equal(left, right))
- return stop;
- }
-
- // If left and right intervals reach to or beyond the _scope's end
- // the result is equality
- if( _scope.upper_less_equal(LeftT::key_value(left))
- && _scope.upper_less_equal(RightT::key_value(right)))
- return stop;
-
- return leftaligned;
- }
-
- int next_left(LeftIterT& left, RightIterT& right)
- {
- if(left == _left_end)
- { // left: same
- // right:sameA...
- _result = result_is_less;
- return stop;
- }
-
- if(!LeftT::key_value(_prior_left).touches(LeftT::key_value(left)))
- { // left: same B = sameB...
- // right:sameA = sameA...
- _result = result_is_greater;
- return stop;
- }
-
- if(compare_codomain() && covalues_are_equal(left, right))
- return stop;
-
- // If left and right intervals reach to or beyond the _scope's end
- // the result is equality
- if( _scope.upper_less_equal(LeftT::key_value(left))
- && _scope.upper_less_equal(RightT::key_value(right)))
- return stop;
-
- return proceed(left, right);
- }
-
- int next_right(LeftIterT& left, RightIterT& right)
- {
- if(right == _right_end)
- { // left: sameA...
- // right:same
- _result = result_is_greater;
- return stop;
- }
-
- if(!RightT::key_value(_prior_right).touches(RightT::key_value(right)))
- {
- // left: sameA... = sameA...
- // right:same B.. = sameB...
- _result = result_is_less;
- return stop;
- }
-
- if(compare_codomain() && covalues_are_equal(left, right))
- return stop;
-
- // If left and right intervals reach to or beyond the _scope's end
- // the result is equality
- if( _scope.upper_less_equal(LeftT::key_value(left))
- && _scope.upper_less_equal(RightT::key_value(right)))
- return stop;
-
- return proceed(left, right);
- }
-
-private:
- const LeftT& _left;
- const RightT& _right;
- LeftIterT _left_end;
- RightIterT _right_end;
- bool _compare_codomain;
- LeftIterT _prior_left;
- RightIterT _prior_right;
- int _result;
- typename LeftT::interval_type _scope;
-};
+ return subset_compare
+ (
+ left, right,
+ left.begin(), left.end(),
+ right.begin(), right.end()
+ ) == inclusion::equal;
+}
-/* Lexicographical comparison on ranges of two interval container */
template<class LeftT, class RightT>
-int lexicographical_compare_3way
-(
- const LeftT& left, //sub
- const RightT& right, //super
- typename LeftT::const_iterator left_begin,
- typename LeftT::const_iterator left_end,
- typename RightT::const_iterator right_begin,
- typename RightT::const_iterator right_end
-)
-{
- typedef interval_sequence_tracker<LeftT,RightT> Step;
- Step step(left, right, left_end, right_end);
- step.set_compare_codomain(is_map<LeftT>::value && is_map<RightT>::value);
-
- typename LeftT::const_iterator left_ = left_begin;
- typename RightT::const_iterator right_ = right_begin;
-
- int state = Step::nextboth;
- while(state != Step::stop)
- {
- switch(state){
- case Step::nextboth: state = step.next_both(left_, right_); break;
- case Step::nextleft: state = step.next_left(left_, right_); break;
- case Step::nextright: state = step.next_right(left_, right_); break;
- case Step::leftaligned: state = step.proceed(left_, right_); break;
- }
- }
- return step.result();
+bool is_element_less(const LeftT& left, const RightT& right)
+{
+ return element_compare
+ (
+ left, right,
+ left.begin(), left.end(),
+ right.begin(), right.end()
+ ) == comparison::less;
}
template<class LeftT, class RightT>
-bool is_element_equal(const LeftT& left, const RightT& right)
+bool is_element_greater(const LeftT& left, const RightT& right)
{
- return lexicographical_compare_3way
+ return element_compare
(
left, right,
left.begin(), left.end(),
right.begin(), right.end()
- ) == 0;
+ ) == comparison::greater;
}
+//------------------------------------------------------------------------------
+// Subset/superset compare on ranges of two interval container
+//------------------------------------------------------------------------------
+
template<class LeftT, class RightT>
-bool is_element_less(const LeftT& left, const RightT& right)
+bool is_inclusion_equal(const LeftT& left, const RightT& right)
{
- return lexicographical_compare_3way
+ return subset_compare
(
left, right,
left.begin(), left.end(),
right.begin(), right.end()
- ) == -1;
+ ) == inclusion::equal;
+}
+
+template<class LeftT, class RightT>
+bool is_contained_in(const LeftT& left, const RightT& right)
+{
+ int result =
+ subset_compare
+ (
+ left, right,
+ left.begin(), left.end(),
+ right.begin(), right.end()
+ );
+ return result == inclusion::subset || result == inclusion::equal;
+}
+
+template<class LeftT, class RightT>
+bool contains(const LeftT& left, const RightT& right)
+{
+ int result =
+ subset_compare
+ (
+ left, right,
+ left.begin(), left.end(),
+ right.begin(), right.end()
+ );
+ return result == inclusion::superset || result == inclusion::equal;
}
} // namespace Interval_Set
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -87,11 +87,41 @@
>
bool is_element_equal
(
- const interval_base_set<SubType,DomainT,Compare,Interval,Alloc>& object,
- const IntervalSet <DomainT,Compare,Interval,Alloc>& operand
+ const interval_base_set<SubType,DomainT,Compare,Interval,Alloc>& left,
+ const IntervalSet <DomainT,Compare,Interval,Alloc>& right
+)
+{
+ return Interval_Set::is_element_equal(left, right);
+}
+
+template
+<
+ class SubType, class DomainT,
+ ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc,
+ template<class, ITL_COMPARE, template<class,ITL_COMPARE>class, ITL_ALLOC>class IntervalSet
+>
+bool is_element_less
+(
+ const interval_base_set<SubType,DomainT,Compare,Interval,Alloc>& left,
+ const IntervalSet <DomainT,Compare,Interval,Alloc>& right
+)
+{
+ return Interval_Set::is_element_less(left, right);
+}
+
+template
+<
+ class SubType, class DomainT,
+ ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc,
+ template<class, ITL_COMPARE, template<class,ITL_COMPARE>class, ITL_ALLOC>class IntervalSet
+>
+bool is_element_greater
+(
+ const interval_base_set<SubType,DomainT,Compare,Interval,Alloc>& left,
+ const IntervalSet <DomainT,Compare,Interval,Alloc>& right
)
{
- return Interval_Set::is_element_equal(object, operand);
+ return Interval_Set::is_element_greater(left, right);
}
Modified: sandbox/itl/boost/itl/notate.hpp
==============================================================================
--- sandbox/itl/boost/itl/notate.hpp (original)
+++ sandbox/itl/boost/itl/notate.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -130,6 +130,23 @@
namespace boost{namespace itl
{
typedef unsigned int nat;
+
+ 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/predicates.hpp
==============================================================================
--- sandbox/itl/boost/itl/predicates.hpp (original)
+++ sandbox/itl/boost/itl/predicates.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -128,7 +128,7 @@
/// Functor class template contained_in implements the subset relation.
template<class Type>
- struct contained_in : public relation<Type,Type>
+ struct sub_super_set : public relation<Type,Type>
{
/// Apply the subset relation.
/** <tt>contained_in(sub, super)</tt> is true if <tt>sub</tt>
@@ -139,16 +139,16 @@
}
};
- /// Functor class template <b>containes</b> implements the superset relation.
+ /// Functor class template <b>contains</b> implements the superset relation.
template<class Type>
- struct containes : public relation<Type,Type>
+ struct super_sub_set : public relation<Type,Type>
{
/// Apply the superset relation.
/** <tt>containes(super, sub)</tt> is true if <tt>super</tt> containes
<tt>sub</tt> */
bool operator()(const Type& super, const Type& sub)const
{
- return super.containes(sub);
+ return super.contains(sub);
}
};
Modified: sandbox/itl/boost/itl/separate_interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/separate_interval_set.hpp (original)
+++ sandbox/itl/boost/itl/separate_interval_set.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -95,6 +95,8 @@
typedef DomainT element_type;
/// The interval type of the set
typedef Interval<DomainT,Compare> interval_type;
+ /// The segment type of the set
+ typedef interval_type segment_type;
/// Comparison functor for domain values
typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
Modified: sandbox/itl/boost/itl/set.hpp
==============================================================================
--- sandbox/itl/boost/itl/set.hpp (original)
+++ sandbox/itl/boost/itl/set.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -487,6 +487,21 @@
{ return object -= operand; }
+ //---------------------------------------------------------------------------------
+ template<class CharType, class CharTraits,
+ class DomainT, ITL_COMPARE Compare, ITL_ALLOC Alloc>
+ std::basic_ostream<CharType, CharTraits>& operator <<
+ (std::basic_ostream<CharType, CharTraits>& stream,
+ const set<DomainT,Compare,Alloc>& object)
+ {
+ typedef itl::set<DomainT,Compare,Alloc> SetT;
+ stream << "{";
+ const_FORALL(typename SetT, it, object)
+ stream << *it;
+
+ return stream << "}";
+ }
+
//-------------------------------------------------------------------------
template <class Type>
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -155,6 +155,7 @@
typedef typename base_type::iterator iterator;
typedef typename base_type::value_type value_type;
typedef typename base_type::element_type element_type;
+ typedef typename base_type::segment_type segment_type;
typedef typename base_type::domain_mapping_type domain_mapping_type;
typedef typename base_type::interval_mapping_type interval_mapping_type;
typedef typename base_type::ImplMapT ImplMapT;
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -113,6 +113,8 @@
typedef DomainT element_type;
/// The interval type of the set
typedef Interval<DomainT,Compare> interval_type;
+ /// The segment type of the set
+ typedef interval_type segment_type;
/// Comparison functor for domain values
typedef ITL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
Added: sandbox/itl/boost/validate/laws/element_order.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/validate/laws/element_order.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,219 @@
+/*----------------------------------------------------------------------------+
+A Law Based Test Automaton 'LaBatea'
+Author: Joachim Faulhaber
+Copyright (c) 2007-2008: 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 __itl_element_order_hpp_JOFA_090202__
+#define __itl_element_order_hpp_JOFA_090202__
+
+#include <boost/itl/type_traits/value_size.hpp>
+#include <boost/itl/interval_morphism.hpp>
+#include <boost/validate/law.h>
+
+namespace boost{namespace itl
+{
+
+ // ---------------------------------------------------------------------------
+ template <typename Type>
+ class ElementEqualDefined
+ : public Law<ElementEqualDefined<Type>,
+ LOKI_TYPELIST_2(Type,Type), LOKI_TYPELIST_2(bool,bool)>
+ {
+ /** is_element_equal(a, a.join())
+ Input = (a := inVal1)
+ Output = ()
+ */
+ public:
+ std::string name()const { return "ElementEqualDefined"; }
+ std::string formula()const { return "is_element_equal(a, a.join())"; }
+
+ std::string typeString()const
+ {
+ return "ElementEqualDefined<"+type_to_string<Type>::apply()+">";
+ }
+
+ public:
+
+ bool holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_element_equal(a, b);
+ bool rhs = (a_atomic == b_atomic);
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+ bool debug_holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_element_equal(a, b);
+ bool rhs = (a_atomic == b_atomic);
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+ size_t size()const
+ {
+ return value_size<Type>::apply(this->template getInputValue<operand_a>());
+ }
+ };
+
+
+ // ---------------------------------------------------------------------------
+ template <typename Type>
+ class ElementLessDefined
+ : public Law<ElementLessDefined<Type>,
+ LOKI_TYPELIST_2(Type,Type), LOKI_TYPELIST_2(bool,bool)>
+ {
+ /** is_element_less(a, b) == a.join() < b.join()
+ Input = (a := inVal1, b := inVal2)
+ Output = (lhs, rhs)
+ */
+ public:
+ std::string name()const { return "ElementLessDefined"; }
+ std::string formula()const { return "is_element_less(a,b) == a.atomic() < b.atomic()"; }
+
+ std::string typeString()const
+ {
+ return "ElementLessDefined<"+type_to_string<Type>::apply()+">";
+ }
+
+ public:
+
+ bool holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_element_less(a, b);
+ bool rhs = a_atomic < b_atomic;
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+ bool debug_holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_element_less(a, b);
+ bool rhs = a_atomic < b_atomic;
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+
+ size_t size()const
+ {
+ return value_size<Type>::apply(this->template getInputValue<operand_a>())+
+ value_size<Type>::apply(this->template getInputValue<operand_b>());
+ }
+ };
+
+
+ // ---------------------------------------------------------------------------
+ template <typename Type>
+ class ElementGreaterDefined
+ : public Law<ElementLessDefined<Type>,
+ LOKI_TYPELIST_2(Type,Type), LOKI_TYPELIST_2(bool,bool)>
+ {
+ /** is_element_greater(a, b) == a.join() > b.join()
+ Input = (a := inVal1, b := inVal2)
+ Output = (lhs, rhs)
+ */
+ public:
+ std::string name()const { return "ElementGreaterDefined"; }
+ std::string formula()const { return "is_element_greater(a,b) == a.atomic() > b.atomic()"; }
+
+ std::string typeString()const
+ {
+ return "ElementGreaterDefined<"+type_to_string<Type>::apply()+">";
+ }
+
+ public:
+
+ bool holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_element_greater(a, b);
+ bool rhs = a_atomic > b_atomic;
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+ bool debug_holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_element_greater(a, b);
+ bool rhs = a_atomic > b_atomic;
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+
+ size_t size()const
+ {
+ return value_size<Type>::apply(this->template getInputValue<operand_a>())+
+ value_size<Type>::apply(this->template getInputValue<operand_b>());
+ }
+ };
+
+
+}} // namespace itl boost
+
+#endif // __itl_element_order_hpp_JOFA_090202__
+
Modified: sandbox/itl/boost/validate/laws/order.h
==============================================================================
--- sandbox/itl/boost/validate/laws/order.h (original)
+++ sandbox/itl/boost/validate/laws/order.h 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -52,7 +52,7 @@
template<>
std::string unary_template_to_string<std::less>::apply() { return "<"; }
template<>
- std::string unary_template_to_string<itl::contained_in>::apply(){ return "C="; }
+ std::string unary_template_to_string<itl::sub_super_set>::apply(){ return "C="; }
// ---------------------------------------------------------------------------
template <typename Type, template<class>class Relation>
@@ -108,7 +108,7 @@
bool holds()
{
Type a = this->template getInputValue<operand_a>();
- Type b = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
return !(Relation<Type>()(a,b) && Relation<Type>()(b,a)) || a == b;
}
@@ -118,7 +118,7 @@
size_t size()const
{
return value_size<Type>::apply(this->template getInputValue<operand_a>())+
- value_size<Type>::apply(this->template getInputValue<operand_b>());
+ value_size<Type>::apply(this->template getInputValue<operand_b>());
}
};
Added: sandbox/itl/boost/validate/laws/subset_order.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/validate/laws/subset_order.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,220 @@
+/*----------------------------------------------------------------------------+
+A Law Based Test Automaton 'LaBatea'
+Author: Joachim Faulhaber
+Copyright (c) 2007-2008: 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 __itl_subset_ordering_hpp_JOFA_090202__
+#define __itl_subset_ordering_hpp_JOFA_090202__
+
+#include <boost/itl/type_traits/value_size.hpp>
+#include <boost/itl/interval_morphism.hpp>
+#include <boost/validate/law.h>
+
+namespace boost{namespace itl
+{
+
+ // ---------------------------------------------------------------------------
+ template <typename Type>
+ class InclusionEqualDefined
+ : public Law<InclusionEqualDefined<Type>,
+ LOKI_TYPELIST_2(Type,Type), LOKI_TYPELIST_2(bool,bool)>
+ {
+ /** is_element_equal(a, a.join())
+ Input = (a := inVal1)
+ Output = ()
+ */
+ public:
+ std::string name()const { return "InclusionEqualDefined"; }
+ std::string formula()const { return "is_element_equal(a, a.join())"; }
+
+ std::string typeString()const
+ {
+ return "InclusionEqualDefined<"+type_to_string<Type>::apply()+">";
+ }
+
+ public:
+
+ bool holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_inclusion_equal(a, b);
+ bool rhs = (a_atomic == b_atomic);
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+ bool debug_holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_inclusion_equal(a, b);
+ bool rhs = (a_atomic == b_atomic);
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+ size_t size()const
+ {
+ return value_size<Type>::apply(this->template getInputValue<operand_a>());
+ }
+ };
+
+
+ // ---------------------------------------------------------------------------
+ template <typename Type>
+ class SubsetDefined
+ : public Law<SubsetDefined<Type>,
+ LOKI_TYPELIST_2(Type,Type), LOKI_TYPELIST_2(bool,bool)>
+ {
+ /** is_contained_in(a, b) == a.atomic().contained_in(b.atomic())
+ Input = (a := inVal1, b := inVal2)
+ Output = (lhs, rhs)
+ */
+ public:
+ std::string name()const { return "SubsetDefined"; }
+ std::string formula()const { return "is_contained_in(a,b) == a.atomic().contained_in(b.atomic())"; }
+
+ std::string typeString()const
+ {
+ return "SubsetDefined<"+type_to_string<Type>::apply()+">";
+ }
+
+ public:
+
+ bool holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = is_contained_in(a, b);
+ bool rhs = a_atomic.contained_in(b_atomic);
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+ bool debug_holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ cout << "a: " << a << endl;
+ cout << "b: " << b << endl;
+
+ bool lhs = is_contained_in(a, b);
+ bool rhs = a_atomic.contained_in(b_atomic);
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+
+ size_t size()const
+ {
+ return value_size<Type>::apply(this->template getInputValue<operand_a>())+
+ value_size<Type>::apply(this->template getInputValue<operand_b>());
+ }
+ };
+
+ // ---------------------------------------------------------------------------
+ template <typename Type>
+ class SupersetDefined
+ : public Law<SubsetDefined<Type>,
+ LOKI_TYPELIST_2(Type,Type), LOKI_TYPELIST_2(bool,bool)>
+ {
+ /** contains(a, b) == a.join() > b.join()
+ Input = (a := inVal1, b := inVal2)
+ Output = (lhs, rhs)
+ */
+ public:
+ std::string name()const { return "SupersetDefined"; }
+ std::string formula()const { return "contains(a,b) == a.atomic() > b.atomic()"; }
+
+ std::string typeString()const
+ {
+ return "SupersetDefined<"+type_to_string<Type>::apply()+">";
+ }
+
+ public:
+
+ bool holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = contains(a, b);
+ bool rhs = a_atomic.contains(b_atomic);
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+ bool debug_holds()
+ {
+ Type a = this->template getInputValue<operand_a>();
+ Type b = this->template getInputValue<operand_b>();
+ typename Type::atomized_type a_atomic;
+ typename Type::atomized_type b_atomic;
+ Interval::atomize(a_atomic, a);
+ Interval::atomize(b_atomic, b);
+
+ bool lhs = contains(a, b);
+ bool rhs = a_atomic.contains(b_atomic);
+
+ this->template setOutputValue<lhs_result>(lhs);
+ this->template setOutputValue<rhs_result>(rhs);
+
+ return lhs == rhs;
+ }
+
+
+ size_t size()const
+ {
+ return value_size<Type>::apply(this->template getInputValue<operand_a>())+
+ value_size<Type>::apply(this->template getInputValue<operand_b>());
+ }
+ };
+
+}} // namespace itl boost
+
+#endif // __itl_subset_ordering_hpp_JOFA_090202__
+
Modified: sandbox/itl/boost/validate/typevalidater.h
==============================================================================
--- sandbox/itl/boost/validate/typevalidater.h (original)
+++ sandbox/itl/boost/validate/typevalidater.h 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -229,7 +229,7 @@
public:
typedef StrictWeakOrderValidater<Type, std::less> LessValidaterT;
typedef PartialOrderValidater<Type, std::less_equal> LessEqualValidaterT;
- typedef PartialOrderValidater<Type, itl::contained_in> ContainedInValidaterT;
+ typedef PartialOrderValidater<Type, itl::sub_super_set> ContainedInValidaterT;
enum Laws
{
Modified: sandbox/itl/libs/itl/build/win32/vc9_all.sln
==============================================================================
--- sandbox/itl/libs/itl/build/win32/vc9_all.sln (original)
+++ sandbox/itl/libs/itl/build/win32/vc9_all.sln 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -57,6 +57,10 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_test_quantifier_map", "..\..\test\test_quantifier_map\vc9_test_quantifier_map.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B7D2A9F9F}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_test_interval_set_laws", "..\..\test\test_interval_set_laws\vc9_test_interval_set_laws.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B7D2A9FA0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_test_casual", "..\..\test\test_casual\vc9_test_casual.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -175,6 +179,14 @@
{EE61B7EF-EC45-4165-8B49-FD5B7D2A9F9F}.Debug|Win32.Build.0 = Debug|Win32
{EE61B7EF-EC45-4165-8B49-FD5B7D2A9F9F}.Release|Win32.ActiveCfg = Release|Win32
{EE61B7EF-EC45-4165-8B49-FD5B7D2A9F9F}.Release|Win32.Build.0 = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D2A9FA0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D2A9FA0}.Debug|Win32.Build.0 = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D2A9FA0}.Release|Win32.ActiveCfg = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D2A9FA0}.Release|Win32.Build.0 = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}.Debug|Win32.Build.0 = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}.Release|Win32.ActiveCfg = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -314,34 +314,74 @@
[section Associated Types]
-[table Associated types of sets
-[[Aspects] [purpose] [type] [__itv__] [__itv_sets__] [__itl_set__] [`std::set`]]
-[[__conceptual__] [data] [`domain_type`] [`DomainT`] [`DomainT`] [`DomainT`] []]
-[[] [ordering][`domain_compare`] [`Compare<DomainT>`] [`Compare<DomainT>`] [`Compare<DomainT>`][]]
-[[__iterative__] [data] [`interval_type`] [] [`Interval<DomainT,Compare>`] [] []]
-[[] [] [`key_type`] [] [`Interval<DomainT,Compare>`] [] [`_Key`]]
-[[] [] [`value_type`] [] [`Interval<DomainT,Compare>`] [] [`_Key`]]
-[[] [ordering][`interval_compare`][] [`exclusive_less <interval_type>`] [] []]
-[[] [] [`key_compare`] [] [`exclusive_less <interval_type>`] [] [`_Compare`]]
-[[__conceptual__] [size] [`size_type`] [`size<DomainT>::type`] [`interval_type:: size_type`] [`std::size_t`] []]
-[[] [] [`difference_type`] [`difference <DomainT>::type`][`interval_type:: difference_type`][`std::size_t`] []]
+In order to give an overview over ['*associated types*] the *itl* works
+with we will again work with abbreviations that were introduced in the
+presentaiton of itl class templates,
+
+[pre
+interval <D, cp, >
+interval_sets<D, cp, i, a >
+itl::set <D, cp, a >
+std::set <D, Cp, Ad>
+interval_maps<D, C, T, cp, cb, s, i, a >
+itl::map <D, C, T, cp, cb, s, a >
+std::map <D, C Cp, Av>
]
-
-[table Associated types of maps JODO
-[[Aspects] [purpose] [type] [__itv_maps__] [__itl_map__] [`std::map`]]
-[[__conceptual__] [data] [`domain_type`] [`DomainT`] [`DomainT`] []]
-[[] [] [`codomain_type`] [`CodomainT`] [`CodomainT`] []]
-[[] [ordering] [`domain_compare`] [`Compare<DomainT>`] [`Compare<DomainT>`] []]
-[[] [aggregation][`codomain_combine`][`Combine<CodomainT>`] [`Combine<CodomainT>`][]]
-[[] [] [`codomain_intersect`][`Section<CodomainT>`] [`Section<CodomainT>`][]]
-[[__iterative__] [data] [`interval_type`] [`Interval<DomainT,Compare>`] [] []]
-[[] [] [`key_type`] [`Interval<DomainT,Compare>`] [] [`_Key`]]
-[[] [] [`value_type`] [`pair<Interval<DomainT,Compare>, CodomainT`] [] [`_Key`]]
-[[] [ordering] [`interval_compare`][`exclusive_less <interval_type>`] [] []]
-[[] [] [`key_compare`] [`exclusive_less <interval_type>`] [] [`_Compare`]]
-[[__conceptual__] [size] [`size_type`] [`interval_type:: size_type`] [`std::size_t`] []]
-[[] [] [`difference_type`] [`interval_type:: difference_type`] [`std::size_t`] []]
-]
+
+where these placeholders were used:
+
+``
+D := class DomainT,
+C := class CodomainT,
+T := class Traits,
+Cp := class Compare = std::less<DomainT>,
+cp := template<class D>class Compare = std::less,
+cb := template<class C>class Combine = itl::inplace_plus,
+s := template<class C>class Section = itl::inplace_et,
+i := template<class D,template<class>class cp>class Interval = itl::interval
+Ad := class Alloc = std::allocator<DomainT>
+Av := class Alloc = std::allocator<std::pair<DomainT,CodomainT> >
+a := template<class>class Alloc = std::allocator
+``
+with some additions,
+``
+sz := template<class D>size
+df := template<class D>difference
+Xl := class ExclusiveLess = exclusive_less<Interval<DomainT,Compare> >
+inv:= template<class Combiner>inverse
+(T,U) := std::pair<T,U> for typnames T,U
+``
+
+we can summarize the associated types as follows.
+Again two additional colums for easy comparison with stl
+sets and maps are provided.
+
+[table Itl Associated types
+[[Purpose][Aspect][Type][interval][interval\nsets][interval\nmaps][itl::set][itl::map][std::set][std::map]]
+[/[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[/ interval itvset itvmap itl:set itl:map std:set std:map]
+[[['*Data*]] [__conceptual__][`domain_type`] [`D`] [`D`] [`D`] [`D`] [`D`] [ ] [ ]]
+[[ ] [ ][`codomain_type`] [`D`] [`D`] [`C`] [`D`] [`C`] [ ] [ ]]
+[[ ] [ ][`element_type`] [`D`] [`D`] [`(D,C)`] [`D`] [`(D,C)`] [ ] [ ]]
+[[ ] [ ][`segment_type`][`i<D,cp>`][`i<D,cp>`][`(i<D,cp>,C)`][ ] [ ] [ ] [ ]]
+[[ ] [['size] ][`size_type`] [`sz<D>`][`sz<D>`][`sz<D>`] [size_t] [size_t] [ ] [ ]]
+[[ ] [ ][`difference_type`] [`df<D>`][`df<D>`][`df<D>`] [size_t] [size_t] [ ] [ ]]
+[[ ] [ ][][interval][interval\nsets][interval\nmaps][itl::set][itl::map][std::set][std::map]]
+[[['*Data*]] [__iterative__ ][`key_type`] [`D`][`i<D,cp>`][`i<D,cp>`] [`D`] [`D`] [`D`] [`D`]]
+[[ ] [ ][`data_type`] [`D`][`i<D,cp>`] [`C`] [`D`] [`C`] [`D`] [`D`]]
+[[ ] [ ][`value_type`] [`D`][`i<D,cp>`][`(i<D,cp>,C)`][`D`][`(D,C)`][`D`] [`(D,C)`]]
+[[ ] [ ][`interval_type`] [`i<D,cp>`][`i<D,cp>`][`i<D,cp>`] [ ] [ ] [ ] [ ]]
+[[ ] [['allocation]][`allocator_type`] [ ][`a<i<D,cp>>`][`a<(i<D,cp>, C)>`][`a<D>`][`a<(D,C)>`][`Ad`][`Av`]]
+[[ ] [ ][][interval][interval\nsets][interval\nmaps][itl::set][itl::map][std::set][std::map]]
+[[['*Ordering*]] [__conceptual__][`domain_compare`] [`cp<D>`][`cp<D>`][`cp<D>`][`cp<D>`][`cp<D>`] [ ] [ ]]
+[[ ] [__iterative__ ][`key_compare`] [`cp<D>`] [`Xl`] [`Xl`] [`cp<D>`] [`cp<D>`] [`Cp`] [`Cp`]]
+[[ ] [ ][`interval_compare`] [ ] [`Xl`] [`Xl`] [ ] [ ] [ ] [ ]]
+[[['*Aggregation*]][__conceptual__][`codomain_combine`] [ ] [ ] [`cb<C>`] [ ] [`cb<C>`] [ ] [ ]]
+[[ ] [ ][`inverse_codomain_combine`] [ ] [ ][`inv<cb<C>>`] [ ][`inv<cb<C>>`] [ ] [ ]]
+[[ ] [ ] [`codomain_intersect`] [ ] [ ] [`s<C>`] [ ] [`s<C>`] [ ] [ ]]
+[[ ] [ ][`inverse_codomain_intersect`] [ ] [ ] [`inv<s<C>>`] [ ][`inv<s<C>>`] [ ] [ ]]
+]
+
[endsect][/ Associated Types]
@@ -376,12 +416,12 @@
[[`I,J` ] [] [polymorhical iterator type]]
[[1,2,... ] [] [number of implementations for this function]]
[[A ] [] [implementation generated by compilers]]
-[[[#element_type] [*e]] [T::domain_type] [the element type of the container]]
-[[[#interval_type] [*i]] [T::interval_type] [the interval type of the container]]
+[[[#element_type] [*e]] [T::element_type] [the element type of __itv_sets__ or __itl_sets__]]
+[[[#interval_type] [*i]] [T::segment_type] [the segment type of of __itv_sets__]]
[[[#itl_set_type] [*s]] [__itl_set__] [itl's set type]]
[[[#interval_set_types] [*S]] [interval_sets] [one of the interval set types]]
-[[[#element_mapping_type] [*b]] [T::element_mapping_type] [type of the element mapping of the map]]
-[[[#interval_mapping_type][*p]] [T::interval_mapping_type][type of the interval mapping of the map]]
+[[[#element_mapping_type] [*b]] [T::element_type] [type of __itv_map_s__ or __itl_map_s__ element value pairs]]
+[[[#interval_mapping_type][*p]] [T::segment_type] [type of __itv_map_s__ interval value pairs]]
[[[#itl_map_type] [*m]] [__itl_map__] [itl's map type]]
[[[#interval_map_types] [*M]] [interval_maps] [one of the interval map types]]
]
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-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -81,6 +81,7 @@
[def __ele_maps__ [classref boost::itl::map maps]]
[def __itl_map__ [classref boost::itl::map itl::map]]
[def __itl_maps__ [classref boost::itl::map itl::maps]]
+[def __itl_map_s__ [classref boost::itl::map itl::map's]]
[def __pabsorber__ [classref boost::itl::partial_absorber partial_absorber]]
[def __penricher__ [classref boost::itl::partial_enricher partial_enricher]]
Added: sandbox/itl/libs/itl/test/test_casual/test_casual.cpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_casual/test_casual.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,57 @@
+/*----------------------------------------------------------------------------+
+Copyright (c) 2008-2008: 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)
++----------------------------------------------------------------------------*/
+#define BOOST_TEST_MODULE itl::interval_set unit test
+#include <string>
+#include <boost/mpl/list.hpp>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/test_case_template.hpp>
+
+// interval instance types
+#include "../test_type_lists.hpp"
+#include "../test_value_maker.hpp"
+
+#include <boost/itl/interval_set.hpp>
+#include <boost/itl/separate_interval_set.hpp>
+#include <boost/itl/split_interval_set.hpp>
+#include <boost/itl/interval_map.hpp>
+#include <boost/itl/split_interval_map.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace unit_test;
+using namespace boost::itl;
+
+
+
+BOOST_AUTO_TEST_CASE(subset_test)
+{
+ typedef interval_map<int,int> IntervalMapT;
+ typedef split_interval_map<int,int> Splimp;
+
+ Splimp left, right;
+ left.add(CDv(2,7,5)).add(IIv(9,9,5));
+ right.add(CDv(-8,-6,2)).add(CIv(2,7,5)).add(CDv(7,9,1)).add(IIv(9,11,5));
+ BOOST_CHECK_EQUAL(is_contained_in(left,right), true);
+
+ left.clear(); right.clear();
+ left.add(CIv(-4,-2,1)).add(IIv(8,8,3));
+ right.add(CIv(-6,-1,1)).add(CIv(6,9,3));
+ is_contained_in(left,right);
+ BOOST_CHECK_EQUAL(is_contained_in(left,right), true);
+}
+
+BOOST_AUTO_TEST_CASE(superset_test)
+{
+ typedef interval_map<int,int> IntervalMapT;
+ typedef split_interval_map<int,int> Splimp;
+
+ Splimp left, right;
+ left.add(IDv(-7,-1,1)).add(IIv(8,16,9));
+ right.add(CDv(-8,-4,1)).add(IIv(8,8,9));
+ BOOST_CHECK_EQUAL(contains(left,right), true);
+}
Added: sandbox/itl/libs/itl/test/test_casual/vc9_test_casual.vcproj
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_casual/vc9_test_casual.vcproj 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_test_casual"
+ ProjectGUID="{EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}"
+ RootNamespace="Test_casual"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Quelldateien"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\test_casual.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Headerdateien"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\test_interval_map_shared.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\test_type_lists.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Ressourcendateien"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Modified: sandbox/itl/libs/itl/test/test_interval_map_mixed/test_interval_map_mixed.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_map_mixed/test_interval_map_mixed.cpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_map_mixed/test_interval_map_mixed.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -942,6 +942,17 @@
split_ab2 += make_pair(interval<T>::rightopen(v1,v7), u1);
BOOST_CHECK_EQUAL( is_element_equal(split_AB, split_ab2), true );
+
+ split_interval_map<T,U> left, right;
+ left. add(IDv(0,2,2));
+ right.add(IDv(0,2,2));
+ BOOST_CHECK_EQUAL( is_element_equal(left, right), true );
+
+ split_interval_set<T> left2, right2;
+ left2. add(I_D(0,2));
+ right2.add(I_D(0,1));
+ is_element_equal(left2, right2);
+ BOOST_CHECK_EQUAL( is_element_equal(left2, right2), false );
}
@@ -1274,3 +1285,4 @@
BOOST_CHECK_EQUAL(join_a & split_a, (split_b = split_a) &= join_a);
BOOST_CHECK_EQUAL(join_a & split_a, split_b);
}
+
Modified: sandbox/itl/libs/itl/test/test_interval_set/test_interval_set_shared.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_set/test_interval_set_shared.cpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_set/test_interval_set_shared.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -31,6 +31,10 @@
{ interval_set_isolate_4_bicremental_continuous_types<interval_set, T>();}
BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_interval_set_element_compare_4_bicremental_types, T, bicremental_types)
+{ interval_set_element_compare_4_bicremental_types<interval_set, T>();}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
(test_itl_interval_set_contains_4_bicremental_types, T, bicremental_types)
{ interval_set_contains_4_bicremental_types<interval_set, T>();}
Added: sandbox/itl/libs/itl/test/test_interval_set_laws/test_interval_set_laws.cpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_interval_set_laws/test_interval_set_laws.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------+
+Copyright (c) 2008-2008: 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)
++----------------------------------------------------------------------------*/
+#define BOOST_TEST_MODULE itl::interval_set unit test
+#include <string>
+#include <boost/mpl/list.hpp>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/test_case_template.hpp>
+
+// interval instance types
+#include "../test_type_lists.hpp"
+#include "../test_value_maker.hpp"
+#include "../test_laws.hpp"
+
+#include <boost/itl/interval_set.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace unit_test;
+using namespace boost::itl;
+
+// -----------------------------------------------------------------------------
+// test_interval_set_shared are tests that should give identical results for all
+// interval_sets: interval_set, separate_interval_set and split_interval_set.
+#include "../test_interval_set_laws_shared.hpp"
+
+// Due to limited expressiveness of the testing framework, the testcode in files
+// test_interval_map{,_split}_shared.cpp is generated through code
+// replication.
+#include "test_interval_set_laws_shared.cpp"
+
+
Added: sandbox/itl/libs/itl/test/test_interval_set_laws/test_interval_set_laws_shared.cpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_interval_set_laws/test_interval_set_laws_shared.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,25 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2008-2008: 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)
++-----------------------------------------------------------------------------*/
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_interval_set_check_monoid_plus_4_bicremental_types, T, bicremental_types)
+{ interval_set_check_monoid_plus_4_bicremental_types<T, interval_set>();}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_interval_set_check_monoid_et_4_bicremental_types, T, bicremental_types)
+{ interval_set_check_monoid_et_4_bicremental_types<T, interval_set>();}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_interval_set_check_abelian_monoid_et_4_bicremental_types, T, bicremental_types)
+{ interval_set_check_abelian_monoid_et_4_bicremental_types<T, interval_set>();}
+
+// x - x = 0
+BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_interval_set_check_partial_invertive_monoid_plus_4_bicremental_types, T, bicremental_types)
+{ interval_set_check_partial_invertive_monoid_plus_4_bicremental_types<T, interval_set>();}
+
Added: sandbox/itl/libs/itl/test/test_interval_set_laws/vc9_test_interval_set_laws.vcproj
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/test/test_interval_set_laws/vc9_test_interval_set_laws.vcproj 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_test_interval_set_laws"
+ ProjectGUID="{EE61B7EF-EC45-4165-8B49-FD5B7D2A9FA0}"
+ RootNamespace="Test_interval_set_laws"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Quelldateien"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\test_interval_set_laws.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Headerdateien"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\test_interval_set_laws_shared.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\test_type_lists.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Ressourcendateien"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Modified: sandbox/itl/libs/itl/test/test_interval_set_mixed/test_interval_set_mixed.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_set_mixed/test_interval_set_mixed.cpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_set_mixed/test_interval_set_mixed.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -236,6 +236,22 @@
BOOST_CHECK_EQUAL( is_element_equal(sep_set, split_set), true );
}
+BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_set_mixed_contains_4_bicremental_types, T, bicremental_types)
+{
+ split_interval_set<T> split_set;
+ split_set.add(I_D(0,4)).add(I_D(4,8));
+ BOOST_CHECK_EQUAL( split_set.contains(MK_v(4)), true );
+ BOOST_CHECK_EQUAL( split_set.contains(C_D(2,5)), true );
+
+ interval_set<T> join_set_gap4(split_set.erase(MK_v(4)));
+ BOOST_CHECK_EQUAL( join_set_gap4.contains(MK_v(4)), false );
+ BOOST_CHECK_EQUAL( join_set_gap4.contains(C_D(2,5)), false );
+
+ BOOST_CHECK_EQUAL( split_set.contains(split_set), true );
+ BOOST_CHECK_EQUAL( split_set.contains(join_set_gap4), true );
+
+}
+
BOOST_AUTO_TEST_CASE_TEMPLATE(test_itl_interval_set_mixed_add_4_bicremental_types, T, bicremental_types)
{
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 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -349,6 +349,50 @@
BOOST_CHECK_EQUAL( iso_set, iso_set4 );
}
+template <template< class T,
+ ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, T),
+ template<class,ITL_COMPARE>class Interval = interval,
+ ITL_ALLOC Alloc = std::allocator
+ >class IntervalSet,
+ class T>
+void interval_set_element_compare_4_bicremental_types()
+{
+ typedef IntervalSet<T> IntervalSetT;
+ typedef IntervalSet<T> ISet;
+
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(), ISet()), true );
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(), ISet(I_D(0,1))), false );
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(0,1)), ISet()), false );
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(0,1)), ISet(I_D(0,1))), true );
+
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(0,5)), ISet(I_D(3,8))), false );
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(3,8)), ISet(I_D(0,5))), false );
+
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(0,1)), ISet(I_D(0,1)) ), true );
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(0,1)), ISet(I_D(0,1))+I_D(1,2) ), false );
+ BOOST_CHECK_EQUAL( is_element_equal( I_D(1,2)+ISet(I_D(0,1)), ISet(I_D(0,1)) ), false );
+ BOOST_CHECK_EQUAL( is_element_equal( I_D(1,2)+ISet(I_D(0,1)), ISet(I_D(0,1))+I_D(1,2) ), true );
+
+ //[0 1)[1 2)
+ //[0 2)
+ BOOST_CHECK_EQUAL( is_element_equal( I_D(0,1)+ISet(I_D(1,2)), ISet(I_D(0,2)) ), true );
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(0,2)), ISet(I_D(0,1))+I_D(1,2) ), true );
+
+ //[0 1) [2 3)
+ //[0 3)
+ BOOST_CHECK_EQUAL( is_element_equal( I_D(0,1)+ISet(I_D(2,3)), ISet(I_D(0,3)) ), false );
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(0,3)), ISet(I_D(0,1))+I_D(2,3) ), false );
+
+ //[0 2)[2 4)
+ // [1 4)
+ BOOST_CHECK_EQUAL( is_element_equal( I_D(0,2)+ISet(I_D(2,4)), ISet(I_D(1,4)) ), false );
+ BOOST_CHECK_EQUAL( is_element_equal( ISet(I_D(1,4)), ISet(I_D(0,2))+I_D(2,4) ), false );
+
+ //[0 2)[2 4)
+ //[0 1)[1 3)[3 4)
+ BOOST_CHECK_EQUAL( is_element_equal( I_D(0,2)+ISet(I_D(2,4)), I_D(0,1)+ISet(I_D(1,4))+I_D(3,4) ), true );
+ BOOST_CHECK_EQUAL( is_element_equal( I_D(0,1)+ISet(I_D(1,4))+I_D(3,4), I_D(0,2)+ISet(I_D(2,4)) ), true );
+}
template <template< class T,
ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, T),
Modified: sandbox/itl/libs/itl/test/test_separate_interval_set/test_separate_interval_set_shared.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_separate_interval_set/test_separate_interval_set_shared.cpp (original)
+++ sandbox/itl/libs/itl/test/test_separate_interval_set/test_separate_interval_set_shared.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -31,6 +31,10 @@
{ interval_set_isolate_4_bicremental_continuous_types<separate_interval_set, T>();}
BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_interval_set_element_compare_4_bicremental_types, T, bicremental_types)
+{ interval_set_element_compare_4_bicremental_types<separate_interval_set, T>();}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
(test_itl_interval_set_contains_4_bicremental_types, T, bicremental_types)
{ interval_set_contains_4_bicremental_types<separate_interval_set, T>();}
Modified: sandbox/itl/libs/itl/test/test_split_interval_set/test_split_interval_set_shared.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_split_interval_set/test_split_interval_set_shared.cpp (original)
+++ sandbox/itl/libs/itl/test/test_split_interval_set/test_split_interval_set_shared.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -31,6 +31,10 @@
{ interval_set_isolate_4_bicremental_continuous_types<split_interval_set, T>();}
BOOST_AUTO_TEST_CASE_TEMPLATE
+(test_itl_interval_set_element_compare_4_bicremental_types, T, bicremental_types)
+{ interval_set_element_compare_4_bicremental_types<split_interval_set, T>();}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE
(test_itl_interval_set_contains_4_bicremental_types, T, bicremental_types)
{ interval_set_contains_4_bicremental_types<split_interval_set, T>();}
Modified: sandbox/itl/libs/itl/test/test_type_lists.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_type_lists.hpp (original)
+++ sandbox/itl/libs/itl/test/test_type_lists.hpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -28,9 +28,9 @@
> bicremental_types;
//DBG short list for debugging
-//typedef ::boost::mpl::list<
-// int
-//> bicremental_types;
+typedef ::boost::mpl::list<
+ int
+> debug_int_type;
typedef ::boost::mpl::list<
float, double
Modified: sandbox/itl/libs/validate/example/labat_single/labat_single.cpp
==============================================================================
--- sandbox/itl/libs/validate/example/labat_single/labat_single.cpp (original)
+++ sandbox/itl/libs/validate/example/labat_single/labat_single.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -17,6 +17,8 @@
#include <boost/itl/map.hpp>
#include <boost/validate/lawvalidater.h>
#include <boost/validate/laws/monoid.h>
+#include <boost/validate/laws/element_order.hpp>
+#include <boost/validate/laws/subset_order.hpp>
#include <boost/validate/gentor/gentorprofile.h>
#include <boost/validate/gentor/rangegentor.h>
@@ -84,16 +86,85 @@
//LawValidater<TestLawT, RandomGentor> test_law;
//test_law.setTrialsCount(1000);
- typedef InplaceFlip
- <split_interval_map<int, int, total_enricher > > TestLawT;
+ //typedef InplaceFlip
+ // <split_interval_map<int, int, total_enricher > > TestLawT;
+ //LawValidater<TestLawT, RandomGentor> test_law;
+ //test_law.setTrialsCount(10000);
+
+ ptime start, stop;
+
+ //-----------------------------------------------------------------------------
+ /*
+ typedef ElementEqualDefined
+ <split_interval_map<int,int> > TestLawT;
LawValidater<TestLawT, RandomGentor> test_law;
test_law.setTrialsCount(10000);
- std::cout << "Start\n";
- ptime start(microsec_clock::local_time());
+ std::cout << "1Start\n";
+ start = ptime(microsec_clock::local_time());
test_law.run();
- ptime stop(microsec_clock::local_time());
+ stop = ptime(microsec_clock::local_time());
+ std::cout << "Stop. Time elapsed: " << stop - start << endl;
+
+ typedef ElementLessDefined
+ <split_interval_map<int,int> > TestLaw2T;
+ LawValidater<TestLaw2T, RandomGentor> test_law2;
+ test_law2.setTrialsCount(10000);
+
+ std::cout << "2Start\n";
+ start = ptime(microsec_clock::local_time());
+ test_law2.run();
+ stop = ptime(microsec_clock::local_time());
+ std::cout << "Stop. Time elapsed: " << stop - start << endl;
+
+ typedef ElementGreaterDefined
+ <split_interval_map<int,int> > TestLaw3T;
+ LawValidater<TestLaw3T, RandomGentor> test_law3;
+ test_law3.setTrialsCount(10000);
+
+ std::cout << "3Start\n";
+ start = ptime(microsec_clock::local_time());
+ test_law3.run();
+ stop = ptime(microsec_clock::local_time());
std::cout << "Stop. Time elapsed: " << stop - start << endl;
+ */
+
+ //-----------------------------------------------------------------------------
+ int test_count = 10000;
+
+ typedef InclusionEqualDefined
+ <split_interval_map<int,int> > TestLaw4T;
+ LawValidater<TestLaw4T, RandomGentor> test_law4;
+ test_law4.setTrialsCount(test_count);
+
+ std::cout << "4Start\n";
+ start = ptime(microsec_clock::local_time());
+ test_law4.run();
+ stop = ptime(microsec_clock::local_time());
+ std::cout << "Stop. Time elapsed: " << stop - start << endl;
+
+ typedef SubsetDefined
+ <split_interval_map<int,int> > TestLaw5T;
+ LawValidater<TestLaw5T, RandomGentor> test_law5;
+ test_law5.setTrialsCount(test_count);
+
+ std::cout << "5Start\n";
+ start = ptime(microsec_clock::local_time());
+ test_law5.run();
+ stop = ptime(microsec_clock::local_time());
+ std::cout << "Stop. Time elapsed: " << stop - start << endl;
+
+ typedef SupersetDefined
+ <split_interval_map<int,int> > TestLaw6T;
+ LawValidater<TestLaw6T, RandomGentor> test_law6;
+ test_law6.setTrialsCount(test_count);
+
+ std::cout << "6Start\n";
+ start = ptime(microsec_clock::local_time());
+ test_law6.run();
+ stop = ptime(microsec_clock::local_time());
+ std::cout << "Stop. Time elapsed: " << stop - start << endl;
+
}
Modified: sandbox/itl/libs/validate/src/gentor/gentorprofile.cpp
==============================================================================
--- sandbox/itl/libs/validate/src/gentor/gentorprofile.cpp (original)
+++ sandbox/itl/libs/validate/src/gentor/gentorprofile.cpp 2009-02-04 14:37:57 EST (Wed, 04 Feb 2009)
@@ -29,39 +29,38 @@
{
//---------------------------------
//standard values
- //set_range_int(-10, 10);
- //set_range_nat(0, 64);
- //set_range_unsigned_short(0, 64);
- //set_range_double(0.0, 1.0);
- //set_range_ContainerSize(0,10);
+ set_range_int(-10, 10);
+ set_range_nat(0, 64);
+ set_range_double(0.0, 1.0);
+ set_range_ContainerSize(0,10);
- //set_range_interval_int(-10, 10);
- //set_maxIntervalLength(8);
+ set_range_interval_int(-10, 10);
+ set_maxIntervalLength(8);
- //set_range_element_ContainerSize(0,5);
+ set_range_element_ContainerSize(0,5);
//---------------------------------
//small values
- set_range_int(0, 10);
- set_range_nat(0, 16);
- set_range_double(0.0, 1.0);
- set_range_ContainerSize(0,4);
+ //set_range_int(0, 10);
+ //set_range_nat(0, 16);
+ //set_range_double(0.0, 1.0);
+ //set_range_ContainerSize(0,4);
- set_range_interval_int(0, 10);
- set_maxIntervalLength(5);
- set_range_element_ContainerSize(0,4);
+ //set_range_interval_int(0, 10);
+ //set_maxIntervalLength(5);
+ //set_range_element_ContainerSize(0,4);
//---------------------------------
//current values
//set_range_int(-5, 5);
//set_range_nat(0, 16);
//set_range_double(0.0, 1.0);
- //set_range_ContainerSize(0,6);
+ //set_range_ContainerSize(0,40);
- //set_range_interval_int(-5, 5);
- //set_maxIntervalLength(6);
+ //set_range_interval_int(-20, 20);
+ //set_maxIntervalLength(20);
- //set_range_element_ContainerSize(0,4);
+ //set_range_element_ContainerSize(0,10);
}
// -------------------------------------
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