Questions tagged [boost-icl]

Boost.Icl (Interval Container Library) is a C++ library providing interval sets and maps and aggregation of associated values.

Boost.Icl (Interval Container Library) is a C++ library providing interval sets and maps and aggregation of associated values.

30 questions
9
votes
2 answers

Does boost interval_map have operator [] or .at() method?

I'm using interval_map from BOOST library. typedef set Tpopulations; interval_map populations; Say I have this in populations [1006311,1006353) 1611,1653, [1006353,1006432) 1031,1611,1653, [1006432,1006469] …
user2848463
  • 123
  • 5
6
votes
3 answers

Can I do this with Boost interval_map?

What I want to do is handling interval efficiently. For example, in my example, intervals are like the following: [10, 20], [15, 25], [40, 100], [5, 14] Intervals are closed and integers, and some of intervals may be ovelapped. I want to find…
Nullptr
  • 2,527
  • 4
  • 23
  • 27
5
votes
2 answers

Iterating boost::icl::interval_set

I am iterating a boost interval_set, and I was expecting each iterator to be a boost interval, whose values would be accessed with the upper and lower methods: boost::icl::interval_set outages; // ... // Insert intervals…
Roman Rdgz
  • 11,378
  • 36
  • 110
  • 192
4
votes
2 answers

Is there a way to get the number of intervals in a boost::icl::interval_map?

Is there an built-in way to get the number of intervals in a boost::icl::interval_map? I can't find it in the documentation. The method size() has a different purpose it seems.
Jan Deinhard
  • 17,925
  • 24
  • 75
  • 131
4
votes
2 answers

Combinations of N Boost interval_set

I have a service which has outages in 4 different locations. I am modeling each location outages into a Boost ICL interval_set. I want to know when at least N locations have an active outage. Therefore, following this answer, I have implemented a…
Roman Rdgz
  • 11,378
  • 36
  • 110
  • 192
4
votes
1 answer

Basic use of function "contains" in Boost ICL: Are some combinations of interval types and functions not implemented?

I started to use Boost ICL and I stumbled upon very basic stuff. For example the function contains should return true or false depending if a given element is in the interval or not. However that works for [right,left]_open_intervals but not for…
alfC
  • 10,293
  • 4
  • 42
  • 88
3
votes
1 answer

Is it possible and resonable to use Boost ICL instead of for_each in case of selecting a service for request?

I have a request structure with std::vector arguments in it. I have a std::map > services where key is service name and value is a vector of arguments that service responds to. arguments of…
myWallJSON
  • 8,264
  • 17
  • 72
  • 139
3
votes
1 answer

What makes the Boost `interval_map` to ignore insertion?

The code below is supposed to insert two intervals with associated values 0 and 1 into the Boost interval map, but it inserts only one: #include #include using Interval = boost::icl::interval; using…
HEKTO
  • 3,305
  • 1
  • 20
  • 37
3
votes
1 answer

Boost ICL, cardinality of an interval set

In Boost ICL, when I call cardinality() or size() functions on an interval set, the return type is size_t, independent of the type of interval. On 32-bit machines this is a 32-bit unsigned integer. If my intervals, however, are of type int64_t, the…
Konstantin
  • 1,591
  • 16
  • 22
3
votes
2 answers

Boost ICL map that replaces values in intervals?

Boost.ICL's interval_map has two kinds of behaviors: += and insert. Both are useful in different context. The first adds up values in common intersections of two existing intervals. The second simply introduces the new value only in previously…
alfC
  • 10,293
  • 4
  • 42
  • 88
3
votes
1 answer

How to shift an interval when using the C++ Boost interval container library (ICL)?

How do I shift a discrete_interval using the Boost interval container library? i.e. I want to subtract integer c from the lower() of the interval and from the upper() of the interval? Obviously I could create a new interval, but I'm looking for the…
daj
  • 6,291
  • 7
  • 39
  • 73
2
votes
1 answer

Using boost::icl::interval_map with std::shared_ptr

I'd like to use shared pointers with boost::icl::interval_map, something similar to the following: namespace icl = boost::icl; icl::interval_map> party; const auto mary = std::make_shared
davidvandebunte
  • 932
  • 9
  • 22
2
votes
0 answers

How to determine openness in Boost ICL interval?

In Boost.ICL, what is the canonical way to determine if an interval is closed or open? Currently I am doing this: #include #include int main(){ boost::icl::discrete_interval di({2, 5}); //…
alfC
  • 10,293
  • 4
  • 42
  • 88
2
votes
0 answers

boost icl shared memory access

I have created icl map in shared memory as described in below link c++ boost icl containers in shared memory below is the code #include #include #include…
user3559050
  • 108
  • 8
1
vote
1 answer

How to get values from interval_maps for given key?

I'm using boost::icl::interval_maps with int intervals and I was wondering how can I get the values for int (key) that belongs to some interval? For example if we have a interval map that has the following structure [0, 5): ["A1", "A2"], [5, 10):…
Daniel
  • 738
  • 6
  • 18
1
2