Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc. |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.*From*: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>*Date*: Sat, 31 Dec 2016 09:33:14 +0100*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+WL+M0xubqzciq0Rj5He0eh3RptlEUso2j4LTX6ooig=; b=u6+46s4d6GYsnZ9pB8rtia9i3lhSWqfudfwpOvB/+n67QgNUWcjciztkmFxGJvD9b1 IKpDGqhy7Lmzeof4Gz6ZJWSdNGRSukWal3ItvZCSaFK5zCZrm22nk+ZX52qIKDI7r31z p5rq+TUkpsFfbchMBX6hdVQIXFDhFg1u49CXGcoKCweYKrcqfXvlLfvYNm7vBYr7hBwJ iXW1SuAKkUTQPuvbRbCOEF5oT1KpsLDA5OTj3iuQ9EzwWXu23BqWDaJvZSYs9Pgc37t/ TWbRUNIYC+n5GeIN3+wpT/g4TGZQJGJ5DWL3xnCBiQLPpPQEsXCtEpUTmhrL4NmXIbzc f6Cg==

On Sat, Dec 31, 2016 at 12:30 AM, Yuanchen Zhu <yuanchen.zhu@xxxxxxxxx> wrote:

Not really, a convex span is related to the convex-hull of a set, and a linear span is the subspace defined by a set of vectors v_1,..,v_n. It can also be defined as the range of the function f(x_1,..x_n)=sum_i x_i v_i.

- you kept "span" (one less character?), but I think "range" is more intuitive (minor)There are several advantages:- Yes one fewer character! Shorter without adding confusion is always better.- Consistency with Armadillo (minor advantage).- The word "range" is overloaded much more than span. There's boost::range, the WIP range v3, and the "range-based" for loops. These big shots can have different conventions, some times [first, last) (range-based for), some times [begin, end) (boost's irange). For span, the only conflict is gsl::span right now (which should really be named array_view anyway, akin to std::string_view. It also takes in (base_ptr, length), so it's categorically different from our use).Just thought of two more points:1. The word "range" in the C++ context often means iterator ranges. Iterators copies the pointer usage, you can ++ until it equals the end of the range, and more importantly you can dereference them. The range we are discussing are range of indices. It might be a good idea to distance away from the (iterator) range connotation.2. If we really want to be nerdy, mathematician has precise definition of spans, as in "linear span" and "convex span". Convex span is sort of exactly what we mean when we write span(first, last). So there you go...

The mathematical notion that is equivalent to what we call range or span here is simply an 'arithmetic progression', also called an 'arithmetic sequence'. So if we really want to avoid confusions/collision with other "range" and "span" in the C++ standard (the span in GSL is likely to be adopted soon), we could think about a contraction like "aseq"?

gael

**References**:**[eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Gael Guennebaud

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Yuanchen Zhu

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Gael Guennebaud

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Yuanchen Zhu

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Gael Guennebaud

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Yuanchen Zhu

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Gael Guennebaud

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Yuanchen Zhu

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Gael Guennebaud

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Yuanchen Zhu

**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.***From:*Yuanchen Zhu

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.** - Next by Date:
**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.** - Previous by thread:
**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.** - Next by thread:
**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |