Re: [eigen] new tutorial on writing functions taking Eigen types as paramters |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] new tutorial on writing functions taking Eigen types as paramters*From*: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>*Date*: Thu, 5 Aug 2010 09:39:12 -0400*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=jXpSPvx7iz4wv6QEHvRj+AiM8KnPXFzRhWlChGnbIRM=; b=KrPTko33QWEztTkKYqiLVZHGXAUPj0xgg/bKdeorwC2PbkukEg2SBO03EyMrGduhPa AbglYw5jlulUFDPvFEFepcb53/jFHewTfgMn/KHXhwdnXs3p1tzqmKYtTgW8d/zTbX67 +MwsL3YxOdqyY/pQN2v7KDPx9AJM4aC0tTGAc=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Uvq/Bgc6ZQ0JJwU/DDeruxjSH22heI+6w9kDwE94xwWWGvEHzvf3GKIAAFtHz4+j6Q bq1D0HmtbofA5id3XKDG0WwkM8OKADT7xbeaKGNlvO848k2K5jctj2WGcMhp0uT9xmUG 4Ga+1Uq5X3PmYQ5EV91oNF683NtTGPLTTmT/U=

2010/8/5 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>: > On Thu, Aug 5, 2010 at 2:16 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote: >> There are 2 different things here: >> - the fact that operator* has a really different meaning on matrices >> and on arrays, is of course wanted. >> - but the fact that .matrix() fails on a matrix is not wanted, IMO. >> It's just that we forgot to add a trivial .matrix() there (of course >> just returning reference to *this) and likewise, add trivial .array() >> on array expressions. > > AFAIK, I introduced Matrix::matrix() already quite some time ago for > other expressions I don't know. I checked, we do have MatrixBase::matrix() which is the Right Thing. Benoit > > Regarding my first post I was once again too hasty. I did not properly > replace everything by Array but left the RowVecotrXf declaration as > RowVectorXf which does not play nicely with array unless you call > .array() or use an array. > >> Looking back at this page I see a few more places that have room for >> improvement: >> 1) the first Array example, >> std::cout << "max: " << (a.max(b)).maxCoeff() << std::endl; >> is a bit not-real-world. How about just taking 1 parameter 'a' and >> doing a.abs().maxCoeff() ? This is definitely array-specific. >> >> 2) the phrase "simple functions" (used to mean "function taking a >> plain Matrix argument") is not precise/explicit enough, and gives the >> impression that Eigen is something complicated in which simple things >> don't work! Why not e.g. "When does passing plain Matrix arguments >> fail?" >> >> 3) the section "How to resize matrices in generic implementations?": two things: >> - since you want to write about this, why not just introduce the >> base class DenseStorageBase? It is the base class for Matrix and Array >> i.e. anything that is a plain object as opposed to an abstract >> expression, hence can be resized. DenseStorageBase inherits either >> MatrixBase or ArrayBase, depending on the XprKind of the Derived type. >> - The title itself, "How to resize matrices in generic >> implementations?" is not precise enough, why not e.g. "How to write >> functions resizing generic arguments" ? > > I will make those changes when I find more time. > > - Hauke > > >

**References**:**[eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Hauke Heibel

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Benoit Jacob

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Hauke Heibel

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Benoit Jacob

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Hauke Heibel

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Benoit Jacob

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Benoit Jacob

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Hauke Heibel

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Benoit Jacob

**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters***From:*Hauke Heibel

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters** - Next by Date:
**[eigen] pseudo-inverse** - Previous by thread:
**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters** - Next by thread:
**Re: [eigen] new tutorial on writing functions taking Eigen types as paramters**

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