Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57086 - in sandbox/itl: boost/validate/itl libs/itl/doc libs/itl/example libs/itl/example/large_bitset_
From: afojgo_at_[hidden]
Date: 2009-10-23 07:02:44


Author: jofaber
Date: 2009-10-23 07:02:43 EDT (Fri, 23 Oct 2009)
New Revision: 57086
URL: http://svn.boost.org/trac/boost/changeset/57086

Log:
Corrections: Bugfix and typos corrections for project large_bitset. Stable {msvc-9.0}

Text files modified:
   sandbox/itl/boost/validate/itl/functors.hpp | 18 ------------------
   sandbox/itl/libs/itl/doc/projects.qbk | 23 +++++++++++++++++------
   sandbox/itl/libs/itl/example/Jamfile.v2 | 27 +++++++++++++++++++++++++++
   sandbox/itl/libs/itl/example/large_bitset_/large_bitset.cpp | 12 ++++++++++++
   sandbox/itl/libs/itl/example/large_bitset_/large_bitset.hpp | 2 +-
   5 files changed, 57 insertions(+), 25 deletions(-)

Modified: sandbox/itl/boost/validate/itl/functors.hpp
==============================================================================
--- sandbox/itl/boost/validate/itl/functors.hpp (original)
+++ sandbox/itl/boost/validate/itl/functors.hpp 2009-10-23 07:02:43 EDT (Fri, 23 Oct 2009)
@@ -63,24 +63,6 @@
 template<>
 inline std::string binary_template_to_string<copy_insertion>::apply() { return "ci"; }
 
-/*JODO
-template <typename SourceT, typename TargetT>
-struct trans_insertion
-{
- void operator()(TargetT& collected, const SourceT& items)
- {
- collected.clear();
- std::transform(items.begin(), items.end(),
- itl::inserter(collected, collected.end()), itl::to_pair);
- }
-};
-
-template<>
-inline std::string binary_template_to_string<copy_insertion>::apply() { return "$ti"; }
-*/
-
-
-
 
 template <typename SourceT, typename TargetT>
 struct base_addition

Modified: sandbox/itl/libs/itl/doc/projects.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/projects.qbk (original)
+++ sandbox/itl/libs/itl/doc/projects.qbk 2009-10-23 07:02:43 EDT (Fri, 23 Oct 2009)
@@ -101,7 +101,7 @@
 so that `large_bitset` looks and feels like a usual
 set class.
 
-[section Usage of a large_bitset]
+[section Using large_bitset]
 
 To quicken your appetite for a look at the implementation
 here are a few use cases first. Let's start large.
@@ -111,7 +111,7 @@
 [large_bitset_test_large_set_all]
 
 . . . we are testing the limits. First we set all bits and
-the we switch off the very last bit.
+then we switch off the very last bit.
 
 [large_bitset_test_large_erase_last]
 
@@ -135,23 +135,34 @@
 ``
 ----- Test function test_small() -----------
 -- Switch on all bits in range [0,64] ------
-[0,9)->11111111
+[0,8)->11111111
+[8,9)->10000000
 --------------------------------------------
 -- Turn off bits: 25,27,28 -----------------
 [0,3)->11111111
 [3,4)->10100111
-[4,9)->11111111
+[4,8)->11111111
+[8,9)->10000000
 --------------------------------------------
 -- Flip bits in range [24,30) --------------
 [0,3)->11111111
 [3,4)->01011011
-[4,9)->11111111
+[4,8)->11111111
+[8,9)->10000000
 --------------------------------------------
 -- Remove the first 10 bits ----------------
 [1,2)->00111111
 [2,3)->11111111
 [3,4)->01011011
-[4,9)->11111111
+[4,8)->11111111
+[8,9)->10000000
+-- remove even bits in range [0,72) --------
+[1,2)->00010101
+[2,3)->01010101
+[3,4)->01010001
+[4,8)->01010101
+-- set odd bits in range [0,72) --------
+[0,9)->01010101
 --------------------------------------------
 ``
 

Modified: sandbox/itl/libs/itl/example/Jamfile.v2
==============================================================================
--- sandbox/itl/libs/itl/example/Jamfile.v2 (original)
+++ sandbox/itl/libs/itl/example/Jamfile.v2 2009-10-23 07:02:43 EDT (Fri, 23 Oct 2009)
@@ -35,6 +35,22 @@
         <include>$(BOOST_ROOT)
     ;
 
+exe std_copy
+ :
+ std_copy_/std_copy.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe std_transform
+ :
+ std_transform_/std_transform.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
 # Examples using boost_date_time
 exe boost_party
     :
@@ -90,6 +106,17 @@
         <include>$(BOOST_ROOT)
     ;
 
+# Projects
+exe large_bitset
+ :
+ large_bitset_/large_bitset.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+
+
 exe itvset_shell
     :
         itvset_shell_/itvset_shell.cpp

Modified: sandbox/itl/libs/itl/example/large_bitset_/large_bitset.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/large_bitset_/large_bitset.cpp (original)
+++ sandbox/itl/libs/itl/example/large_bitset_/large_bitset.cpp 2009-10-23 07:02:43 EDT (Fri, 23 Oct 2009)
@@ -50,6 +50,7 @@
     large_bitset<nat, bits8> tall; // small is tall ...
         // ... it really is, because even this 'small' large_bitset
         // can represent up to 2^32-1 == 4,294,967,295 bits.
+ // BTW nat is defined as unsigned int.
 
     cout << "----- Test function test_small() -----------\n";
     cout << "-- Switch on all bits in range [0,64] ------\n";
@@ -70,7 +71,18 @@
     cout << "-- Remove the first 10 bits ----------------\n";
     tall -= interval<nat>::rightopen(0,10);
     tall.show_segments();
+
+ cout << "-- remove even bits in range [0,72) --------\n";
+ int bit;
+ for(bit=0; bit<72; bit++) if(!(bit%2)) tall -= bit;
+ tall.show_segments();
+
+ cout << "-- set odd bits in range [0,72) --------\n";
+ for(bit=0; bit<72; bit++) if(bit%2) tall += bit;
+ tall.show_segments();
+
     cout << "--------------------------------------------\n\n";
+
 }
 //]
 

Modified: sandbox/itl/libs/itl/example/large_bitset_/large_bitset.hpp
==============================================================================
--- sandbox/itl/libs/itl/example/large_bitset_/large_bitset.hpp (original)
+++ sandbox/itl/libs/itl/example/large_bitset_/large_bitset.hpp 2009-10-23 07:02:43 EDT (Fri, 23 Oct 2009)
@@ -184,7 +184,7 @@
                 lower = base+1;
             }
 
- if(ceil_rest == 0)
+ if(ceil_rest == all)
                 upper = ceil+1;
             else
             {


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