StrictlyLower/StrictlyUpper triangularView doesn't work properly with matrix product

Submitted by Lauri Berkovits

Assigned to Nobody

Link to original bugzilla bug (#1405)
Version: 3.3 (current stable)
Operating system: Linux

Description

Created attachment 782
example code

This kind of code doesn't give what one expects:

C.triangularView<StrictlyLower>() = A*B;

(Without "strictly" it works perfectly.)

Example code:

MatrixXi A, B, C, D;
A = MatrixXi::Ones(5,5);
B = MatrixXi::Ones(5,5);

C = MatrixXi::Zero(5,5);
D = MatrixXi::Zero(5,5);

C.triangularView<StrictlyLower>() = AB;
D.triangularView<StrictlyUpper>() = A
B;

cout << "\n C = \n " << C << endl;
cout << "\n D = \n " << D << endl;

Output:

C =
5 5 5 5 0
0 5 5 5 0
0 0 5 5 0
0 0 0 5 0
0 0 0 0 5

D =
5 5 5 5 0
0 5 5 5 0
0 0 5 5 0
0 0 0 5 0
0 0 0 0 5

Attachment 782, "example code":
testing.cpp

Edited by Eigen Bugzilla