Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66435 - in trunk/libs/icl: . example example/boost_party_ example/custom_interval_ example/dynamic_interval_ example/interval_ example/interval_container_ example/itvset_shell_ example/large_bitset_ example/man_power_ example/month_and_week_grid_ example/overlap_counter_ example/party_ example/partys_height_average_ example/partys_tallest_guests_ example/splititvmap_shell_ example/static_interval_ example/std_copy_ example/std_transform_ example/user_groups_
From: afojgo_at_[hidden]
Date: 2010-11-07 11:55:14


Author: jofaber
Date: 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
New Revision: 66435
URL: http://svn.boost.org/trac/boost/changeset/66435

Log:
Boost.Icl version 4.0.0 initial import
Added:
   trunk/libs/icl/
   trunk/libs/icl/example/
   trunk/libs/icl/example/Jamfile.v2 (contents, props changed)
   trunk/libs/icl/example/boost_party_/
   trunk/libs/icl/example/boost_party_/Jamfile.v2 (contents, props changed)
   trunk/libs/icl/example/boost_party_/boost_party.cpp (contents, props changed)
   trunk/libs/icl/example/boost_party_/vc9_boost_party.vcproj (contents, props changed)
   trunk/libs/icl/example/custom_interval_/
   trunk/libs/icl/example/custom_interval_/Jamfile.v2 (contents, props changed)
   trunk/libs/icl/example/custom_interval_/custom_interval.cpp (contents, props changed)
   trunk/libs/icl/example/custom_interval_/vc9_custom_interval.vcproj (contents, props changed)
   trunk/libs/icl/example/dynamic_interval_/
   trunk/libs/icl/example/dynamic_interval_/dynamic_interval.cpp (contents, props changed)
   trunk/libs/icl/example/dynamic_interval_/vc9_dynamic_interval.vcproj (contents, props changed)
   trunk/libs/icl/example/interval_/
   trunk/libs/icl/example/interval_/interval.cpp (contents, props changed)
   trunk/libs/icl/example/interval_/vc9_interval.vcproj (contents, props changed)
   trunk/libs/icl/example/interval_container_/
   trunk/libs/icl/example/interval_container_/interval_container.cpp (contents, props changed)
   trunk/libs/icl/example/interval_container_/vc9_interval_container.vcproj (contents, props changed)
   trunk/libs/icl/example/itvset_shell_/
   trunk/libs/icl/example/itvset_shell_/itvset_shell.cpp (contents, props changed)
   trunk/libs/icl/example/itvset_shell_/vc9_itvset_shell.vcproj (contents, props changed)
   trunk/libs/icl/example/large_bitset_/
   trunk/libs/icl/example/large_bitset_/bits.hpp (contents, props changed)
   trunk/libs/icl/example/large_bitset_/large_bitset.cpp (contents, props changed)
   trunk/libs/icl/example/large_bitset_/large_bitset.hpp (contents, props changed)
   trunk/libs/icl/example/large_bitset_/meta_log.hpp (contents, props changed)
   trunk/libs/icl/example/large_bitset_/vc9_large_bitset.vcproj (contents, props changed)
   trunk/libs/icl/example/man_power_/
   trunk/libs/icl/example/man_power_/man_power.cpp (contents, props changed)
   trunk/libs/icl/example/man_power_/vc9_man_power.vcproj (contents, props changed)
   trunk/libs/icl/example/month_and_week_grid_/
   trunk/libs/icl/example/month_and_week_grid_/month_and_week_grid.cpp (contents, props changed)
   trunk/libs/icl/example/month_and_week_grid_/vc9_month_and_week_grid.vcproj (contents, props changed)
   trunk/libs/icl/example/overlap_counter_/
   trunk/libs/icl/example/overlap_counter_/overlap_counter.cpp (contents, props changed)
   trunk/libs/icl/example/overlap_counter_/vc9_overlap_counter.vcproj (contents, props changed)
   trunk/libs/icl/example/party_/
   trunk/libs/icl/example/party_/party.cpp (contents, props changed)
   trunk/libs/icl/example/party_/vc9_party.vcproj (contents, props changed)
   trunk/libs/icl/example/partys_height_average_/
   trunk/libs/icl/example/partys_height_average_/Jamfile.v2 (contents, props changed)
   trunk/libs/icl/example/partys_height_average_/partys_height_average.cpp (contents, props changed)
   trunk/libs/icl/example/partys_height_average_/vc9_partys_height_average.vcproj (contents, props changed)
   trunk/libs/icl/example/partys_tallest_guests_/
   trunk/libs/icl/example/partys_tallest_guests_/Jamfile.v2 (contents, props changed)
   trunk/libs/icl/example/partys_tallest_guests_/partys_tallest_guests.cpp (contents, props changed)
   trunk/libs/icl/example/partys_tallest_guests_/vc9_partys_tallest_guests.vcproj (contents, props changed)
   trunk/libs/icl/example/splititvmap_shell_/
   trunk/libs/icl/example/splititvmap_shell_/splititvmap_shell.cpp (contents, props changed)
   trunk/libs/icl/example/splititvmap_shell_/vc9_splititvmap_shell.vcproj (contents, props changed)
   trunk/libs/icl/example/static_interval_/
   trunk/libs/icl/example/static_interval_/static_interval.cpp (contents, props changed)
   trunk/libs/icl/example/static_interval_/vc9_static_interval.vcproj (contents, props changed)
   trunk/libs/icl/example/std_copy_/
   trunk/libs/icl/example/std_copy_/std_copy.cpp (contents, props changed)
   trunk/libs/icl/example/std_copy_/vc9_std_copy.vcproj (contents, props changed)
   trunk/libs/icl/example/std_transform_/
   trunk/libs/icl/example/std_transform_/std_transform.cpp (contents, props changed)
   trunk/libs/icl/example/std_transform_/vc9_std_transform.vcproj (contents, props changed)
   trunk/libs/icl/example/toytime.hpp (contents, props changed)
   trunk/libs/icl/example/user_groups_/
   trunk/libs/icl/example/user_groups_/user_groups.cpp (contents, props changed)
   trunk/libs/icl/example/user_groups_/vc9_user_groups.vcproj (contents, props changed)
   trunk/libs/icl/example/vc9_icl_examples.sln (contents, props changed)

Added: trunk/libs/icl/example/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/Jamfile.v2 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,159 @@
+# (C) Copyright 2008: 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 interval
+ :
+ interval_/interval.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe interval_container
+ :
+ interval_container_/interval_container.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe overlap_counter
+ :
+ overlap_counter_/overlap_counter.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe party
+ :
+ party_/party.cpp
+ :
+ <include>../../..
+ <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)
+ ;
+
+exe custom_interval
+ :
+ custom_interval_/custom_interval.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe dynamic_interval
+ :
+ dynamic_interval_/dynamic_interval.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe static_interval
+ :
+ static_interval_/static_interval.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+# Examples using boost_date_time
+exe boost_party
+ :
+ boost_party_/boost_party.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe partys_height_average
+ :
+ partys_height_average_/partys_height_average.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe partys_tallest_guests
+ :
+ partys_tallest_guests_/partys_tallest_guests.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe man_power
+ :
+ man_power_/man_power.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe month_and_week_grid
+ :
+ month_and_week_grid_/month_and_week_grid.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe user_groups
+ :
+ user_groups_/user_groups.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+# Projects
+exe large_bitset
+ :
+ large_bitset_/large_bitset.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+
+
+exe itvset_shell
+ :
+ itvset_shell_/itvset_shell.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+
+exe splititvmap_shell
+ :
+ splititvmap_shell_/splititvmap_shell.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;
+

Added: trunk/libs/icl/example/boost_party_/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/boost_party_/Jamfile.v2 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,12 @@
+# (C) Copyright 2008: 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)
+
+exe boost_party
+ :
+ boost_party.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;

Added: trunk/libs/icl/example/boost_party_/boost_party.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/boost_party_/boost_party.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,137 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+
+/** Example boost_party.cpp \file boost_party.cpp
+ \brief Generates an attendance history of a party by inserting into an interval_map.
+ Demonstrating <i>aggregate on overlap</i>.
+
+ boost_party.cpp demonstrates the possibilities of an interval map
+ (interval_map or split_interval_map). Boost::posix_time::ptime is used as time
+ parameter. An interval_map maps intervals to a given content. In this case the
+ content is a set of party guests represented by their name strings.
+
+ As time goes by, groups of people join the party and leave later in the evening.
+ So we add a time interval and a name set to the interval_map for the attendance
+ of each group of people, that come together and leave together.
+
+ On every overlap of intervals, the corresponding name sets are accumulated. At
+ the points of overlap the intervals are split. The accumulation of content on
+ overlap of intervals is done via an operator += that has to be implemented
+ for the content parameter of the interval_map.
+
+ Finally the interval_map contains the history of attendance and all points in
+ time, where the group of party guests changed.
+
+ boost_party.cpp demonstrates a principle that we call
+ <b><em>aggregate on overlap (aggrovering;)</em></b>:
+ On insertion a value associated to the interval is aggregated (added) to those
+ values in the interval_map that overlap with the inserted value.
+
+ There are two behavioral aspects to <b>aggrovering</b>: a <em>decompositional
+ behavior</em> and a <em>accumulative behavior</em>.
+
+ The <em>decompositional behavior</em> splits up intervals on the time dimension of the
+ interval_map so that the intervals change whenever associated values
+ change.
+
+ The <em>accumulative behavior</em> accumulates associated values on every overlap of
+ an insertion for the associated values.
+
+ \include boost_party_/boost_party.cpp
+*/
+//[example_boost_party
+// The next line includes <boost/date_time/posix_time/posix_time.hpp>
+// and a few lines of adapter code.
+#include <boost/icl/ptime.hpp>
+#include <iostream>
+#include <boost/icl/interval_map.hpp>
+
+using namespace std;
+using namespace boost::posix_time;
+using namespace boost::icl;
+
+// Type set<string> collects the names of party guests. Since std::set is
+// a model of the itl's set concept, the concept provides an operator +=
+// that performs a set union on overlap of intervals.
+typedef std::set<string> GuestSetT;
+
+void boost_party()
+{
+ GuestSetT mary_harry;
+ mary_harry.insert("Mary");
+ mary_harry.insert("Harry");
+
+ GuestSetT diana_susan;
+ diana_susan.insert("Diana");
+ diana_susan.insert("Susan");
+
+ GuestSetT peter;
+ peter.insert("Peter");
+
+ // A party is an interval map that maps time intervals to sets of guests
+ interval_map<ptime, GuestSetT> party;
+
+ party.add( // add and element
+ make_pair(
+ interval<ptime>::right_open(
+ time_from_string("2008-05-20 19:30"),
+ time_from_string("2008-05-20 23:00")),
+ mary_harry));
+
+ party += // element addition can also be done via operator +=
+ make_pair(
+ interval<ptime>::right_open(
+ time_from_string("2008-05-20 20:10"),
+ time_from_string("2008-05-21 00:00")),
+ diana_susan);
+
+ party +=
+ make_pair(
+ interval<ptime>::right_open(
+ time_from_string("2008-05-20 22:15"),
+ time_from_string("2008-05-21 00:30")),
+ peter);
+
+
+ interval_map<ptime, GuestSetT>::iterator it = party.begin();
+ cout << "----- History of party guests -------------------------\n";
+ while(it != party.end())
+ {
+ interval<ptime>::type when = it->first;
+ // Who is at the party within the time interval 'when' ?
+ GuestSetT who = (*it++).second;
+ cout << when << ": " << who << endl;
+ }
+
+}
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample boost_party.cpp <<\n";
+ cout << "-------------------------------------------------------\n";
+ boost_party();
+ return 0;
+}
+
+// Program output:
+/*-----------------------------------------------------------------------------
+>>Interval Container Library: Sample boost_party.cpp <<
+-------------------------------------------------------
+----- History of party guests -------------------------
+[2008-May-20 19:30:00, 2008-May-20 20:10:00): Harry Mary
+[2008-May-20 20:10:00, 2008-May-20 22:15:00): Diana Harry Mary Susan
+[2008-May-20 22:15:00, 2008-May-20 23:00:00): Diana Harry Mary Peter Susan
+[2008-May-20 23:00:00, 2008-May-21 00:00:00): Diana Peter Susan
+[2008-May-21 00:00:00, 2008-May-21 00:30:00): Peter
+-----------------------------------------------------------------------------*/
+//]
+

Added: trunk/libs/icl/example/boost_party_/vc9_boost_party.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/boost_party_/vc9_boost_party.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_boost_party"
+ ProjectGUID="{0D1DB87E-E72A-4FE9-A067-1907CC6613F8}"
+ RootNamespace="Boost_party"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\boost_party.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/custom_interval_/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/custom_interval_/Jamfile.v2 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,11 @@
+# (C) Copyright 2010: 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)
+
+exe custom_interval
+ :
+ custom_interval.cpp
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;

Added: trunk/libs/icl/example/custom_interval_/custom_interval.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/custom_interval_/custom_interval.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,103 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2010: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+
+/** Example custom_interval.cpp \file custom_interval.cpp
+ \brief Shows how to use interval containers with own interval classes.
+
+ There may be instances, where we want to use interval container with our
+ own user defined interval classes. Boost interval containers can be adapted
+ to your interval class by partial template specialisation. Only a few lines
+ of code are needed to achieve this.
+
+ \include custom_interval_/custom_interval.cpp
+*/
+//[example_custom_interval
+#include <iostream>
+#include <boost/icl/interval_set.hpp>
+
+using namespace std;
+using namespace boost::icl;
+
+// Here is a typical class that may model intervals in your application.
+class MyInterval
+{
+public:
+ MyInterval(): _first(), _past(){}
+ MyInterval(int lo, int up): _first(lo), _past(up){}
+ int first()const{ return _first; }
+ int past ()const{ return _past; }
+private:
+ int _first, _past;
+};
+
+namespace boost{ namespace icl
+{
+// Class template interval_traits serves as adapter to register and customize your interval class
+template<>
+struct interval_traits< MyInterval > //1. Partially specialize interval_traits for
+{ // your class MyInterval
+ //2. Define associated types
+ typedef MyInterval interval_type; //2.1 MyInterval will be the interval_type
+ typedef int domain_type; //2.2 The elements of the domain are ints
+ typedef std::less<int> domain_compare; //2.3 This is the way our element shall be ordered.
+ //3. Next we define the essential functions
+ // of the specialisation
+ //3.1 Construction of intervals
+ static interval_type construct(const domain_type& lo, const domain_type& up)
+ { return interval_type(lo, up); }
+ //3.2 Selection of values
+ static domain_type lower(const interval_type& inter_val){ return inter_val.first(); };
+ static domain_type upper(const interval_type& inter_val){ return inter_val.past(); };
+};
+
+template<>
+struct interval_bound_type<MyInterval> //4. Finally we define the interval borders.
+{ // Choose between static_open (lo..up)
+ typedef interval_bound_type type; // static_left_open (lo..up]
+ BOOST_STATIC_CONSTANT(bound_type, value = interval_bounds::static_right_open);//[lo..up)
+}; // and static_closed [lo..up]
+
+}} // namespace boost icl
+
+void custom_interval()
+{
+ // Now we can use class MyInterval with interval containers:
+ typedef interval_set<int, std::less, MyInterval> MyIntervalSet;
+ MyIntervalSet mySet;
+ mySet += MyInterval(1,9);
+ cout << mySet << endl;
+ mySet.subtract(3) -= 6;
+ cout << mySet << " subtracted 3 and 6\n";
+ mySet ^= MyInterval(2,8);
+ cout << mySet << " flipped between 2 and 7\n";
+}
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample custom_interval.cpp <<\n";
+ cout << "-----------------------------------------------------------\n";
+ cout << "This program uses a user defined interval class:\n";
+ custom_interval();
+ return 0;
+}
+
+// Program output:
+/*-----------------------------------------------------------------------------
+>>Interval Container Library: Sample custom_interval.cpp <<
+-----------------------------------------------------------
+This program uses a user defined interval class:
+{[1, 9)}
+{[1, 3) [4, 6) [7, 9)} subtracted 3 and 6
+{[1,2) [3,4) [6,7) [8,9)} flipped between 2 and 7
+-----------------------------------------------------------------------------*/
+//]
+

Added: trunk/libs/icl/example/custom_interval_/vc9_custom_interval.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/custom_interval_/vc9_custom_interval.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_custom_interval"
+ ProjectGUID="{0D1DB87E-E72A-4FE9-A067-1907CC6614F8}"
+ RootNamespace="Custom_interval"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\custom_interval.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/dynamic_interval_/dynamic_interval.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/dynamic_interval_/dynamic_interval.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,140 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2010: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example dynamic_interval.cpp \file dynamic_interval.cpp
+ \brief Intervals with dynamic interval bounds that can be changed at runtime.
+
+ Intervals types with dynamic interval bounds can represent closed and
+ open interval borders. Interval borders are not static or fixed for
+ the type but may change due to computations in interval containers.
+ Dynamically bounded intervals are the library default for interval
+ parameters in interval containers.
+
+ \include dynamic_interval_/dynamic_interval.cpp
+*/
+//[example_dynamic_interval
+#include <iostream>
+#include <string>
+#include <math.h>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/icl/interval_set.hpp>
+#include <boost/icl/split_interval_set.hpp>
+// Dynamically bounded intervals 'discrete_interval' and 'continuous_interval'
+// are indirectly included via interval containers as library defaults.
+#include "../toytime.hpp"
+#include <boost/icl/rational.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::icl;
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample interval.cpp <<\n";
+ cout << "----------------------------------------------------\n";
+
+ // Dynamically bounded intervals are the library default for
+ // interval parameters in interval containers.
+ BOOST_STATIC_ASSERT((
+ boost::is_same< interval_set<int>::interval_type
+ , discrete_interval<int> >::value
+ ));
+
+
+ BOOST_STATIC_ASSERT((
+ boost::is_same< interval_set<float>::interval_type
+ , continuous_interval<float> >::value
+ ));
+
+ // As we can see the library default chooses the appropriate
+ // class template instance discrete_interval<T> or continuous_interval<T>
+ // dependent on the domain_type T. The library default for intervals
+ // is also available via the template 'interval':
+ BOOST_STATIC_ASSERT((
+ boost::is_same< interval<int>::type
+ , discrete_interval<int> >::value
+ ));
+
+ BOOST_STATIC_ASSERT((
+ boost::is_same< interval<float>::type
+ , continuous_interval<float> >::value
+ ));
+
+ // template interval also provides static functions for the four border types
+
+ interval<int>::type int_interval = interval<int>::closed(3, 7);
+ interval<double>::type sqrt_interval = interval<double>::right_open(1/sqrt(2.0), sqrt(2.0));
+ interval<string>::type city_interval = interval<string>::left_open("Barcelona", "Boston");
+ interval<Time>::type time_interval = interval<Time>::open(Time(monday,8,30), Time(monday,17,20));
+
+ cout << "----- Dynamically bounded intervals ----------------------------------------\n";
+ cout << " discrete_interval<int> : " << int_interval << endl;
+ cout << "continuous_interval<double>: " << sqrt_interval << " does "
+ << string(contains(sqrt_interval, sqrt(2.0))?"":"NOT")
+ << " contain sqrt(2)" << endl;
+ cout << "continuous_interval<string>: " << city_interval << " does "
+ << string(contains(city_interval,"Barcelona")?"":"NOT")
+ << " contain 'Barcelona'" << endl;
+ cout << "continuous_interval<string>: " << city_interval << " does "
+ << string(contains(city_interval, "Berlin")?"":"NOT")
+ << " contain 'Berlin'" << endl;
+ cout << " discrete_interval<Time> : " << time_interval << "\n\n";
+
+ // Using dynamically bounded intervals allows to apply operations
+ // with intervals and also with elements on all interval containers
+ // including interval containers of continuous domain types:
+
+ interval<rational<int> >::type unit_interval
+ = interval<rational<int> >::right_open(rational<int>(0), rational<int>(1));
+ interval_set<rational<int> > unit_set(unit_interval);
+ interval_set<rational<int> > ratio_set(unit_set);
+ ratio_set -= rational<int>(1,3); // Subtract 1/3 from the set
+
+ cout << "----- Manipulation of single values in continuous sets ---------------------\n";
+ cout << "1/3 subtracted from [0..1) : " << ratio_set << endl;
+ cout << "The set does " << string(contains(ratio_set, rational<int>(1,3))?"":"NOT")
+ << " contain '1/3'" << endl;
+ ratio_set ^= unit_set;
+ cout << "Flipping the holey set : " << ratio_set << endl;
+ cout << "yields the subtracted : 1/3\n\n";
+
+ // Of course we can use interval types that are different from the
+ // library default by explicit instantiation:
+ split_interval_set<int, std::less, closed_interval<Time> > intuitive_times;
+ // Interval set 'intuitive_times' uses statically bounded closed intervals
+ intuitive_times += closed_interval<Time>(Time(monday, 9,00), Time(monday, 10,59));
+ intuitive_times += closed_interval<Time>(Time(monday, 10,00), Time(monday, 11,59));
+ cout << "----- Here we are NOT using the library default for intervals --------------\n";
+ cout << intuitive_times << endl;
+
+ return 0;
+}
+
+// Program output:
+//>>Interval Container Library: Sample interval.cpp <<
+//----------------------------------------------------
+//----- Dynamically bounded intervals ----------------------------------------
+// discrete_interval<int> : [3,7]
+//continuous_interval<double>: [0.707107,1.41421) does NOT contain sqrt(2)
+//continuous_interval<string>: (Barcelona,Boston] does NOT contain 'Barcelona'
+//continuous_interval<string>: (Barcelona,Boston] does contain 'Berlin'
+// discrete_interval<Time> : (mon:08:30,mon:17:20)
+//
+//----- Manipulation of single values in continuous sets ---------------------
+//1/3 subtracted from [0..1) : {[0/1,1/3)(1/3,1/1)}
+//The set does NOT contain '1/3'
+//Flipping the holey set : {[1/3,1/3]}
+//yields the subtracted : 1/3
+//
+//----- Here we are NOT using the library default for intervals --------------
+//{[mon:09:00,mon:09:59][mon:10:00,mon:10:59][mon:11:00,mon:11:59]}
+//]
+

Added: trunk/libs/icl/example/dynamic_interval_/vc9_dynamic_interval.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/dynamic_interval_/vc9_dynamic_interval.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_dynamic_interval"
+ ProjectGUID="{EE61B7EF-EC45-4165-8B49-FD5B7D3A9F7C}"
+ RootNamespace="Dynamic_interval"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\dynamic_interval.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\dynamic_interval.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/interval_/interval.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/interval_/interval.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,111 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2010: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example interval.cpp \file interval.cpp
+ \brief Intervals for integral and continuous instance types.
+ Closed and open interval borders.
+
+ Much of the library code deals with intervals which are implemented
+ by interval class templates. This program gives a very short samlpe of
+ different interval instances.
+
+ \include interval_/interval.cpp
+*/
+//[example_interval
+#include <iostream>
+#include <string>
+#include <math.h>
+
+// Dynamically bounded intervals
+#include <boost/icl/discrete_interval.hpp>
+#include <boost/icl/continuous_interval.hpp>
+
+// Statically bounded intervals
+#include <boost/icl/right_open_interval.hpp>
+#include <boost/icl/left_open_interval.hpp>
+#include <boost/icl/closed_interval.hpp>
+#include <boost/icl/open_interval.hpp>
+
+#include "../toytime.hpp"
+#include <boost/icl/rational.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::icl;
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample interval.cpp <<\n";
+ cout << "----------------------------------------------------\n";
+
+ // Class template discrete_interval can be used for discrete data types
+ // like integers, date and time and other types that have a least steppable
+ // unit.
+ discrete_interval<int> int_interval
+ = construct<discrete_interval<int> >(3, 7, interval_bounds::closed());
+
+ // Class template continuous_interval can be used for continuous data types
+ // like double, boost::rational or strings.
+ continuous_interval<double> sqrt_interval
+ = construct<continuous_interval<double> >(1/sqrt(2.0), sqrt(2.0));
+ //interval_bounds::right_open() is default
+ continuous_interval<string> city_interval
+ = construct<continuous_interval<string> >("Barcelona", "Boston", interval_bounds::left_open());
+
+ discrete_interval<Time> time_interval
+ = construct<discrete_interval<Time> >(Time(monday,8,30), Time(monday,17,20),
+ interval_bounds::open());
+
+ cout << "Dynamically bounded intervals:\n";
+ cout << " discrete_interval<int>: " << int_interval << endl;
+ cout << "continuous_interval<double>: " << sqrt_interval << " does "
+ << string(contains(sqrt_interval, sqrt(2.0))?"":"NOT")
+ << " contain sqrt(2)" << endl;
+ cout << "continuous_interval<string>: " << city_interval << " does "
+ << string(contains(city_interval,"Barcelona")?"":"NOT")
+ << " contain 'Barcelona'" << endl;
+ cout << "continuous_interval<string>: " << city_interval << " does "
+ << string(contains(city_interval, "Berlin")?"":"NOT")
+ << " contain 'Berlin'" << endl;
+ cout << " discrete_interval<Time>: " << time_interval << "\n\n";
+
+ // There are statically bounded interval types with fixed interval borders
+ right_open_interval<string> fix_interval1; // You will probably use one kind of static intervals
+ // right_open_intervals are recommended.
+ closed_interval<unsigned int> fix_interval2; // ... static closed, left_open and open intervals
+ left_open_interval<float> fix_interval3; // are implemented for sake of completeness but
+ open_interval<short> fix_interval4; // are of minor practical importance.
+
+ right_open_interval<rational<int> > range1(rational<int>(0,1), rational<int>(2,3));
+ right_open_interval<rational<int> > range2(rational<int>(1,3), rational<int>(1,1));
+
+ // This middle third of the unit interval [0,1)
+ cout << "Statically bounded interval:\n";
+ cout << "right_open_interval<rational<int>>: " << (range1 & range2) << endl;
+
+ return 0;
+}
+
+// Program output:
+
+//>>Interval Container Library: Sample interval.cpp <<
+//----------------------------------------------------
+//Dynamically bounded intervals
+// discrete_interval<int>: [3,7]
+//continuous_interval<double>: [0.707107,1.41421) does NOT contain sqrt(2)
+//continuous_interval<string>: (Barcelona,Boston] does NOT contain 'Barcelona'
+//continuous_interval<string>: (Barcelona,Boston] does contain 'Berlin'
+// discrete_interval<Time>: (mon:08:30,mon:17:20)
+//
+//Statically bounded interval
+//right_open_interval<rational<int>>: [1/3,2/3)
+
+//]
+

Added: trunk/libs/icl/example/interval_/vc9_interval.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/interval_/vc9_interval.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_interval"
+ ProjectGUID="{EE61B7EF-EC45-4165-8B49-FD5B7D2A9F7C}"
+ RootNamespace="Interval"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\interval.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/interval_container_/interval_container.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/interval_container_/interval_container.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,107 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example interval_container.cpp \file interval_container.cpp
+
+ \brief Demonstrates basic characteristics of interval container objects.
+
+ \include interval_container_/interval_container.cpp
+*/
+//[example_interval_container
+#include <iostream>
+#include <boost/icl/interval_set.hpp>
+#include <boost/icl/separate_interval_set.hpp>
+#include <boost/icl/split_interval_set.hpp>
+#include <boost/icl/split_interval_map.hpp>
+#include "../toytime.hpp"
+
+using namespace std;
+using namespace boost::icl;
+
+void interval_container_basics()
+{
+ interval<Time>::type night_and_day(Time(monday, 20,00), Time(tuesday, 20,00));
+ interval<Time>::type day_and_night(Time(tuesday, 7,00), Time(wednesday, 7,00));
+ interval<Time>::type next_morning(Time(wednesday, 7,00), Time(wednesday,10,00));
+ interval<Time>::type next_evening(Time(wednesday,18,00), Time(wednesday,21,00));
+
+ // An interval set of type interval_set joins intervals that that overlap or touch each other.
+ interval_set<Time> joinedTimes;
+ joinedTimes.insert(night_and_day);
+ joinedTimes.insert(day_and_night); //overlapping in 'day' [07:00, 20.00)
+ joinedTimes.insert(next_morning); //touching
+ joinedTimes.insert(next_evening); //disjoint
+
+ cout << "Joined times :" << joinedTimes << endl;
+
+ // A separate interval set of type separate_interval_set joins intervals that that
+ // overlap but it preserves interval borders that just touch each other. You may
+ // represent time grids like the months of a year as a split_interval_set.
+ separate_interval_set<Time> separateTimes;
+ separateTimes.insert(night_and_day);
+ separateTimes.insert(day_and_night); //overlapping in 'day' [07:00, 20.00)
+ separateTimes.insert(next_morning); //touching
+ separateTimes.insert(next_evening); //disjoint
+
+ cout << "Separate times:" << separateTimes << endl;
+
+ // A split interval set of type split_interval_set preserves all interval
+ // borders. On insertion of overlapping intervals the intervals in the
+ // set are split up at the interval borders of the inserted interval.
+ split_interval_set<Time> splitTimes;
+ splitTimes += night_and_day;
+ splitTimes += day_and_night; //overlapping in 'day' [07:00, 20:00)
+ splitTimes += next_morning; //touching
+ splitTimes += next_evening; //disjoint
+
+ cout << "Split times :\n" << splitTimes << endl;
+
+ // A split interval map splits up inserted intervals on overlap and aggregates the
+ // associated quantities via the operator +=
+ split_interval_map<Time, int> overlapCounter;
+ overlapCounter += make_pair(night_and_day,1);
+ overlapCounter += make_pair(day_and_night,1); //overlapping in 'day' [07:00, 20.00)
+ overlapCounter += make_pair(next_morning, 1); //touching
+ overlapCounter += make_pair(next_evening, 1); //disjoint
+
+ cout << "Split times overlap counted:\n" << overlapCounter << endl;
+
+ // An interval map joins touching intervals, if associated values are equal
+ interval_map<Time, int> joiningOverlapCounter;
+ joiningOverlapCounter = overlapCounter;
+ cout << "Times overlap counted:\n" << joiningOverlapCounter << endl;
+}
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample interval_container.cpp <<\n";
+ cout << "--------------------------------------------------------------\n";
+ interval_container_basics();
+ return 0;
+}
+
+
+// Program output:
+/* ----------------------------------------------------------------------------
+>>Interval Container Library: Sample interval_container.cpp <<
+--------------------------------------------------------------
+Joined times :[mon:20:00,wed:10:00)[wed:18:00,wed:21:00)
+Separate times:[mon:20:00,wed:07:00)[wed:07:00,wed:10:00)[wed:18:00,wed:21:00)
+Split times :
+[mon:20:00,tue:07:00)[tue:07:00,tue:20:00)[tue:20:00,wed:07:00)
+[wed:07:00,wed:10:00)[wed:18:00,wed:21:00)
+Split times overlap counted:
+{([mon:20:00,tue:07:00)->1)([tue:07:00,tue:20:00)->2)([tue:20:00,wed:07:00)->1)
+([wed:07:00,wed:10:00)->1)([wed:18:00,wed:21:00)->1)}
+Times overlap counted:
+{([mon:20:00,tue:07:00)->1)([tue:07:00,tue:20:00)->2)([tue:20:00,wed:10:00)->1)
+([wed:18:00,wed:21:00)->1)}
+-----------------------------------------------------------------------------*/
+//]

Added: trunk/libs/icl/example/interval_container_/vc9_interval_container.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/interval_container_/vc9_interval_container.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_interval_container"
+ ProjectGUID="{278324CE-9EC1-4D16-B637-E91A07F9DD81}"
+ RootNamespace="interval_container"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\interval_container.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\separate_interval_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\split_interval_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\split_interval_set.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/itvset_shell_/itvset_shell.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/itvset_shell_/itvset_shell.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,132 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2007-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------+
+itvset_shell.cpp provides a simple test shells for interval sets.
+The shell also gives you a good idea how interval container are working.
++-----------------------------------------------------------------------------*/
+#include <iostream>
+
+#include <boost/icl/split_interval_set.hpp>
+#include <boost/icl/split_interval_map.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::icl;
+
+void instructions()
+{
+ cout << "+++++ Test shell for interval set +++++\n";
+ cout << "Type: q e or 0 to quit\n";
+ cout << "Type: + for insertions\n";
+ cout << "Type: - for subtraction\n";
+ cout << "Type: j to join contiguous intervals\n";
+ cout << "Type: s to compute total size\n";
+}
+
+void wrongInput()
+{
+ cout << "Wrong Input ------------------\n";
+ instructions();
+}
+
+
+template <class SetTV>
+void setTestShell()
+{
+ SetTV m1;
+
+ try {
+ char cmd = 'b';
+ typename SetTV::domain_type lwb = typename SetTV::domain_type();
+ typename SetTV::domain_type upb = typename SetTV::domain_type();
+
+ instructions();
+
+ for(;;)
+ {
+ cout << "> ";
+ cin >> cmd ;
+
+ switch(cmd)
+ {
+ case 'q':
+ case 'e':
+ case '0': cout << "good bye\n"; return;
+ case '+':
+ {
+ cout << "input: lwb upb >> ";
+ cin >> lwb >> upb;
+ typename SetTV::interval_type itv
+ = typename SetTV::interval_type(lwb,upb);
+ // SetTV::IntervalTD itv = rightOpenInterval(lwb,upb);
+ m1.insert(itv);
+
+ cout << "+" << itv << " =" << endl;
+ cout << "{" << m1 << "}" << endl;
+
+ }
+ break;
+ case '-':
+ {
+ cout << "input: lwb upb >> ";
+ cin >> lwb >> upb;
+ typename SetTV::interval_type itv
+ = typename SetTV::interval_type(lwb,upb);
+ // m1.subtract(itv);
+ SetTV tmp;
+ tmp.insert(itv);
+ m1 -= tmp;
+
+ cout << "-" << itv << " =" << endl;
+ cout << "{" << m1 << "}" << endl;
+
+ }
+ break;
+ case 'j':
+ {
+ icl::join(m1);
+ cout << "{" << m1 << "}" << endl;
+ }
+ break;
+ case 's':
+ {
+ cout << "size = " << m1.size() << endl;
+ }
+ break;
+
+ default: wrongInput();
+ }
+ }
+
+ }
+ catch (exception& e)
+ {
+ cout << "itvset_shell: exception caught: " << endl
+ << e.what() << endl;
+ }
+ catch (...)
+ {
+ cout << "itvset_shell: unknown exception caught" << endl;
+ }
+}
+
+
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Test itvset_shell.cpp <<\n";
+ cout << "------------------------------------------------------\n";
+ setTestShell< interval_set<int> >();
+
+ return 0;
+}
+

Added: trunk/libs/icl/example/itvset_shell_/vc9_itvset_shell.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/itvset_shell_/vc9_itvset_shell.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_itvset_shell"
+ ProjectGUID="{FC32CF3E-293A-4576-A5C2-9373AECAF5BB}"
+ RootNamespace="vc9_itvset_shell"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\itvset_shell.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_set.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/large_bitset_/bits.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/large_bitset_/bits.hpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,77 @@
+/*-----------------------------------------------------------------------------+
+Author: Joachim Faulhaber
+Copyright (c) 2009-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_LIBS_ICL_EXAMPLE_LARGE_BITSET_BITS_HPP_JOFA_091019
+#define BOOST_LIBS_ICL_EXAMPLE_LARGE_BITSET_BITS_HPP_JOFA_091019
+//[mini_bits_includes
+ // These includes are needed ...
+#include <string> // for conversion to output and to
+#include <boost/icl/type_traits/has_set_semantics.hpp>//declare that bits has the
+ // behavior of a set.
+//]
+
+namespace mini
+{
+//[mini_bits_class_bits
+template<class NaturalT> class bits
+{
+public:
+ typedef NaturalT word_type;
+ static const int digits = std::numeric_limits<NaturalT>::digits;
+ static const word_type w1 = static_cast<NaturalT>(1) ;
+
+ bits():_bits(){}
+ explicit bits(word_type value):_bits(value){}
+
+ word_type word()const{ return _bits; }
+ bits& operator |= (const bits& value){_bits |= value._bits; return *this;}
+ bits& operator &= (const bits& value){_bits &= value._bits; return *this;}
+ bits& operator ^= (const bits& value){_bits ^= value._bits; return *this;}
+ bits operator ~ ()const { return bits(~_bits); }
+ bool operator < (const bits& value)const{return _bits < value._bits;}
+ bool operator == (const bits& value)const{return _bits == value._bits;}
+
+ bool contains(word_type element)const{ return ((w1 << element) & _bits) != 0; }
+ std::string as_string(const char off_on[2] = " 1")const;
+
+private:
+ word_type _bits;
+};
+//]
+
+template<class NaturalT>
+std::string bits<NaturalT>::as_string(const char off_on[2])const
+{
+ std::string sequence;
+ for(int bit=0; bit < digits; bit++)
+ sequence += contains(bit) ? off_on[1] : off_on[0];
+ return sequence;
+}
+
+} // mini
+
+//[mini_bits_is_set
+namespace boost { namespace icl
+{
+ template<class NaturalT>
+ struct is_set<mini::bits<NaturalT> >
+ {
+ typedef is_set<mini::bits<NaturalT> > type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<class NaturalT>
+ struct has_set_semantics<mini::bits<NaturalT> >
+ {
+ typedef has_set_semantics<mini::bits<NaturalT> > type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+}}
+//]
+
+#endif

Added: trunk/libs/icl/example/large_bitset_/large_bitset.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/large_bitset_/large_bitset.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,168 @@
+/*-----------------------------------------------------------------------------+
+Author: Joachim Faulhaber
+Copyright (c) 2009-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example large_bitset.cpp \file large_bitset.cpp
+ \brief Shows a bitset class that combines interval and bitset compression
+ in order to represent very large bitsets efficiently.
+
+ Example large_bitset.cpp demonstrates the usage of a large_bitset class
+ template that is implemented as an interval_map of bitsets. The idea is
+ to combine interval compression and bitset compression. Large uninterrupted
+ runs of bits are represented by intervals (interval compression). Local
+ nests of varying bitsequences are represented by associated bitests
+ (bitset compression).
+
+ Find a commented sample implementation in the boost book documentation
+ <a href="http://www.joachim-faulhaber.de/boost_itl/doc/libs/icl/doc/html/boost_itl/projects.html#boost_itl.projects.large_bitset">
+ here</a>.
+
+ \include large_bitset_/large_bitset.cpp
+*/
+#if defined(_MSC_VER)
+#pragma warning(disable:4244) // Msvc warns on some operations that are needed
+#pragma warning(disable:4245) // in this example - we're working on bit level.
+#endif // So we intentionally disable them.
+
+//[large_bitset_cpp_includes
+#include <limits>
+#include "large_bitset.hpp"
+
+using namespace std;
+using namespace boost;
+using namespace boost::icl;
+using namespace mini;
+//]
+
+
+//[large_bitset_test_large_set_all
+void test_large()
+{
+ const nat64 much = 0xffffffffffffffffull;
+ large_bitset<> venti; // ... the largest, I can think of ;)
+ venti += discrete_interval<nat64>(0, much);
+
+ cout << "----- Test function test_large() -----------------------------------------------\n";
+ cout << "We have just turned on the awesome amount of 18,446,744,073,709,551,616 bits ;-)\n";
+ venti.show_segments();
+ //]
+
+ //[large_bitset_test_large_erase_last
+ cout << "---- Let's swich off the very last bit -----------------------------------------\n";
+ venti -= much;
+ venti.show_segments();
+
+ cout << "---- Venti is plenty ... let's do something small: A tall ----------------------\n\n";
+}
+//]
+
+//[large_bitset_test_small
+void test_small()
+{
+ large_bitset<nat32, bits8> tall; // small is tall ...
+ // ... because even this 'small' large_bitset
+ // can represent up to 2^32 == 4,294,967,296 bits.
+
+ cout << "----- Test function test_small() -----------\n";
+ cout << "-- Switch on all bits in range [0,64] ------\n";
+ tall += discrete_interval<nat>(0, 64);
+ tall.show_segments();
+ cout << "--------------------------------------------\n";
+
+ cout << "-- Turn off bits: 25,27,28 -----------------\n";
+
+ (((tall -= 25) -= 27) -= 28) ;
+ tall.show_segments();
+ cout << "--------------------------------------------\n";
+
+ cout << "-- Flip bits in range [24,30) --------------\n";
+ tall ^= discrete_interval<nat>::right_open(24,30);
+ tall.show_segments();
+ cout << "--------------------------------------------\n";
+
+ cout << "-- Remove the first 10 bits ----------------\n";
+ tall -= discrete_interval<nat>::right_open(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";
+
+}
+//]
+
+//[large_bitset_test_picturesque
+void test_picturesque()
+{
+ typedef large_bitset<nat, bits8> Bit8Set;
+
+ Bit8Set square, stare;
+ square += discrete_interval<nat>(0,8);
+ for(int i=1; i<5; i++)
+ {
+ square += 8*i;
+ square += 8*i+7;
+ }
+
+ square += discrete_interval<nat>(41,47);
+
+ cout << "----- Test function test_picturesque() -----\n";
+ cout << "-------- empty face: "
+ << square.interval_count() << " intervals -----\n";
+ square.show_matrix(" *");
+
+ stare += 18; stare += 21;
+ stare += discrete_interval<nat>(34,38);
+
+ cout << "-------- compressed smile: "
+ << stare.interval_count() << " intervals -----\n";
+ stare.show_matrix(" *");
+
+ cout << "-------- staring bitset: "
+ << (square + stare).interval_count() << " intervals -----\n";
+ (square + stare).show_matrix(" *");
+
+ cout << "--------------------------------------------\n";
+}
+//]
+
+template<class NatT, class BitsT>
+void test_set()
+{
+ const NatT much = (numeric_limits<NatT>::max)();
+
+ large_bitset<NatT, BitsT> venti; //the largest, I can think of
+ venti += discrete_interval<NatT>(0, much);
+
+ cout << "--------------------------------------------------------------------------------\n";
+ venti.show_segments();
+
+ venti -= much;
+ cout << "--------------------------------------------------------------------------------\n";
+ venti.show_segments();
+}
+
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample large_bitset.cpp <<\n";
+ cout << "--------------------------------------------------------\n";
+ test_large();
+ test_small();
+ test_picturesque();
+ //test_set<nat64,bits64>();
+ return 0;
+}
+

Added: trunk/libs/icl/example/large_bitset_/large_bitset.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/large_bitset_/large_bitset.hpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,210 @@
+/*-----------------------------------------------------------------------------+
+Author: Joachim Faulhaber
+Copyright (c) 2009-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_LIBS_ICL_EXAMPLE_LARGE_BITSET__LARGE_BITSET_HPP_JOFA_091019
+#define BOOST_LIBS_ICL_EXAMPLE_LARGE_BITSET__LARGE_BITSET_HPP_JOFA_091019
+
+//[large_bitset_includes
+#include <iostream> // to organize output
+#include <limits> // limits and associated constants
+#include <boost/operators.hpp> // to define operators with minimal effort
+#include "meta_log.hpp" // a meta logarithm
+#include "bits.hpp" // a minimal bitset implementation
+#include <boost/icl/interval_map.hpp> // base of large bitsets
+
+namespace mini // minimal implementations for example projects
+{
+//]
+
+//[large_bitset_natural_typedefs
+typedef unsigned char nat8; // nati i: number bits
+typedef unsigned short nat16;
+typedef unsigned long nat32;
+typedef unsigned long long nat64;
+typedef unsigned long nat;
+
+typedef bits<nat8> bits8;
+typedef bits<nat16> bits16;
+typedef bits<nat32> bits32;
+typedef bits<nat64> bits64;
+//]
+
+//[large_bitset_class_template_header
+template
+<
+ typename DomainT = nat64,
+ typename BitSetT = bits64,
+ ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, DomainT),
+ ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, DomainT, Compare),
+ ICL_ALLOC Alloc = std::allocator
+>
+class large_bitset
+ : boost::equality_comparable < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>
+ , boost::less_than_comparable< large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>
+
+ , boost::addable < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>
+ , boost::orable < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>
+ , boost::subtractable < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>
+ , boost::andable < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>
+ , boost::xorable < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>
+
+ , boost::addable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, DomainT
+ , boost::orable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, DomainT
+ , boost::subtractable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, DomainT
+ , boost::andable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, DomainT
+ , boost::xorable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, DomainT
+
+ , boost::addable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, ICL_INTERVAL_TYPE(Interval,DomainT,Compare)
+ , boost::orable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, ICL_INTERVAL_TYPE(Interval,DomainT,Compare)
+ , boost::subtractable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, ICL_INTERVAL_TYPE(Interval,DomainT,Compare)
+ , boost::andable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, ICL_INTERVAL_TYPE(Interval,DomainT,Compare)
+ , boost::xorable2 < large_bitset<DomainT,BitSetT,Compare,Interval,Alloc>, ICL_INTERVAL_TYPE(Interval,DomainT,Compare)
+ > > > > > > > > > > > > > > > > >
+ //^ & - | + ^ & - | + ^ & - | + < ==
+ //segment element container
+//]
+{
+public:
+ //[large_bitset_associated_types
+ typedef boost::icl::interval_map
+ <DomainT, BitSetT, boost::icl::partial_absorber,
+ std::less, boost::icl::inplace_bit_add, boost::icl::inplace_bit_and> interval_bitmap_type;
+
+ typedef DomainT domain_type;
+ typedef DomainT element_type;
+ typedef BitSetT bitset_type;
+ typedef typename BitSetT::word_type word_type;
+ typedef typename interval_bitmap_type::interval_type interval_type;
+ typedef typename interval_bitmap_type::value_type value_type;
+ //]
+//[large_bitset_operators
+public:
+ bool operator ==(const large_bitset& rhs)const { return _map == rhs._map; }
+ bool operator < (const large_bitset& rhs)const { return _map < rhs._map; }
+
+ large_bitset& operator +=(const large_bitset& rhs) {_map += rhs._map; return *this;}
+ large_bitset& operator |=(const large_bitset& rhs) {_map |= rhs._map; return *this;}
+ large_bitset& operator -=(const large_bitset& rhs) {_map -= rhs._map; return *this;}
+ large_bitset& operator &=(const large_bitset& rhs) {_map &= rhs._map; return *this;}
+ large_bitset& operator ^=(const large_bitset& rhs) {_map ^= rhs._map; return *this;}
+
+ large_bitset& operator +=(const element_type& rhs) {return add(interval_type(rhs)); }
+ large_bitset& operator |=(const element_type& rhs) {return add(interval_type(rhs)); }
+ large_bitset& operator -=(const element_type& rhs) {return subtract(interval_type(rhs)); }
+ large_bitset& operator &=(const element_type& rhs) {return intersect(interval_type(rhs));}
+ large_bitset& operator ^=(const element_type& rhs) {return flip(interval_type(rhs)); }
+
+ large_bitset& operator +=(const interval_type& rhs){return add(rhs); }
+ large_bitset& operator |=(const interval_type& rhs){return add(rhs); }
+ large_bitset& operator -=(const interval_type& rhs){return subtract(rhs); }
+ large_bitset& operator &=(const interval_type& rhs){return intersect(rhs);}
+ large_bitset& operator ^=(const interval_type& rhs){return flip(rhs); }
+ //]
+ //[large_bitset_fundamental_functions
+ large_bitset& add (const interval_type& rhs){return segment_apply(&large_bitset::add_, rhs);}
+ large_bitset& subtract (const interval_type& rhs){return segment_apply(&large_bitset::subtract_, rhs);}
+ large_bitset& intersect(const interval_type& rhs){return segment_apply(&large_bitset::intersect_,rhs);}
+ large_bitset& flip (const interval_type& rhs){return segment_apply(&large_bitset::flip_, rhs);}
+ //]
+
+ //[large_bitset_demo_functions
+ size_t interval_count()const { return boost::icl::interval_count(_map); }
+
+ void show_segments()const
+ {
+ for(typename interval_bitmap_type::const_iterator it_ = _map.begin();
+ it_ != _map.end(); ++it_)
+ {
+ interval_type itv = it_->first;
+ bitset_type bits = it_->second;
+ std::cout << itv << "->" << bits.as_string("01") << std::endl;
+ }
+ }
+
+ void show_matrix(const char off_on[2] = " 1")const
+ {
+ using namespace boost;
+ typename interval_bitmap_type::const_iterator iter = _map.begin();
+ while(iter != _map.end())
+ {
+ element_type fst = icl::first(iter->first), lst = icl::last(iter->first);
+ for(element_type chunk = fst; chunk <= lst; chunk++)
+ std::cout << iter->second.as_string(off_on) << std::endl;
+ ++iter;
+ }
+ }
+ //]
+
+//[large_bitset_impl_constants
+private: // Example value
+ static const word_type // 8-bit case
+ digits = std::numeric_limits // --------------------------------------------------------------
+ <word_type>::digits , // 8 Size of the associated bitsets
+ divisor = digits , // 8 Divisor to find intervals for values
+ last = digits-1 , // 7 Last bit (0 based)
+ shift = log2_<divisor>::value , // 3 To express the division as bit shift
+ w1 = static_cast<word_type>(1) , // Helps to avoid static_casts for long long
+ mask = divisor - w1 , // 7=11100000 Helps to express the modulo operation as bit_and
+ all = ~static_cast<word_type>(0), // 255=11111111 Helps to express a complete associated bitset
+ top = w1 << (digits-w1) ; // 128=00000001 Value of the most significant bit of associated bitsets
+ // !> Note: Most signigicant bit on the right.
+ //]
+ //[large_bitset_segment_combiner
+ typedef void (large_bitset::*segment_combiner)(element_type, element_type, bitset_type);
+ //]
+
+ //[large_bitset_bitset_filler
+ static word_type from_lower_to(word_type bit){return bit==last ? all : (w1<<(bit+w1))-w1;}
+ static word_type to_upper_from(word_type bit){return bit==last ? top : ~((w1<<bit)-w1); }
+ //]
+
+ //[large_bitset_segment_apply
+ large_bitset& segment_apply(segment_combiner combine, const interval_type& operand)
+ {
+ using namespace boost; // same as
+ element_type base = icl::first(operand) >> shift, // icl::first(operand) / divisor
+ ceil = icl::last (operand) >> shift; // icl::last (operand) / divisor
+ word_type base_rest = icl::first(operand) & mask , // icl::first(operand) % divisor
+ ceil_rest = icl::last (operand) & mask ; // icl::last (operand) % divisor
+
+ if(base == ceil) // [first, last] are within one bitset (chunk)
+ (this->*combine)(base, base+1, bitset_type( to_upper_from(base_rest)
+ & from_lower_to(ceil_rest)));
+ else // [first, last] spread over more than one bitset (chunk)
+ {
+ element_type mid_low = base_rest == 0 ? base : base+1, // first element of mid part
+ mid_up = ceil_rest == all ? ceil+1 : ceil ; // last element of mid part
+
+ if(base_rest > 0) // Bitset of base interval has to be filled from base_rest to last
+ (this->*combine)(base, base+1, bitset_type(to_upper_from(base_rest)));
+ if(ceil_rest < all) // Bitset of ceil interval has to be filled from first to ceil_rest
+ (this->*combine)(ceil, ceil+1, bitset_type(from_lower_to(ceil_rest)));
+ if(mid_low < mid_up) // For the middle part all bits have to set.
+ (this->*combine)(mid_low, mid_up, bitset_type(all));
+ }
+ return *this;
+ }
+ //]
+
+ //[large_bitmap_combiners
+ void add_(DomainT lo, DomainT up, BitSetT bits){_map += value_type(interval_type::right_open(lo,up), bits);}
+ void subtract_(DomainT lo, DomainT up, BitSetT bits){_map -= value_type(interval_type::right_open(lo,up), bits);}
+ void intersect_(DomainT lo, DomainT up, BitSetT bits){_map &= value_type(interval_type::right_open(lo,up), bits);}
+ void flip_(DomainT lo, DomainT up, BitSetT bits){_map ^= value_type(interval_type::right_open(lo,up), bits);}
+ //]
+
+//[large_bitmap_impl_map
+private:
+ interval_bitmap_type _map;
+//]
+};
+
+} // mini
+#endif
+
+

Added: trunk/libs/icl/example/large_bitset_/meta_log.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/large_bitset_/meta_log.hpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,26 @@
+/*-----------------------------------------------------------------------------+
+Author: Joachim Faulhaber
+Copyright (c) 2009-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+
+namespace mini // minimal implementations for example projects
+{
+// A meta implementation of an the logarithm function on integrals
+template <size_t Argument, size_t Base=2>
+struct log_{ enum { value = 1 + log_<Argument/Base, Base>::value }; };
+
+template <size_t Base>struct log_<1, Base>{ enum { value = 0 }; };
+template <size_t Base>struct log_<0, Base>{ enum { value = 0 }; };
+
+template <size_t Argument>
+struct log2_{ enum { value = log_<Argument, 2>::value }; };
+
+template <size_t Argument>
+struct power2_{ enum { value = 1 << Argument }; };
+
+} // namespace mini
+

Added: trunk/libs/icl/example/large_bitset_/vc9_large_bitset.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/large_bitset_/vc9_large_bitset.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_large_bitset"
+ ProjectGUID="{6BE62DDE-21B9-4333-BF11-AA054DD53759}"
+ RootNamespace="Large_bitset"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib;../../boost_1_35_0/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib;../../boost_1_35_0/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\large_bitset.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\bits.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\large_bitset.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/man_power_/man_power.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/man_power_/man_power.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,190 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example man_power.cpp \file man_power.cpp
+ \brief Using set style operators to compute with interval sets and maps.
+
+ Interval sets and maps can be filled and manipulated using
+ set style operation like union (+=), difference (-=) and intersection
+ (&=).
+
+ In this example 'man_power' a number of those operations are
+ demonstrated in the process of calculation the available working
+ times (man-power) of a company's employees accounting for weekends,
+ holidays, sickness times and vacations.
+
+ \include man_power_/man_power.cpp
+*/
+//[example_man_power
+// The next line includes <boost/gregorian/date.hpp>
+// and a few lines of adapter code.
+#include <boost/icl/gregorian.hpp>
+#include <iostream>
+#include <boost/icl/discrete_interval.hpp>
+#include <boost/icl/interval_map.hpp>
+
+using namespace std;
+using namespace boost::gregorian;
+using namespace boost::icl;
+
+
+// Function weekends returns the interval_set of weekends that are contained in
+// the date interval 'scope'
+interval_set<date> weekends(const discrete_interval<date>& scope)
+{
+ interval_set<date> weekends;
+
+ date cur_weekend_sat
+ = first(scope)
+ + days(days_until_weekday(first(scope), greg_weekday(Saturday)))
+ - weeks(1);
+ week_iterator week_iter(cur_weekend_sat);
+
+ for(; week_iter <= last(scope); ++week_iter)
+ weekends += discrete_interval<date>::right_open(*week_iter, *week_iter + days(2));
+
+ weekends &= scope; // cut off the surplus
+
+ return weekends;
+}
+
+// The available working time for the employees of a company is calculated
+// for a period of 3 months accounting for weekends and holidays.
+// The available daily working time for the employees is calculated
+// using interval_sets and interval_maps demonstrating a number of
+// addition, subtraction and intersection operations.
+void man_power()
+{
+ date someday = from_string("2008-08-01");
+ date thenday = someday + months(3);
+
+ discrete_interval<date> scope = discrete_interval<date>::right_open(someday, thenday);
+
+ // ------------------------------------------------------------------------
+ // (1) In a first step, the regular working times are computed for the
+ // company within the given scope. From all available days, the weekends
+ // and holidays have to be subtracted:
+ interval_set<date> worktime(scope);
+ // Subtract the weekends
+ worktime -= weekends(scope);
+ // Subtract holidays
+ worktime -= from_string("2008-10-03"); //German reunification ;)
+
+ // company holidays (fictitious ;)
+ worktime -= discrete_interval<date>::closed(from_string("2008-08-18"),
+ from_string("2008-08-22"));
+
+ //-------------------------------------------------------------------------
+ // (2) Now we calculate the individual work times for some employees
+ //-------------------------------------------------------------------------
+ // In the company works Claudia.
+ // This is the map of her regular working times:
+ interval_map<date,int> claudias_working_hours;
+
+ // Claudia is working 8 hours a day. So the next statement says
+ // that every day in the whole scope is mapped to 8 hours worktime.
+ claudias_working_hours += make_pair(scope, 8);
+
+ // But Claudia only works 8 hours on regular working days so we do
+ // an intersection of the interval_map with the interval_set worktime:
+ claudias_working_hours &= worktime;
+
+ // Yet, in addition Claudia has her own absence times like
+ discrete_interval<date> claudias_seminar (from_string("2008-09-16"),
+ from_string("2008-09-24"),
+ interval_bounds::closed());
+ discrete_interval<date> claudias_vacation(from_string("2008-08-01"),
+ from_string("2008-08-14"),
+ interval_bounds::closed());
+
+ interval_set<date> claudias_absence_times(claudias_seminar);
+ claudias_absence_times += claudias_vacation;
+
+ // All the absence times have to subtracted from the map of her working times
+ claudias_working_hours -= claudias_absence_times;
+
+ //-------------------------------------------------------------------------
+ // Claudia's boss is Bodo. He only works part time.
+ // This is the map of his regular working times:
+ interval_map<date,int> bodos_working_hours;
+
+ // Bodo is working 4 hours a day.
+ bodos_working_hours += make_pair(scope, 4);
+
+ // Bodo works only on regular working days
+ bodos_working_hours &= worktime;
+
+ // Bodos additional absence times
+ discrete_interval<date> bodos_flu(from_string("2008-09-19"), from_string("2008-09-29"),
+ interval_bounds::closed());
+ discrete_interval<date> bodos_vacation(from_string("2008-08-15"), from_string("2008-09-03"),
+ interval_bounds::closed());
+
+ interval_set<date> bodos_absence_times(bodos_flu);
+ bodos_absence_times += bodos_vacation;
+
+ // All the absence times have to be subtracted from the map of his working times
+ bodos_working_hours -= bodos_absence_times;
+
+ //-------------------------------------------------------------------------
+ // (3) Finally we want to calculate the available manpower of the company
+ // for the selected time scope: This is done by adding up the employees
+ // working time maps:
+ interval_map<date,int> manpower;
+ manpower += claudias_working_hours;
+ manpower += bodos_working_hours;
+
+
+ cout << first(scope) << " - " << last(scope)
+ << " available man-power:" << endl;
+ cout << "---------------------------------------------------------------\n";
+
+ for(interval_map<date,int>::iterator it = manpower.begin();
+ it != manpower.end(); it++)
+ {
+ cout << first(it->first) << " - " << last(it->first)
+ << " -> " << it->second << endl;
+ }
+}
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample man_power.cpp <<\n";
+ cout << "---------------------------------------------------------------\n";
+ man_power();
+ return 0;
+}
+
+// Program output:
+/*
+>>Interval Container Library: Sample man_power.cpp <<
+---------------------------------------------------------------
+2008-Aug-01 - 2008-Oct-31 available man-power:
+---------------------------------------------------------------
+2008-Aug-01 - 2008-Aug-01 -> 4
+2008-Aug-04 - 2008-Aug-08 -> 4
+2008-Aug-11 - 2008-Aug-14 -> 4
+2008-Aug-15 - 2008-Aug-15 -> 8
+2008-Aug-25 - 2008-Aug-29 -> 8
+2008-Sep-01 - 2008-Sep-03 -> 8
+2008-Sep-04 - 2008-Sep-05 -> 12
+2008-Sep-08 - 2008-Sep-12 -> 12
+2008-Sep-15 - 2008-Sep-15 -> 12
+2008-Sep-16 - 2008-Sep-18 -> 4
+2008-Sep-25 - 2008-Sep-26 -> 8
+2008-Sep-29 - 2008-Sep-29 -> 8
+2008-Sep-30 - 2008-Oct-02 -> 12
+2008-Oct-06 - 2008-Oct-10 -> 12
+2008-Oct-13 - 2008-Oct-17 -> 12
+2008-Oct-20 - 2008-Oct-24 -> 12
+2008-Oct-27 - 2008-Oct-31 -> 12
+*/
+//]
+

Added: trunk/libs/icl/example/man_power_/vc9_man_power.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/man_power_/vc9_man_power.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_man_power"
+ ProjectGUID="{8B9B91C9-E79C-4F24-BD5C-04ED0F38E8C2}"
+ RootNamespace="Party"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\man_power.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_set.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/month_and_week_grid_/month_and_week_grid.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/month_and_week_grid_/month_and_week_grid.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,140 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example month_and_week_grid.cpp \file month_and_week_grid.cpp
+ \brief Creating and combining time grids.
+
+ A split_interval_set preserves all interval borders on insertion
+ and intersection operations. So given a split_interval_set ...
+ \code
+ x = {[1, 3)}
+ x.add( [2, 4)) then
+ x == {[1,2)[2,3)[3,4)}
+ \endcode
+ ... using this property we can intersect splitting interval containers
+ in order to iterate over intervals accounting for all changes of
+ interval borders.
+
+ In this example we provide an intersection of two split_interval_sets
+ representing a month and week time grid.
+
+ \include month_and_week_grid_/month_and_week_grid.cpp
+*/
+//[example_month_and_week_grid
+// The next line includes <boost/gregorian/date.hpp>
+// and a few lines of adapter code.
+#include <boost/icl/gregorian.hpp>
+#include <iostream>
+#include <boost/icl/split_interval_set.hpp>
+
+using namespace std;
+using namespace boost::gregorian;
+using namespace boost::icl;
+
+typedef split_interval_set<boost::gregorian::date> date_grid;
+
+// This function splits a gregorian::date interval 'scope' into a month grid:
+// For every month contained in 'scope' that month is contained as interval
+// in the resulting split_interval_set.
+date_grid month_grid(const discrete_interval<date>& scope)
+{
+ split_interval_set<date> month_grid;
+
+ date frame_months_1st = first(scope).end_of_month() + days(1) - months(1);
+ month_iterator month_iter(frame_months_1st);
+
+ for(; month_iter <= last(scope); ++month_iter)
+ month_grid += discrete_interval<date>::right_open(*month_iter, *month_iter + months(1));
+
+ month_grid &= scope; // cut off the surplus
+
+ return month_grid;
+}
+
+// This function splits a gregorian::date interval 'scope' into a week grid:
+// For every week contained in 'scope' that month is contained as interval
+// in the resulting split_interval_set.
+date_grid week_grid(const discrete_interval<date>& scope)
+{
+ split_interval_set<date> week_grid;
+
+ date frame_weeks_1st = first(scope) + days(days_until_weekday(first(scope), greg_weekday(Monday))) - weeks(1);
+ week_iterator week_iter(frame_weeks_1st);
+
+ for(; week_iter <= last(scope); ++week_iter)
+ week_grid.insert(discrete_interval<date>::right_open(*week_iter, *week_iter + weeks(1)));
+
+ week_grid &= scope; // cut off the surplus
+
+ return week_grid;
+}
+
+// For a period of two months, starting from today, the function
+// computes a partitioning for months and weeks using intersection
+// operator &= on split_interval_sets.
+void month_and_time_grid()
+{
+ date someday = day_clock::local_day();
+ date thenday = someday + months(2);
+
+ discrete_interval<date> itv = discrete_interval<date>::right_open(someday, thenday);
+
+ // Compute a month grid
+ date_grid month_and_week_grid = month_grid(itv);
+ // Intersection of the month and week grids:
+ month_and_week_grid &= week_grid(itv);
+
+ cout << "interval : " << first(itv) << " - " << last(itv)
+ << " month and week partitions:" << endl;
+ cout << "---------------------------------------------------------------\n";
+
+ for(date_grid::iterator it = month_and_week_grid.begin();
+ it != month_and_week_grid.end(); it++)
+ {
+ if(first(*it).day() == 1)
+ cout << "new month: ";
+ else if(first(*it).day_of_week()==greg_weekday(Monday))
+ cout << "new week : " ;
+ else if(it == month_and_week_grid.begin())
+ cout << "first day: " ;
+ cout << first(*it) << " - " << last(*it) << endl;
+ }
+}
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample month_and_time_grid.cpp <<\n";
+ cout << "---------------------------------------------------------------\n";
+ month_and_time_grid();
+ return 0;
+}
+
+// Program output:
+/*
+>>Interval Container Library: Sample month_and_time_grid.cpp <<
+---------------------------------------------------------------
+interval : 2008-Jun-22 - 2008-Aug-21 month and week partitions:
+---------------------------------------------------------------
+first day: 2008-Jun-22 - 2008-Jun-22
+new week : 2008-Jun-23 - 2008-Jun-29
+new week : 2008-Jun-30 - 2008-Jun-30
+new month: 2008-Jul-01 - 2008-Jul-06
+new week : 2008-Jul-07 - 2008-Jul-13
+new week : 2008-Jul-14 - 2008-Jul-20
+new week : 2008-Jul-21 - 2008-Jul-27
+new week : 2008-Jul-28 - 2008-Jul-31
+new month: 2008-Aug-01 - 2008-Aug-03
+new week : 2008-Aug-04 - 2008-Aug-10
+new week : 2008-Aug-11 - 2008-Aug-17
+new week : 2008-Aug-18 - 2008-Aug-21
+*/
+//]
+

Added: trunk/libs/icl/example/month_and_week_grid_/vc9_month_and_week_grid.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/month_and_week_grid_/vc9_month_and_week_grid.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_month_and_week_grid"
+ ProjectGUID="{360BCFA9-9EB6-4D22-8469-CDC290478F78}"
+ RootNamespace="Party"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../bin/debug/"
+ IntermediateDirectory="../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../bin/release/"
+ IntermediateDirectory="../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\month_and_week_grid.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\split_interval_set.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/overlap_counter_/overlap_counter.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/overlap_counter_/overlap_counter.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,108 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example overlap_counter.cpp \file overlap_counter.cpp
+
+ \brief The most simple application of an interval map:
+ Counting the overlaps of added intervals.
+
+ The most basic application of an interval_map is a counter counting
+ the number of overlaps of intervals inserted into it.
+
+ On could call an interval_map an aggregate on overlap machine. A very basic
+ aggregation is summation of an integer. A interval_map<int,int> maps
+ intervals of int to ints.
+
+ If we insert a value pair (discrete_interval<int>(2,6), 1) into the interval_map, it
+ increases the content of all value pairs in the map by 1, if their interval
+ part overlaps with discrete_interval<int>(2,6).
+
+ \include overlap_counter_/overlap_counter.cpp
+*/
+//[example_overlap_counter
+#include <iostream>
+#include <boost/icl/split_interval_map.hpp>
+
+using namespace std;
+using namespace boost::icl;
+
+
+/* The most simple example of an interval_map is an overlap counter.
+ If intervals are added that are associated with the value 1,
+ all overlaps of added intervals are counted as a result in the
+ associated values.
+*/
+typedef interval_map<int, int> OverlapCounterT;
+
+void print_overlaps(const OverlapCounterT& counter)
+{
+ for(OverlapCounterT::const_iterator it = counter.begin(); it != counter.end(); it++)
+ {
+ discrete_interval<int> itv = (*it).first;
+ int overlaps_count = (*it).second;
+ if(overlaps_count == 1)
+ cout << "in interval " << itv << " intervals do not overlap" << endl;
+ else
+ cout << "in interval " << itv << ": "<< overlaps_count << " intervals overlap" << endl;
+ }
+}
+
+void overlap_counter()
+{
+ OverlapCounterT overlap_counter;
+ discrete_interval<int> inter_val;
+
+ inter_val = discrete_interval<int>::right_open(4,8);
+ cout << "-- adding " << inter_val << " -----------------------------------------" << endl;
+ overlap_counter += make_pair(inter_val, 1);
+ print_overlaps(overlap_counter);
+ cout << "-----------------------------------------------------------" << endl;
+
+ inter_val = discrete_interval<int>::right_open(6,9);
+ cout << "-- adding " << inter_val << " -----------------------------------------" << endl;
+ overlap_counter += make_pair(inter_val, 1);
+ print_overlaps(overlap_counter);
+ cout << "-----------------------------------------------------------" << endl;
+
+ inter_val = discrete_interval<int>::right_open(1,9);
+ cout << "-- adding " << inter_val << " -----------------------------------------" << endl;
+ overlap_counter += make_pair(inter_val, 1);
+ print_overlaps(overlap_counter);
+ cout << "-----------------------------------------------------------" << endl;
+
+}
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample overlap_counter.cpp <<\n";
+ cout << "-----------------------------------------------------------\n";
+ overlap_counter();
+ return 0;
+}
+
+// Program output:
+
+// >>Interval Container Library: Sample overlap_counter.cpp <<
+// -----------------------------------------------------------
+// -- adding [4,8) -----------------------------------------
+// in interval [4,8) intervals do not overlap
+// -----------------------------------------------------------
+// -- adding [6,9) -----------------------------------------
+// in interval [4,6) intervals do not overlap
+// in interval [6,8): 2 intervals overlap
+// in interval [8,9) intervals do not overlap
+// -----------------------------------------------------------
+// -- adding [1,9) -----------------------------------------
+// in interval [1,4) intervals do not overlap
+// in interval [4,6): 2 intervals overlap
+// in interval [6,8): 3 intervals overlap
+// in interval [8,9): 2 intervals overlap
+// -----------------------------------------------------------
+//]

Added: trunk/libs/icl/example/overlap_counter_/vc9_overlap_counter.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/overlap_counter_/vc9_overlap_counter.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_overlap_counter"
+ ProjectGUID="{8DC9BDE4-E5A4-4294-A12F-D75FD6990B83}"
+ RootNamespace="overlap_counter"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\overlap_counter.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/party_/party.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/party_/party.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,115 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#include <iostream>
+#include <boost/icl/interval_map.hpp>
+#include "../toytime.hpp"
+
+using namespace std;
+using namespace boost::icl;
+
+/**
+
+ Party.cpp demonstrates the possibilities of an interval map (interval_map or
+ split_interval_map). An interval_map maps intervals to a given content. In
+ this case the content is a set of party guests represented by their name
+ strings.
+
+ As time goes by, groups of people join the party and leave later in the
+ evening. So we add a time interval and a name set to the interval_map for
+ the attendance of each group of people, that come together and leave
+ together.
+
+ On every overlap of intervals, the corresponding name sets are accumulated.
+ At the points of overlap the intervals are split. The accumulation of content
+ on overlap of intervals is always done via an operator += that has to be
+ implemented for the content parameter of the interval_map.
+
+ Finally the interval_map contains the history of attendance and all points
+ in time, where the group of party guests changed.
+
+ Party.cpp demonstrates a principle that we call aggregate on overlap
+ (aggovering;) On insertion a value associated to the interval is aggregated
+ (added) to those values in the interval_map that overlap with the inserted
+ value.
+
+ There are two behavioral aspects to aggovering: a decompositional behavior
+ and a accumulative behavior.
+
+ The decompositional behavior splits up intervals on the time dimension of
+ the interval_map so that the intervals change whenever associated values
+ change.
+
+ The accumulative behavior accumulates associated values on every overlap of
+ an insertion for the associated values.
+
+*/
+
+// Type set<string> collects the names of party guests. Since std::set is
+// a model of the itl's set concept, the concept provides an operator +=
+// that performs a set union on overlap of intervals.
+typedef std::set<string> GuestSetT;
+
+// Time is the domain type the split_interval_map. It's key values are therefore
+// time intervals. The content is the set of names: GuestSetT.
+
+
+void party()
+{
+ GuestSetT mary_harry;
+ mary_harry.insert("Mary");
+ mary_harry.insert("Harry");
+
+ GuestSetT diana_susan;
+ diana_susan.insert("Diana");
+ diana_susan.insert("Susan");
+
+ GuestSetT peter;
+ peter.insert("Peter");
+
+ interval_map<Time, GuestSetT> party;
+
+ //party += make_pair( discrete_interval<Time>::right_open(Time(19,30), Time(23,00)), mary_harry);
+ //party += make_pair( discrete_interval<Time>::right_open(Time(20,10), Time(monday,0,0)), diana_susan);
+ //party += make_pair( discrete_interval<Time>::right_open(Time(22,15), Time(monday,0,30)), peter);
+
+ party += make_pair( interval<Time>::right_open(Time(19,30), Time(23,00)), mary_harry);
+ party += make_pair( interval<Time>::right_open(Time(20,10), Time(monday,0,0)), diana_susan);
+ party += make_pair( interval<Time>::right_open(Time(22,15), Time(monday,0,30)), peter);
+
+ interval_map<Time, GuestSetT>::iterator it = party.begin();
+ while(it != party.end())
+ {
+ discrete_interval<Time> when = it->first;
+ // Who is at the party within the time interval 'when' ?
+ GuestSetT who = (*it++).second;
+ cout << when << ": " << who << endl;
+ }
+}
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample party.cpp <<\n";
+ cout << "-------------------------------------------------------\n";
+ party();
+ return 0;
+}
+
+// Program output:
+
+// >>Interval Container Library: Sample party.cpp <<
+// -------------------------------------------------
+// [sun:19:30,sun:20:10): Harry Mary
+// [sun:20:10,sun:22:15): Diana Harry Mary Susan
+// [sun:22:15,sun:23:00): Diana Harry Mary Peter Susan
+// [sun:23:00,mon:00:00): Diana Peter Susan
+// [mon:00:00,mon:00:30): Peter
+
+

Added: trunk/libs/icl/example/party_/vc9_party.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/party_/vc9_party.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_party"
+ ProjectGUID="{6BE62DDE-21B9-4333-BF11-AA054DD43759}"
+ RootNamespace="Party"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib;../../boost_1_35_0/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib;../../boost_1_35_0/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\party.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/partys_height_average_/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/partys_height_average_/Jamfile.v2 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,12 @@
+# (C) Copyright 2008: 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)
+
+exe partys_height_average
+ :
+ partys_height_average.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;

Added: trunk/libs/icl/example/partys_height_average_/partys_height_average.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/partys_height_average_/partys_height_average.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,134 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+
+/** Example partys_height_average.cpp \file partys_height_average.cpp
+ \brief Using <i>aggregate on overlap</i> a history of height averages of
+ party guests is computed.
+
+ In partys_height_average.cpp we compute yet another aggregation:
+ The average height of guests as it changes over time. This is done by
+ defining a class counted_sum that sums up heights and counts the number
+ of guests via an operator +=.
+
+ Based on the operator += we can aggregate counted sums on addition
+ of interval value pairs into an interval_map.
+
+ \include partys_height_average_/partys_height_average.cpp
+*/
+//[example_partys_height_average
+// The next line includes <boost/date_time/posix_time/posix_time.hpp>
+// and a few lines of adapter code.
+#include <boost/icl/ptime.hpp>
+#include <iostream>
+#include <boost/icl/interval_map.hpp>
+#include <boost/icl/split_interval_map.hpp>
+
+using namespace std;
+using namespace boost::posix_time;
+using namespace boost::icl;
+
+
+class counted_sum
+{
+public:
+ counted_sum():_sum(0),_count(0){}
+ counted_sum(int sum):_sum(sum),_count(1){}
+
+ int sum()const {return _sum;}
+ int count()const{return _count;}
+ double average()const{ return _count==0 ? 0.0 : _sum/static_cast<double>(_count); }
+
+ counted_sum& operator += (const counted_sum& right)
+ { _sum += right.sum(); _count += right.count(); return *this; }
+
+private:
+ int _sum;
+ int _count;
+};
+
+bool operator == (const counted_sum& left, const counted_sum& right)
+{ return left.sum()==right.sum() && left.count()==right.count(); }
+
+
+void partys_height_average()
+{
+ interval_map<ptime, counted_sum> height_sums;
+
+ height_sums +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 19:30"),
+ time_from_string("2008-05-20 23:00")),
+ counted_sum(165)); // Mary is 1,65 m tall.
+
+ height_sums +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 19:30"),
+ time_from_string("2008-05-20 23:00")),
+ counted_sum(180)); // Harry is 1,80 m tall.
+
+ height_sums +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 20:10"),
+ time_from_string("2008-05-21 00:00")),
+ counted_sum(170)); // Diana is 1,70 m tall.
+
+ height_sums +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 20:10"),
+ time_from_string("2008-05-21 00:00")),
+ counted_sum(165)); // Susan is 1,65 m tall.
+
+ height_sums +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 22:15"),
+ time_from_string("2008-05-21 00:30")),
+ counted_sum(200)); // Peters height is 2,00 m
+
+ interval_map<ptime, counted_sum>::iterator height_sum_ = height_sums.begin();
+ cout << "-------------- History of average guest height -------------------\n";
+ while(height_sum_ != height_sums.end())
+ {
+ discrete_interval<ptime> when = height_sum_->first;
+
+ double height_average = (*height_sum_++).second.average();
+ cout << setprecision(3)
+ << "[" << first(when) << " - " << upper(when) << ")"
+ << ": " << height_average <<" cm = " << height_average/30.48 << " ft" << endl;
+ }
+}
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample partys_height_average.cpp <<\n";
+ cout << "------------------------------------------------------------------\n";
+ partys_height_average();
+ return 0;
+}
+
+// Program output:
+/*-----------------------------------------------------------------------------
+>>Interval Container Library: Sample partys_height_average.cpp <<
+------------------------------------------------------------------
+-------------- History of average guest height -------------------
+[2008-May-20 19:30:00 - 2008-May-20 20:10:00): 173 cm = 5.66 ft
+[2008-May-20 20:10:00 - 2008-May-20 22:15:00): 170 cm = 5.58 ft
+[2008-May-20 22:15:00 - 2008-May-20 23:00:00): 176 cm = 5.77 ft
+[2008-May-20 23:00:00 - 2008-May-21 00:00:00): 178 cm = 5.85 ft
+[2008-May-21 00:00:00 - 2008-May-21 00:30:00): 200 cm = 6.56 ft
+-----------------------------------------------------------------------------*/
+//]
+

Added: trunk/libs/icl/example/partys_height_average_/vc9_partys_height_average.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/partys_height_average_/vc9_partys_height_average.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_partys_height_average"
+ ProjectGUID="{0D1DB87E-E72A-4FE9-A067-1907CC6633F8}"
+ RootNamespace="Partys_height_average"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\partys_height_average.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/partys_tallest_guests_/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/partys_tallest_guests_/Jamfile.v2 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,12 @@
+# (C) Copyright 2008: 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)
+
+exe partys_tallest_guests
+ :
+ partys_tallest_guests.cpp
+ /boost/date_time//boost_date_time
+ :
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ ;

Added: trunk/libs/icl/example/partys_tallest_guests_/partys_tallest_guests.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/partys_tallest_guests_/partys_tallest_guests.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,161 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+
+/** Example partys_tallest_guests.cpp \file partys_tallest_guests.cpp
+ \brief Using <i>aggregate on overlap</i> the heights of the party's tallest
+ guests are computed.
+
+ In partys_tallest_guests.cpp we use a different instantiation of
+ interval map templates to compute maxima of guest heights.
+
+ Instead of aggregating groups of people attending the party in time
+ we aggregate the maximum of guest height for the time intervals.
+
+ Using a joining interval_map results in a smaller map: All interval
+ value pairs are joined if the maximum does not change in time. Using
+ a split_interval_map results in a larger map: All splits of intervals
+ that occur due to entering and leaving of guests are preserved in
+ the split_interval_map.
+
+ \include partys_tallest_guests_/partys_tallest_guests.cpp
+*/
+//[example_partys_tallest_guests
+// The next line includes <boost/date_time/posix_time/posix_time.hpp>
+// and a few lines of adapter code.
+#include <boost/icl/ptime.hpp>
+#include <iostream>
+#include <boost/icl/interval_map.hpp>
+#include <boost/icl/split_interval_map.hpp>
+
+using namespace std;
+using namespace boost::posix_time;
+using namespace boost::icl;
+
+
+// A party's height shall be defined as the maximum height of all guests ;-)
+// The last parameter 'inplace_max' is a functor template that calls a max
+// aggregation on overlap.
+typedef interval_map<ptime, int, partial_absorber, less, inplace_max>
+ PartyHeightHistoryT;
+
+// Using a split_interval_map we preserve interval splittings that occurred via insertion.
+typedef split_interval_map<ptime, int, partial_absorber, less, inplace_max>
+ PartyHeightSplitHistoryT;
+
+void partys_height()
+{
+ PartyHeightHistoryT tallest_guest;
+
+ tallest_guest +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 19:30"),
+ time_from_string("2008-05-20 23:00")),
+ 180); // Mary & Harry: Harry is 1,80 m tall.
+
+ tallest_guest +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 20:10"),
+ time_from_string("2008-05-21 00:00")),
+ 170); // Diana & Susan: Diana is 1,70 m tall.
+
+ tallest_guest +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 22:15"),
+ time_from_string("2008-05-21 00:30")),
+ 200); // Peters height is 2,00 m
+
+ PartyHeightHistoryT::iterator height_ = tallest_guest.begin();
+ cout << "-------------- History of maximum guest height -------------------\n";
+ while(height_ != tallest_guest.end())
+ {
+ discrete_interval<ptime> when = height_->first;
+ // Of what height are the tallest guests within the time interval 'when' ?
+ int height = (*height_++).second;
+ cout << "[" << first(when) << " - " << upper(when) << ")"
+ << ": " << height <<" cm = " << height/30.48 << " ft" << endl;
+ }
+
+}
+
+// Next we are using a split_interval_map instead of a joining interval_map
+void partys_split_height()
+{
+ PartyHeightSplitHistoryT tallest_guest;
+
+ // adding an element can be done wrt. simple aggregate functions
+ // like e.g. min, max etc. in their 'inplace' or op= incarnation
+ tallest_guest +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 19:30"),
+ time_from_string("2008-05-20 23:00")),
+ 180); // Mary & Harry: Harry is 1,80 m tall.
+
+ tallest_guest +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 20:10"),
+ time_from_string("2008-05-21 00:00")),
+ 170); // Diana & Susan: Diana is 1,70 m tall.
+
+ tallest_guest +=
+ make_pair(
+ discrete_interval<ptime>::right_open(
+ time_from_string("2008-05-20 22:15"),
+ time_from_string("2008-05-21 00:30")),
+ 200); // Peters height is 2,00 m
+
+ PartyHeightSplitHistoryT::iterator height_ = tallest_guest.begin();
+ cout << "\n";
+ cout << "-------- Split History of maximum guest height -------------------\n";
+ cout << "--- Same map as above but split for every interval insertion. ---\n";
+ while(height_ != tallest_guest.end())
+ {
+ discrete_interval<ptime> when = height_->first;
+ // Of what height are the tallest guests within the time interval 'when' ?
+ int height = (*height_++).second;
+ cout << "[" << first(when) << " - " << upper(when) << ")"
+ << ": " << height <<" cm = " << height/30.48 << " ft" << endl;
+ }
+
+}
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample partys_tallest_guests.cpp <<\n";
+ cout << "------------------------------------------------------------------\n";
+ partys_height();
+ partys_split_height();
+ return 0;
+}
+
+// Program output:
+/*-----------------------------------------------------------------------------
+>>Interval Container Library: Sample partys_tallest_guests.cpp <<
+------------------------------------------------------------------
+-------------- History of maximum guest height -------------------
+[2008-May-20 19:30:00 - 2008-May-20 22:15:00): 180 cm = 5.90551 ft
+[2008-May-20 22:15:00 - 2008-May-21 00:30:00): 200 cm = 6.56168 ft
+
+-------- Split History of maximum guest height -------------------
+--- Same map as above but split for every interval insertion. ---
+[2008-May-20 19:30:00 - 2008-May-20 20:10:00): 180 cm = 5.90551 ft
+[2008-May-20 20:10:00 - 2008-May-20 22:15:00): 180 cm = 5.90551 ft
+[2008-May-20 22:15:00 - 2008-May-20 23:00:00): 200 cm = 6.56168 ft
+[2008-May-20 23:00:00 - 2008-May-21 00:00:00): 200 cm = 6.56168 ft
+[2008-May-21 00:00:00 - 2008-May-21 00:30:00): 200 cm = 6.56168 ft
+-----------------------------------------------------------------------------*/
+//]
+

Added: trunk/libs/icl/example/partys_tallest_guests_/vc9_partys_tallest_guests.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/partys_tallest_guests_/vc9_partys_tallest_guests.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_partys_tallest_guests"
+ ProjectGUID="{0D1DB87E-E72A-4FE9-A067-1907CC6623F8}"
+ RootNamespace="Partys_tallest_guests"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\partys_tallest_guests.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_base_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/splititvmap_shell_/splititvmap_shell.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/splititvmap_shell_/splititvmap_shell.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,131 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2007-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------+
+splititvmap_shell.cpp provides a simple test shell for splitting interval maps.
+The shell also gives you a good idea how interval container are working.
++-----------------------------------------------------------------------------*/
+#include <iostream>
+
+#include <boost/icl/split_interval_set.hpp>
+#include <boost/icl/split_interval_map.hpp>
+#include <boost/icl/interval_map.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::icl;
+
+void instructions()
+{
+ cout << "+++++ Test shell for split interval map +++++\n";
+ cout << "Type: q e or 0 to quit\n";
+ cout << "Type: + for insertions\n";
+ cout << "Type: - for subtraction of ([a,b],value)\n";
+ cout << "Type: _ for subtraction of [a,b]\n";
+ cout << "Type: j to join contiguous intervals\n";
+ cout << "Type: s to compute total size\n";
+}
+
+void wrongInput()
+{
+ cout << "Wrong Input ------------------\n";
+ instructions();
+}
+
+
+template <class MapTV>
+void mapTestShell()
+{
+ MapTV m1;
+
+ try {
+ char cmd = 'b';
+ typename MapTV::domain_type
+ lwb = typename MapTV::domain_type(),
+ upb = typename MapTV::domain_type();
+
+ typename MapTV::codomain_type
+ val = typename MapTV::codomain_type();
+
+ instructions();
+
+ for(;;)
+ {
+ cout << "> ";
+ cin >> cmd ;
+
+ switch(cmd)
+ {
+ case 'q':
+ case 'e':
+ case '0': cout << "good bye\n"; return;
+ case '+':
+ {
+ cout << "input: lwb upb val >> ";
+ cin >> lwb >> upb >> val;
+ typename MapTV::interval_type
+ itv = typename MapTV::interval_type(lwb,upb);
+ m1 += make_pair(itv,val);
+
+ cout << "+" << itv << " " << val << " =" << endl;
+ cout << "{" << m1 << "}" << endl;
+
+ }
+ break;
+ case '-':
+ {
+ cout << "input: lwb upb val >> ";
+ cin >> lwb >> upb >> val;
+ typename MapTV::interval_type
+ itv = typename MapTV::interval_type(lwb,upb);
+ m1 -= make_pair(itv,val);
+
+ cout << "-" << itv << " " << val << " =" << endl;
+ cout << "{" << m1 << "}" << endl;
+
+ }
+ break;
+ case 'j':
+ {
+ icl::join(m1);
+ cout << "{" << m1 << "}" << endl;
+ }
+ break;
+ case 's':
+ {
+ cout << "size = " << m1.size() << endl;
+ }
+ break;
+
+ default: wrongInput();
+ }
+ } // end while
+ }
+ catch (exception& e)
+ {
+ cout << "splititvmap_shell: exception caught: " << endl
+ << e.what() << endl;
+ }
+ catch (...)
+ {
+ cout << "splititvmap_shell: unknown exception caught" << endl;
+ }
+}
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Test splititvmap_shell.cpp <<\n";
+ cout << "-----------------------------------------------------------\n";
+ mapTestShell< interval_map<int, int> >();
+
+ return 0;
+}
+

Added: trunk/libs/icl/example/splititvmap_shell_/vc9_splititvmap_shell.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/splititvmap_shell_/vc9_splititvmap_shell.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_splititvmap_shell"
+ ProjectGUID="{639F6AD9-CD50-40BF-92B9-CC9DD069D65A}"
+ RootNamespace="splititvmap_shell"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/Debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\splititvmap_shell.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\split_interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/static_interval_/static_interval.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/static_interval_/static_interval.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,123 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2010: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example static_interval.cpp \file static_interval.cpp
+ \brief Intervals with static interval bounds.
+
+ Intervals types with static or fixed interval bounds. Statically
+ bounded intervals use up to 33% less memory than dynamically
+ bounded ones. Of the four possible statically bounded intervals types
+ right_open_intervals are the most important ones. We can switch the
+ library default to statically bounded intervals by defining
+ BOOST_ICL_USE_STATIC_BOUNDED_INTERVALS.
+
+ \include static_interval_/static_interval.cpp
+*/
+//[example_static_interval
+#include <iostream>
+#include <string>
+#include <math.h>
+#include <boost/type_traits/is_same.hpp>
+
+// We can change the library default for the interval types by defining
+#define BOOST_ICL_USE_STATIC_BOUNDED_INTERVALS
+// prior to other inluces from the icl.
+// The interval type that is automatically used with interval
+// containers then is the statically bounded right_open_interval.
+
+#include <boost/icl/interval_set.hpp>
+#include <boost/icl/split_interval_set.hpp>
+// The statically bounded interval type 'right_open_interval'
+// is indirectly included via interval containers.
+
+
+#include "../toytime.hpp"
+#include <boost/icl/rational.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::icl;
+
+int main()
+{
+ cout << ">> Interval Container Library: Sample static_interval.cpp <<\n";
+ cout << "------------------------------------------------------------\n";
+
+ // Statically bounded intervals are the user defined library default for
+ // interval parameters in interval containers now.
+ BOOST_STATIC_ASSERT((
+ boost::is_same< interval_set<int>::interval_type
+ , right_open_interval<int> >::value
+ ));
+
+ BOOST_STATIC_ASSERT((
+ boost::is_same< interval_set<float>::interval_type
+ , right_open_interval<float> >::value
+ ));
+
+ // As we can see the library default both for discrete and continuous
+ // domain_types T is 'right_open_interval<T>'.
+ // The user defined library default for intervals is also available via
+ // the template 'interval':
+ BOOST_STATIC_ASSERT((
+ boost::is_same< interval<int>::type
+ , right_open_interval<int> >::value
+ ));
+
+ // Again we are declaring and initializing the four test intervals that have been used
+ // in the example 'interval' and 'dynamic_interval'
+ interval<int>::type int_interval = interval<int>::right_open(3, 8); // shifted the upper bound
+ interval<double>::type sqrt_interval = interval<double>::right_open(1/sqrt(2.0), sqrt(2.0));
+
+ // Interval ("Barcelona", "Boston"] can not be represented because there is no 'steppable next' on
+ // lower bound "Barcelona". Ok. this is a different interval:
+ interval<string>::type city_interval = interval<string>::right_open("Barcelona", "Boston");
+
+ // Toy Time is discrete again so we can transfrom open(Time(monday,8,30), Time(monday,17,20))
+ // to right_open(Time(monday,8,31), Time(monday,17,20))
+ interval<Time>::type time_interval = interval<Time>::right_open(Time(monday,8,31), Time(monday,17,20));
+
+ cout << "----- Statically bounded intervals ----------------------------------------\n";
+ cout << "right_open_interval<int> : " << int_interval << endl;
+ cout << "right_open_interval<double>: " << sqrt_interval << " does "
+ << string(contains(sqrt_interval, sqrt(2.0))?"":"NOT")
+ << " contain sqrt(2)" << endl;
+ cout << "right_open_interval<string>: " << city_interval << " does "
+ << string(contains(city_interval,"Barcelona")?"":"NOT")
+ << " contain 'Barcelona'" << endl;
+ cout << "right_open_interval<string>: " << city_interval << " does "
+ << string(contains(city_interval, "Boston")?"":"NOT")
+ << " contain 'Boston'" << endl;
+ cout << "right_open_interval<Time> : " << time_interval << "\n\n";
+
+ // Using statically bounded intervals does not allows to apply operations
+ // with elements on all interval containers, if their domain_type is continuous.
+ // The code that follows is identical to example 'dynamic_interval'. Only 'internally'
+ // the library default for the interval template now is 'right_open_interval'
+ interval<rational<int> >::type unit_interval
+ = interval<rational<int> >::right_open(rational<int>(0), rational<int>(1));
+ interval_set<rational<int> > unit_set(unit_interval);
+ interval_set<rational<int> > ratio_set(unit_set);
+ // ratio_set -= rational<int>(1,3); // This line will not compile, because we can not
+ // represent a singleton interval as right_open_interval.
+ return 0;
+}
+
+// Program output:
+//>> Interval Container Library: Sample static_interval.cpp <<
+//------------------------------------------------------------
+//----- Statically bounded intervals ----------------------------------------
+//right_open_interval<int> : [3,8)
+//right_open_interval<double>: [0.707107,1.41421) does NOT contain sqrt(2)
+//right_open_interval<string>: [Barcelona,Boston) does contain 'Barcelona'
+//right_open_interval<string>: [Barcelona,Boston) does NOT contain 'Boston'
+//right_open_interval<Time> : [mon:08:31,mon:17:20)
+//]
+

Added: trunk/libs/icl/example/static_interval_/vc9_static_interval.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/static_interval_/vc9_static_interval.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_static_interval"
+ ProjectGUID="{EE61B7EF-EC45-4165-8B49-FD5B7D4A9F7C}"
+ RootNamespace="Static_interval"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\static_interval.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\static_interval.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/std_copy_/std_copy.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/std_copy_/std_copy.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,105 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example std_copy.cpp \file std_copy.cpp
+ \brief Fill interval containers using std::copy.
+
+ Example std_copy shows how algorithm std::copy can be used to
+ fill interval containers from other std::containers and how copying
+ to interval containers differs from other uses of std::copy.
+
+ \include std_copy_/std_copy.cpp
+*/
+//[example_std_copy
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <boost/icl/interval_map.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::icl;
+
+// 'make_segments' returns a vector of interval value pairs, which
+// are not sorted. The values are taken from the minimal example
+// in section 'interval combining styles'.
+vector<pair<discrete_interval<int>, int> > make_segments()
+{
+ vector<pair<discrete_interval<int>, int> > segment_vec;
+ segment_vec.push_back(make_pair(discrete_interval<int>::right_open(2,4), 1));
+ segment_vec.push_back(make_pair(discrete_interval<int>::right_open(4,5), 1));
+ segment_vec.push_back(make_pair(discrete_interval<int>::right_open(1,3), 1));
+ return segment_vec;
+}
+
+// 'show_segments' displays the source segements.
+void show_segments(const vector<pair<discrete_interval<int>, int> >& segments)
+{
+ vector<pair<discrete_interval<int>, int> >::const_iterator iter = segments.begin();
+ while(iter != segments.end())
+ {
+ cout << "(" << iter->first << "," << iter->second << ")";
+ ++iter;
+ }
+}
+
+void std_copy()
+{
+ // So we have some segments stored in an std container.
+ vector<pair<discrete_interval<int>, int> > segments = make_segments();
+ // Display the input
+ cout << "input sequence: "; show_segments(segments); cout << "\n\n";
+
+ // We are going to 'std::copy' those segments into an interval_map:
+ interval_map<int,int> segmap;
+
+ // Use an 'icl::inserter' from <boost/icl/iterator.hpp> to call
+ // insertion on the interval container.
+ std::copy(segments.begin(), segments.end(),
+ icl::inserter(segmap, segmap.end()));
+ cout << "icl::inserting: " << segmap << endl;
+ segmap.clear();
+
+ // When we are feeding data into interval_maps, most of the time we are
+ // intending to compute an aggregation result. So we are not interested
+ // the std::insert semantincs but the aggregating icl::addition semantics.
+ // To achieve this there is an icl::add_iterator and an icl::adder function
+ // provided in <boost/icl/iterator.hpp>.
+ std::copy(segments.begin(), segments.end(),
+ icl::adder(segmap, segmap.end())); //Aggregating associated values
+ cout << "icl::adding : " << segmap << endl;
+
+ // In this last case, the semantics of 'std::copy' transforms to the
+ // generalized addition operation, that is implemented by operator
+ // += or + on itl maps and sets.
+}
+
+int main()
+{
+ cout << ">> Interval Container Library: Example std_copy.cpp <<\n";
+ cout << "-----------------------------------------------------------\n";
+ cout << "Using std::copy to fill an interval_map:\n\n";
+
+ std_copy();
+ return 0;
+}
+
+// Program output:
+/*---------------------------------------------------------
+>> Interval Container Library: Example std_copy.cpp <<
+-----------------------------------------------------------
+Using std::copy to fill an interval_map:
+
+input sequence: ([2,4),1)([4,5),1)([1,3),1)
+
+icl::inserting: {([1,5)->1)}
+icl::adding : {([1,2)->1)([2,3)->2)([3,5)->1)}
+---------------------------------------------------------*/
+//]

Added: trunk/libs/icl/example/std_copy_/vc9_std_copy.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/std_copy_/vc9_std_copy.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_std_copy"
+ ProjectGUID="{8DC9BDE4-E5A4-4294-A12F-D75FD6990B84}"
+ RootNamespace="std_copy"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\std_copy.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/std_transform_/std_transform.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/std_transform_/std_transform.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,149 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example std_transform.cpp \file std_transform.cpp
+ \brief Fill interval containers from user defined objects using std::transform.
+
+ Example std_transform shows how algorithm std::transform can be used to
+ fill interval containers from std::containers of objects of a user
+ defined class.
+
+ \include std_transform_/std_transform.cpp
+*/
+//[example_std_transform
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <boost/icl/split_interval_map.hpp>
+#include <boost/icl/separate_interval_set.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::icl;
+
+// Suppose we are working with a class called MyObject, containing some
+// information about interval bounds e.g. _from, _to and some data members
+// that carry associated information like e.g. _value.
+class MyObject
+{
+public:
+ MyObject(){}
+ MyObject(int from, int to, int value): _from(from), _to(to), _value(value){}
+ int from()const {return _from;}
+ int to()const {return _to;}
+ int value()const{return _value;}
+private:
+ int _from;
+ int _to;
+ int _value;
+};
+
+// ... in order to use the std::transform algorithm to fill
+// interval maps with MyObject data we need a function
+// 'to_segment' that maps an object of type MyObject into
+// the value type to the interval map we want to tranform to ...
+pair<discrete_interval<int>, int> to_segment(const MyObject& myObj)
+{
+ return std::pair< discrete_interval<int>, int >
+ (discrete_interval<int>::closed(myObj.from(), myObj.to()), myObj.value());
+}
+
+// ... there may be another function that returns the interval
+// of an object only
+discrete_interval<int> to_interval(const MyObject& myObj)
+{
+ return discrete_interval<int>::closed(myObj.from(), myObj.to());
+}
+
+
+// ... make_object computes a sequence of objects to test.
+vector<MyObject> make_objects()
+{
+ vector<MyObject> object_vec;
+ object_vec.push_back(MyObject(2,3,1));
+ object_vec.push_back(MyObject(4,4,1));
+ object_vec.push_back(MyObject(1,2,1));
+ return object_vec;
+}
+
+// ... show_objects displays the sequence of input objects.
+void show_objects(const vector<MyObject>& objects)
+{
+ vector<MyObject>::const_iterator iter = objects.begin();
+ while(iter != objects.end())
+ {
+ cout << "([" << iter->from() << "," << iter->to() << "],"
+ << iter->value() << ")";
+ ++iter;
+ }
+}
+
+
+void std_transform()
+{
+ // This time we want to transform objects into a splitting interval map:
+ split_interval_map<int,int> segmap;
+ vector<MyObject> myObjects = make_objects();
+
+ // Display the input
+ cout << "input sequence: "; show_objects(myObjects); cout << "\n\n";
+
+ // Use an icl::inserter to fill the interval map via inserts
+ std::transform(myObjects.begin(), myObjects.end(),
+ icl::inserter(segmap, segmap.end()),
+ to_segment);
+ cout << "icl::inserting: " << segmap << endl;
+ segmap.clear();
+
+ // In order to compute aggregation results on associated values, we
+ // usually want to use an icl::adder instead of an std or icl::inserter
+ std::transform(myObjects.begin(), myObjects.end(),
+ icl::adder(segmap, segmap.end()),
+ to_segment);
+ cout << "icl::adding : " << segmap << "\n\n";
+
+ separate_interval_set<int> segset;
+ std::transform(myObjects.begin(), myObjects.end(),
+ icl::adder (segset, segset.end()),
+ // could be a icl::inserter(segset, segset.end()), here: same effect
+ to_interval);
+
+ cout << "Using std::transform to fill a separate_interval_set:\n\n";
+ cout << "icl::adding : " << segset << "\n\n";
+}
+
+
+int main()
+{
+ cout << ">> Interval Container Library: Example std_transform.cpp <<\n";
+ cout << "------------------------------------------------------------\n";
+ cout << "Using std::transform to fill a split_interval_map:\n\n";
+
+ std_transform();
+ return 0;
+}
+
+// Program output:
+/*----------------------------------------------------------
+>> Interval Container Library: Example std_transform.cpp <<
+------------------------------------------------------------
+Using std::transform to fill a split_interval_map:
+
+input sequence: ([2,3],1)([4,4],1)([1,2],1)
+
+icl::inserting: {([1,2)->1)([2,3]->1)([4,4]->1)}
+icl::adding : {([1,2)->1)([2,2]->2)((2,3]->1)([4,4]->1)}
+
+Using std::transform to fill a separate_interval_set:
+
+icl::adding : {[1,3][4,4]}
+----------------------------------------------------------*/
+//]
+

Added: trunk/libs/icl/example/std_transform_/vc9_std_transform.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/std_transform_/vc9_std_transform.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_std_transform"
+ ProjectGUID="{8DC9BDE4-E5A4-4294-A12F-D75FD6990B85}"
+ RootNamespace="std_transform"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\std_transform.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\separate_interval_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\itl\split_interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/toytime.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/toytime.hpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,74 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2007-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996) // This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
+#endif
+
+namespace boost{namespace icl
+{
+
+/** Time is a toy-class to demonstrate a class that conforms the requirements of
+ a template parameter for class template icl::interval.
+
+ In real world applications you may want to use the integer representation of a
+ time variable. That way intervals and their containers are working most efficiently.
+*/
+
+enum {sunday=0, monday, tuesday, wednesday, thursday, friday, saturday};
+static const char* daynames[] = {"sun", "mon", "tue", "wed", "thu", "fri", "sat"};
+
+class Time
+{
+public:
+ Time(): m_time(0) {}
+ Time(int hours, int minutes): m_time(60*hours+minutes) {}
+ Time(int day, int hours, int minutes): m_time((24*60)*day+60*hours+minutes) {}
+ int getDay()const { return m_time/(24*60); }
+ int getHours()const { return (m_time%(24*60))/60; }
+ int getMinutes()const { return (m_time%(24*60))%60; }
+ int asInt()const { return m_time; }
+ std::string getDayString()const { return daynames[getDay()]; }
+
+ std::string as_string()const
+ {
+ const int MAX_TIMESTING_LEN = 256;
+ char repr[MAX_TIMESTING_LEN];
+ sprintf(repr, "%3s:%02d:%02d", getDayString().c_str(), getHours(), getMinutes());
+ return std::string(repr);
+ }
+
+ Time& operator ++ () { m_time++; return *this; }
+ Time& operator -- () { m_time--; return *this; }
+
+private:
+ int m_time;
+};
+
+
+bool operator < (const Time& x1, const Time& x2) { return x1.asInt() < x2.asInt(); }
+bool operator == (const Time& x1, const Time& x2) { return x1.asInt() == x2.asInt(); }
+bool operator <= (const Time& x1, const Time& x2) { return x1.asInt() <= x2.asInt(); }
+
+
+template<class CharType, class CharTraits>
+std::basic_ostream<CharType, CharTraits> &operator<<
+ (std::basic_ostream<CharType, CharTraits> &stream, Time const& value)
+{
+ return stream << value.as_string();
+}
+
+}} // namespace icl boost
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+

Added: trunk/libs/icl/example/user_groups_/user_groups.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/user_groups_/user_groups.cpp 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,197 @@
+/*-----------------------------------------------------------------------------+
+Interval Container Library
+Author: Joachim Faulhaber
+Copyright (c) 2007-2009: Joachim Faulhaber
+Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+/** Example user_groups.cpp \file user_groups.cpp
+ \brief Shows the availability of set operations on interval maps.
+
+ In the example there is a user group 'med_users' of a hosptial staff
+ that has the authorisation to handle medical data of patients.
+ User group 'admin_users' has access to administrative data like
+ health insurance and invoice data.
+
+ The membership for each user in one of the user groups has a time
+ interval of validity. The group membership begins and ends.
+
+ Using a union operation '+' we can have an overview over both
+ user groups and the membership dates of employees.
+
+ Computing an intersection '&' shows the super users. The persons
+ that are members of both med_users and admin_users and the times
+ of the joint memberships.
+
+ \include user_groups_/user_groups.cpp
+*/
+//[example_user_groups
+// The next line includes <boost/gregorian/date.hpp>
+// and a few lines of adapter code.
+#include <boost/icl/gregorian.hpp>
+#include <iostream>
+#include <boost/icl/interval_map.hpp>
+
+using namespace std;
+using namespace boost::gregorian;
+using namespace boost::icl;
+
+// Type icl::set<string> collects the names a user group's members. Therefore
+// it needs to implement operator += that performs a set union on overlap of
+// intervals.
+typedef std::set<string> MemberSetT;
+
+// boost::gregorian::date is the domain type the interval map.
+// It's key values are therefore time intervals: discrete_interval<date>. The content
+// is the set of names: MemberSetT.
+typedef interval_map<date, MemberSetT> MembershipT;
+
+// Collect user groups for medical and administrative staff and perform
+// union and intersection operations on the collected membership schedules.
+void user_groups()
+{
+ MemberSetT mary_harry;
+ mary_harry.insert("Mary");
+ mary_harry.insert("Harry");
+
+ MemberSetT diana_susan;
+ diana_susan.insert("Diana");
+ diana_susan.insert("Susan");
+
+ MemberSetT chief_physician;
+ chief_physician.insert("Dr.Jekyll");
+
+ MemberSetT director_of_admin;
+ director_of_admin.insert("Mr.Hyde");
+
+ //----- Collecting members of user group: med_users -------------------
+ MembershipT med_users;
+
+ med_users.add( // add and element
+ make_pair(
+ discrete_interval<date>::closed(
+ from_string("2008-01-01"), from_string("2008-12-31")), mary_harry));
+
+ med_users += // element addition can also be done via operator +=
+ make_pair(
+ discrete_interval<date>::closed(
+ from_string("2008-01-15"), from_string("2008-12-31")),
+ chief_physician);
+
+ med_users +=
+ make_pair(
+ discrete_interval<date>::closed(
+ from_string("2008-02-01"), from_string("2008-10-15")),
+ director_of_admin);
+
+ //----- Collecting members of user group: admin_users ------------------
+ MembershipT admin_users;
+
+ admin_users += // element addition can also be done via operator +=
+ make_pair(
+ discrete_interval<date>::closed(
+ from_string("2008-03-20"), from_string("2008-09-30")), diana_susan);
+
+ admin_users +=
+ make_pair(
+ discrete_interval<date>::closed(
+ from_string("2008-01-15"), from_string("2008-12-31")),
+ chief_physician);
+
+ admin_users +=
+ make_pair(
+ discrete_interval<date>::closed(
+ from_string("2008-02-01"), from_string("2008-10-15")),
+ director_of_admin);
+
+ MembershipT all_users = med_users + admin_users;
+
+ MembershipT super_users = med_users & admin_users;
+
+ MembershipT::iterator med_ = med_users.begin();
+ cout << "----- Membership of medical staff -----------------------------------\n";
+ while(med_ != med_users.end())
+ {
+ discrete_interval<date> when = (*med_).first;
+ // Who is member of group med_users within the time interval 'when' ?
+ MemberSetT who = (*med_++).second;
+ cout << "[" << first(when) << " - " << last(when) << "]"
+ << ": " << who << endl;
+ }
+
+ MembershipT::iterator admin_ = admin_users.begin();
+ cout << "----- Membership of admin staff -------------------------------------\n";
+ while(admin_ != admin_users.end())
+ {
+ discrete_interval<date> when = (*admin_).first;
+ // Who is member of group admin_users within the time interval 'when' ?
+ MemberSetT who = (*admin_++).second;
+ cout << "[" << first(when) << " - " << last(when) << "]"
+ << ": " << who << endl;
+ }
+
+ MembershipT::iterator all_ = all_users.begin();
+ cout << "----- Membership of all users (med + admin) -------------------------\n";
+ while(all_ != all_users.end())
+ {
+ discrete_interval<date> when = (*all_).first;
+ // Who is member of group med_users OR admin_users ?
+ MemberSetT who = (*all_++).second;
+ cout << "[" << first(when) << " - " << last(when) << "]"
+ << ": " << who << endl;
+ }
+
+ MembershipT::iterator super_ = super_users.begin();
+ cout << "----- Membership of super users: intersection(med,admin) ------------\n";
+ while(super_ != super_users.end())
+ {
+ discrete_interval<date> when = (*super_).first;
+ // Who is member of group med_users AND admin_users ?
+ MemberSetT who = (*super_++).second;
+ cout << "[" << first(when) << " - " << last(when) << "]"
+ << ": " << who << endl;
+ }
+
+}
+
+
+int main()
+{
+ cout << ">>Interval Container Library: Sample user_groups.cpp <<\n";
+ cout << "-------------------------------------------------------\n";
+ user_groups();
+ return 0;
+}
+
+// Program output:
+/*-----------------------------------------------------------------------------
+>>Interval Container Library: Sample user_groups.cpp <<
+-------------------------------------------------------
+----- Membership of medical staff -----------------------------------
+[2008-Jan-01 - 2008-Jan-14]: Harry Mary
+[2008-Jan-15 - 2008-Jan-31]: Dr.Jekyll Harry Mary
+[2008-Feb-01 - 2008-Oct-15]: Dr.Jekyll Harry Mary Mr.Hyde
+[2008-Oct-16 - 2008-Dec-31]: Dr.Jekyll Harry Mary
+----- Membership of admin staff -------------------------------------
+[2008-Jan-15 - 2008-Jan-31]: Dr.Jekyll
+[2008-Feb-01 - 2008-Mar-19]: Dr.Jekyll Mr.Hyde
+[2008-Mar-20 - 2008-Sep-30]: Diana Dr.Jekyll Mr.Hyde Susan
+[2008-Oct-01 - 2008-Oct-15]: Dr.Jekyll Mr.Hyde
+[2008-Oct-16 - 2008-Dec-31]: Dr.Jekyll
+----- Membership of all users (med + admin) -------------------------
+[2008-Jan-01 - 2008-Jan-14]: Harry Mary
+[2008-Jan-15 - 2008-Jan-31]: Dr.Jekyll Harry Mary
+[2008-Feb-01 - 2008-Mar-19]: Dr.Jekyll Harry Mary Mr.Hyde
+[2008-Mar-20 - 2008-Sep-30]: Diana Dr.Jekyll Harry Mary Mr.Hyde Susan
+[2008-Oct-01 - 2008-Oct-15]: Dr.Jekyll Harry Mary Mr.Hyde
+[2008-Oct-16 - 2008-Dec-31]: Dr.Jekyll Harry Mary
+----- Membership of super users: intersection(med,admin) ------------
+[2008-Jan-15 - 2008-Jan-31]: Dr.Jekyll
+[2008-Feb-01 - 2008-Oct-15]: Dr.Jekyll Mr.Hyde
+[2008-Oct-16 - 2008-Dec-31]: Dr.Jekyll
+-----------------------------------------------------------------------------*/
+//]
+

Added: trunk/libs/icl/example/user_groups_/vc9_user_groups.vcproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/user_groups_/vc9_user_groups.vcproj 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_user_groups"
+ ProjectGUID="{900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}"
+ RootNamespace="User_groups"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="true"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseUnicodeResponseFiles="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release/"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release/"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseUnicodeResponseFiles="false"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib; ../../../../stage/lib"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\user_groups.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\itl\interval_map.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: trunk/libs/icl/example/vc9_icl_examples.sln
==============================================================================
--- (empty file)
+++ trunk/libs/icl/example/vc9_icl_examples.sln 2010-11-07 11:54:37 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,110 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_std_copy", "std_copy_\vc9_std_copy.vcproj", "{8DC9BDE4-E5A4-4294-A12F-D75FD6990B84}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_std_transform", "std_transform_\vc9_std_transform.vcproj", "{8DC9BDE4-E5A4-4294-A12F-D75FD6990B85}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_large_bitset", "large_bitset_\vc9_large_bitset.vcproj", "{6BE62DDE-21B9-4333-BF11-AA054DD53759}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_interval", "interval_\vc9_interval.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B7D2A9F7C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_boost_party", "boost_party_\vc9_boost_party.vcproj", "{0D1DB87E-E72A-4FE9-A067-1907CC6613F8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_interval_container", "interval_container_\vc9_interval_container.vcproj", "{278324CE-9EC1-4D16-B637-E91A07F9DD81}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_man_power", "man_power_\vc9_man_power.vcproj", "{8B9B91C9-E79C-4F24-BD5C-04ED0F38E8C2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_month_and_week_grid", "month_and_week_grid_\vc9_month_and_week_grid.vcproj", "{360BCFA9-9EB6-4D22-8469-CDC290478F78}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_overlap_counter", "overlap_counter_\vc9_overlap_counter.vcproj", "{8DC9BDE4-E5A4-4294-A12F-D75FD6990B83}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_party", "party_\vc9_party.vcproj", "{6BE62DDE-21B9-4333-BF11-AA054DD43759}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_partys_height_average", "partys_height_average_\vc9_partys_height_average.vcproj", "{0D1DB87E-E72A-4FE9-A067-1907CC6633F8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_partys_tallest_guests", "partys_tallest_guests_\vc9_partys_tallest_guests.vcproj", "{0D1DB87E-E72A-4FE9-A067-1907CC6623F8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_user_groups", "user_groups_\vc9_user_groups.vcproj", "{900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_custom_interval", "custom_interval_\vc9_custom_interval.vcproj", "{0D1DB87E-E72A-4FE9-A067-1907CC6614F8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_dynamic_interval", "dynamic_interval_\vc9_dynamic_interval.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B7D3A9F7C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_static_interval", "static_interval_\vc9_static_interval.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B7D4A9F7C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B84}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B84}.Debug|Win32.Build.0 = Debug|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B84}.Release|Win32.ActiveCfg = Release|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B84}.Release|Win32.Build.0 = Release|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B85}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B85}.Debug|Win32.Build.0 = Debug|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B85}.Release|Win32.ActiveCfg = Release|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B85}.Release|Win32.Build.0 = Release|Win32
+ {6BE62DDE-21B9-4333-BF11-AA054DD53759}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6BE62DDE-21B9-4333-BF11-AA054DD53759}.Debug|Win32.Build.0 = Debug|Win32
+ {6BE62DDE-21B9-4333-BF11-AA054DD53759}.Release|Win32.ActiveCfg = Release|Win32
+ {6BE62DDE-21B9-4333-BF11-AA054DD53759}.Release|Win32.Build.0 = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D2A9F7C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D2A9F7C}.Debug|Win32.Build.0 = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D2A9F7C}.Release|Win32.ActiveCfg = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D2A9F7C}.Release|Win32.Build.0 = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6613F8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6613F8}.Debug|Win32.Build.0 = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6613F8}.Release|Win32.ActiveCfg = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6613F8}.Release|Win32.Build.0 = Release|Win32
+ {278324CE-9EC1-4D16-B637-E91A07F9DD81}.Debug|Win32.ActiveCfg = Debug|Win32
+ {278324CE-9EC1-4D16-B637-E91A07F9DD81}.Debug|Win32.Build.0 = Debug|Win32
+ {278324CE-9EC1-4D16-B637-E91A07F9DD81}.Release|Win32.ActiveCfg = Release|Win32
+ {278324CE-9EC1-4D16-B637-E91A07F9DD81}.Release|Win32.Build.0 = Release|Win32
+ {8B9B91C9-E79C-4F24-BD5C-04ED0F38E8C2}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8B9B91C9-E79C-4F24-BD5C-04ED0F38E8C2}.Debug|Win32.Build.0 = Debug|Win32
+ {8B9B91C9-E79C-4F24-BD5C-04ED0F38E8C2}.Release|Win32.ActiveCfg = Release|Win32
+ {8B9B91C9-E79C-4F24-BD5C-04ED0F38E8C2}.Release|Win32.Build.0 = Release|Win32
+ {360BCFA9-9EB6-4D22-8469-CDC290478F78}.Debug|Win32.ActiveCfg = Debug|Win32
+ {360BCFA9-9EB6-4D22-8469-CDC290478F78}.Debug|Win32.Build.0 = Debug|Win32
+ {360BCFA9-9EB6-4D22-8469-CDC290478F78}.Release|Win32.ActiveCfg = Release|Win32
+ {360BCFA9-9EB6-4D22-8469-CDC290478F78}.Release|Win32.Build.0 = Release|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B83}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B83}.Debug|Win32.Build.0 = Debug|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B83}.Release|Win32.ActiveCfg = Release|Win32
+ {8DC9BDE4-E5A4-4294-A12F-D75FD6990B83}.Release|Win32.Build.0 = Release|Win32
+ {6BE62DDE-21B9-4333-BF11-AA054DD43759}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6BE62DDE-21B9-4333-BF11-AA054DD43759}.Debug|Win32.Build.0 = Debug|Win32
+ {6BE62DDE-21B9-4333-BF11-AA054DD43759}.Release|Win32.ActiveCfg = Release|Win32
+ {6BE62DDE-21B9-4333-BF11-AA054DD43759}.Release|Win32.Build.0 = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6633F8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6633F8}.Debug|Win32.Build.0 = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6633F8}.Release|Win32.ActiveCfg = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6633F8}.Release|Win32.Build.0 = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6623F8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6623F8}.Debug|Win32.Build.0 = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6623F8}.Release|Win32.ActiveCfg = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6623F8}.Release|Win32.Build.0 = Release|Win32
+ {900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}.Debug|Win32.Build.0 = Debug|Win32
+ {900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}.Release|Win32.ActiveCfg = Release|Win32
+ {900B8478-E01B-4ECD-A4D6-DC88DD5BF4A1}.Release|Win32.Build.0 = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6614F8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6614F8}.Debug|Win32.Build.0 = Debug|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6614F8}.Release|Win32.ActiveCfg = Release|Win32
+ {0D1DB87E-E72A-4FE9-A067-1907CC6614F8}.Release|Win32.Build.0 = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D3A9F7C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D3A9F7C}.Debug|Win32.Build.0 = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D3A9F7C}.Release|Win32.ActiveCfg = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D3A9F7C}.Release|Win32.Build.0 = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D4A9F7C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D4A9F7C}.Debug|Win32.Build.0 = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D4A9F7C}.Release|Win32.ActiveCfg = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B7D4A9F7C}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal


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