|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68012 - in sandbox/icl: boost/icl_xt libs/icl/test libs/icl_xt/example libs/icl_xt/example/casual_sample_ libs/icl_xt/example/time_and_duration_ libs/icl_xt/test
From: afojgo_at_[hidden]
Date: 2011-01-11 19:20:26
Author: jofaber
Date: 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
New Revision: 68012
URL: http://svn.boost.org/trac/boost/changeset/68012
Log:
Adjustments for back compatibility with gcc-3.4. Jamfiles added for icl_xt test and example.
Added:
sandbox/icl/libs/icl_xt/example/Jamfile.v2 (contents, props changed)
sandbox/icl/libs/icl_xt/test/Jamfile.v2 (contents, props changed)
Text files modified:
sandbox/icl/boost/icl_xt/interval_bitset.hpp | 376 ++++++++++++++++-----------------------
sandbox/icl/boost/icl_xt/tuple_computer.hpp | 3
sandbox/icl/libs/icl/test/test_functions.hpp | 8
sandbox/icl/libs/icl/test/test_icl_map.hpp | 33 ++
sandbox/icl/libs/icl/test/test_icl_quantifier_shared.hpp | 118 +++++++++--
sandbox/icl/libs/icl/test/test_interval_map_shared.hpp | 253 ++++++++++++++++++++++----
sandbox/icl/libs/icl/test/test_interval_quantifier_shared.hpp | 121 ++++++++++--
sandbox/icl/libs/icl/test/test_interval_set_shared.hpp | 10
sandbox/icl/libs/icl_xt/example/casual_sample_/casual_sample.cpp | 2
sandbox/icl/libs/icl_xt/example/time_and_duration_/time_and_duration.cpp | 158 +++++++++-------
10 files changed, 680 insertions(+), 402 deletions(-)
Modified: sandbox/icl/boost/icl_xt/interval_bitset.hpp
==============================================================================
--- sandbox/icl/boost/icl_xt/interval_bitset.hpp (original)
+++ sandbox/icl/boost/icl_xt/interval_bitset.hpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -91,7 +91,7 @@
typedef short narrow_type; // small signed type that includes bit_type
typedef BitSetT bitset_type;
typedef BitSetT data_type;
- typedef typename std::size_t size_type;
+ typedef std::size_t size_type;
typedef typename interval_bitmap_type::interval_type interval_type;
typedef interval_type segment_type;
@@ -177,7 +177,6 @@
bool contains(element_type element)const{ return _map(element>>shift).contains(element & mask); }
bool contains(const segment_type& segment)const;
- //CL bool contains(const element_type& element)const { return contains(segment_type(element)); };
bool contains(const interval_bitset& sub)const { return icl::contains(_map, sub._map); }
bool contained_in(const interval_bitset& super)const{ return icl::within(_map, super._map); }
@@ -204,53 +203,6 @@
const_reverse_iterator rbegin()const { return _map.rbegin(); }
const_reverse_iterator rend()const { return _map.rend(); }
- //==========================================================================
- //= Element iterator related
- //==========================================================================
- element_iterator elements_begin()
- {
- if(this->begin()==this->end())
- return element_iterator(this->begin(), element_iterator::beyond);
- else
- return element_iterator(this->begin(), element_iterator::ante );
- }
-
- element_iterator elements_end()
- { return element_iterator(this->end(), element_iterator::beyond); }
-
- element_const_iterator elements_begin()const
- {
- if(this->begin()==this->end())
- return element_const_iterator(this->begin(), element_iterator::beyond);
- else
- return element_const_iterator(this->begin(), element_iterator::ante );
- }
-
- element_const_iterator elements_end()const
- { return element_const_iterator(this->end(), element_iterator::beyond); }
-
- element_reverse_iterator elements_rbegin()
- {
- if(this->rbegin()==this->rend())
- return element_reverse_iterator(this->rbegin(), element_iterator::before);
- else
- return element_reverse_iterator(this->rbegin(), element_iterator::past );
- }
-
- element_reverse_iterator elements_rend()
- { return element_reverse_iterator(this->rend(), element_iterator::before); }
-
- element_const_reverse_iterator elements_rbegin()const
- {
- if(this->rbegin()==this->rend())
- return element_const_reverse_iterator(this->rbegin(), element_iterator::before);
- else
- return element_const_reverse_iterator(this->rbegin(), element_iterator::past );
- }
-
- element_const_reverse_iterator elements_rend()const
- { return element_const_reverse_iterator(this->rend(), element_iterator::before); }
-
private:
typedef typename interval_bitmap_type::segment_type seg_type;
@@ -333,138 +285,9 @@
interval_bitmap_type _map;
};
-
//==============================================================================
-//= Element iterator related
+//= interval_bitset member functions (implementation)
//==============================================================================
-/*JODO decide which version to use
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator
-elements_begin(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
- if(object.begin()==object.end())
- return element_iterator(object.begin(), element_iterator::beyond);
- else
- return element_iterator(object.begin(), element_iterator::ante );
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator
-elements_end(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
- return element_iterator(object.end(), element_iterator::beyond);
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator
-elements_begin(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator element_const_iterator;
- if(object.begin()==object.end())
- return element_const_iterator(object.begin(), element_iterator::beyond);
- else
- return element_const_iterator(object.begin(), element_iterator::ante );
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator
-elements_end(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator element_const_iterator;
- return element_const_iterator(object.end(), element_iterator::beyond);
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator
-elements_rbegin(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator element_reverse_iterator;
- if(object.rbegin()==object.rend())
- return element_reverse_iterator(object.rbegin(), element_iterator::before);
- else
- return element_reverse_iterator(object.rbegin(), element_iterator::past );
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator
-elements_rend(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator element_reverse_iterator;
- return element_reverse_iterator(object.rend(), element_iterator::before);
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator
-elements_rbegin(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator element_const_reverse_iterator;
- if(object.rbegin()==object.rend())
- return element_const_reverse_iterator(object.rbegin(), element_iterator::before);
- else
- return element_const_reverse_iterator(object.rbegin(), element_iterator::past );
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator
-elements_rend(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator element_const_reverse_iterator;
- return element_const_reverse_iterator(object.rend(), element_iterator::before);
-}
-*/
-
-//------------------------------------------------------------------------------
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator
-elements_begin(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{ return object.elements_begin(); }
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator
-elements_end(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{ return object.elements_end(); }
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator
-elements_begin(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{ return object.elements_begin(); }
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator
-elements_end(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{ return object.elements_end(); }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator
-elements_rbegin(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{ return object.elements_rbegin(); }
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator
-elements_rend(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{ return object.elements_rend(); }
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator
-elements_rbegin(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{ return object.elements_rbegin(); }
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator
-elements_rend(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{ return object.elements_rend(); }
-//------------------------------------------------------------------------------
-
// For a given interval like e.g. [5,27] we have to split up the intervals into
// partitions
@@ -534,8 +357,6 @@
}
}
-
-
template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
bool interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::contains(const segment_type& segment)const
{
@@ -572,38 +393,9 @@
return cardinality;
}
-
-//JODO move ...
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::size_type
- cardinality(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::type object_type;
- typedef typename object_type::size_type size_type;
- size_type cardinality = 0;
- ICL_const_FORALL(typename object_type, it_, object)
- cardinality += (it_->second.cardinality() * icl::cardinality(it_->first));//JODO icl::bits
- return cardinality;
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::size_type
- interval_count(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- return object.iterative_size();
-}
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::interval_type
-hull(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::interval_type interval_type;
- return
- icl::is_empty(object)
- ? identity_element<interval_type>::value()
- : interval_type::closed(*object.elements_begin(), *object.elements_rbegin());
-}
-
+//==============================================================================
+//= Representation (special member functions)
+//==============================================================================
template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
void interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::show_segments()const
{
@@ -630,17 +422,13 @@
}
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-bool is_element_equal(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& left,
- const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& right)
-{ return left == right; }
-
-template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
-void clear(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
-{
- object.clear();
-}
+//==============================================================================
+//= interval_bitset global functions
+//==============================================================================
+//==============================================================================
+//= Containedness
+//==============================================================================
template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
bool is_empty(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
{
@@ -675,6 +463,61 @@
return super.contains(sub);
}
+//==============================================================================
+//= Equivalences and Orderings
+//==============================================================================
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+bool is_element_equal(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& left,
+ const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& right)
+{
+ return left == right;
+}
+
+//==============================================================================
+//= Size
+//==============================================================================
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::size_type
+ cardinality(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::type object_type;
+ typedef typename object_type::size_type size_type;
+ size_type cardinality = 0;
+ ICL_const_FORALL(typename object_type, it_, object)
+ cardinality += (it_->second.cardinality() * icl::cardinality(it_->first));//JODO icl::bits
+ return cardinality;
+}
+
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::size_type
+ interval_count(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ return object.iterative_size();
+}
+
+//==============================================================================
+//= Range
+//==============================================================================
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::interval_type
+hull(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::interval_type interval_type;
+ return
+ icl::is_empty(object)
+ ? identity_element<interval_type>::value()
+ : interval_type::closed(*elements_begin(object), *elements_rbegin(object));
+}
+
+//==============================================================================
+//= Erasure
+//==============================================================================
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+void clear(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ object.clear();
+}
+
template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
bool intersects(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& x1,
const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& x2 )
@@ -696,7 +539,92 @@
{
object.erase(segment->first);
object.insert(segment);
- return *this;
+ return object;
+}
+
+//==============================================================================
+//= Element iterator related
+//==============================================================================
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator
+elements_begin(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
+ if(object.begin()==object.end())
+ return element_iterator(object.begin(), element_iterator::beyond);
+ else
+ return element_iterator(object.begin(), element_iterator::ante );
+}
+
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator
+elements_end(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
+ return element_iterator(object.end(), element_iterator::beyond);
+}
+
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator
+elements_begin(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator element_const_iterator;
+ if(object.begin()==object.end())
+ return element_const_iterator(object.begin(), element_iterator::beyond);
+ else
+ return element_const_iterator(object.begin(), element_iterator::ante );
+}
+
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator
+elements_end(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_iterator element_const_iterator;
+ return element_const_iterator(object.end(), element_iterator::beyond);
+}
+
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator
+elements_rbegin(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator element_reverse_iterator;
+ if(object.rbegin()==object.rend())
+ return element_reverse_iterator(object.rbegin(), element_iterator::before);
+ else
+ return element_reverse_iterator(object.rbegin(), element_iterator::past );
+}
+
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator
+elements_rend(interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_reverse_iterator element_reverse_iterator;
+ return element_reverse_iterator(object.rend(), element_iterator::before);
+}
+
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator
+elements_rbegin(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator element_const_reverse_iterator;
+ if(object.rbegin()==object.rend())
+ return element_const_reverse_iterator(object.rbegin(), element_iterator::before);
+ else
+ return element_const_reverse_iterator(object.rbegin(), element_iterator::past );
+}
+
+template<class DomainT, class BitSetT, ICL_COMPARE Compare, ICL_INTERVAL(ICL_COMPARE) Interval, ICL_ALLOC Alloc>
+typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator
+elements_rend(const interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>& object)
+{
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_iterator element_iterator;
+ typedef typename interval_bitset<DomainT,BitSetT,Compare,Interval,Alloc>::element_const_reverse_iterator element_const_reverse_iterator;
+ return element_const_reverse_iterator(object.rend(), element_iterator::before);
}
template<class CharType, class CharTraits,
Modified: sandbox/icl/boost/icl_xt/tuple_computer.hpp
==============================================================================
--- sandbox/icl/boost/icl_xt/tuple_computer.hpp (original)
+++ sandbox/icl/boost/icl_xt/tuple_computer.hpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -9,6 +9,7 @@
#ifndef __tuple_computer_JOFA_040614_H__
#define __tuple_computer_JOFA_040614_H__
+#include <sstream>
#include <boost/icl/map.hpp>
#include <boost/icl_xt/set.hpp>
#include <boost/icl_xt/var_tuple_order.hpp>
@@ -190,7 +191,7 @@
///
std::string as_string()const
{
- stringstream str;
+ std::stringstream str;
str << m_map;
return str.str();
}
Modified: sandbox/icl/libs/icl/test/test_functions.hpp
==============================================================================
--- sandbox/icl/libs/icl/test/test_functions.hpp (original)
+++ sandbox/icl/libs/icl/test/test_functions.hpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -25,7 +25,11 @@
{
template <class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap,
+#else
ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap,
+#endif
class SequenceT
>
void itl_map_copy(const SequenceT& segments,
@@ -37,7 +41,11 @@
template <class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap,
+#else
ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap,
+#endif
class SequenceT
>
void test_interval_map_copy_via_inserter(const SequenceT& segments,
Modified: sandbox/icl/libs/icl/test/test_icl_map.hpp
==============================================================================
--- sandbox/icl/libs/icl/test/test_icl_map.hpp (original)
+++ sandbox/icl/libs/icl/test/test_icl_map.hpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -10,8 +10,15 @@
#include "portability.hpp"
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itl_map_contains_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -39,8 +46,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itl_map_find_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -64,8 +78,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itl_map_inclusion_compare_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
Modified: sandbox/icl/libs/icl/test/test_icl_quantifier_shared.hpp
==============================================================================
--- sandbox/icl/libs/icl/test/test_icl_quantifier_shared.hpp (original)
+++ sandbox/icl/libs/icl/test/test_icl_quantifier_shared.hpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -10,8 +10,15 @@
#include "portability.hpp"
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void make_3_icl_maps_and_derivatives_1
(icl::map<T,U,Trt>& map_a,
icl::map<T,U,Trt>& map_b,
@@ -59,8 +66,15 @@
//------------------------------------------------------------------------------
// Monoid EAN
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_monoid_plus_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -75,8 +89,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_monoid_et_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -94,16 +115,15 @@
// Abelian monoid EANC
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- template<class _T, class _U,
- class Traits = Trt,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, _U),
- ICL_COMBINE Combine = ICL_COMBINE_INSTANCE(icl::inplace_plus, _U),
- ICL_SECTION Section = ICL_SECTION_INSTANCE(icl::inter_section, _U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, _T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalMap
- >
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_abelian_monoid_plus_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -118,8 +138,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_abelian_monoid_et_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -137,8 +164,15 @@
//------------------------------------------------------------------------------
// Abelian partial invertive monoid
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_partial_invertive_monoid_plus_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -155,8 +189,15 @@
//------------------------------------------------------------------------------
// Abelian partial invertive monoid with distinct equality for inversion
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_partial_invertive_monoid_plus_prot_inv_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -179,8 +220,15 @@
//------------------------------------------------------------------------------
// Abelian group EANIC
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_abelian_group_plus_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -197,8 +245,15 @@
//------------------------------------------------------------------------------
// (0 - x) + x =d= 0
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_abelian_group_plus_prot_inv_4_bicremental_types()
{
// check abelian group wrt. + and inverability wrt. distinct equality =d= :
@@ -223,8 +278,15 @@
//------------------------------------------------------------------------------
// Containedness
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void icl_quantifier_check_containedness_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
Modified: sandbox/icl/libs/icl/test/test_interval_map_shared.hpp
==============================================================================
--- sandbox/icl/libs/icl/test/test_interval_map_shared.hpp (original)
+++ sandbox/icl/libs/icl/test/test_interval_map_shared.hpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -10,8 +10,15 @@
#include "portability.hpp"
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_fundamentals_4_ordered_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -155,8 +162,15 @@
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_ctor_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -213,8 +227,15 @@
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_add_sub_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -260,8 +281,15 @@
BOOST_CHECK_EQUAL( map_A2, map_B2 );
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_distinct_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -288,8 +316,15 @@
BOOST_CHECK_EQUAL( iterative_size(is_1_3_5), 3 );
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_distinct_4_bicremental_continuous_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -335,8 +370,15 @@
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_isolate_4_bicremental_continuous_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -384,8 +426,15 @@
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_contains_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -420,8 +469,15 @@
BOOST_CHECK_EQUAL( icl::contains(itv_map, itv_set2), true );
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_contains_key_objects_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -455,8 +511,15 @@
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_operators_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -491,8 +554,15 @@
// Test for nontrivial intersection of interval maps with intervals and values
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_base_intersect_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -591,8 +661,15 @@
// Test for nontrivial erasure of interval maps with intervals and interval sets
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_base_erase_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -702,8 +779,15 @@
// Test first_collision
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_base_is_disjoint_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -780,8 +864,15 @@
BOOST_CHECK_EQUAL( intersects(map_B, set_A), true );
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_flip_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -801,8 +892,15 @@
BOOST_CHECK_EQUAL(set_a ^= IDv(1,3,1), IMap(IDv(0,1,1)) + IDv(2,3,1));
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_infix_plus_overload_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -822,8 +920,15 @@
BOOST_CHECK_EQUAL(map_b + map_pair, map_pair + map_b);
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_infix_pipe_overload_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -845,8 +950,15 @@
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_infix_minus_overload_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -891,8 +1003,15 @@
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_infix_et_overload_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -934,8 +1053,15 @@
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_infix_caret_overload_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -967,8 +1093,15 @@
BOOST_CHECK_EQUAL(map_b ^ map_pair, map_pair ^ map_b);
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_find_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -993,8 +1126,15 @@
}
-template <ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
- class T, class U>
+template
+<
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,partial_absorber) IntervalMap,
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,partial_absorber) IntervalMap,
+#endif
+ class T, class U
+>
void interval_map_set_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
@@ -1013,8 +1153,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void interval_map_inclusion_compare_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -1077,8 +1224,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void interval_map_std_copy_via_inserter_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT; //Nedded for the test value generator
@@ -1111,8 +1265,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void interval_map_element_iter_4_discrete_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
Modified: sandbox/icl/libs/icl/test/test_interval_quantifier_shared.hpp
==============================================================================
--- sandbox/icl/libs/icl/test/test_interval_quantifier_shared.hpp (original)
+++ sandbox/icl/libs/icl/test/test_interval_quantifier_shared.hpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -10,8 +10,15 @@
#include "portability.hpp"
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void make_3_itv_maps_and_derivatives_1
(ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)& itv_map_a,
ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)& itv_map_b,
@@ -33,8 +40,15 @@
//------------------------------------------------------------------------------
// Monoid EAN
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_monoid_plus_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -48,8 +62,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_monoid_et_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -66,8 +87,15 @@
// Abelian monoid EANC
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_abelian_monoid_plus_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -81,8 +109,15 @@
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_abelian_monoid_et_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -99,8 +134,15 @@
//------------------------------------------------------------------------------
// Abelian partial invertive monoid
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_partial_invertive_monoid_plus_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -116,8 +158,15 @@
//------------------------------------------------------------------------------
// Abelian partial invertive monoid with distinct equality for inversion
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_partial_invertive_monoid_plus_prot_inv_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -139,8 +188,15 @@
//------------------------------------------------------------------------------
// Abelian group EANIC
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_abelian_group_plus_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -156,8 +212,15 @@
//------------------------------------------------------------------------------
// (0 - x) + x =d= 0
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_abelian_group_plus_prot_inv_4_bicremental_types()
{
// check abelian group wrt. + and inverability wrt. distinct equality =d= :
@@ -182,8 +245,15 @@
//------------------------------------------------------------------------------
// Inner complement
//------------------------------------------------------------------------------
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_inner_complementarity_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
@@ -198,8 +268,15 @@
has_inner_complementarity<IntervalMapT,IntervalSetT>(map_c);
}
-template <class T, class U, class Trt,
- ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap>
+template
+<
+ class T, class U, class Trt,
+#if (defined(__GNUC__) && (__GNUC__ < 4)) //MEMO Can be simplified, if gcc-3.4 is obsolete
+ ICL_IntervalMap_TEMPLATE(T,U,Traits,Trt) IntervalMap
+#else
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap
+#endif
+>
void itv_quantifier_check_length_complementarity_4_bicremental_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
Modified: sandbox/icl/libs/icl/test/test_interval_set_shared.hpp
==============================================================================
--- sandbox/icl/libs/icl/test/test_interval_set_shared.hpp (original)
+++ sandbox/icl/libs/icl/test/test_interval_set_shared.hpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -715,15 +715,15 @@
found = set_a.find(MK_v(5));
BOOST_CHECK( found == set_a.end() );
- set_a.add(MK_v(64));
- found = set_a.find(MK_v(64));
+ set_a.add(MK_v(64));
+ found = set_a.find(MK_v(64));
BOOST_CHECK( (found->second).contains(0) );
- set_a.add(MK_v(65));
- found = set_a.find(MK_v(65));
+ set_a.add(MK_v(65));
+ found = set_a.find(MK_v(65));
BOOST_CHECK( (found->second).contains(1) );
- found = set_a.find(MK_v(66));
+ found = set_a.find(MK_v(66));
BOOST_CHECK( found == set_a.end() );
}
Added: sandbox/icl/libs/icl_xt/example/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/icl/libs/icl_xt/example/Jamfile.v2 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -0,0 +1,32 @@
+# (C) Copyright 2008-2011: Joachim Faulhaber
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+# Examples that do not use boost_date_time
+exe amount_cube
+ :
+ amount_cube_/amount_cube.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe history
+ :
+ history_/history.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+
+# Examples using boost_date_time
+exe time_and_duration
+ :
+ time_and_duration_/time_and_duration.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
Modified: sandbox/icl/libs/icl_xt/example/casual_sample_/casual_sample.cpp
==============================================================================
--- sandbox/icl/libs/icl_xt/example/casual_sample_/casual_sample.cpp (original)
+++ sandbox/icl/libs/icl_xt/example/casual_sample_/casual_sample.cpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -1,7 +1,7 @@
/*-----------------------------------------------------------------------------+
Interval Container Library
Author: Joachim Faulhaber
-Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 2007-2011: Joachim Faulhaber
Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
+------------------------------------------------------------------------------+
Distributed under the Boost Software License, Version 1.0.
Modified: sandbox/icl/libs/icl_xt/example/time_and_duration_/time_and_duration.cpp
==============================================================================
--- sandbox/icl/libs/icl_xt/example/time_and_duration_/time_and_duration.cpp (original)
+++ sandbox/icl/libs/icl_xt/example/time_and_duration_/time_and_duration.cpp 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -1,7 +1,7 @@
/*-----------------------------------------------------------------------------+
Interval Container Library
Author: Joachim Faulhaber
-Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 2007-2011: Joachim Faulhaber
Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
+------------------------------------------------------------------------------+
Distributed under the Boost Software License, Version 1.0.
@@ -65,91 +65,96 @@
interval<ptime> + interval<duration> -> interval<ptime>
etc.
*/
-void time_and_duration()
+
+void limits_of_time()
{
- // boost::posix_times are points in time related to the
- // Gregorian calendar. It has a time origin January-1-0, 00:00
- // which is NOT in the scope of its representable values.
-
- // The smallest representable point in time is
- cout << "Technical time origin: " << ptime(min_date_time) << endl;
- // which is also the identity element on ptime
- cout << "Also Null value : " << icl::identity_element<ptime>::value() << endl;
- // Note, that identity_element<ptime> is added to boost posix_time by
- // adaptor code in <boost/icl/ptime.hpp>
-
- posix_time::ptime origin = identity_element<ptime>::value();
- ptime next = origin; ++next;
- cout << "Smallest next time : " << next << endl;
+ // boost::posix_times are points in time related to the
+ // Gregorian calendar. It has a time origin January-1-0, 00:00
+ // which is NOT in the scope of its representable values.
+
+ cout << "----- Testing some traits of date_time::posix_time ----------\n";
+ // The smallest representable point in time is
+ cout << "Technical time origin: " << ptime(min_date_time) << endl;
+ // which is also the identity element on ptime
+ cout << "Also Null value : " << icl::identity_element<ptime>::value() << endl;
+ // Note, that identity_element<ptime> is added to boost posix_time by
+ // adaptor code in <boost/icl/ptime.hpp>
+
+ posix_time::ptime origin = identity_element<ptime>::value();
+ ptime next = origin; ++next;
+ cout << "Smallest next time : " << next << endl;
+
+ cout << "For most applications on time schedules, using resolutions\n"
+ << "of minutes or seconds, an integer (4 bytes) would be ok.\n"
+ << "boost::ptime being a 'univeral compromise' needs 8 bytes.\n";
+
+ cout << "sizeof(int) = " << sizeof(int) << endl;
+ cout << "sizeof(ptime) = " << sizeof(ptime) << endl;
+ cout << "sizeof(time_duration) = " << sizeof(time_duration) << endl;
+
+ cout << "-------------------------------------------------------------\n";
+}
- // Start decorating the Christmas tree
+void time_and_duration()
+{
+ // Start decorating the Christmas tree
ptime start_deco = time_from_string("2010-12-24 16:30");
- // Ahh! Christmas tree is decorated
+ // Ahh! Christmas tree is decorated
ptime stop_deco = time_from_string("2010-12-24 17:15");
time_duration decoration_time = stop_deco - start_deco;
- //-----------------------------------------------------------------------------
- cout << "sizeof(int) = " << sizeof(int) << endl;
- cout << "sizeof(ptime) = " << sizeof(ptime) << endl;
- cout << "sizeof(time_duration) = " << sizeof(time_duration) << endl;
-
- //-----------------------------------------------------------------------------
- //JODO Make it a nice example
- ptime t_a = time_from_string("2010-12-24 19:30");
- ptime t_b = time_from_string("2010-12-24 20:30");
- time_duration a_2_b = t_b - t_a;
- cout << "Duration of [" << t_a << "," << t_b << ") = "
- << a_2_b << endl;
-
- interval<ptime>::type a_b
- = interval<ptime>::right_open(t_a, t_b);
- cout << "Duration of " << a_b << " = "
- << icl::size(a_b) << endl;
-
- icl::size(a_b);
-
- posix_time::time_duration half = a_2_b / 2;
- ptime t_m = t_a + half;
-
- cout << a_b << (icl::contains(a_b, t_m) ?
- " contains " : "does not contain ")
- << t_m << endl;
-
- ptime day_begin = time_from_string("2010-12-24 00:00");
- time_duration d_a = t_a - day_begin;
- time_duration d_b = t_b - day_begin;
- time_duration d_m = d_b - d_a;
-
- interval<time_duration>::type rel_a_b
- = interval<time_duration>::right_open(d_a, d_b);
-
- time_duration sz_a_b_1 = d_b - d_a;
- time_duration sz_a_b_2 = icl::size(rel_a_b);
- cout << "b-a = " << sz_a_b_1 << endl;
- cout << "size([a,b)) = " << sz_a_b_2 << endl;
- cout << "size([a,b)) = " << (icl::size(rel_a_b)) << endl;
+ //-----------------------------------------------------------------------------
+ cout << "Duration of [" << start_deco << "," << stop_deco << ") = "
+ << decoration_time << endl;
+
+ interval<ptime>::type deco_2010
+ = interval<ptime>::right_open(start_deco, stop_deco);
+ cout << "Duration of " << deco_2010 << " = " << icl::size(deco_2010) << endl;
- cout << rel_a_b << " " << (icl::size(rel_a_b)) << endl;
+ // To work with 'relative times' that do not have a fixed origin
+ // we can work with time_durations.
+
+ ptime day_begin = time_from_string("2010-12-24 00:00");
+ // It's deco time on Christmas.
+ time_duration deco_start = start_deco - day_begin;
+ time_duration deco_stop = stop_deco - day_begin;
+
+ time_duration deco_mid = decoration_time / 2;
+
+ ptime deco_mid_2010 = start_deco + deco_mid;
+
+ cout << deco_2010 << (icl::contains(deco_2010, deco_mid_2010) ?
+ " contains " : "does not contain ")
+ << deco_mid_2010 << endl;
+
+ // We can work with intervals of time_durations
+ interval<time_duration>::type deco_interval
+ = interval<time_duration>::right_open(deco_start, deco_stop);
+
+ cout << "----- We can work with intervals of time_durations: ---------\n";
+ cout << "size(" << deco_interval << ") = " << icl::size(deco_interval) << endl;
+ cout << "-------------------------------------------------------------\n";
}
-void time_durations()
+void time_and_durations2()
{
- time_duration start = hours(8) + minutes(30);
- time_duration stop = hours(17) + minutes(15);
+ // Some convenient notations for time_durations
+ time_duration start = hours(8) + minutes(30);
+ time_duration stop = hours(17) + minutes(15);
- icl::interval<time_duration>::type working_hours
- = icl::interval<time_duration>::right_open(start, stop);
+ icl::interval<time_duration>::type working_hours
+ = icl::interval<time_duration>::right_open(start, stop);
- cout << "working_hours: " << working_hours << endl;
+ cout << "working_hours: " << working_hours << endl;
}
int main()
{
cout << ">>Interval Container Library: Sample time_and_duration.cpp <<\n";
cout << "-------------------------------------------------------------\n";
- //time_and_duration();
- time_durations();
+ limits_of_time();
+ time_and_duration();
return 0;
}
@@ -157,7 +162,22 @@
/*-----------------------------------------------------------------------------
>>Interval Container Library: Sample time_and_duration.cpp <<
-------------------------------------------------------------
-TODO Show prgram output.
------------------------------------------------------------------------------*/
+----- Testing some traits of date_time::posix_time ----------
+Technical time origin: 1400-Jan-01 00:00:00
+Also Null value : 1400-Jan-01 00:00:00
+Smallest next time : 1400-Jan-01 00:00:00.000001
+For most applications on time schedules, using resolutions
+of minutes or seconds, an integer (4 bytes) would be ok.
+boost::ptime being a 'univeral compromise' needs 8 bytes.
+sizeof(int) = 4
+sizeof(ptime) = 8
+sizeof(time_duration) = 8
+-------------------------------------------------------------
+Duration of [2010-Dec-24 16:30:00,2010-Dec-24 17:15:00) = 00:45:00
+Duration of [2010-Dec-24 16:30:00,2010-Dec-24 17:15:00) = 00:45:00
+[2010-Dec-24 16:30:00,2010-Dec-24 17:15:00) contains 2010-Dec-24 16:52:30
+----- We can work with intervals of time_durations: ---------
+size([16:30:00,17:15:00)) = 00:45:00
+-------------------------------------------------------------------------------*/
//]
Added: sandbox/icl/libs/icl_xt/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/icl/libs/icl_xt/test/Jamfile.v2 2011-01-11 19:20:17 EST (Tue, 11 Jan 2011)
@@ -0,0 +1,22 @@
+# (C) Copyright 2008-2011: Joachim Faulhaber
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+# bring in rules for testing
+import testing ;
+import feature ;
+
+project
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <library>/boost/date_time//boost_date_time
+ <link>static
+ <include>../../..
+ ;
+
+test-suite "icl_xt"
+ :
+ # interval_bitset
+ [ run fastest_interval_bitset_/fastest_interval_bitset.cpp ]
+ [ run fastest_interval_bitset_infix_/fastest_interval_bitset_infix.cpp ]
+ ;
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