Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/tst/testinstall/   (GAP Algebra Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 4 kB image not shown  

Quelle  matblock.tst   Sprache: unbekannt

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

#@local dim,m1,m2,m3,mm,o1,o2,p1,p2,p3,p4,tmp,z,R,G,H,reps,ind,img
gap> START_TEST("matblock.tst");
gap> m1 := BlockMatrix( [ [ 11, [[1,1],[0,1]] ],
>                         [ 13, [[1,0],[0,1]] ],
>                         [ 22, [[0,1],[1,0]] ],
>                         [ 34, [[1,0],[0,0]] ] ], 34 );
<block matrix of dimensions (3*2)x(4*2)>
gap> m2 := BlockMatrix( [ [ 13, [[1,0],[0,1]] ],
>                         [ 21, [[1,0],[0,1]] ],
>                         [ 32, [[1,0],[0,1]] ] ], 33 );
<block matrix of dimensions (3*2)x(3*2)>
gap> m3 := AsBlockMatrix( m2, 22 );
<block matrix of dimensions (2*3)x(2*3)>
gap> z  := BlockMatrix( [], 33220 );
<block matrix of dimensions (3*2)x(3*2)>
gap> NrRows( m1 ); NrCols( m1 ); DimensionsMat( m1 );
6
8
68 ]
gap> NrRows( m2 ); NrCols( m2 ); DimensionsMat( m2 );
6
6
66 ]
gap> NrRows( m3 ); NrCols( m3 ); DimensionsMat( m3 );
6
6
66 ]
gap> NrRows( z ); NrCols( z );  DimensionsMat( z );
6
6
66 ]
gap> m1[3];
00010000 ]
gap> m1[3][4] := 4;
Error, List Assignment: <list> must be a mutable list
gap> m1[3];
00010000 ]
gap> z[2];
000000 ]
gap> m2 = m3;
true
gap> p1:= m2 * m1;
<block matrix of dimensions (3*2)x(4*2)>
gap> p2:= m3 * m1;
[ [ 00000010 ], [ 00000000 ], 
  [ 11001000 ], [ 01000100 ], 
  [ 00010000 ], [ 00100000 ] ]
gap> p1 = p2;
true
gap> p3:= m1 * TransposedMat( m1 );
<block matrix of dimensions (3*2)x(3*2)>
gap> mm:= MatrixByBlockMatrix( m1 );
[ [ 11001000 ], [ 01000100 ], 
  [ 00010000 ], [ 00100000 ], 
  [ 00000010 ], [ 00000000 ] ]
gap> mm * TransposedMat( mm ) = p3;
true
gap> p4:= TransposedMat( m1 ) * m2;
<block matrix of dimensions (4*2)x(3*2)>
gap> p3 = p4;
false
gap> z = AsBlockMatrix( z, 22 );
true
gap> Zero( m3 ) = z;
true
gap> MatrixByBlockMatrix( m1 );
[ [ 11001000 ], [ 01000100 ], 
  [ 00010000 ], [ 00100000 ], 
  [ 00000010 ], [ 00000000 ] ]
gap> MatrixByBlockMatrix( m2 );
[ [ 000010 ], [ 000001 ], [ 100000 ], 
  [ 010000 ], [ 001000 ], [ 000100 ] ]
gap> Print( m1 + m1, "\n" );
BlockMatrix( [ [ 11, [ [ 22 ], [ 02 ] ] ], 
  [ 13, [ [ 20 ], [ 02 ] ] ], [ 22, [ [ 02 ], [ 20 ] ] ], 
  [ 34, [ [ 20 ], [ 00 ] ] ] ],3,4,2,2,0 )
gap> m2 + m3;
[ [ 000020 ], [ 000002 ], [ 200000 ], 
  [ 020000 ], [ 002000 ], [ 000200 ] ]
gap> Print( AdditiveInverse( m3 ), "\n" );
BlockMatrix( [ [ 11, [ [ 000 ], [ 000 ], [ -100 ] ] ], 
  [ 12, [ [ 0, -10 ], [ 00, -1 ], [ 000 ] ] ], 
  [ 21, [ [ 0, -10 ], [ 00, -1 ], [ 000 ] ] ], 
  [ 22, [ [ 000 ], [ 000 ], [ -100 ] ] ] ],2,2,3,3,0 )
gap> m1 * [ 12345678 ];
884370 ]
gap> m2 * [ 123456 ];
561234 ]
gap> [ 123456 ] * m1;
13431250 ]
gap> z * [ 123456 ];
000000 ]
gap> [ 123456 ] * z;
000000 ]
gap> 3 * m1;
<block matrix of dimensions (3*2)x(4*2)>
gap> Print( m2 * 5, "\n" );
BlockMatrix( [ [ 13, [ [ 50 ], [ 05 ] ] ], 
  [ 21, [ [ 50 ], [ 05 ] ] ], [ 32, [ [ 50 ], [ 05 ] ] ] ],3,3,2,
2,0 )
gap> o1:= One( m2 );
<block matrix of dimensions (3*2)x(3*2)>
gap> o2:= One( z );
<block matrix of dimensions (3*2)x(3*2)>
gap> o1 = o2;
true

# New style access to block matrix
gap> dim := DimensionsMat( m1 );;
gap> tmp := List([1..dim[1]], row->List([1..dim[2]], col -> m1[row,col]));;
gap> tmp = MatrixByBlockMatrix(m1);
true
gap> dim := DimensionsMat( m2 );;
gap> tmp := List([1..dim[1]], row->List([1..dim[2]], col -> m2[row,col]));;
gap> tmp = MatrixByBlockMatrix(m2);
true

# block matrices are immutable
#@if IsHPCGAP
gap> m1[1,2] := 5;
Error, Matrix Assignment: <mat> must be a mutable matrix (not an atomic compon\
ent object)
#@else
gap> m1[1,2] := 5;
Error, Matrix Assignment: <mat> must be a mutable matrix (not a component obje\
ct)
#@fi

# Matrix operations for block matrices
gap> R:= BaseDomain( MatrixByBlockMatrix( m2 ) );;
gap> R = BaseDomain( m2 );
true
gap> TraceMatrix( m2 ) = TraceMatrix( MatrixByBlockMatrix( m2 ) );
true
gap> Determinant( m2 ) = Determinant( MatrixByBlockMatrix( m2 ) );
true
gap> MinimalPolynomial( R, m2 ) = MinimalPolynomial( R, MatrixByBlockMatrix( m2 ) );
true

# Groups that consist of block matrices
gap> G:= SmallGroup( 2412 );;
gap> H:= SylowSubgroup( G, 2 );;
gap> reps:= IrreducibleRepresentations( H );;
gap> ind:= InducedRepresentation( reps[5], G );;
gap> img:= Image( ind );;
gap> ForAll( GeneratorsOfGroup( img ), IsBlockMatrixRep );
true
gap> Size( img );
24

#
gap> STOP_TEST("matblock.tst");

[Dauer der Verarbeitung: 0.14 Sekunden, vorverarbeitet 2026-06-14]