Re: [eigen] Using Triangular Views

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


I can confirm that this is an issue.
Somewhat related is this bug which at the moment is only worked-around:
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=879

Triang*Triang did not work in 3.2 either, it seems.

I think for 3.3 we should at least work-around this (similar to bug 879)


Christoph


On 2016-08-30 14:09, Brad Bell wrote:
How does one multiply a lower triangular matrix times a lower triangular
matrix and avoid multiplying the zeros in the lower triangular matrix ?

An attempt at this (see below) does not seem to compile when
MULTIPLY_VIEW is non-zero: To be specific, I get the error message:

error: no match for ‘operator*’ (operand types are ‘const
Eigen::TriangularView<Eigen::Matrix<double, 2, 2>, 1u>’ and ‘const
Eigen::TriangularView<Eigen::Transpose<Eigen::Matrix<double, 2, 2> >, 2u>’)
    matrix B = view_L * view_L.transpose();

when I try to compile the program:
# include <Eigen/Core>
# include <iostream>

// code does not compile if you select MULTIPLY_VIEW equal to 1
# define MULTIPLY_VIEW 0

int main()
{   typedef Eigen::Matrix<double, 2, 2> matrix;
    using Eigen::Lower;
    using Eigen::TriangularView;

    matrix A;
    A <<
    1, 2,
    3, 4;
    //
    const TriangularView<matrix, Lower> view_L = A.triangularView<Lower>();
    matrix L = view_L;
    //
# if MULTIPLY_VIEW
    matrix B = view_L * view_L.transpose();
# else
    matrix B = view_L * L.transpose();
# endif
    //
    std::cout << "B =\n" << B << "\n";

    return 0;
}





--
 Dipl. Inf., Dipl. Math. Christoph Hertzberg

 Universität Bremen
 FB 3 - Mathematik und Informatik
 AG Robotik
 Robert-Hooke-Straße 1
 28359 Bremen, Germany

 Zentrale: +49 421 178 45-6611

 Besuchsadresse der Nebengeschäftsstelle:
 Robert-Hooke-Straße 5
 28359 Bremen, Germany

 Tel.:    +49 421 178 45-4021
 Empfang: +49 421 178 45-6600
 Fax:     +49 421 178 45-4150
 E-Mail:  chtz@xxxxxxxxxxxxxxxxxxxxxxxx

 Weitere Informationen: http://www.informatik.uni-bremen.de/robotik



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/