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: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Mon, 16 Aug 2010 12:13:14 +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=l1kwXUdZArTd7YE5ci7o/eDJl4I/rkgqIEteyE4qSIc=; b=L6Ai9jmipSJotCZURiKjacteipAVnnoX8gABB2bQ8LpVwcVjaAzx3Pb1xtLSr3TyE3 tJmbZyUwjpp5m/V47BWZVp70o2TQtCiaGtyXkRlF6sXbyITrWVDhUoXZfYqs/cU2CMJG mawGW19VV7KMVVGUA2kXtpCa6gJr3a6JimT1o=
- 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=Qfm93m+oWTY8JJybCaHa/VTxeFubwJFU9IqjV1fYcJfCQQtdQV0JDAsYEf3/xwmYSx GxCu0mD51LYluXXF6LsVnELhspnyZv+3wS45jv29kf64zwWPCMx1uE/CaFg+pMhKvZeT rQ+AKLkBL4+H0O6DnaJIoXgo4+Ayu6oh4n8qY=
On Mon, Aug 16, 2010 at 11:55 AM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> On Thu, Aug 5, 2010 at 3:48 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>> - mention Nested (at the end of the page! it's an advanced topic, but
>> it's important for advanced users).
>
> I don't think this is an advanced topic, and to be safe, every
> argument should be systematically converted to their nested type:
> template<typename Derived> void foo(const MatrixBase<Derived>& _x)
> {
> typename Derived::Nested x (_x);
> // use x, not _x
> }
Do we need this as a safeguard for types that require evaluation
before nesting? Here it would be more like "require evaluation before
further usage".
But is it really true, that we need something like this? Could you
maybe help me out with a use case? When somebody were passing a
product, that would anyways use it's internal temporary, right?
> For advanced user we should also explain ei_nested which is preferred
> if the argument is used more than once. Since ei_nested is mostly
> internal, maybe we should also add a slightly higher level public
> wrapper....
Should not ei_nested<Derived> in theory be the same as Derived::Nested?
- Hauke