Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/tst/testinstall/MatrixObj/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 773 B image not shown  

Quelle  Randomize.tst   Sprache: unbekannt

 
gap> START_TEST("Randomize.tst");
gap> ll := [1,2,3,4,5,6];
[ 1, 2, 3, 4, 5, 6 ]
gap> v1 := Vector(IsPlistVectorRep, Rationals, ll);
<plist vector over Rationals of length 6>
gap> Randomize( v1 );
<plist vector over Rationals of length 6>
gap> Unpack( v1 );
[ -2/3, 2, 1, -4, 0, 1 ]
gap> Randomize( v1 );
<plist vector over Rationals of length 6>
gap> Unpack( v1 );
[ -1, -1, 1/2, 0, -2, 1/2 ]
gap> v2 := Vector(GF(5), ll*One(GF(5)));
[ Z(5)^0, Z(5), Z(5)^3, Z(5)^2, 0*Z(5), Z(5)^0 ]
gap> Randomize( v2 );
[ Z(5)^3, Z(5)^2, 0*Z(5), Z(5)^2, Z(5)^3, 0*Z(5) ]
gap> v2;
[ Z(5)^3, Z(5)^2, 0*Z(5), Z(5)^2, Z(5)^3, 0*Z(5) ]
gap> Randomize( v2 );
[ Z(5)^0, 0*Z(5), Z(5)^3, Z(5), Z(5), Z(5) ]
gap> v2;
[ Z(5)^0, 0*Z(5), Z(5)^3, Z(5), Z(5), Z(5) ]
gap> STOP_TEST( "Randomize.tst" );

[ Dauer der Verarbeitung: 0.7 Sekunden  (vorverarbeitet)  ]