############################################################################# ## #W determinant.tst Robert F. Morse ## ## #H $Id: determinant.tst,v 1.4 2001/11/23 13:32:50 unialg Exp $ ## ## ## gap> START_TEST("$Id: determinant.tst,v 1.4 2001/11/23 13:32:50 unialg Exp $"); gap> ######################################################################## gap> ## Test strategy: gap> ## Fix a commutative ring, gap> ## create (randomly) a Vandermonde matrix over that ring, gap> ## compute the determinant analytically and then via the gap> ## fraction or division-free method and compare results. gap> ## gap> ## Integers gap> ## gap> n:=5;; gap> r := Integers; Integers gap> ## Vandermonde Matrix gap> _X := List([1..n],z->Random(r));; gap> M := List(_X,x->List([0..n-1],y->x^y));; gap> VD := Product(List(Filtered(Cartesian([1..n],[1..n]), x->x[1]_X[x[2]]-_X[x[1]]));; gap> D := DeterminantMatDivFree(M);; gap> VD=D; true gap> ## GaussianIntegers gap> ## gap> r := GaussianIntegers; GaussianIntegers gap> ## Vandermonde Matrix gap> _X := List([1..n],z->Random(r));; gap> M := List(_X,x->List([0..n-1],y->x^y));; gap> VD := Product(List(Filtered(Cartesian([1..n],[1..n]), x->x[1]_X[x[2]]-_X[x[1]]));; gap> D := DeterminantMatDivFree(M);; gap> VD=D; true gap> ## gap> ## Group ring gap> ## gap> r := GroupRing(Integers,CyclicGroup(10));; gap> _X := List([1..n],z->Random(r));; gap> M := List(_X,x->List([0..n-1],y->x^y));; gap> VD := Product(List(Filtered(Cartesian([1..n],[1..n]), x->x[1]_X[x[2]]-_X[x[1]]));; gap> D := DeterminantMatDivFree(M);; gap> VD=D; true gap> ## gap> ## polynomial ring gap> ## gap> r := PolynomialRing(Integers);; gap> x := IndeterminatesOfPolynomialRing(r)[1];; gap> _X := List([1..n],z->Random(Integers)*x^Random(Integers));; gap> M := List(_X,x->List([0..n-1],y->x^y));; gap> VD := Product(List(Filtered(Cartesian([1..n],[1..n]), x->x[1]_X[x[2]]-_X[x[1]]));; gap> D := DeterminantMatDivFree(M);; gap> VD=D; true gap> STOP_TEST( "determinant.tst", 1000000000 ); ############################################################################# ## #E determinant.tst . . . . . . . . . . . . . . . . . . . . . . . . ends here