This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 839

Summary: Wrong 1x1 triangular matrix-vector product
Product: Eigen Reporter: Chen-Pang He <jdh8>
Component: Core - matrix productsAssignee: Nobody <eigen.nobody>
Status: RESOLVED FIXED    
Severity: Wrong Result CC: chtz, gael.guennebaud
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 840    
Attachments:
Description Flags
Demo reproducing the bug none

Description Chen-Pang He 2014-07-07 14:28:02 UTC
Created attachment 473 [details]
Demo reproducing the bug

Our internal::triangular_matrix_vector_product is specialized for triangular matrix-vector product.  When 1x1 times 1xn, it ends prematurely by computing only one entry.

The below is the output from the program compiled with the attachment.

Matrix:
 0.144509
0.0973679
-0.228021
 0.190039
-0.105256
-0.131808
0.0489002
 0.160188

Triangular:
0.144509
       0
       0
       0
       0
       0
       0
       0

?TRMV:
0.144509
       0
       0
       0
       0
       0
       0
       0

?TRMM:
 0.144509
0.0973679
-0.228021
 0.190039
-0.105256
-0.131808
0.0489002
 0.160188
Comment 1 Chen-Pang He 2014-07-08 08:13:34 UTC
I see where the problem is.

When TriangularProduct invokes internal::trmv_selector, side information is lost.  We assumed that if the non-triangular is column-vector then the triangular is on the left.  However, it is possible that the triangular is row-vector on the right.

I am working on a patch to internal::trmv_selector.
Comment 2 Chen-Pang He 2014-07-08 21:38:55 UTC
I found that no refactorization is needed.  I have made a pull request.
https://bitbucket.org/eigen/eigen/pull-request/72/fix-bug-839
Comment 4 Nobody 2019-12-04 13:29:57 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/839.