Re: [eigen] Vector generators |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Vector generators*From*: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>*Date*: Sun, 25 Apr 2010 09:19:51 +0200*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=PQcSjxZR1wEQzJyVmE8mKriGFBPqJsM7ltcUASUOmRM=; b=DQYiXw8wkw0OG/A263nEytbHiN7hyGLvcbFb5ovXVouD7r1g35wbW6lRDrf0WpB6+1 ucEg/muVPMyJjzk+J3/12sOrwzN93uB//+Xq82JuwYnRo7VlNq0R9Va74jecHHNqVL7H K/+EPXLHtPsLkiDeI/ldbxYD09y/T/CF8F4ug=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ALxGK2va1Wr0eCRw8NHJbGDz8D6KEdj4MpdAo4LyRcAmlbX03wX64mCUpX8XPpRQvV 2zTLF2X3/fu7clYgmX6oMCQHrw6vwytEFFHmoui3DrAZl3XjH5UCVh+bvA+Ixq8OZjGF ms0lYBRCAkATg7aFgSslel//1DHDepTDUWux8=

We have some functions which might be offering what you are looking for in the development branch: 1) setLinSpaced(const Scalar &low, const Scalar &high, int size), see here http://tinyurl.com/32lo4fr 2) LinSpaced (const Scalar &low, const Scalar &high, int size), http://tinyurl.com/2uqfjhj 3) LinSpaced (Sequential_t, const Scalar &low, const Scalar &high, int size), http://tinyurl.com/36zjs6g The third method is the fastes since it is setting up to 4 values in one step though there is a slight approximation error involved due to successive summation. All methods have in common, that you may (actually, will most likely) end up with your last element being high + small error which is caused by typical rounding errors. Regards, Hauke On Sat, Apr 24, 2010 at 8:48 PM, Manoj Rajagopalan <rmanoj@xxxxxxxxx> wrote: > Hi, > > I frequently generate mesh-data of the form f((1:n)*factor), where n is the > number of elements in the mesh, factor is some multiplicative factor > (mesh-spacing), and f() is some function that operates on each of the > generated values. Is something like this possible with concise syntax in > eigen? > > The quantity (1:n) can be thought of as an extension of the constant-vector > concept. A further extension is the vector generated by (start,finish,delta). > These vectors, like eigen's constant-vectors, can be concisely encoded and > expanded at assignment-time. > > Thanks, > Manoj > > >

**References**:**[eigen] Vector generators***From:*Manoj Rajagopalan

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Vector generators** - Next by Date:
**[eigen] Nullary test in fab6e2c5ce0e** - Previous by thread:
**[eigen] Vector generators** - Next by thread:
**[eigen] Nullary test in fab6e2c5ce0e**

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