Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66034 - in sandbox/itl: boost/itl/concept libs/itl/doc libs/itl/test/test_casual_
From: afojgo_at_[hidden]
Date: 2010-10-17 07:16:50


Author: jofaber
Date: 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
New Revision: 66034
URL: http://svn.boost.org/trac/boost/changeset/66034

Log:
Updated documentation: Modified function references, range, replaced TABs.
Text files modified:
   sandbox/itl/boost/itl/concept/interval_associator.hpp | 64 ++++++++++++++++++++++++++--
   sandbox/itl/libs/itl/doc/examples.qbk | 88 ++++++++++++++++++++--------------------
   sandbox/itl/libs/itl/doc/functions.qbk | 6 +-
   sandbox/itl/libs/itl/doc/functions_insertion.qbk | 4
   sandbox/itl/libs/itl/doc/functions_range.qbk | 36 ++++++++-------
   sandbox/itl/libs/itl/doc/interface.qbk | 10 +++-
   sandbox/itl/libs/itl/doc/introduction.qbk | 28 ++++++------
   sandbox/itl/libs/itl/doc/projects.qbk | 8 +-
   sandbox/itl/libs/itl/doc/semantics.qbk | 2
   sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp | 30 ++++++------
   10 files changed, 167 insertions(+), 109 deletions(-)

Modified: sandbox/itl/boost/itl/concept/interval_associator.hpp
==============================================================================
--- sandbox/itl/boost/itl/concept/interval_associator.hpp (original)
+++ sandbox/itl/boost/itl/concept/interval_associator.hpp 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -185,16 +185,68 @@
 //==============================================================================
 //= Range<IntervalSet|IntervalMap>
 //==============================================================================
-template<class ObjectT>
-typename enable_if<is_interval_container<ObjectT>,
- typename ObjectT::interval_type>::type
-hull(const ObjectT& object)
+template<class Type>
+typename enable_if<is_interval_container<Type>,
+ typename Type::interval_type>::type
+hull(const Type& object)
 {
     return
- icl::is_empty(object) ? identity_element<typename ObjectT::interval_type>::value()
- : hull((key_value<ObjectT>(object.begin())), key_value<ObjectT>(object.rbegin()));
+ icl::is_empty(object)
+ ? identity_element<typename Type::interval_type>::value()
+ : icl::hull( key_value<Type>(object.begin()),
+ key_value<Type>(object.rbegin()) );
 }
 
+template<class Type>
+typename enable_if<is_interval_container<Type>,
+ typename Type::interval_type>::type
+lower(const Type& object)
+{
+ return
+ icl::is_empty(object)
+ ? identity_element<typename Type::interval_type>::value()
+ : icl::lower( key_value<Type>(object.begin()) );
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>,
+ typename Type::interval_type>::type
+upper(const Type& object)
+{
+ return
+ icl::is_empty(object)
+ ? identity_element<typename Type::interval_type>::value()
+ : icl::upper( key_value<Type>(object.rbegin()) );
+}
+
+//------------------------------------------------------------------------------
+template<class Type>
+typename enable_if
+< mpl::and_< is_interval_container<Type>
+ , is_discrete<typename Type::domain_type> >
+, typename Type::interval_type>::type
+first(const Type& object)
+{
+ return
+ icl::is_empty(object)
+ ? identity_element<typename Type::interval_type>::value()
+ : icl::first( key_value<Type>(object.begin()) );
+}
+
+template<class Type>
+typename enable_if
+< mpl::and_< is_interval_container<Type>
+ , is_discrete<typename Type::domain_type> >
+, typename Type::interval_type>::type
+last(const Type& object)
+{
+ return
+ icl::is_empty(object)
+ ? identity_element<typename Type::interval_type>::value()
+ : icl::last( key_value<Type>(object.rbegin()) );
+}
+
+
 //==============================================================================
 //= Addition<IntervalSet|IntervalMap>
 //==============================================================================

Modified: sandbox/itl/libs/itl/doc/examples.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/examples.qbk (original)
+++ sandbox/itl/libs/itl/doc/examples.qbk 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -11,52 +11,52 @@
 [section Overview]
 
 [table Overview over Icl Examples
- [[level] [example] [classes] [features]]
- [[intro][[link boost_icl.examples.party Party]]
- [__itv_map__][Generates an attendance history of a party
- by inserting into an __itv_map__.
- Demonstrating
- ['*aggregate on overlap*].]]
- [[basic] [[link boost_icl.examples.interval Interval]]
- [__itv__] [Intervals for integral and continuous instance types.
- Closed and open interval borders.]]
- [[basic] [[link boost_icl.examples.interval_container Interval container]]
- [__itv_set__,\n__sep_itv_set__,\n__spl_itv_set__,\n__spl_itv_map__,\n__itv_map__]
- [Basic characteristics of interval containers.]]
- [[basic] [[link boost_icl.examples.overlap_counter Overlap counter]]
- [__itv_map__][The most simple application of an interval map:
- Counting the overlaps of added intervals.]]
- [[advanced][[link boost_icl.examples.partys_height_average Party's height average]]
- [__itv_map__][Using /aggregate on overlap/ a history of height averages of party guests is computed.
- Associated values are user defined class objects, that implement
- an appropriate `operator +=` for the aggregation.]]
- [[advanced][[link boost_icl.examples.partys_tallest_guests Party's tallest guests]]
- [__itv_map__,\n__spl_itv_map__]
- [Using /aggregate on overlap/ the heights of the party's tallest guests are computed.
- Associated values are aggregated via a maximum functor, that can
- be chosen as template parameter of an interval_map class template.]]
- [[advanced][[link boost_icl.examples.time_grids_for_months_and_weeks Time grids for months and weeks]]
- [__spl_itv_set__]
- [Shows how the ['*border preserving*]
+ [[level] [example] [classes] [features]]
+ [[intro][[link boost_icl.examples.party Party]]
+ [__itv_map__][Generates an attendance history of a party
+ by inserting into an __itv_map__.
+ Demonstrating
+ ['*aggregate on overlap*].]]
+ [[basic] [[link boost_icl.examples.interval Interval]]
+ [__itv__] [Intervals for integral and continuous instance types.
+ Closed and open interval borders.]]
+ [[basic] [[link boost_icl.examples.interval_container Interval container]]
+ [__itv_set__,\n__sep_itv_set__,\n__spl_itv_set__,\n__spl_itv_map__,\n__itv_map__]
+ [Basic characteristics of interval containers.]]
+ [[basic] [[link boost_icl.examples.overlap_counter Overlap counter]]
+ [__itv_map__][The most simple application of an interval map:
+ Counting the overlaps of added intervals.]]
+ [[advanced][[link boost_icl.examples.partys_height_average Party's height average]]
+ [__itv_map__][Using /aggregate on overlap/ a history of height averages of party guests is computed.
+ Associated values are user defined class objects, that implement
+ an appropriate `operator +=` for the aggregation.]]
+ [[advanced][[link boost_icl.examples.partys_tallest_guests Party's tallest guests]]
+ [__itv_map__,\n__spl_itv_map__]
+ [Using /aggregate on overlap/ the heights of the party's tallest guests are computed.
+ Associated values are aggregated via a maximum functor, that can
+ be chosen as template parameter of an interval_map class template.]]
+ [[advanced][[link boost_icl.examples.time_grids_for_months_and_weeks Time grids for months and weeks]]
+ [__spl_itv_set__]
+ [Shows how the ['*border preserving*]
                                               __spl_itv_set__ can be used to create time partitions where different
                                               periodic time intervals overlay each other.]]
- [[advanced][[link boost_icl.examples.man_power Man power]]
- [__itv_set__,\n__itv_map__]
- [Set style operations on __itv_sets__ and __itv_maps__ like union, difference
- and intersection can be used to obtain calculations in a flexible way. Example
- [*man_power] demonstrates such operations in the process of calculating the
- available man-power of a company in a given time interval.]]
- [[advanced][[link boost_icl.examples.user_groups User groups]][__itv_map__]
- [Example [*user_groups] shows how interval_maps can be unified or
+ [[advanced][[link boost_icl.examples.man_power Man power]]
+ [__itv_set__,\n__itv_map__]
+ [Set style operations on __itv_sets__ and __itv_maps__ like union, difference
+ and intersection can be used to obtain calculations in a flexible way. Example
+ [*man_power] demonstrates such operations in the process of calculating the
+ available man-power of a company in a given time interval.]]
+ [[advanced][[link boost_icl.examples.user_groups User groups]][__itv_map__]
+ [Example [*user_groups] shows how interval_maps can be unified or
          intersected to calculate desired information.]]
          
- [[and std] [[link boost_icl.examples.std_copy Std copy]]
- [__itv_map__][Fill interval containers using `std::copy`.]]
- [[and std] [[link boost_icl.examples.std_transform Std transform]]
- [__itv_map__,\n__sep_itv_set__][Fill interval containers from user defined objects using `std::transform`.]]
-
- [[customize] [[link boost_icl.examples.custom_interval Custom interval]]
- [__itv_tr__][Use interval containers with your own interval class types.]]
+ [[and std] [[link boost_icl.examples.std_copy Std copy]]
+ [__itv_map__][Fill interval containers using `std::copy`.]]
+ [[and std] [[link boost_icl.examples.std_transform Std transform]]
+ [__itv_map__,\n__sep_itv_set__][Fill interval containers from user defined objects using `std::transform`.]]
+
+ [[customize] [[link boost_icl.examples.custom_interval Custom interval]]
+ [__itv_tr__][Use interval containers with your own interval class types.]]
 
 ]
 
@@ -93,11 +93,11 @@
 
 * The ['*accumulative behavior*] accumulates associated values on every overlap of
   an insertion for the associated values.
-
+
 The aggregation function is += by default. Different aggregations can
 be used, if desired.
 
-
+
 [example_boost_party]
 
 [caution

Modified: sandbox/itl/libs/itl/doc/functions.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/functions.qbk (original)
+++ sandbox/itl/libs/itl/doc/functions.qbk 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -192,9 +192,9 @@
 [table Selection of elements, segments and sub maps using key types
 [[ ][ __M: __itv_maps__ ][ __m: itl_map ]]
 [[__e: `domain_type` ][ key value pair ][ key value pair ]]
-[[__i: `interval_type` ][ interval value pair ][ ]]
-[[__S: __itv_sets__ ][ interval map ][ ]]
-[[__s: __icl_set__ ][ ][ interval map ]]
+[[__i: `interval_type` ][ interval value pair ][ ]]
+[[__S: __itv_sets__ ][ interval map ][ ]]
+[[__s: __icl_set__ ][ ][ interval map ]]
 ]
 
 __biLSubtraction__, __biLerasure__, __biLintersection__

Modified: sandbox/itl/libs/itl/doc/functions_insertion.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/functions_insertion.qbk (original)
+++ sandbox/itl/libs/itl/doc/functions_insertion.qbk 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -130,8 +130,8 @@
 T& T::set(const P&)
 
 set | b p
-----+----
-m | m
+----+----
+m | m
 M | M
 ``
 

Modified: sandbox/itl/libs/itl/doc/functions_range.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/functions_range.qbk (original)
+++ sandbox/itl/libs/itl/doc/functions_range.qbk 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -1,5 +1,5 @@
 [/
- Copyright (c) 2008-2009 Joachim Faulhaber
+ Copyright (c) 2008-2010 Joachim Faulhaber
 
     Distributed under the Boost Software License, Version 1.0.
     (See accompanying file LICENSE_1_0.txt or copy at
@@ -12,11 +12,12 @@
 
 [table
 [[['*Range*]] [__ch_itvs__][__ch_itv_sets__][__ch_itv_maps__][condition] ]
-[[`interval<domain_type> hull(const T&)`] [ ] [__O1__] [__O1__][] ]
-[[`domain_type T::lower()const`] [__O1__] [__O1__] [__O1__][] ]
-[[`domain_type T::upper()const`] [__O1__] [__O1__] [__O1__][] ]
-[[`domain_type T::first()const`] [__O1__] [__O1__] [__O1__][`!is_continuous<domain_type>::value`]]
-[[`domain_type T::last()const`] [__O1__] [__O1__] [__O1__][`!is_continuous<domain_type>::value`]]
+[[`interval_type hull(const T&)`] [ ] [__O1__] [__O1__][] ]
+[[`T hull(const T&, const T&)`] [__O1__] [ ] [ ][] ]
+[[`domain_type lower(const T&)`] [__O1__] [__O1__] [__O1__][] ]
+[[`domain_type upper(const T&)`] [__O1__] [__O1__] [__O1__][] ]
+[[`domain_type first(const T&)`] [__O1__] [__O1__] [__O1__][`is_discrete<domain_type>::value`]]
+[[`domain_type last(const T&)`] [__O1__] [__O1__] [__O1__][`is_discrete<domain_type>::value`]]
 ]
 
 The table above shows the availability of functions
@@ -26,21 +27,22 @@
 
 [table
 [[['*Range*]] [Types] [Description] ]
-[[`interval<domain_type> hull(const T&)`] [__S __M] [`hull(x)` returns the smallest interval that contains all intervals of an interval container `x`.] ]
-[[`domain_type T::lower()const`] [__i __S __M][`x.lower()` returns the lower bound of an interval or interval container `x`.] ]
-[[`domain_type T::upper()const`] [__i __S __M][`x.upper()` returns the upper bound of an interval or interval container `x`.] ]
-[[`domain_type T::first()const`] [__i __S __M][`x.first()` returns the first element of an interval or interval container `x`.
- `T::first()` is defined for a non continuous `domain_type` only.] ]
-[[`domain_type T::last()const`] [__i __S __M][`x.last()` returns the last element of an interval or interval container `x`.
- `T::last()` is defined for a non continuous `domain_type` only.] ]
+[[`interval_type hull(const T&)`] [__S __M] [`hull(x)` returns the smallest interval that contains all intervals of an interval container `x`.] ]
+[[`T hull(const T&, const T&)`] [__S __M] [`hull(i,j)` returns the smallest interval that contains intervals `i` abd 'j'.] ]
+[[`domain_type lower(const T&)`] [__i __S __M][`lower(x)` returns the lower bound of an interval or interval container `x`.] ]
+[[`domain_type upper(const T&)`] [__i __S __M][`upper(x)` returns the upper bound of an interval or interval container `x`.] ]
+[[`domain_type first(const T&)`] [__i __S __M][`first(x)` returns the first element of an interval or interval container `x`.
+ `first(const T&)` is defined for a discrete `domain_type` only.] ]
+[[`domain_type last(const T&)`] [__i __S __M][`last(x)` returns the last element of an interval or interval container `x`.
+ `last(const T&)` is defined for a discrete `domain_type` only.] ]
 ]
 
 ``
 // for interval_containers x:
-hull(x).lower() == x.lower()
-hull(x).upper() == x.upper()
-hull(x).first() == x.first()
-hull(x).last() == x.last()
+lower(hull(x)) == lower(x)
+upper(hull(x)) == upper(x)
+first(hull(x)) == first(x)
+last(hull(x)) == last(x)
 ``
 
 ['*Back to section . . .*]

Modified: sandbox/itl/libs/itl/doc/interface.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/interface.qbk (original)
+++ sandbox/itl/libs/itl/doc/interface.qbk 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -406,7 +406,7 @@
 
 [table
 [[Placeholder] [Argument types] [Description]]
-[[`T` ] [] [a container type]]
+[[`T` ] [] [a container or interval type]]
 [[`P` ] [] [polymorphical container argument type]]
 [[`J` ] [] [polymorphical iterator type]]
 [[`K` ] [] [polymorphical element_iterator type for interval containers]]
@@ -460,15 +460,19 @@
 [[`difference_type length(const T&)`] [1] [1] [1] [ ] [ ] ]
 [[`size_type iterative_size(const T&)`] [ ] [1] [1] [1] [1] ]
 [[`size_type interval_count(const T&)`] [ ] [1] [1] [ ] [ ] ]
-
+
 [[__biLSelection__ ] [ ] [ ] [ ] [ ] [ ] ]
 [[`J T::find(const domain_type&)`] [ ] [1] [1] [2] [2] ]
 [[`codomain_type& operator[] (const domain_type&)`][ ] [ ] [ ] [ ] [1] ]
 [[`codomain_type operator() (const domain_type&)const`][ ] [ ] [1] [ ] [1] ]
 
-[[__biLHull__ ] [ ] [ ] [ ] [ ] [ ] ]
+[[__biLRange__] [ ] [ ] [ ] [ ] [ ] ]
 [[`interval_type hull(const T&)`] [ ] [1] [1] [ ] [ ] ]
 [[`T hull(const T&, const T&)`] [1] [ ] [ ] [ ] [ ] ]
+[[`domain_type lower(const T&)`] [1] [1] [1] [ ] [ ] ]
+[[`domain_type upper(const T&)`] [1] [1] [1] [ ] [ ] ]
+[[`domain_type first(const T&)`] [1] [1] [1] [ ] [ ] ]
+[[`domain_type last(const T&)`] [1] [1] [1] [ ] [ ] ]
 
 [[__biLAddition__] [__ch_itvs__][__ch_itv_sets__][__ch_itv_maps__][__ch_ele_sets__][__ch_ele_maps__]]
 [[`T& T::add(const P&)`] [ ] [__ei] [__bp] [ ] [__b] ]

Modified: sandbox/itl/libs/itl/doc/introduction.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/introduction.qbk (original)
+++ sandbox/itl/libs/itl/doc/introduction.qbk 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -106,7 +106,7 @@
 // Iterating over elements (seconds) would be silly ...
 for(interval_set<seconds>::iterator telecast = myTvProgram.begin();
     telecast != myTvProgram.end(); ++telecast)
- //...so this iterates over intervals
+ //...so this iterates over intervals
    TV.switch_on(*telecast);
 ``
 
@@ -210,22 +210,22 @@
 [table Interval container's ways to combine intervals
     [[] [joining] [separating] [splitting]]
     [[set] [[classref boost::itl::interval_set interval_set]]
- [[classref boost::itl::separate_interval_set separate_interval_set]]
- [[classref boost::itl::split_interval_set split_interval_set]]]
+ [[classref boost::itl::separate_interval_set separate_interval_set]]
+ [[classref boost::itl::split_interval_set split_interval_set]]]
     [[map] [[classref boost::itl::interval_map interval_map]]
- []
- [[classref boost::itl::split_interval_map split_interval_map]]]
- [[] [Intervals are joined on overlap or touch\n(if associated values are equal).]
- [Intervals are joined on overlap, not on touch.]
- [Intervals are split on overlap.\nAll interval borders are preserved.]]
+ []
+ [[classref boost::itl::split_interval_map split_interval_map]]]
+ [[] [Intervals are joined on overlap or touch\n(if associated values are equal).]
+ [Intervals are joined on overlap, not on touch.]
+ [Intervals are split on overlap.\nAll interval borders are preserved.]]
 ]
 
 [table Interval combining styles by example
     [[] [joining] [separating] [splitting]]
     [[set] [[classref boost::itl::interval_set interval_set] /A/]
- [[classref boost::itl::separate_interval_set separate_interval_set] /B/]
- [[classref boost::itl::split_interval_set split_interval_set] /C/]]
-[[]
+ [[classref boost::itl::separate_interval_set separate_interval_set] /B/]
+ [[classref boost::itl::split_interval_set split_interval_set] /C/]]
+[[]
 [``
   {[1 3) }
 + [2 4)
@@ -244,10 +244,10 @@
 ]
 
     [[map] [[classref boost::itl::interval_map interval_map] /D/]
- []
- [[classref boost::itl::split_interval_map split_interval_map] /E/]]
+ []
+ [[classref boost::itl::split_interval_map split_interval_map] /E/]]
 
-[[]
+[[]
 [``
   {[1 3)->1 }
 + [2 4)->1

Modified: sandbox/itl/libs/itl/doc/projects.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/projects.qbk (original)
+++ sandbox/itl/libs/itl/doc/projects.qbk 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -23,10 +23,10 @@
 [section Overview]
 
 [table Overview over Icl Examples
- [[level] [example] [classes] [features]]
- [[basic] [[link boost_icl.examples.large_bitset Large Bitset]]
- [__itv_map__][The most simple application of an interval map:
- Counting the overlaps of added intervals.]]
+ [[level] [example] [classes] [features]]
+ [[basic] [[link boost_icl.examples.large_bitset Large Bitset]]
+ [__itv_map__][The most simple application of an interval map:
+ Counting the overlaps of added intervals.]]
 ]
 
 [endsect][/ Overview IN Projects]

Modified: sandbox/itl/libs/itl/doc/semantics.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/semantics.qbk (original)
+++ sandbox/itl/libs/itl/doc/semantics.qbk 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -305,7 +305,7 @@
 collect and concatenate
 `std::strings` associated to intervals,
 
-``
+``
 interval_map<int,std::string> cat_map;
 cat_map += make_pair(interval<int>::rightopen(1,5),std::string("Hello"));
 cat_map += make_pair(interval<int>::rightopen(3,7),std::string(" World"));

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 2010-10-17 07:16:46 EDT (Sun, 17 Oct 2010)
@@ -52,25 +52,25 @@
 
 BOOST_AUTO_TEST_CASE(intro_sample_42)
 {
- interval_set<int> mySet;
- mySet.insert(42);
- bool has_answer = contains(mySet, 42);
+ interval_set<int> mySet;
+ mySet.insert(42);
+ bool has_answer = contains(mySet, 42);
 }
 
 BOOST_AUTO_TEST_CASE(intro_sample_telecast)
 {
- // Switch on my favorite telecasts using an interval_set
- interval<int>::type news(2000, 2015);
- interval<int>::type talk_show(2245, 2330);
- interval_set<int> myTvProgram;
- myTvProgram.add(news).add(talk_show);
-
- // Iterating over elements (seconds) would be silly ...
- for(interval_set<int>::iterator telecast = myTvProgram.begin();
- telecast != myTvProgram.end(); ++telecast)
- //...so this iterates over intervals
- //TV.switch_on(*telecast);
- cout << *telecast;
+ // Switch on my favorite telecasts using an interval_set
+ interval<int>::type news(2000, 2015);
+ interval<int>::type talk_show(2245, 2330);
+ interval_set<int> myTvProgram;
+ myTvProgram.add(news).add(talk_show);
+
+ // Iterating over elements (seconds) would be silly ...
+ for(interval_set<int>::iterator telecast = myTvProgram.begin();
+ telecast != myTvProgram.end(); ++telecast)
+ //...so this iterates over intervals
+ //TV.switch_on(*telecast);
+ cout << *telecast;
 }
 
 


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