This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 371 - Automatically transforming a*b.transpose()*c into a*b.dot(c)
Summary: Automatically transforming a*b.transpose()*c into a*b.dot(c)
Status: CONFIRMED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - expression templates (show other bugs)
Version: 3.0
Hardware: All All
: Normal Optimization
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on: ExprEval
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-31 15:48 UTC by Rhys Ulerich
Modified: 2019-12-04 11:14 UTC (History)
3 users (show)



Attachments

Description Rhys Ulerich 2011-10-31 15:48:41 UTC
Awhile back (http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2009/09/msg00280.html)there was some discussion of automatically transforming a*b.transpose()*c into the equivalent (and faster) a*b.dot(c).

A quick test 3.0.3 shows the latter expression being appreciably faster than the former at -O3 using the (admittedly lousy) benchmark

    Eigen::Vector3d a, b, c, d;

    for (unsigned long i = 0; i < 1000000; ++i) {
        grvy_timer_begin("Outer");
        a.setRandom();
        b.setRandom();
        c.setRandom();
        d = a*b.transpose()*c;
        grvy_timer_end("Outer");

        grvy_timer_begin("Dot");
        a.setRandom();
        b.setRandom();
        c.setRandom();
        d = a*b.dot(c);
        grvy_timer_end("Dot");
    }

Very, very low priority.  Just wanted to capture it as an issue.

- Rhys
Comment 1 Benoit Jacob 2011-10-31 15:51:26 UTC
The expression evaluator (bug 99) should make this kind of optimizations possible.
Comment 2 Nobody 2019-12-04 11:14:43 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/371.

Note You need to log in before you can comment on or make changes to this bug.