We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10cc76d commit de2743aCopy full SHA for de2743a
lib/matrix.gi
@@ -473,8 +473,16 @@ BindGlobal( "Matrix_CharacteristicPolynomialSameField",
473
vec[i] := zero;
474
fi;
475
od;
476
- Assert(3, IsZero(Value(cp,imat)));
477
Assert(2, Length(CoefficientsOfUnivariatePolynomial(cp)) = n+1);
+ if AssertionLevel()>=3 then
478
+ # cannot use Value(cp,imat), as this uses characteristic polynomial
479
+ n:=Zero(imat);
480
+ one:=One(imat);
481
+ for i in Reversed(CoefficientsOfUnivariatePolynomial(cp)) do
482
+ n:=n*imat+(i*one);
483
+ od;
484
+ Assert(3,IsZero(n));
485
+ fi;
486
Info(InfoMatrix,1,"Characteristic Polynomial returns ", cp);
487
return cp;
488
end );
0 commit comments