[eigen] Const referencing of matrix indexes |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Const referencing of matrix indexes
- From: Daniel Stonier <d.stonier@xxxxxxxxx>
- Date: Fri, 5 Feb 2010 14:19:48 +0900
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Gt5dIYDnbr8VZ1Q2yMzwtjoCcbYcZ6ukiRqVBUrRKY8=; b=T6CTabQz+0ykoyOYW71h9KsWBcIipqOJnEyfkzWz5W5PIJWsGKSzG+XfqCdN1MkNOe EgrqsJb4ArvPGV3OmAcqatq6jTd7+FGy/UoO5pI05UadBh0TTiwgCZOhyOdks6YEAGzz x121p9T/CNj7jDR8U2v3i96ukqfQMmlDbGGws=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=g0hYLm0Nh3qlob2dALFRxFa6ExzAq+qyzS1wvF+6kWxqgXAemOYTuarydFionWEvRn 5TKHcjUhYgGA+SQZUmrgMdEvrI0oKcf6GG0BZlkPA7qPydXcqPXxbTDpI93CcVFZWIDX 68VJDow1/jZJ4S50wKZFNxicC7/15sjEofIEs=
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