Re: [eigen] Const referencing of matrix indexes |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Const referencing of matrix indexes
- From: Daniel Stonier <d.stonier@xxxxxxxxx>
- Date: Fri, 5 Feb 2010 15:04:04 +0900
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=zBo64gPlmomiwN8/IdHl9ISBApCfmBMTnYfZnFzPEoY=; b=aIqxbES81d6hWRHP5KVhGkGZJm6evBT6zCnrMIlWskEPNS1MeQx46XXwHfCn8VY1sC HA15dlj90mz0vhOHXaJdYk3deqqbS4J8rj+ffZ/k3rcF4sW1MEKr+wayX2UcSHazT/MY fpBp3lw9Db0q4LxN79AuqqBBPbtkqFtn0JmPo=
- 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; b=N4r3hDm3jm5TPkAzrgOVYD5skrPARQL5fQN8y44WeWh5EEpuebRKa6jqnOrtvq/A8V J6itJIOACj/hLmiDxQbQSkmWoMGVs0kt8RCTPTFd+qLepSTgcNRZUe6q7acXZVwvcSw+ xkVmLUt/MRiEVed1e+5Gqk6RhMGM9JKTiBFWI=
Ah, ok. Yes, was referring to MatrixBase.h of 2.0.11.
Cheers,
Daniel.
On 5 February 2010 14:23, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> In the development branch they definitely return references for all
> expressions where that makes sense.
>
> I guess you're talking about 2.0? That's just a design mistake. One of
> many reasons for doing Eigen3 ;)
>
> Benoit
>
> 2010/2/5 Daniel Stonier <d.stonier@xxxxxxxxx>:
>> I just noticed the matrixbase operator[](int index) const (and
>> operator()(...) const) both return "const Scaler" rather than "const
>> Scaler&". Just out of curiosity, what is the reasoning behind this?
>> I've always thought it was standard practice (reading from e.g. the
>> c++ faq-lite) and faster for large objects to return the const
>> reference.
>>
>> Regards,
>> Daniel.
>>
>> --
>> Phone : +82-10-5400-3296 (010-5400-3296)
>> Home: http://snorriheim.dnsdojo.com/
>> Yujin Robot: http://www.yujinrobot.com/
>> Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl
>>
>>
>>
>
>
>
--
Phone : +82-10-5400-3296 (010-5400-3296)
Home: http://snorriheim.dnsdojo.com/
Yujin Robot: http://www.yujinrobot.com/
Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl