Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/cap/tst/   (GAP Algebra Version 4.15.1©)  Datei vom 22.8.2025 mit Größe 1 kB image not shown  

Quelle  ListWithKeys.tst   Sprache: unbekannt

 
Spracherkennung für: .tst vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

gap> START_TEST( "ListWithKeys" );

#
gap> LoadPackage( "CAP", false );
true

#
gap> ListWithKeys( [ 987 ], { key, value } -> [ key, value ] ) = [ [ 19 ], [ 28 ], [ 37 ] ];
true
gap> SumWithKeys( [ ], { key, value } -> key + value );
0
gap> SumWithKeys( [ 987 ], { key, value } -> key + value );
30
gap> ProductWithKeys( [ ], { key, value } -> key * value );
1
gap> ProductWithKeys( [ 987 ], { key, value } -> key * value );
3024
gap> ForAllWithKeys( [ 987 ], { key, value } -> [ 987 ][key] = value );
true
gap> ForAllWithKeys( [ 987 ], { key, value } -> key = 1 or value = 8 );
false
gap> ForAnyWithKeys( [ 987 ], { key, value } -> [ 987 ][key] <> value );
false
gap> ForAnyWithKeys( [ 987 ], { key, value } -> key = 3 and value = 7 );
true
gap> NumberWithKeys( [ 987 ], { key, value } -> key = 1 or value = 8 );
2
gap> FilteredWithKeys( [ 987 ], { key, value } -> key = 1 or value = 8 ) = [ 98 ];
true
gap> FirstWithKeys( [ 987 ], { key, value } -> key = 1 and value = 7 );
fail
gap> FirstWithKeys( [ 987 ], { key, value } -> key = 3 and value = 7 );
7
gap> LastWithKeys( [ 987 ], { key, value } -> key = 3 and value = 9 );
fail
gap> LastWithKeys( [ 987 ], { key, value } -> key = 1 and value = 9 );
9

#
gap> STOP_TEST( "ListWithKeys" );

[Dauer der Verarbeitung: 0.20 Sekunden, vorverarbeitet 2026-06-15]