Boost logo

Boost :

From: Marco (mrcekets_at_[hidden])
Date: 2007-04-13 15:44:48


On Fri, 13 Apr 2007 20:26:17 +0200, Daniel Walker
<daniel.j.walker_at_[hidden]> wrote:

> On 4/13/07, Neal Becker <ndbecker2_at_[hidden]> wrote:
>> I just posted something on ublas, but I think it may be of more general
>> interest.
>>
>> I have been using boost::range heavily, and find it useful for generic
>> interfaces. I think it is also useful to have a multi-dimensional
>> extension to range. In particular, a 2-d extension would help in
>> creating
>> algorithms that can accept a variety of 2-d structures.
>>
>> For example, range has size, begin, end.
>>
>> range2d would have size1, size2, begin1, begin2.
>
> I think this is an interesting idea, and I've been looking into a
> little while. You could make this multi-dimensional not just 2d. How
> about something like ..
>
> // get the number of lines in the plane at index 0 of a 3d space
> plane_type& space_2d = span(space_3d, 0);
> range_size<
> plane_type
> >::type n_2d = size(space_2d);
>
> I'm not sure if span is the right name for it, and this has got to be
> encroaching on UBLAS' domain. But it's doable for ranges. I just tried
> the following, which I believe will work for arbitrary dimensions.
>

Mathematically speaking, the term "span" is inappropriate: span is usually
used in linear algebra to denote the space generated by all linear
combinations of a set of vectors; so if you have two indipendent vectors
belonging to the plane they generate the whole plane (they are a system of
generators for the plane).
On the contrary you do not want to expand space_3d. The right term, IMHO,
could be "slice" because you want to slice space_3d in order to get one of
its affine subspace.

Marco

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk