linbox-team / linbox

LinBox - C++ library for exact, high-performance linear algebra
https://linbox-team.github.io/linbox
GNU Lesser General Public License v2.1
81 stars 28 forks source link

problem with zero sequence for minpoly/charpoly #288

Closed pascalgiorgi closed 2 years ago

pascalgiorgi commented 2 years ago

The current minpoly does not ensure that the sequence is not the zero sequence, i.e. the projection vectors are not orthogonal. This clearly expose a bug for charpoly with the zero matrix.

This PR fixes this issue by checking the dot product of the projection vectors is not zero.

A test has been added for charpoly to cover symmetric and non symmetric case.