Add static assertion for incompatible scalar types in decompositions

Submitted by seb..@..uni.lu

Assigned to Nobody

Link to original bugzilla bug (#949)
Version: 3.2

Description

Created attachment 537
Demo

For a regular square matrix with n >= 5 rows, the determinant computation returns completely wrong results. I attach a sample code.

For instance for the following matrix:

Eigen::Matrix<int,5,5> C0, C1, C2;  
    C0 <<  
        1, 2, 3, 4, 5,  
        3, 0, 4, 5, 6,  
        2, 1, 2, 3, 4,  
        0, 0, 0, 6, 5,  
        0, 0, 0, 5, 6;  
    C1 <<  
        0, 0,  3, 1, 1,  
        3, 1,  1, 0, 1,  
        1, 0,  2, 3, 3,  
        3, 1,  2, 3, 3,  
        0, 2,  1, 2, 1;  
    C2 <<  
	1, 1,  1,  1,  1,  
	1, 2,  3,  4,  5,  
	1, 3,  6, 10, 15,  
	1, 4, 10, 20, 35,  
	1, 5, 15, 35, 69;  

Expected det(C0) = 99 (when C0.determinant() = -432
Expected det(C1) = -25 (when C1.determinant() = -54
Expected det(C2) = 0 (when C2.determinant() = 1296

Attachment 537, "Demo":
eigen_demo.cpp

Depends on

#750 (closed)

Blocking

#558 (closed)

Edited by Eigen Bugzilla