Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/pkg/utils/doc/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 11.8.2025 mit Größe 3 kB image not shown  

Quelle  matrix.xml   Sprache: XML

 
<!-- ------------------------------------------------------------------- -->
<!--                                                                     -->
<!--  matrix.xml          Utils documentation                            -->
<!--                                                                     -->
<!--  Copyright (C) 2023, The GAP Group                                  --> 
<!--                                                                     -->
<!-- ------------------------------------------------------------------- -->

<?xml version="1.0" encoding="UTF-8"?>

<Chapter Label="chap-matrix">
<Heading>Matrices</Heading>

<Section Label="sec-matrix-ops">
<Heading>Some operations for matrices</Heading>


<ManSection>
   <Oper Name="DirectSumDecompositionMatrices"
         Arg="M" />
<Description>
In June 2023 Hongyi Zhao asked in the Forum for a function to implement 
matrix decomposition into blocks. 
Such a function was then provided by Pedro García-Sánchez. 
Hongyi Zhao then requested that the function be added to 
<Package>Utils</Package>. 
What is provided here is a revised version of the original solution, 
returning a list of decompositions. 
<P/> 
This function is a partial inverse to the undocumented library operation 
<C>DirectSumMat</C>.  
So if <M>L</M> is the list of diagonal decompositions of a matrix <M>M</M> 
then each entry in <M>L</M> is a list of matrices, and the direct sum of 
each of these lists is equal to the original <M>M</M>. 
<P/> 
In the following examples, <M>M_6</M> is an obvious direct sum 
with <M>3</M> blocks. 
<M>M_4</M> is an example with three decompositions, 
while <M>M_8 = M_4 \oplus M_4</M> has <M>16</M> decompositions (not listed).
<P/> 
</Description>
</ManSection>
<Example>
<![CDATA[
gap> M6 := [ [1,2,0,0,0,0], [3,4,0,0,0,0], [5,6,0,0,0,0],                       
>            [0,0,9,0,0,0], [0,0,0,1,2,3], [0,0,0,4,5,6] ];;
gap> Display( M6 );
[ [  1,  2,  0,  0,  0,  0 ],
  [  3,  4,  0,  0,  0,  0 ],
  [  5,  6,  0,  0,  0,  0 ],
  [  0,  0,  9,  0,  0,  0 ],
  [  0,  0,  0,  1,  2,  3 ],
  [  0,  0,  0,  4,  5,  6 ] ]
gap> L6 := DirectSumDecompositionMatrices( M6 );
[ [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ], [ [ 9 ] ], [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] 
     ] ]

gap> M4 := [ [0,3,0,0], [0,0,0,0], [0,0,0,0], [0,0,4,0] ];;
gap> Display( M4 );
[ [  0,  3,  0,  0 ],
  [  0,  0,  0,  0 ],
  [  0,  0,  0,  0 ],
  [  0,  0,  4,  0 ] ]
gap> L4 := DirectSumDecompositionMatrices( M4 );
[ [ [ [ 0, 3 ] ], [ [ 0, 0 ], [ 0, 0 ], [ 4, 0 ] ] ], 
  [ [ [ 0, 3 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 4, 0 ] ] ], 
  [ [ [ 0, 3 ], [ 0, 0 ], [ 0, 0 ] ], [ [ 4, 0 ] ] ] ]
gap> for L in L4 do 
>        A := DirectSumMat( L );; 
>        if ( A = M4 ) then Print( "yes, A = M4\n" ); fi; 
>    od;
yes, A = M4
yes, A = M4
yes, A = M4

gap> M8 := DirectSumMat( M4, M4 );; 
gap> Display( M8 );
[ [  0,  3,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  4,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  3,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  4,  0 ] ]
gap> L8 := DirectSumDecompositionMatrices( M8 );;
gap> Length( L8 ); 
16
]]>
</Example>
<P/>

The current method does not, however, catch all possible decompositions. 
In the following example the matrix <M>M_5</M> has its third row 
and third column extirely zero, and the only decomposition found 
has a <M>[0]</M> factor. 
There are clearly two <M>2</M>-factor decompositions with a 
<M>2</M>-by-<M>3</M> and a <M>3</M>-by-<M>2</M> factor, 
but these are not found at present.
<P/>
<Example>
<![CDATA[
gap> M5 := [ [1,2,0,0,0], [3,4,0,0,0], [0,0,0,0,0],
>            [0,0,0,6,7], [0,0,0,8,9] ];;
gap> Display(M5);
[ [  1,  2,  0,  0,  0 ],
  [  3,  4,  0,  0,  0 ],
  [  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  6,  7 ],
  [  0,  0,  0,  8,  9 ] ]
gap> L5 := DirectSumDecompositionMatrices( M5 ); 
[ [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 0 ] ], [ [ 6, 7 ], [ 8, 9 ] ] ] ]
]]>
</Example>

</Section> 

</Chapter>

93%


¤ Dauer der Verarbeitung: 0.24 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.