|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57620 - in sandbox/itl: boost/itl boost/itl/detail boost/itl_xt boost/itl_xt/detail libs/itl/test libs/itl/test/test_casual_
From: afojgo_at_[hidden]
Date: 2009-11-12 18:07:48
Author: jofaber
Date: 2009-11-12 18:07:46 EST (Thu, 12 Nov 2009)
New Revision: 57620
URL: http://svn.boost.org/trac/boost/changeset/57620
Log:
Replaced tabs. Stable {msvc-8.0, 9.0; gcc-3.4.4}
Text files modified:
sandbox/itl/boost/itl/detail/element_iterator.hpp | 214 +++++++++---------
sandbox/itl/boost/itl/detail/mapped_reference.hpp | 22 +-
sandbox/itl/boost/itl/interval_base_map.hpp | 34 +-
sandbox/itl/boost/itl/interval_base_set.hpp | 34 +-
sandbox/itl/boost/itl_xt/detail/bit_element_iterator.hpp | 412 ++++++++++++++++++------------------
sandbox/itl/boost/itl_xt/interval_bitset.hpp | 36 +-
sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp | 434 ++++++++++++++++++++--------------------
sandbox/itl/libs/itl/test/test_interval_map_shared.hpp | 34 +-
sandbox/itl/libs/itl/test/test_interval_set_shared.hpp | 24 +-
9 files changed, 622 insertions(+), 622 deletions(-)
Modified: sandbox/itl/boost/itl/detail/element_iterator.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/element_iterator.hpp (original)
+++ sandbox/itl/boost/itl/detail/element_iterator.hpp 2009-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -20,15 +20,15 @@
template<class Type>
struct is_std_pair
{
- typedef is_std_pair<Type> type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ typedef is_std_pair<Type> type;
+ BOOST_STATIC_CONSTANT(bool, value = false);
};
template<class FirstT, class SecondT>
struct is_std_pair<std::pair<FirstT, SecondT> >
{
- typedef is_std_pair<std::pair<FirstT, SecondT> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
+ typedef is_std_pair<std::pair<FirstT, SecondT> > type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
};
@@ -36,13 +36,13 @@
template<class Type>
struct first_element
{
- typedef Type type;
+ typedef Type type;
};
template<class FirstT, class SecondT>
struct first_element<std::pair<FirstT, SecondT> >
{
- typedef FirstT type;
+ typedef FirstT type;
};
//------------------------------------------------------------------------------
@@ -51,22 +51,22 @@
template<class IteratorT>
struct is_reverse
{
- typedef is_reverse type;
- BOOST_STATIC_CONSTANT(bool, value = false);
+ typedef is_reverse type;
+ BOOST_STATIC_CONSTANT(bool, value = false);
};
template<class BaseIteratorT>
struct is_reverse<std::reverse_iterator<BaseIteratorT> >
{
- typedef is_reverse<std::reverse_iterator<BaseIteratorT> > type;
- BOOST_STATIC_CONSTANT(bool, value = true);
+ typedef is_reverse<std::reverse_iterator<BaseIteratorT> > type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
};
template<class BaseIteratorT>
struct is_reverse<itl::element_iterator<BaseIteratorT> >
{
- typedef is_reverse<itl::element_iterator<BaseIteratorT> > type;
- BOOST_STATIC_CONSTANT(bool, value = is_reverse<BaseIteratorT>::value);
+ typedef is_reverse<itl::element_iterator<BaseIteratorT> > type;
+ BOOST_STATIC_CONSTANT(bool, value = is_reverse<BaseIteratorT>::value);
};
//------------------------------------------------------------------------------
@@ -76,24 +76,24 @@
template<class DomainT, ITL_COMPARE Compare, template<class, ITL_COMPARE>class Interval>
struct elemental<Interval<DomainT,Compare> >
{
- typedef Interval<DomainT,Compare> segment_type;
- typedef segment_type interval_type;
- typedef DomainT type;
- typedef DomainT domain_type;
- typedef DomainT codomain_type;
- typedef DomainT transit_type;
+ typedef Interval<DomainT,Compare> segment_type;
+ typedef segment_type interval_type;
+ typedef DomainT type;
+ typedef DomainT domain_type;
+ typedef DomainT codomain_type;
+ typedef DomainT transit_type;
};
template< class DomainT, class CodomainT,
- ITL_COMPARE Compare, template<class, ITL_COMPARE>class Interval >
+ ITL_COMPARE Compare, template<class, ITL_COMPARE>class Interval >
struct elemental<std::pair<Interval<DomainT,Compare>const, CodomainT> >
{
- typedef std::pair<Interval<DomainT,Compare>, CodomainT> segment_type;
- typedef Interval<DomainT,Compare> interval_type;
- typedef std::pair<DomainT, CodomainT> type;
- typedef DomainT domain_type;
- typedef CodomainT codomain_type;
- typedef mapped_reference<DomainT, CodomainT> transit_type;
+ typedef std::pair<Interval<DomainT,Compare>, CodomainT> segment_type;
+ typedef Interval<DomainT,Compare> interval_type;
+ typedef std::pair<DomainT, CodomainT> type;
+ typedef DomainT domain_type;
+ typedef CodomainT codomain_type;
+ typedef mapped_reference<DomainT, CodomainT> transit_type;
};
@@ -106,51 +106,51 @@
template<class SegmentIteratorT, class DomainT, ITL_COMPARE Compare, template<class, ITL_COMPARE>class Interval>
struct segment_adapter<SegmentIteratorT, Interval<DomainT,Compare> >
{
- typedef segment_adapter type;
- typedef Interval<DomainT,Compare> segment_type;
- typedef segment_type interval_type;
- typedef typename interval_type::difference_type domain_difference_type;
- typedef DomainT domain_type;
- typedef DomainT codomain_type;
- typedef domain_type element_type;
- typedef domain_type& transit_type;
-
- static domain_type first (const SegmentIteratorT& leaper){ return leaper->first(); }
- static domain_type last (const SegmentIteratorT& leaper){ return leaper->last(); }
- static domain_difference_type length(const SegmentIteratorT& leaper){ return leaper->length();}
-
- static transit_type transient_element(domain_type& inter_pos, const SegmentIteratorT& leaper,
- const domain_difference_type& sneaker)
- {
- inter_pos = is_reverse<SegmentIteratorT>::value ? leaper->last() - sneaker
- : leaper->first() + sneaker;
- return inter_pos;
- }
+ typedef segment_adapter type;
+ typedef Interval<DomainT,Compare> segment_type;
+ typedef segment_type interval_type;
+ typedef typename interval_type::difference_type domain_difference_type;
+ typedef DomainT domain_type;
+ typedef DomainT codomain_type;
+ typedef domain_type element_type;
+ typedef domain_type& transit_type;
+
+ static domain_type first (const SegmentIteratorT& leaper){ return leaper->first(); }
+ static domain_type last (const SegmentIteratorT& leaper){ return leaper->last(); }
+ static domain_difference_type length(const SegmentIteratorT& leaper){ return leaper->length();}
+
+ static transit_type transient_element(domain_type& inter_pos, const SegmentIteratorT& leaper,
+ const domain_difference_type& sneaker)
+ {
+ inter_pos = is_reverse<SegmentIteratorT>::value ? leaper->last() - sneaker
+ : leaper->first() + sneaker;
+ return inter_pos;
+ }
};
template < class SegmentIteratorT, class DomainT, class CodomainT,
- ITL_COMPARE Compare, template<class, ITL_COMPARE>class Interval >
+ ITL_COMPARE Compare, template<class, ITL_COMPARE>class Interval >
struct segment_adapter<SegmentIteratorT, std::pair<Interval<DomainT,Compare>const, CodomainT> >
{
- typedef segment_adapter type;
- typedef Interval<DomainT,Compare> interval_type;
- typedef typename interval_type::difference_type domain_difference_type;
- typedef DomainT domain_type;
- typedef std::pair<DomainT, CodomainT> element_type;
- typedef CodomainT codomain_type;
- typedef mapped_reference<DomainT, CodomainT> transit_type;
-
- static domain_type first (const SegmentIteratorT& leaper){ return leaper->first.first(); }
- static domain_type last (const SegmentIteratorT& leaper){ return leaper->first.last(); }
- static domain_difference_type length(const SegmentIteratorT& leaper){ return leaper->first.length();}
-
- static transit_type transient_element(domain_type& inter_pos, const SegmentIteratorT& leaper,
- const domain_difference_type& sneaker)
- {
- inter_pos = is_reverse<SegmentIteratorT>::value ? leaper->first.last() - sneaker
- : leaper->first.first() + sneaker;
- return transit_type(inter_pos, leaper->second);
- }
+ typedef segment_adapter type;
+ typedef Interval<DomainT,Compare> interval_type;
+ typedef typename interval_type::difference_type domain_difference_type;
+ typedef DomainT domain_type;
+ typedef std::pair<DomainT, CodomainT> element_type;
+ typedef CodomainT codomain_type;
+ typedef mapped_reference<DomainT, CodomainT> transit_type;
+
+ static domain_type first (const SegmentIteratorT& leaper){ return leaper->first.first(); }
+ static domain_type last (const SegmentIteratorT& leaper){ return leaper->first.last(); }
+ static domain_difference_type length(const SegmentIteratorT& leaper){ return leaper->first.length();}
+
+ static transit_type transient_element(domain_type& inter_pos, const SegmentIteratorT& leaper,
+ const domain_difference_type& sneaker)
+ {
+ inter_pos = is_reverse<SegmentIteratorT>::value ? leaper->first.last() - sneaker
+ : leaper->first.first() + sneaker;
+ return transit_type(inter_pos, leaper->second);
+ }
};
@@ -158,39 +158,39 @@
class element_iterator
: public boost::iterator_facade<
element_iterator<SegmentIteratorT>
- , typename elemental<typename SegmentIteratorT::value_type>::transit_type
+ , typename elemental<typename SegmentIteratorT::value_type>::transit_type
, boost::bidirectional_traversal_tag
- , typename elemental<typename SegmentIteratorT::value_type>::transit_type
+ , typename elemental<typename SegmentIteratorT::value_type>::transit_type
>
{
public:
- typedef SegmentIteratorT segment_iterator;
- typedef typename SegmentIteratorT::value_type segment_type;
- typedef typename first_element<segment_type>::type interval_type;
- typedef typename interval_type::difference_type domain_difference_type;
- typedef typename elemental<segment_type>::type element_type;
- typedef typename elemental<segment_type>::domain_type domain_type;
- typedef typename elemental<segment_type>::codomain_type codomain_type;
- typedef typename elemental<segment_type>::transit_type transit_type;
- typedef transit_type value_type;
+ typedef SegmentIteratorT segment_iterator;
+ typedef typename SegmentIteratorT::value_type segment_type;
+ typedef typename first_element<segment_type>::type interval_type;
+ typedef typename interval_type::difference_type domain_difference_type;
+ typedef typename elemental<segment_type>::type element_type;
+ typedef typename elemental<segment_type>::domain_type domain_type;
+ typedef typename elemental<segment_type>::codomain_type codomain_type;
+ typedef typename elemental<segment_type>::transit_type transit_type;
+ typedef transit_type value_type;
private:
- typedef typename segment_adapter<segment_iterator,segment_type>::type adapt;
+ typedef typename segment_adapter<segment_iterator,segment_type>::type adapt;
struct enabler{};
public:
element_iterator()
- : _saltator(neutron<segment_iterator>::value())
- , _reptator(neutron<domain_difference_type>::value()){}
+ : _saltator(neutron<segment_iterator>::value())
+ , _reptator(neutron<domain_difference_type>::value()){}
explicit element_iterator(segment_iterator jumper)
: _saltator(jumper), _reptator(neutron<domain_difference_type>::value()) {}
template <class SaltatorT>
element_iterator
- ( element_iterator<SaltatorT> const& other
- , typename enable_if<boost::is_convertible<SaltatorT*,SegmentIteratorT*>, enabler>::type = enabler())
+ ( element_iterator<SaltatorT> const& other
+ , typename enable_if<boost::is_convertible<SaltatorT*,SegmentIteratorT*>, enabler>::type = enabler())
: _saltator(other._saltator), _reptator(other._reptator) {}
private:
@@ -201,42 +201,42 @@
bool equal(element_iterator<SaltatorT> const& other) const
{
return this->_saltator == other._saltator
- && this->_reptator == other._reptator;
+ && this->_reptator == other._reptator;
}
void increment()
- {
- if(_reptator < pred(adapt::length(_saltator)))
- ++_reptator;
- else
- {
- ++_saltator;
- _reptator = neutron<domain_difference_type>::value();
- }
- }
+ {
+ if(_reptator < pred(adapt::length(_saltator)))
+ ++_reptator;
+ else
+ {
+ ++_saltator;
+ _reptator = neutron<domain_difference_type>::value();
+ }
+ }
void decrement()
- {
- if(neutron<domain_difference_type>::value() < _reptator)
- --_reptator;
- else
- {
- --_saltator;
- _reptator = adapt::length(_saltator);
- --_reptator;
- }
- }
+ {
+ if(neutron<domain_difference_type>::value() < _reptator)
+ --_reptator;
+ else
+ {
+ --_saltator;
+ _reptator = adapt::length(_saltator);
+ --_reptator;
+ }
+ }
value_type dereference()const
- {
- return adapt::transient_element(_inter_pos, _saltator, _reptator);
- }
+ {
+ return adapt::transient_element(_inter_pos, _saltator, _reptator);
+ }
private:
segment_iterator _saltator; // satltare: to jump : the fast moving iterator
- mutable domain_difference_type _reptator; // reptare: to sneak : the slow moving iterator 0 based
- mutable domain_type _inter_pos; // inter position : Position within the current segment
- // _saltator->first.first() <= _inter_pos <= _saltator->first.last()
+ mutable domain_difference_type _reptator; // reptare: to sneak : the slow moving iterator 0 based
+ mutable domain_type _inter_pos; // inter position : Position within the current segment
+ // _saltator->first.first() <= _inter_pos <= _saltator->first.last()
};
}} // namespace itl boost
Modified: sandbox/itl/boost/itl/detail/mapped_reference.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/mapped_reference.hpp (original)
+++ sandbox/itl/boost/itl/detail/mapped_reference.hpp 2009-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -14,21 +14,21 @@
template<class FirstT, class SecondT>
struct mapped_reference
{
- typedef FirstT first_type;
- typedef SecondT second_type;
- typedef mapped_reference type;
+ typedef FirstT first_type;
+ typedef SecondT second_type;
+ typedef mapped_reference type;
- const FirstT& first;
- SecondT& second;
+ const FirstT& first;
+ SecondT& second;
- mapped_reference(const FirstT& fst, SecondT& snd) : first(fst), second(snd){}
+ mapped_reference(const FirstT& fst, SecondT& snd) : first(fst), second(snd){}
- template<class FstT, class SndT>
- mapped_reference(const mapped_reference<FstT, SndT>& source):
- first(source.first), second(source.second){}
+ template<class FstT, class SndT>
+ mapped_reference(const mapped_reference<FstT, SndT>& source):
+ first(source.first), second(source.second){}
- template<class FstT, class SndT>
- operator std::pair<FstT,SndT>(){ return std::pair<FstT,SndT>(first, second); }
+ template<class FstT, class SndT>
+ operator std::pair<FstT,SndT>(){ return std::pair<FstT,SndT>(first, second); }
};
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-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -153,14 +153,14 @@
/// const_iterator for iteration over intervals
typedef typename ImplMapT::const_reverse_iterator const_reverse_iterator;
- /// element iterator: Depreciated, see documentation.
- typedef boost::itl::element_iterator<iterator> element_iterator;
- /// const element iterator: Depreciated, see documentation.
- typedef boost::itl::element_iterator<const_iterator> element_const_iterator;
- /// element reverse iterator: Depreciated, see documentation.
- typedef boost::itl::element_iterator<reverse_iterator> element_reverse_iterator;
- /// element const reverse iterator: Depreciated, see documentation.
- typedef boost::itl::element_iterator<const_reverse_iterator> element_const_reverse_iterator;
+ /// element iterator: Depreciated, see documentation.
+ typedef boost::itl::element_iterator<iterator> element_iterator;
+ /// const element iterator: Depreciated, see documentation.
+ typedef boost::itl::element_iterator<const_iterator> element_const_iterator;
+ /// element reverse iterator: Depreciated, see documentation.
+ typedef boost::itl::element_iterator<reverse_iterator> element_reverse_iterator;
+ /// element const reverse iterator: Depreciated, see documentation.
+ typedef boost::itl::element_iterator<const_reverse_iterator> element_const_reverse_iterator;
typedef typename ImplMapT::pointer pointer;
typedef typename ImplMapT::const_pointer const_pointer;
@@ -667,15 +667,15 @@
//==========================================================================
//= Element iterator related
//==========================================================================
- element_iterator elements_begin(){ return element_iterator(this->begin()); }
- element_iterator elements_end() { return element_iterator(this->end()); }
- element_const_iterator elements_begin()const{ return element_iterator(this->begin()); }
- element_const_iterator elements_end() const{ return element_iterator(this->end()); }
-
- element_reverse_iterator elements_rbegin(){ return element_reverse_iterator(this->rbegin()); }
- element_reverse_iterator elements_rend() { return element_reverse_iterator(this->rend()); }
- element_const_reverse_iterator elements_rbegin()const{ return element_reverse_iterator(this->rbegin()); }
- element_const_reverse_iterator elements_rend() const{ return element_reverse_iterator(this->rend()); }
+ element_iterator elements_begin(){ return element_iterator(this->begin()); }
+ element_iterator elements_end() { return element_iterator(this->end()); }
+ element_const_iterator elements_begin()const{ return element_iterator(this->begin()); }
+ element_const_iterator elements_end() const{ return element_iterator(this->end()); }
+
+ element_reverse_iterator elements_rbegin(){ return element_reverse_iterator(this->rbegin()); }
+ element_reverse_iterator elements_rend() { return element_reverse_iterator(this->rend()); }
+ element_const_reverse_iterator elements_rbegin()const{ return element_reverse_iterator(this->rbegin()); }
+ element_const_reverse_iterator elements_rend() const{ return element_reverse_iterator(this->rend()); }
//==========================================================================
//= Representation
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-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -117,14 +117,14 @@
/// const_iterator for iteration over intervals
typedef typename ImplSetT::const_reverse_iterator const_reverse_iterator;
- /// element iterator: Depreciated, see documentation.
- typedef boost::itl::element_iterator<iterator> element_iterator;
- /// element const iterator: Depreciated, see documentation.
- typedef boost::itl::element_iterator<const_iterator> element_const_iterator;
- /// element reverse iterator: Depreciated, see documentation.
- typedef boost::itl::element_iterator<reverse_iterator> element_reverse_iterator;
- /// element const reverse iterator: Depreciated, see documentation.
- typedef boost::itl::element_iterator<const_reverse_iterator> element_const_reverse_iterator;
+ /// element iterator: Depreciated, see documentation.
+ typedef boost::itl::element_iterator<iterator> element_iterator;
+ /// element const iterator: Depreciated, see documentation.
+ typedef boost::itl::element_iterator<const_iterator> element_const_iterator;
+ /// element reverse iterator: Depreciated, see documentation.
+ typedef boost::itl::element_iterator<reverse_iterator> element_reverse_iterator;
+ /// element const reverse iterator: Depreciated, see documentation.
+ typedef boost::itl::element_iterator<const_reverse_iterator> element_const_reverse_iterator;
typedef typename ImplSetT::pointer pointer;
typedef typename ImplSetT::const_pointer const_pointer;
@@ -415,15 +415,15 @@
//==========================================================================
//= Element iterator related
//==========================================================================
- element_iterator elements_begin(){ return element_iterator(this->begin()); }
- element_iterator elements_end() { return element_iterator(this->end()); }
- element_const_iterator elements_begin()const{ return element_iterator(this->begin()); }
- element_const_iterator elements_end() const{ return element_iterator(this->end()); }
-
- element_reverse_iterator elements_rbegin(){ return element_reverse_iterator(this->rbegin()); }
- element_reverse_iterator elements_rend() { return element_reverse_iterator(this->rend()); }
- element_const_reverse_iterator elements_rbegin()const{ return element_reverse_iterator(this->rbegin()); }
- element_const_reverse_iterator elements_rend() const{ return element_reverse_iterator(this->rend()); }
+ element_iterator elements_begin(){ return element_iterator(this->begin()); }
+ element_iterator elements_end() { return element_iterator(this->end()); }
+ element_const_iterator elements_begin()const{ return element_iterator(this->begin()); }
+ element_const_iterator elements_end() const{ return element_iterator(this->end()); }
+
+ element_reverse_iterator elements_rbegin(){ return element_reverse_iterator(this->rbegin()); }
+ element_reverse_iterator elements_rend() { return element_reverse_iterator(this->rend()); }
+ element_const_reverse_iterator elements_rbegin()const{ return element_reverse_iterator(this->rbegin()); }
+ element_const_reverse_iterator elements_rend() const{ return element_reverse_iterator(this->rend()); }
//==========================================================================
//= Morphisms
Modified: sandbox/itl/boost/itl_xt/detail/bit_element_iterator.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/detail/bit_element_iterator.hpp (original)
+++ sandbox/itl/boost/itl_xt/detail/bit_element_iterator.hpp 2009-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -15,7 +15,7 @@
namespace iterator_state
{
- enum { dereferencable, end };
+ enum { dereferencable, end };
}
//------------------------------------------------------------------------------
@@ -24,32 +24,32 @@
template<class DomainT, ITL_COMPARE Compare, template<class, ITL_COMPARE>class Interval, class BitSetT>
struct bitwise<std::pair<Interval<DomainT,Compare>const, BitSetT> >
{
- typedef bitwise type;
- typedef DomainT domain_type;
- typedef DomainT codomain_type;
- typedef DomainT element_type;
- typedef typename BitSetT::word_type word_type;
+ typedef bitwise type;
+ typedef DomainT domain_type;
+ typedef DomainT codomain_type;
+ typedef DomainT element_type;
+ typedef typename BitSetT::word_type word_type;
- BOOST_STATIC_CONSTANT(bit_range_type, digits = BitSetT::digits);
+ BOOST_STATIC_CONSTANT(bit_range_type, digits = BitSetT::digits);
};
template <class SegmentIteratorT>
class bit_element_iterator
: public boost::iterator_facade<
bit_element_iterator<SegmentIteratorT>
- , typename bitwise<typename SegmentIteratorT::value_type>::element_type
+ , typename bitwise<typename SegmentIteratorT::value_type>::element_type
, boost::bidirectional_traversal_tag
- , typename bitwise<typename SegmentIteratorT::value_type>::element_type
+ , typename bitwise<typename SegmentIteratorT::value_type>::element_type
>
{
public:
- typedef SegmentIteratorT segment_iterator;
- typedef typename SegmentIteratorT::value_type segment_type;
- typedef typename first_element<segment_type>::type interval_type;
- typedef typename interval_type::difference_type domain_difference_type;
- typedef typename bitwise<segment_type>::domain_type domain_type;
- typedef typename bitwise<segment_type>::codomain_type codomain_type;
- typedef typename bitwise<segment_type>::element_type element_type;
+ typedef SegmentIteratorT segment_iterator;
+ typedef typename SegmentIteratorT::value_type segment_type;
+ typedef typename first_element<segment_type>::type interval_type;
+ typedef typename interval_type::difference_type domain_difference_type;
+ typedef typename bitwise<segment_type>::domain_type domain_type;
+ typedef typename bitwise<segment_type>::codomain_type codomain_type;
+ typedef typename bitwise<segment_type>::element_type element_type;
private:
struct enabler{};
@@ -57,34 +57,34 @@
public:
bit_element_iterator()
- : _saltator(neutron<segment_iterator>::value())
- , _reptator(neutron<domain_difference_type>::value())
- , _on_bit(ante)
- {}
+ : _saltator(neutron<segment_iterator>::value())
+ , _reptator(neutron<domain_difference_type>::value())
+ , _on_bit(ante)
+ {}
- explicit bit_element_iterator(segment_iterator jumper, int state = iterator_state::dereferencable)
+ explicit bit_element_iterator(segment_iterator jumper, int state = iterator_state::dereferencable)
: _saltator(jumper)
- , _reptator(neutron<domain_difference_type>::value())
- {
- if(state == iterator_state::dereferencable)
- _on_bit = biterate::proceed<word_type,digits>::next(jumper->second.word(), ante);
- }
+ , _reptator(neutron<domain_difference_type>::value())
+ {
+ if(state == iterator_state::dereferencable)
+ _on_bit = biterate::proceed<word_type,digits>::next(jumper->second.word(), ante);
+ }
template <class SaltatorT>
bit_element_iterator
- ( bit_element_iterator<SaltatorT> const& other
- , typename enable_if<boost::is_convertible<SaltatorT*,SegmentIteratorT*>, enabler>::type = enabler())
+ ( bit_element_iterator<SaltatorT> const& other
+ , typename enable_if<boost::is_convertible<SaltatorT*,SegmentIteratorT*>, enabler>::type = enabler())
: _saltator(other._saltator)
- , _reptator(other._reptator)
- , _on_bit(other._on_bit)
- {}
+ , _reptator(other._reptator)
+ , _on_bit(other._on_bit)
+ {}
private:
- typedef typename bitwise<segment_type>::word_type word_type;
- BOOST_STATIC_CONSTANT(bit_range_type, digits = bitwise<segment_type>::digits );
- BOOST_STATIC_CONSTANT(bit_range_type, shift = log2_<digits>::value );
- BOOST_STATIC_CONSTANT(bit_range_type, past = digits );
- BOOST_STATIC_CONSTANT(bit_range_type, ante = -1 );
+ typedef typename bitwise<segment_type>::word_type word_type;
+ BOOST_STATIC_CONSTANT(bit_range_type, digits = bitwise<segment_type>::digits );
+ BOOST_STATIC_CONSTANT(bit_range_type, shift = log2_<digits>::value );
+ BOOST_STATIC_CONSTANT(bit_range_type, past = digits );
+ BOOST_STATIC_CONSTANT(bit_range_type, ante = -1 );
friend class boost::iterator_core_access;
template <class> friend class bit_element_iterator;
@@ -93,71 +93,71 @@
bool equal(bit_element_iterator<SaltatorT> const& other) const
{
return this->_saltator == other._saltator
- && this->_reptator == other._reptator;
+ && this->_reptator == other._reptator;
}
void increment()
- {
- if(!next_bit()) // find and update the next on bit.
- {
- if(_reptator < pred(_saltator->first.length()))
- {
- ++_reptator;
- _on_bit = ante;
- }
- else
- {
- ++_saltator;
- _reptator = neutron<domain_difference_type>::value();
- _on_bit = ante;
- }
- // The existence of at least one bit is asserted (absorber trait)
- }
- }
+ {
+ if(!next_bit()) // find and update the next on bit.
+ {
+ if(_reptator < pred(_saltator->first.length()))
+ {
+ ++_reptator;
+ _on_bit = ante;
+ }
+ else
+ {
+ ++_saltator;
+ _reptator = neutron<domain_difference_type>::value();
+ _on_bit = ante;
+ }
+ // The existence of at least one bit is asserted (absorber trait)
+ }
+ }
void decrement()
- {
- if(!prev_bit()) // find and update the previous on bit.
- {
- if(neutron<domain_difference_type>::value() < _reptator)
- --_reptator;
- else
- {
- --_saltator;
- _reptator = _saltator->first.length();
- --_reptator;
- }
- // The existence of at least one bit is asserted (absorber trait)
- _on_bit = past;
- next_bit();
- }
- }
+ {
+ if(!prev_bit()) // find and update the previous on bit.
+ {
+ if(neutron<domain_difference_type>::value() < _reptator)
+ --_reptator;
+ else
+ {
+ --_saltator;
+ _reptator = _saltator->first.length();
+ --_reptator;
+ }
+ // The existence of at least one bit is asserted (absorber trait)
+ _on_bit = past;
+ next_bit();
+ }
+ }
element_type dereference()const
- {
- return (_saltator->first.first() << shift) + _reptator + _on_bit;
- }
-
- bool next_bit()
- {
- BOOST_ASSERT(ante <= _on_bit && _on_bit < past);
- _on_bit = biterate::proceed<word_type,digits>::next(_saltator->second.word(), _on_bit);
- return _on_bit != past;
- }
-
- bool prev_bit()
- {
- BOOST_ASSERT(ante < _on_bit && _on_bit <= past);
- _on_bit = biterate::proceed<word_type,digits>::prev(_saltator->second.word(), _on_bit);
- return _on_bit != ante;
- }
+ {
+ return (_saltator->first.first() << shift) + _reptator + _on_bit;
+ }
+
+ bool next_bit()
+ {
+ BOOST_ASSERT(ante <= _on_bit && _on_bit < past);
+ _on_bit = biterate::proceed<word_type,digits>::next(_saltator->second.word(), _on_bit);
+ return _on_bit != past;
+ }
+
+ bool prev_bit()
+ {
+ BOOST_ASSERT(ante < _on_bit && _on_bit <= past);
+ _on_bit = biterate::proceed<word_type,digits>::prev(_saltator->second.word(), _on_bit);
+ return _on_bit != ante;
+ }
private:
segment_iterator _saltator; // satltare: to jump : the fast moving iterator
- mutable domain_difference_type _reptator; // reptare: to sneak : the slow moving iterator 0 based
- mutable bit_range_type _on_bit; // position of the current on bit.
- // -1 <= _on_bit <= digits
- // rend() end()
+ mutable domain_difference_type _reptator; // reptare: to sneak : the slow moving iterator 0 based
+ mutable bit_range_type _on_bit; // position of the current on bit.
+ // -1 <= _on_bit <= digits
+ // rend() end()
};
namespace biterate
@@ -178,12 +178,12 @@
inline static nat32 high_bit(nat32 v)
{
- v |= v >> 1;
- v |= v >> 2;
- v |= v >> 4;
- v |= v >> 8;
- v |= v >> 16;
- return (v >> 1) + 1;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ return (v >> 1) + 1;
}
template<typename WordT, bit_range_type Digits>
@@ -192,7 +192,7 @@
typedef nat32 word_type;
typedef proceed<WordT, Digits> type;
- BOOST_STATIC_CONSTANT( word_type, digits = Digits );
+ BOOST_STATIC_CONSTANT( word_type, digits = Digits );
BOOST_STATIC_CONSTANT( word_type, w1 = static_cast<word_type>(1) );
BOOST_STATIC_CONSTANT( word_type, top = w1 << (digits-w1) );
BOOST_STATIC_CONSTANT( word_type, factor = 0x077CB531U );
@@ -203,40 +203,40 @@
static bit_range_type next(word_type value, bit_range_type cur_pos)
{
- BOOST_ASSERT( ante <= cur_pos && cur_pos < past );
+ BOOST_ASSERT( ante <= cur_pos && cur_pos < past );
- if(cur_pos == last)
- return past;
- else if(cur_pos == ante)
- return index32[(((value & -value) * factor)) >> shift];
- else
- {
- // next contains all bits of value above cur_pos
- word_type next = value & ~((1<<(cur_pos+1))-1);
- if(!next)
- return past;
- else
- return index32[(((next & -next) * factor)) >> shift];
- }
+ if(cur_pos == last)
+ return past;
+ else if(cur_pos == ante)
+ return index32[(((value & -value) * factor)) >> shift];
+ else
+ {
+ // next contains all bits of value above cur_pos
+ word_type next = value & ~((1<<(cur_pos+1))-1);
+ if(!next)
+ return past;
+ else
+ return index32[(((next & -next) * factor)) >> shift];
+ }
}
static bit_range_type prev(word_type value, bit_range_type cur_pos)
{
- BOOST_ASSERT(ante < cur_pos && cur_pos <= past);
+ BOOST_ASSERT(ante < cur_pos && cur_pos <= past);
- if(cur_pos == 0)
- return ante;
- else if(cur_pos == past)
- return index32[((high_bit(value) * factor)) >> shift];
- else
- {
- // next contains all bits of value above cur_pos
- word_type prev = value & ((1<<cur_pos)-1);
- if(!prev)
- return ante;
- else
- return index32[((high_bit(prev) * factor)) >> shift];
- }
+ if(cur_pos == 0)
+ return ante;
+ else if(cur_pos == past)
+ return index32[((high_bit(value) * factor)) >> shift];
+ else
+ {
+ // next contains all bits of value above cur_pos
+ word_type prev = value & ((1<<cur_pos)-1);
+ if(!prev)
+ return ante;
+ else
+ return index32[((high_bit(prev) * factor)) >> shift];
+ }
}
};
@@ -247,7 +247,7 @@
typedef nat32 half_type;
typedef proceed<word_type,64> type;
- BOOST_STATIC_CONSTANT( word_type, digits = 64 );
+ BOOST_STATIC_CONSTANT( word_type, digits = 64 );
BOOST_STATIC_CONSTANT( word_type, w1 = static_cast<word_type>(1) );
BOOST_STATIC_CONSTANT( word_type, top = w1 << (digits-w1) );
BOOST_STATIC_CONSTANT( half_type, factor = 0x077CB531U );
@@ -260,96 +260,96 @@
BOOST_STATIC_CONSTANT( word_type, lower_mask = (w1 << 32)-w1 );
- static half_type lower_next(word_type value, bit_range_type cur_pos)
- {
- return static_cast<half_type>(lower_mask & (value & ~((1<<(cur_pos+1))-1)));
- }
-
- static half_type upper_next(word_type value, bit_range_type cur_pos)
- {
- return static_cast<half_type>(value >> half) & ~((1<<(cur_pos-half+1))-1);
- }
+ static half_type lower_next(word_type value, bit_range_type cur_pos)
+ {
+ return static_cast<half_type>(lower_mask & (value & ~((1<<(cur_pos+1))-1)));
+ }
+
+ static half_type upper_next(word_type value, bit_range_type cur_pos)
+ {
+ return static_cast<half_type>(value >> half) & ~((1<<(cur_pos-half+1))-1);
+ }
static bit_range_type next(word_type value, bit_range_type cur_pos)
{
- BOOST_ASSERT(cur_pos < past );
+ BOOST_ASSERT(cur_pos < past );
- if(cur_pos == last)
- return past;
- else if(cur_pos == ante)
- {
- half_type lower = static_cast<half_type>(lower_mask & value);
- if(lower)
- return index32[(((lower & -lower) * factor)) >> shift];
- else
- {
- half_type upper = static_cast<half_type>(value >> half);
- return half + index32[(((upper & -upper) * factor)) >> shift];
- }
- }
- else
- {
- half_type low_next, up_next;
- if(half-1 <= cur_pos)
- if(up_next = upper_next(value, cur_pos))
- return half + index32[(((up_next & -up_next) * factor)) >> shift];
- else
- return past;
- else
- if(low_next = lower_next(value, cur_pos))
- return index32[(((low_next & -low_next) * factor)) >> shift];
- else
- {
- half_type up_next = upper_next(value, cur_pos);
- return half + index32[(((up_next & -up_next) * factor)) >> shift];
- }
- }
+ if(cur_pos == last)
+ return past;
+ else if(cur_pos == ante)
+ {
+ half_type lower = static_cast<half_type>(lower_mask & value);
+ if(lower)
+ return index32[(((lower & -lower) * factor)) >> shift];
+ else
+ {
+ half_type upper = static_cast<half_type>(value >> half);
+ return half + index32[(((upper & -upper) * factor)) >> shift];
+ }
+ }
+ else
+ {
+ half_type low_next, up_next;
+ if(half-1 <= cur_pos)
+ if(up_next = upper_next(value, cur_pos))
+ return half + index32[(((up_next & -up_next) * factor)) >> shift];
+ else
+ return past;
+ else
+ if(low_next = lower_next(value, cur_pos))
+ return index32[(((low_next & -low_next) * factor)) >> shift];
+ else
+ {
+ half_type up_next = upper_next(value, cur_pos);
+ return half + index32[(((up_next & -up_next) * factor)) >> shift];
+ }
+ }
}
- static half_type lower_previous(word_type value, bit_range_type cur_pos)
- {
- return static_cast<half_type>(lower_mask & (value & ((1<<(cur_pos))-1)));
- }
-
- static half_type upper_previous(word_type value, bit_range_type cur_pos)
- {
- return static_cast<half_type>(value >> half) & ((1<<(cur_pos-half))-1);
- }
+ static half_type lower_previous(word_type value, bit_range_type cur_pos)
+ {
+ return static_cast<half_type>(lower_mask & (value & ((1<<(cur_pos))-1)));
+ }
+
+ static half_type upper_previous(word_type value, bit_range_type cur_pos)
+ {
+ return static_cast<half_type>(value >> half) & ((1<<(cur_pos-half))-1);
+ }
static bit_range_type prev(word_type value, bit_range_type cur_pos)
{
- BOOST_ASSERT(ante < cur_pos);
+ BOOST_ASSERT(ante < cur_pos);
- if(cur_pos == 0)
- return ante;
- else if(cur_pos == past)
- {
- half_type upper = static_cast<half_type>(value >> half);
- if(upper)
- return half + index32[((high_bit(upper) * factor)) >> shift];
- else
- {
- half_type lower = static_cast<half_type>(value & lower_mask);
- return index32[((high_bit(lower) * factor)) >> shift];
- }
- }
- else
- {
- half_type up_prev, low_prev;
- if(half == cur_pos)
- if(low_prev = static_cast<half_type>(lower_mask & value))
- return index32[((high_bit(low_prev) * factor)) >> shift];
- else
- return ante;
- else if(cur_pos < half || !(up_prev = upper_previous(value, cur_pos)))
- if(low_prev = lower_previous(value,cur_pos))
- return index32[((high_bit(low_prev) * factor)) >> shift];
- else
- return ante;
- else
- return half + index32[((high_bit(up_prev) * factor)) >> shift];
- }
+ if(cur_pos == 0)
+ return ante;
+ else if(cur_pos == past)
+ {
+ half_type upper = static_cast<half_type>(value >> half);
+ if(upper)
+ return half + index32[((high_bit(upper) * factor)) >> shift];
+ else
+ {
+ half_type lower = static_cast<half_type>(value & lower_mask);
+ return index32[((high_bit(lower) * factor)) >> shift];
+ }
+ }
+ else
+ {
+ half_type up_prev, low_prev;
+ if(half == cur_pos)
+ if(low_prev = static_cast<half_type>(lower_mask & value))
+ return index32[((high_bit(low_prev) * factor)) >> shift];
+ else
+ return ante;
+ else if(cur_pos < half || !(up_prev = upper_previous(value, cur_pos)))
+ if(low_prev = lower_previous(value,cur_pos))
+ return index32[((high_bit(low_prev) * factor)) >> shift];
+ else
+ return ante;
+ else
+ return half + index32[((high_bit(up_prev) * factor)) >> shift];
+ }
}
};
Modified: sandbox/itl/boost/itl_xt/interval_bitset.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/interval_bitset.hpp (original)
+++ sandbox/itl/boost/itl_xt/interval_bitset.hpp 2009-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -64,7 +64,7 @@
typedef DomainT condensed_type; // 0 .. (2^digits(element_type)-1)/digits(word_type)
typedef typename BitSetT::word_type word_type; // 0 .. 2^digits(word_type)-1
typedef typename BitSetT::bit_type bit_type; // 0 .. digits(word_type)
- typedef short narrow_type; // small signed type that includes bit_type
+ 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;
@@ -81,14 +81,14 @@
typedef typename interval_bitmap_type::reverse_iterator reverse_iterator;
typedef typename interval_bitmap_type::const_reverse_iterator const_reverse_iterator;
- /// element iterator: Depreciated, see documentation.
- typedef boost::itl::bit_element_iterator<iterator> element_iterator;
- /// element const iterator: Depreciated, see documentation.
- typedef boost::itl::bit_element_iterator<const_iterator> element_const_iterator;
- /// element reverse iterator: Depreciated, see documentation.
- typedef boost::itl::bit_element_iterator<reverse_iterator> element_reverse_iterator;
- /// element const reverse iterator: Depreciated, see documentation.
- typedef boost::itl::bit_element_iterator<const_reverse_iterator> element_const_reverse_iterator;
+ /// element iterator: Depreciated, see documentation.
+ typedef boost::itl::bit_element_iterator<iterator> element_iterator;
+ /// element const iterator: Depreciated, see documentation.
+ typedef boost::itl::bit_element_iterator<const_iterator> element_const_iterator;
+ /// element reverse iterator: Depreciated, see documentation.
+ typedef boost::itl::bit_element_iterator<reverse_iterator> element_reverse_iterator;
+ /// element const reverse iterator: Depreciated, see documentation.
+ typedef boost::itl::bit_element_iterator<const_reverse_iterator> element_const_reverse_iterator;
typedef typename interval_bitmap_type::pointer pointer;
typedef typename interval_bitmap_type::const_pointer const_pointer;
@@ -163,15 +163,15 @@
//==========================================================================
//= Element iterator related
//==========================================================================
- element_iterator elements_begin(){ return element_iterator(this->begin()); }
- element_iterator elements_end() { return element_iterator(this->end(), iterator_state::end); }
- element_const_iterator elements_begin()const{ return element_iterator(this->begin()); }
- element_const_iterator elements_end() const{ return element_iterator(this->end(), iterator_state::end); }
-
- element_reverse_iterator elements_rbegin(){ return element_reverse_iterator(this->rbegin()); }
- element_reverse_iterator elements_rend() { return element_reverse_iterator(this->rend(), iterator_state::end); }
- element_const_reverse_iterator elements_rbegin()const{ return element_reverse_iterator(this->rbegin()); }
- element_const_reverse_iterator elements_rend() const{ return element_reverse_iterator(this->rend(), iterator_state::end); }
+ element_iterator elements_begin(){ return element_iterator(this->begin()); }
+ element_iterator elements_end() { return element_iterator(this->end(), iterator_state::end); }
+ element_const_iterator elements_begin()const{ return element_iterator(this->begin()); }
+ element_const_iterator elements_end() const{ return element_iterator(this->end(), iterator_state::end); }
+
+ element_reverse_iterator elements_rbegin(){ return element_reverse_iterator(this->rbegin()); }
+ element_reverse_iterator elements_rend() { return element_reverse_iterator(this->rend(), iterator_state::end); }
+ element_const_reverse_iterator elements_rbegin()const{ return element_reverse_iterator(this->rbegin()); }
+ element_const_reverse_iterator elements_rend() const{ return element_reverse_iterator(this->rend(), iterator_state::end); }
private:
typedef typename interval_bitmap_type::segment_type seg_type;
Modified: sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp (original)
+++ sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp 2009-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -42,256 +42,256 @@
BOOST_AUTO_TEST_CASE(casual_test)
{
- typedef interval_bitset<nat, bits8> InterBits8T;
- InterBits8T lbs;
+ typedef interval_bitset<nat, bits8> InterBits8T;
+ InterBits8T lbs;
- lbs.add(1).add(4).add(7).add(8);
-
- InterBits8T::element_iterator it = lbs.elements_begin();
- cout << "{";
- while(it != lbs.elements_end())
- {
- int ele = *it;
- cout << *it << " ";
- if(ele == 8)
- {
- int dbg = 1;
- }
- ++it;
- }
- cout << "}";
+ lbs.add(1).add(4).add(7).add(8);
+
+ InterBits8T::element_iterator it = lbs.elements_begin();
+ cout << "{";
+ while(it != lbs.elements_end())
+ {
+ int ele = *it;
+ cout << *it << " ";
+ if(ele == 8)
+ {
+ int dbg = 1;
+ }
+ ++it;
+ }
+ cout << "}";
}
/*
BOOST_AUTO_TEST_CASE(biter64_test)
{
- typedef nat64 worT ;
- const bit_range_type wdth = 64;
+ typedef nat64 worT ;
+ const bit_range_type wdth = 64;
- worT val = 1;
- short pos = -1;
- short nxt, prv;
-
- cout << "------- bitter 64 ---------\n";
-
- val = 0;
- val |= 1ull << 63ull;
- val |= 1ull << 62ull;
- val |= 1ull << 55ull;
- val |= 1ull << 44ull;
- val |= 1ull << 33ull;
- val |= 1ull << 32ull;
- val |= 1ull << 31ull;
- val |= 1ull << 30ull;
- val |= 1ull << 22ull;
- val |= 1ull << 11ull;
- val |= 1ull << 3ull;
- val |= 1ull << 2ull;
- val |= 1ull << 1ull;
- val |= 1ull << 0ull;
- pos = -1;
-
- while(pos < wdth)
- {
- nxt = biterate::proceed<worT,wdth>::next(val,pos);
- cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
- pos = nxt;
- }
- cout << "- - - - - - - - - -\n";
- while(pos > -1)
- {
- if(pos == 31)
- {
- int dbg = 42;
- }
- prv = biterate::proceed<worT,wdth>::prev(val,pos);
- cout << "prev(" << val <<","<< pos << ")" << "=" << prv << endl;
- pos = prv;
- }
+ worT val = 1;
+ short pos = -1;
+ short nxt, prv;
+
+ cout << "------- bitter 64 ---------\n";
+
+ val = 0;
+ val |= 1ull << 63ull;
+ val |= 1ull << 62ull;
+ val |= 1ull << 55ull;
+ val |= 1ull << 44ull;
+ val |= 1ull << 33ull;
+ val |= 1ull << 32ull;
+ val |= 1ull << 31ull;
+ val |= 1ull << 30ull;
+ val |= 1ull << 22ull;
+ val |= 1ull << 11ull;
+ val |= 1ull << 3ull;
+ val |= 1ull << 2ull;
+ val |= 1ull << 1ull;
+ val |= 1ull << 0ull;
+ pos = -1;
+
+ while(pos < wdth)
+ {
+ nxt = biterate::proceed<worT,wdth>::next(val,pos);
+ cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
+ pos = nxt;
+ }
+ cout << "- - - - - - - - - -\n";
+ while(pos > -1)
+ {
+ if(pos == 31)
+ {
+ int dbg = 42;
+ }
+ prv = biterate::proceed<worT,wdth>::prev(val,pos);
+ cout << "prev(" << val <<","<< pos << ")" << "=" << prv << endl;
+ pos = prv;
+ }
}
BOOST_AUTO_TEST_CASE(biter64_up_test)
{
- typedef nat64 worT ;
- const bit_range_type wdth = 64;
+ typedef nat64 worT ;
+ const bit_range_type wdth = 64;
- worT val = 1;
- short pos = -1;
- short nxt, prv;
-
- cout << "------- bitter 64 up ---------\n";
-
- val = 0;
- val |= 1ull << 63ull;
- val |= 1ull << 62ull;
- val |= 1ull << 55ull;
- val |= 1ull << 44ull;
- val |= 1ull << 33ull;
- val |= 1ull << 32ull;
- pos = -1;
-
- while(pos < wdth)
- {
- nxt = biterate::proceed<worT,wdth>::next(val,pos);
- cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
- pos = nxt;
- }
- cout << "- - - - - - - - - -\n";
- while(pos > -1)
- {
- if(pos == 31)
- {
- int dbg = 42;
- }
- prv = biterate::proceed<worT,wdth>::prev(val,pos);
- cout << "prev(" << val <<","<< pos << ")" << "=" << prv << endl;
- pos = prv;
- }
+ worT val = 1;
+ short pos = -1;
+ short nxt, prv;
+
+ cout << "------- bitter 64 up ---------\n";
+
+ val = 0;
+ val |= 1ull << 63ull;
+ val |= 1ull << 62ull;
+ val |= 1ull << 55ull;
+ val |= 1ull << 44ull;
+ val |= 1ull << 33ull;
+ val |= 1ull << 32ull;
+ pos = -1;
+
+ while(pos < wdth)
+ {
+ nxt = biterate::proceed<worT,wdth>::next(val,pos);
+ cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
+ pos = nxt;
+ }
+ cout << "- - - - - - - - - -\n";
+ while(pos > -1)
+ {
+ if(pos == 31)
+ {
+ int dbg = 42;
+ }
+ prv = biterate::proceed<worT,wdth>::prev(val,pos);
+ cout << "prev(" << val <<","<< pos << ")" << "=" << prv << endl;
+ pos = prv;
+ }
}
BOOST_AUTO_TEST_CASE(biter64_low_test)
{
- typedef nat64 worT ;
- const bit_range_type wdth = 64;
+ typedef nat64 worT ;
+ const bit_range_type wdth = 64;
- worT val = 1;
- short pos = -1;
- short nxt, prv;
-
- cout << "------- bitter 64 low ---------\n";
-
- val = 0;
- val |= 1ull << 31ull;
- val |= 1ull << 30ull;
- val |= 1ull << 22ull;
- val |= 1ull << 11ull;
- val |= 1ull << 3ull;
- val |= 1ull << 2ull;
- val |= 1ull << 1ull;
- val |= 1ull << 0ull;
- pos = -1;
-
- while(pos < wdth)
- {
- nxt = biterate::proceed<worT,wdth>::next(val,pos);
- cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
- pos = nxt;
- }
- cout << "- - - - - - - - - -\n";
- while(pos > -1)
- {
- if(pos == 64)
- {
- int dbg = 42;
- }
- prv = biterate::proceed<worT,wdth>::prev(val,pos);
- cout << "prev(" << val <<","<< pos << ")" << "=" << prv << endl;
- pos = prv;
- }
+ worT val = 1;
+ short pos = -1;
+ short nxt, prv;
+
+ cout << "------- bitter 64 low ---------\n";
+
+ val = 0;
+ val |= 1ull << 31ull;
+ val |= 1ull << 30ull;
+ val |= 1ull << 22ull;
+ val |= 1ull << 11ull;
+ val |= 1ull << 3ull;
+ val |= 1ull << 2ull;
+ val |= 1ull << 1ull;
+ val |= 1ull << 0ull;
+ pos = -1;
+
+ while(pos < wdth)
+ {
+ nxt = biterate::proceed<worT,wdth>::next(val,pos);
+ cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
+ pos = nxt;
+ }
+ cout << "- - - - - - - - - -\n";
+ while(pos > -1)
+ {
+ if(pos == 64)
+ {
+ int dbg = 42;
+ }
+ prv = biterate::proceed<worT,wdth>::prev(val,pos);
+ cout << "prev(" << val <<","<< pos << ")" << "=" << prv << endl;
+ pos = prv;
+ }
}
BOOST_AUTO_TEST_CASE(biter32_test)
{
- typedef nat32 worT ;
- const bit_range_type wdth = 32;
+ typedef nat32 worT ;
+ const bit_range_type wdth = 32;
- worT val = 1;
- short pos = -1;
- short nxt, prv;
-
- cout << "------- bitter 32 ---------\n";
-
- val = 0;
- val |= 1ul << 31ul;
- val |= 1ul << 30ul;
- val |= 1ul << 22ul;
- val |= 1ul << 11ul;
- val |= 1ul << 3ul;
- val |= 1ul << 2ul;
- val |= 1ul << 1ul;
- val |= 1ul << 0ul;
- pos = -1;
-
- while(pos < wdth)
- {
- if(pos == wdth)
- {
- int dbg = 42;
- }
- nxt = biterate::proceed<worT,wdth>::next(val,pos);
- cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
- pos = nxt;
- }
-
- cout << "- - - - - - - - - -\n";
- while(pos > -1)
- {
- if(pos == 31)
- {
- int dbg = 42;
- }
- prv = biterate::proceed<worT,wdth>::prev(val,pos);
- cout << "prev(" << val <<","<< pos << ")" << "=" << prv << endl;
- pos = prv;
- }
+ worT val = 1;
+ short pos = -1;
+ short nxt, prv;
+
+ cout << "------- bitter 32 ---------\n";
+
+ val = 0;
+ val |= 1ul << 31ul;
+ val |= 1ul << 30ul;
+ val |= 1ul << 22ul;
+ val |= 1ul << 11ul;
+ val |= 1ul << 3ul;
+ val |= 1ul << 2ul;
+ val |= 1ul << 1ul;
+ val |= 1ul << 0ul;
+ pos = -1;
+
+ while(pos < wdth)
+ {
+ if(pos == wdth)
+ {
+ int dbg = 42;
+ }
+ nxt = biterate::proceed<worT,wdth>::next(val,pos);
+ cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
+ pos = nxt;
+ }
+
+ cout << "- - - - - - - - - -\n";
+ while(pos > -1)
+ {
+ if(pos == 31)
+ {
+ int dbg = 42;
+ }
+ prv = biterate::proceed<worT,wdth>::prev(val,pos);
+ cout << "prev(" << val <<","<< pos << ")" << "=" << prv << endl;
+ pos = prv;
+ }
}
BOOST_AUTO_TEST_CASE(biter16_test)
{
- typedef nat16 worT ;
- const bit_range_type wdth = 16;
+ typedef nat16 worT ;
+ const bit_range_type wdth = 16;
- worT val = 1;
- short pos = -1;
- short nxt;
-
- cout << "------- bitter 16 ---------\n";
-
- val = 0;
- val |= 1 << 15;
- val |= 1 << 14;
- val |= 1 << 12;
- val |= 1 << 11;
- val |= 1 << 3;
- val |= 1 << 2;
- val |= 1 << 1;
- val |= 1 << 0;
- pos = -1;
-
- while(pos < wdth)
- {
- nxt = biterate::proceed<worT,wdth>::next(val,pos);
- cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
- pos = nxt;
- }
+ worT val = 1;
+ short pos = -1;
+ short nxt;
+
+ cout << "------- bitter 16 ---------\n";
+
+ val = 0;
+ val |= 1 << 15;
+ val |= 1 << 14;
+ val |= 1 << 12;
+ val |= 1 << 11;
+ val |= 1 << 3;
+ val |= 1 << 2;
+ val |= 1 << 1;
+ val |= 1 << 0;
+ pos = -1;
+
+ while(pos < wdth)
+ {
+ nxt = biterate::proceed<worT,wdth>::next(val,pos);
+ cout << "next(" << val <<","<< pos << ")" << "=" << nxt << endl;
+ pos = nxt;
+ }
}
BOOST_AUTO_TEST_CASE(biter8_test)
{
- typedef nat8 worT ;
- const bit_range_type wdth = 8;
+ typedef nat8 worT ;
+ const bit_range_type wdth = 8;
- worT val = 1;
- short pos = -1;
- short nxt;
-
- cout << "------- bitter 8 ---------\n";
-
- val = 0;
- val |= 1 << 7;
- val |= 1 << 4;
- val |= 1 << 2;
- val |= 1 << 1;
- val |= 1 << 0;
- pos = -1;
-
- while(pos < wdth)
- {
- nxt = biterate::proceed<worT,wdth>::next(val,pos);
- cout << "next(" << static_cast<short>(val) <<","<< pos << ")" << "=" << nxt << endl;
- pos = nxt;
- }
+ worT val = 1;
+ short pos = -1;
+ short nxt;
+
+ cout << "------- bitter 8 ---------\n";
+
+ val = 0;
+ val |= 1 << 7;
+ val |= 1 << 4;
+ val |= 1 << 2;
+ val |= 1 << 1;
+ val |= 1 << 0;
+ pos = -1;
+
+ while(pos < wdth)
+ {
+ nxt = biterate::proceed<worT,wdth>::next(val,pos);
+ cout << "next(" << static_cast<short>(val) <<","<< pos << ")" << "=" << nxt << endl;
+ pos = nxt;
+ }
}
*/
Modified: sandbox/itl/libs/itl/test/test_interval_map_shared.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_map_shared.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_map_shared.hpp 2009-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -1247,33 +1247,33 @@
void interval_map_element_iter_4_discrete_types()
{
typedef IntervalMap<T,U,Trt> IntervalMapT;
- typedef typename IntervalMapT::element_iterator ReptatorT;
- typedef std::vector<std::pair<T,U> > VectorT;
+ typedef typename IntervalMapT::element_iterator ReptatorT;
+ typedef std::vector<std::pair<T,U> > VectorT;
- IntervalMapT map_a;
- map_a.insert(IIv(1,3,1)).insert(IIv(6,7,2));
+ IntervalMapT map_a;
+ map_a.insert(IIv(1,3,1)).insert(IIv(6,7,2));
- typename IntervalMapT::atomized_type ato_map_a;
- ReptatorT el_it = map_a.elements_begin();
+ typename IntervalMapT::atomized_type ato_map_a;
+ ReptatorT el_it = map_a.elements_begin();
- VectorT vec(5), cev(5);
- vec[0]=sK_v(1,1);vec[1]=sK_v(2,1);vec[2]=sK_v(3,1);vec[3]=sK_v(6,2);vec[4]=sK_v(7,2);
- cev[0]=sK_v(7,2);cev[1]=sK_v(6,2);cev[2]=sK_v(3,1);cev[3]=sK_v(2,1);cev[4]=sK_v(1,1);
+ VectorT vec(5), cev(5);
+ vec[0]=sK_v(1,1);vec[1]=sK_v(2,1);vec[2]=sK_v(3,1);vec[3]=sK_v(6,2);vec[4]=sK_v(7,2);
+ cev[0]=sK_v(7,2);cev[1]=sK_v(6,2);cev[2]=sK_v(3,1);cev[3]=sK_v(2,1);cev[4]=sK_v(1,1);
- VectorT dest;
- std::copy(map_a.elements_begin(), map_a.elements_end(), std::back_inserter(dest));
+ VectorT dest;
+ std::copy(map_a.elements_begin(), map_a.elements_end(), std::back_inserter(dest));
BOOST_CHECK_EQUAL( vec == dest, true );
- dest.clear();
- std::copy(map_a.elements_rbegin(), map_a.elements_rend(), std::back_inserter(dest));
+ dest.clear();
+ std::copy(map_a.elements_rbegin(), map_a.elements_rend(), std::back_inserter(dest));
BOOST_CHECK_EQUAL( cev == dest, true );
- dest.clear();
- std::reverse_copy(map_a.elements_rbegin(), map_a.elements_rend(), std::back_inserter(dest));
+ dest.clear();
+ std::reverse_copy(map_a.elements_rbegin(), map_a.elements_rend(), std::back_inserter(dest));
BOOST_CHECK_EQUAL( vec == dest, true );
- dest.clear();
- std::reverse_copy(map_a.elements_begin(), map_a.elements_end(), std::back_inserter(dest));
+ dest.clear();
+ std::reverse_copy(map_a.elements_begin(), map_a.elements_end(), std::back_inserter(dest));
BOOST_CHECK_EQUAL( cev == dest, true );
}
Modified: sandbox/itl/libs/itl/test/test_interval_set_shared.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_set_shared.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_set_shared.hpp 2009-11-12 18:07:46 EST (Thu, 12 Nov 2009)
@@ -728,29 +728,29 @@
void interval_set_element_iter_4_discrete_types()
{
typedef IntervalSet<T> IntervalSetT;
- typedef std::vector<T> VectorT;
+ typedef std::vector<T> VectorT;
IntervalSetT set_a;
set_a.add(I_I(1,3)).add(I_I(6,7));
- VectorT vec(5), cev(5);
- vec[0]=MK_v(1);vec[1]=MK_v(2);vec[2]=MK_v(3);vec[3]=MK_v(6);vec[4]=MK_v(7);
- cev[0]=MK_v(7);cev[1]=MK_v(6);cev[2]=MK_v(3);cev[3]=MK_v(2);cev[4]=MK_v(1);
+ VectorT vec(5), cev(5);
+ vec[0]=MK_v(1);vec[1]=MK_v(2);vec[2]=MK_v(3);vec[3]=MK_v(6);vec[4]=MK_v(7);
+ cev[0]=MK_v(7);cev[1]=MK_v(6);cev[2]=MK_v(3);cev[3]=MK_v(2);cev[4]=MK_v(1);
- VectorT dest;
- std::copy(set_a.elements_begin(), set_a.elements_end(), std::back_inserter(dest));
+ VectorT dest;
+ std::copy(set_a.elements_begin(), set_a.elements_end(), std::back_inserter(dest));
BOOST_CHECK_EQUAL( vec == dest, true );
- dest.clear();
- std::copy(set_a.elements_rbegin(), set_a.elements_rend(), std::back_inserter(dest));
+ dest.clear();
+ std::copy(set_a.elements_rbegin(), set_a.elements_rend(), std::back_inserter(dest));
BOOST_CHECK_EQUAL( cev == dest, true );
- dest.clear();
- std::reverse_copy(set_a.elements_begin(), set_a.elements_end(), std::back_inserter(dest));
+ dest.clear();
+ std::reverse_copy(set_a.elements_begin(), set_a.elements_end(), std::back_inserter(dest));
BOOST_CHECK_EQUAL( cev == dest, true );
- dest.clear();
- std::reverse_copy(set_a.elements_rbegin(), set_a.elements_rend(), std::back_inserter(dest));
+ dest.clear();
+ std::reverse_copy(set_a.elements_rbegin(), set_a.elements_rend(), std::back_inserter(dest));
BOOST_CHECK_EQUAL( vec == dest, true );
}
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