Boost logo

Boost :

Subject: Re: [boost] boost interval arithmetic
From: Asbjørn (lordcrc_at_[hidden])
Date: 2015-01-15 07:08:51

On 15.01.2015 12:22, Павел Кудан wrote:
> But at any comparison mode arithmetic functions must return correct result.

This[1] article mentions the following:

"There is, however, no consensus on interval division.
In most expositions, interval division, X/Y , is only defined under the
condition that 0 not be contained in Y."

"Interval computation involving division has to be a compromise between
information gain, computational efficiency, and program complexity."

"For efficiency in computation, one may choose to represent
sets of reals by a single closed interval. This can be simply
achieved by replacing <a, b> / <c, d> by the least interval con-
taining it. For the example above this would yield the inter-
val <−∞, +∞>. Another choice would be to represent this
quotient as a finite union of closed intervals, which would
result in more information but also a greater cost in storage
and processing for the operation. For the example above,
this would yield <−∞, 0> ∪ <1, +∞>, which captures all infor-
mation except for the openness of the right endpoint of the
first interval."

I'm not very familiar with interval arithmetics, but I do work with some
algorithms where it could be useful and as such have been looking into it some.

A policy for how to handle divisions seems like a good compromise if it's not
too difficult to implement, ie current behavior vs throw in cases where the
result should technically be a union of intervals.


- Asbjørn

Boost list run by bdawes at, gregod at, cpdaniel at, john at