Boost logo

Boost Users :

From: Daryle Walker (darylew_at_[hidden])
Date: 2004-01-24 19:20:02


On 1/21/04 5:22 PM, "David Brownell" <david_brownell_at_[hidden]> wrote:

[SNIP]
> I would like an Interval that goes from a min_value to a max_value, where
> each value is the previous value + N.

I think std::valarray<> has something like this.

> For example, the interval {2, 6, 10, 14, 18} has a minimum value of 2, a
> maximum value of 18, and increments by 4. Given this interval, I would like
> a function, Foo, that works as follows:
>
> Interval(2, 18, 4) i;

I think the val-array slice goes "start, length, stride", so the values for
the slice object would be (2, 5, 4).

> i.Foo(2) == 2
> i.Foo(6) == 2
> i.Foo(0) == 2
> i.Foo(18) == 18
> i.Foo(20) == 18
> i.Foo(5) == 6
> i.Foo(3) == 6
[TRUNCATE]

What problem are you trying to solve? Also, I can't see any pattern for the
"Foo" function.

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

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