Re: [eigen] Matrix multiplication seems to be exceptionally slow in one specific case |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
On 16.06.2014 17:02, Marc Glisse wrote:
On Mon, 16 Jun 2014, Christian Seiler wrote:
There has been a proposal for 'operator auto' in C++ because of this,
but there doesn't seem to be enough traction for it.
The latest related paper is:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4035.pdf
and the committee will discuss it this week. If you have any comments,
please feel free to post them on:
https://groups.google.com/a/isocpp.org/forum/#!forum/std-proposals
There is some resistance to this kind of change, so any extra
information (use cases, requirements, suggestions, etc) helps, not least
because it shows interest in the proposal.
While I like the idea in general, I'm not totally sure about that
either. This can bring very strange performance differences when
switching between different C++ versions.
In some cases it might even degrade performance, e.g.:
auto AB = A*B; // shall this evaluate into a temporary?
MatrixXd result = AB+C; // actually, no explicit temporary AB required
// direct evaluation would have been better
What would also be confusing is that passing a product to
template<class Matrix> void foo(const Matrix&);
will not do automatic 'auto'-conversion, but this would:
auto X = expression; // auto-conversion
foo(X); // converted X
foo(expression); // no conversion
I think the best thing we can do on our side (and we can do that
independently of changes in the standard) is to warn users about
pitfalls with the auto-keyword. E.g., we could create a doxygen-page for
that and link it prominently (from all starting guides, etc).
I posted a bug for that:
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=825
Christoph
--
----------------------------------------------
Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen
Tel: +49 (421) 218-64252
----------------------------------------------