Boost logo

Boost Users :

Subject: [Boost-users] ICL library usage for interval map
From: Dave Schwartz (decebel_at_[hidden])
Date: 2011-06-02 23:48:13


Hi Users,

I am trying to use the new ICL (interval container library) for a
project that requires some interval based calculations.
I have a question on using the joining interval_map.

For example, below I have a conceptual 30 minute window divided into
three 10 minute intervals. I want to do some aggregates in my 10
minute windows.
{ [0,10], (10, 20], (20, 30) }

Now say, I have 2 clients shopping in the first interval (0, 10) and
their shopping time window interval is [2, 5] and [4, 9] minutes
respectively.
When I add the 2 interval, value pairs to my interval_map, I see that
the interval map gets splited from [0, 10] to { [0,2], [2, 4], [5,9],
[9,10] }.
How do I make sure the interval still remains from [0, 10].

My question is how do I make sure my original interval of 10 minutes
is preserved. The samples mentioned do mention about joining
interval_map but I cannot seem to figure out an example for my
requirement.

Thank you for your help
Dece


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net