Hello,
I don't understand the behavior of icl::interval_map<,> on the
following scenario:
1. Before adding a new segment:
{([0.179494,0.679494)->0.333333)([2.51847,3.01847)->0.333333)([3.24221,3.74221)->0.333333)}
2. Add segment: ([3.74221,4.24221)->0.333333)
3. After adding the segment:
{([0.179494,0.679494)->0.333333)([2.51847,3.01847)->0.333333)([3.24221,4.24221)->0.333333)}
What I would expect at step #3 is:
{([0.179494,0.679494)->0.333333)([2.51847,3.01847)->0.333333)([3.24221,4.24221)->0.666667)}
For the sake of clarity I provide a sample code below:
--- [code] ---
#include
#include
#include <iostream>
#include <utility>
namespace icl = ::boost::icl;
int main()
{
typedef double time_type;
typedef double value_type;
typedef icl::interval interval_type;
icl::interval_map intervals;
intervals +=
::std::make_pair(interval_type::right_open(0.1794936069088625,
0.6794936069088625), 0.3333333333333333);
intervals +=
::std::make_pair(interval_type::right_open(2.518467327901063,
3.018467327901063), 0.3333333333333333);
intervals +=
::std::make_pair(interval_type::right_open(3.242205294874485,
3.742205294874485), 0.3333333333333333);
std::cout << "Intervals:\n" << intervals << std::endl;
intervals +=
::std::make_pair(interval_type::right_open(3.742205294874485,
4.242205294874486), 0.3333333333333333);
std::cout << "Updated Intervals:\n" << intervals << std::endl;
}
--- [/code] ---
What kind of interval container should I use in order to obtain the
wanted result?
I'm using the SVN trunk version of boost with GCC 4.5.1 (linux x86_64)
Thank you very much for helping me!
Best,
-- Marco