Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/semigroups/tst/standard/elements/   (GAP Algebra Version 4.15.1©)  Datei vom 29.7.2025 mit Größe 5 kB image not shown  

Quelle  blocks.tst   Sprache: unbekannt

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

#############################################################################
##
#W  standard/elements/blocks.tst
#Y  Copyright (C) 2014-2022                               Attila Egri-Nagy
##                                                       James D. Mitchell
##
##  Licensing information can be found in the README file of this package.
##
#############################################################################
##

#@local S, a, b, blocks, x, y
gap> START_TEST("Semigroups package: standard/elements/blocks.tst");
gap> LoadPackage("semigroups", false);;

#
gap> SEMIGROUPS.StartTest();

# blocks: BLOCKS_NC 1/1
gap> x := BLOCKS_NC([[1], [2], [-3]]);
<blocks: [ 1* ], [ 2* ], [ 3 ]>

# blocks: PrintString 1/1
gap> x := BLOCKS_NC([[16], [2], [34], [-5]]);;
gap> PrintString(x);
"BLOCKS_NC([ [ 16 ], [ 2 ], [ 34 ], [ -5 ] ])"

# blocks: SEMIGROUPS.HashFunctionForBlocks 1/1
gap> Size(Monoid([Bipartition([[12, -1], [-2]]),
>  Bipartition([[1], [2, -1, -2]])]));
8

# blocks: \< 1/1
gap> a := BLOCKS_NC([[12], [35], [4]]);;
gap> b := BLOCKS_NC([[1], [23], [4], [-5]]);;
gap> a < b;
true
gap> b < a;
false

# blocks: \= 1/1
gap> a := BLOCKS_NC([[12], [35], [4]]);;
gap> b := BLOCKS_NC([[1], [23], [4], [-5]]);;
gap> b = a;
false
gap> a = b;
false
gap> a = a;
true

# blocks: ProjectionFromBlocks 1/1
gap> x :=
> Bipartition([[123], [479], [5610, -1], [8, -3, -5, -8],
>  [-2, -4], [-6, -7], [-9, -10]]);;
gap> y := LeftBlocks(x);
<blocks: [ 123 ], [ 479 ], [ 5*, 6*, 10* ], [ 8* ]>
gap> ProjectionFromBlocks(y);
<bipartition: [ 123 ], [ 479 ], [ 5610, -5, -6, -10 ], [ 8, -8 ], 
 [ -1, -2, -3 ], [ -4, -7, -9 ]>
gap> last = LeftProjection(x);
true

# blocks: BLOCKS_RIGHT_ACT 1/1 
gap> NrRClasses(PartitionMonoid(3));
22

# blocks: BLOCKS_LEFT_ACT 1/3 
gap> S := Monoid([Bipartition([[12, -1], [-2]]),
>  Bipartition([[1, -2], [2, -1]])]);;
gap> NrLClasses(S);
3

# blocks: BLOCKS_LEFT_ACT 2/3
gap> NrLClasses(PartitionMonoid(2));
6

# blocks: BLOCKS_E_TESTER 1/3
gap> NrIdempotents(PartitionMonoid(3));
114

# blocks: BLOCKS_E_TESTER 2/3
gap> x := BLOCKS_NC([[14], [235]]);;
gap> y := BLOCKS_NC([[123], [4], [-5, -6]]);;
gap> BLOCKS_E_TESTER(x, y);
false

# blocks: BLOCKS_E_TESTER 3/3
gap> x := BLOCKS_NC([[14], [235]]);;
gap> y := BLOCKS_NC([[1], [-2, -3, -4], [-5]]);;
gap> BLOCKS_E_TESTER(x, y);
false

# blocks: BLOCKS_E_CREATOR 1/3
gap> Set(Idempotents(PartitionMonoid(2)));
[ <block bijection: [ 12, -1, -2 ]>, <bipartition: [ 12, -1 ], [ -2 ]>, 
  <bipartition: [ 12, -2 ], [ -1 ]>, <bipartition: [ 12 ], [ -1, -2 ]>, 
  <bipartition: [ 12 ], [ -1 ], [ -2 ]>, <bipartition: [ 1, -1, -2 ], [ 2 ]>
    , <block bijection: [ 1, -1 ], [ 2, -2 ]>, 
  <bipartition: [ 1, -1 ], [ 2 ], [ -2 ]>, <bipartition: [ 1 ], [ 2, -1, -2 ]>
    , <bipartition: [ 1 ], [ 2, -2 ], [ -1 ]>, 
  <bipartition: [ 1 ], [ 2 ], [ -1, -2 ]>, 
  <bipartition: [ 1 ], [ 2 ], [ -1 ], [ -2 ]> ]

# blocks: BLOCKS_RIGHT_ACT 1/1
gap> x := Bipartition([[110], [2, -7, -9], [3468],
> [5, -5], [79, -2], [-1, -10], [-3, -4, -6, -8]]);;
gap> blocks := BLOCKS_NC([[-1, -10], [2], [-3, -4, -6, -8], [5],
> [79]]);;
gap> BLOCKS_RIGHT_ACT(blocks, x) = blocks;
true

# blocks: BLOCKS_LEFT_ACT 1/1
gap> x := Bipartition([[110], [2, -7, -9], [3468],
> [5, -5], [79, -2], [-1, -10], [-3, -4, -6, -8]]);;
gap> blocks := BLOCKS_NC([[-1, -10], [2], [-3, -4, -6, -8], [5],
> [79]]);;
gap> BLOCKS_LEFT_ACT(blocks, Star(x)) = blocks;
true

# blocks: BLOCKS_INV_RIGHT, 1/1
gap> x := Bipartition([[1478, -4], [235, -2, -7],
> [6, -1], [-3], [-5, -6, -8]]);;
gap> blocks := BLOCKS_NC([[-1, -4, -5, -8], [-2, -3, -7], [6]]);;
gap> RankOfBlocks(blocks);
1
gap> RankOfBlocks(BLOCKS_RIGHT_ACT(blocks, x));
1
gap> BLOCKS_INV_RIGHT(blocks, x);
<bipartition: [ 1, -6 ], [ 2345678 ], [ -1, -4, -5, -8 ], 
 [ -2, -3, -7 ]>

# blocks: BLOCKS_INV_LEFT, 1/1
gap> x := Bipartition([[1478, -4], [235, -2, -7],
> [6, -1], [-3], [-5, -6, -8]]);;
gap> blocks := BLOCKS_NC([[-1, -2, -6], [345], [-7, -8]]);;
gap> RankOfBlocks(BLOCKS_LEFT_ACT(blocks, x));
1
gap> BLOCKS_INV_LEFT(blocks, x);
<bipartition: [ 126 ], [ 345, -1, -2, -3, -4, -5, -6, -7, -8 ], 
 [ 78 ]>

# blocks: AsDigraph and CanonicalBlocks
gap> x := Bipartition([[147812, -1, -5, -14],
> [2351015, -2, -4, -17], [691719, -9, -20],
> [1120, -6, -8, -16], [13141618, -12, -18], [-3, -7, -11, -19],
> [-10, -13, -15]]);;
gap> blocks := LeftBlocks(x);;
gap> CanonicalBlocks(blocks);
<blocks: [ 1*, 2* ], [ 3*, 4*, 5*, 6* ], [ 7*, 8*, 9*, 10* ], [ 11*, 12*, 13*,\
 14*, 15* ], [ 16*, 17*, 18*, 19*, 20* ]>
gap> blocks := RightBlocks(x);;
gap> CanonicalBlocks(blocks);
<blocks: [ 1*, 2* ], [ 3*, 4* ], [ 5*, 6*, 7* ], [ 8*, 9*, 10* ], [ 11*, 12*, \
13* ], [ 141516 ], [ 17181920 ]>
gap> Print(last); "this string allows us to test the PrintObj method";
BLOCKS_NC([ [ 12 ], [ 34 ], [ 567 ], [ 8910 ], [ 111213 ], [ -\
14, -15, -16 ], [ -17, -18, -19, -20 ] ])"this string allows us to test the Pr\
intObj method"

# Test empty blocks
gap> BLOCKS_NC([]);
<empty blocks>


gap> SEMIGROUPS.StopTest();
gap> STOP_TEST("Semigroups package: standard/elements/blocks.tst");

[Dauer der Verarbeitung: 0.27 Sekunden, vorverarbeitet 2026-06-17]