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.
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.