@@ -570,7 +570,8 @@ bool testDixonSmallFat() {
570570 return success = ZZ .areEqual (r [0 ], b [0 ]);
571571}
572572
573- bool testZeroMatrixCharPoly () {
573+ template < typename CMethod = Method ::Blackbox >
574+ bool testZeroMatrixCharPoly (const CMethod & cMeth = CMethod ()) {
574575 bool success ;
575576 using Ring = Givaro ::Modular < double > ;
576577 using Matrix = SparseMatrix < Ring > ;
@@ -581,7 +582,7 @@ bool testZeroMatrixCharPoly() {
581582
582583 PolynomialRing < Ring > ::Element c_A , Ex ;
583584
584- charpoly (c_A , A );
585+ charpoly (c_A , A , RingCategories :: ModularTag (), cMeth );
585586
586587 PolynomialRing < Ring > PZ (R ,'X' ); PZ .assign (Ex , Givaro ::Degree (1 ), R .one );
587588
@@ -596,38 +597,7 @@ bool testZeroMatrixCharPoly() {
596597 }
597598 return false;
598599 } else
599- if (writing ) std ::cout << "ZMCP: PASSED" << std ::endl ;
600-
601- return success ;
602- }
603- bool testZeroSymmetricMatrixCharPoly () {
604- bool success ;
605- using Ring = Givaro ::Modular < double > ;
606- using Matrix = SparseMatrix < Ring > ;
607- Ring R (3 );
608-
609- Matrix A (R , 1 , 1 );
610- A .setEntry (0 , 0 , R .zero );
611-
612- PolynomialRing < Ring > ::Element c_A , Ex ;
613-
614-
615- charpoly (c_A , A , RingCategories ::ModularTag (), Method ::Blackbox (Shape ::Symmetric ));
616-
617- PolynomialRing < Ring > PZ (R ,'X' ); PZ .assign (Ex , Givaro ::Degree (1 ), R .one );
618-
619- success = PZ .areEqual (c_A , Ex );
620-
621- if (!success ) {
622- if (writing ) {
623- std ::clog <<"**** ERROR **** Fail ZSMCP " <<std ::endl ;
624-
625- PZ .write (std ::clog << "Ex: " , Ex ) << std ::endl ;
626- PZ .write (std ::clog << "cA: " , c_A ) << std ::endl ;
627- }
628- return false;
629- } else
630- if (writing ) std ::cout << "ZSMCP: PASSED" << std ::endl ;
600+ if (writing ) std ::cout << "ZMCP" << cMeth .name () << cMeth .shapeFlags .flags << " : PASSED" << std ::endl ;
631601
632602 return success ;
633603}
@@ -706,8 +676,10 @@ int main (int argc, char **argv)
706676 pass &= testSparseDiagDet (46 );
707677 pass &= testZeroDimensionalCharPoly ();
708678 pass &= testZeroDimensionalMinPoly ();
709- pass &= testZeroMatrixCharPoly ();
710- pass &= testZeroSymmetricMatrixCharPoly ();
679+ pass &= testZeroMatrixCharPoly < > ( );
680+ pass &= testZeroMatrixCharPoly (Method ::Blackbox (Shape ::Symmetric ));
681+ pass &= testZeroMatrixCharPoly (Method ::DenseElimination ());
682+ // pass &= testZeroMatrixCharPoly(Method::SparseElimination());
711683 pass &= testBigScalarCharPoly ();
712684 pass &= testLocalSmith ();
713685 pass &= testInconsistent < DenseMatrix < ZRingInts >> (Method ::DenseElimination ());
0 commit comments