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: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 5 Feb 2010 00:23:39 -0500
- 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=W47dnr/wenx5XWY2rOkwTxwPvA/qcJpmWucAG2OIwZw=; b=M5wGLZcZqiZzjjla5o+X8t7KAo4SLgLt75RHizZLa+oPCHycMlsdTaKmuiifETnbac yQnv7d5aEwqfOfkB0aepYEnP7tShRru/yCQBauK5Se6k4XojlqFJlYPZ6SU6CXCVWATD Q3UYqHqg5a2RKdQTYLW0f7CUyfnkQQgDLXKu8=
- 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=R4J/0bS8kMMTDrk6leUsj/2S/YfW5sy7l7Xwuk5YKYJpmJrJszMB4Rb7OSZsUMWVLu VnU4z2zq05O1DJjI6toMuH3Oi1VArgR0O1RWqDzOmCHmZCKbeNsF2NO7GFLtIyXibZYU p/Fs3Lfu7n3Czldl8e/gyX52IEdpqwfww+Mvw=
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
>
>
>