Re: [eigen] matrix function / exponential warnings |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] matrix function / exponential warnings
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Sun, 20 Jun 2010 18:05:53 +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; bh=tX0gCOunON4MTdLlW48qp/s/ZT4QSDFrVt9/2tJ0Z48=; b=BiYwBzO5w/px5hYnScAB6AerB0l1H8uJILnBq3IbFygove8yTT3hnCEkB6PfmKmSFi 2w+xWNEAJJXVDGko/iu75MpvGtFHAEDcJc+5TiAp6LsPlyC72JwZMEMQmiXLDL4ZEmT5 grCItQW5S0PlefzrplUJvzryahSI8wRf+7380=
- 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; b=e03aansd30jEFlXYCxf4XAX3JIpPkSRiGWx84gqkHVpeL8GjrQ1gnlZBpkhA0ksLOr J+sMyIKm0QGyXiVfElaSnRUAC07zgtLtFska3uG4tzzwCOf3cVLmdZGb9BAR/sjggNf3 P+3W8t3O4tbUQXUUtf6HSYsbCZ4nILPxI6nFI=
On Sun, Jun 20, 2010 at 5:16 PM, Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx> wrote:
> What warnings do you get? I don't remember that I got any, so I guess it's
> MS specific. I think that MatrixBase::fullPivLu() does something very
> similar, so I'm interested why you don't get warnings there.
I got this one:
warning C4181: qualifier applied to reference type; ignored
It is happening when you do e.g. something like this:
typedef int& IntRef;
int a = 5;
const IntRef b = a;
So nothing to worry about though I really want to have a green
dashboard for 3.0.
> I thought that eval() always returns either a PlainObject or a constant
> reference to a PlainObject. That's what the comment "ei_plain_matrix_type:
> the difference from ei_eval is that ei_plain_matrix_type is always a plain
> matrix type,whereas ei_eval is a const reference in the case of a matrix" in
> XprHelper.h suggests to me.
ei_eval<T> is either a
PlainObject = ei_eval<T>::type
or it is a
T const&
or even a
T
So in case you really want to store your temporary, I would just do
this (which I did in my patch)
const typename Derived::PlainObject srcEvaluated = m_src.eval();
>> Any comments? Is there a particular reason why ei_nested<...>::type
>> should not be working out of the box?
>
> I don't know what n should be in ei_nested<...> . It should definitely be
> high because computing matrix functions is very expensive. In fact, I
> thought that the argument of matrix functions should always be evaluated in
> situations like (matrixA+matrixB).exp() onless the argument is a matrix as
> in matrixA.exp(), in which case there is nothing to evaluate. This is
> exactly what eval() is doing.
Yes, you may be totally right. I think it does not make much sense to
go any further. Even though I added right now ei_nested, it should
change pretty much nothing because ei_nested<PlainObject> is in fact
"PlainObject const&".
- Hauke