File: matblock.gd

package info (click to toggle)
gap 4r7p5-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 29,272 kB
  • ctags: 7,129
  • sloc: ansic: 107,802; xml: 46,868; sh: 3,548; perl: 2,329; makefile: 740; python: 94; asm: 62; awk: 6
file content (111 lines) | stat: -rw-r--r-- 3,664 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#############################################################################
##
#W  matblock.gd                 GAP Library                  Alexander Hulpke
##
##
#Y  Copyright (C)  1997,  Lehrstuhl D für Mathematik,  RWTH Aachen,  Germany
#Y  (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland
#Y  Copyright (C) 2002 The GAP Group
##
##  This file contains the declarations for block matrices.
##


##  <#GAPDoc Label="[1]{matblock}">
##  Block matrices are a special representation of matrices which can save a
##  lot of memory if large matrices have a block structure with lots of zero
##  blocks. &GAP; uses the representation <C>IsBlockMatrixRep</C> 
##  to store block matrices.
##  <Index Key="IsBlockMatrixRep">IsBlockMatrixRep</Index>
##  <#/GAPDoc>
##


#############################################################################
##
#F  BlockMatrix( <blocks>, <nrb>, <ncb>[, <rpb>, <cpb>, <zero>] )
##
##  <#GAPDoc Label="BlockMatrix">
##  <ManSection>
##  <Func Name="BlockMatrix" Arg='blocks, nrb, ncb[, rpb, cpb, zero]'/>
##
##  <Description>
##  <Ref Func="BlockMatrix"/> returns an immutable matrix in the sparse
##  representation <C>IsBlockMatrixRep</C>.
##  The nonzero blocks are described by the list <A>blocks</A> of triples
##  <M>[ <A>i</A>, <A>j</A>, M(i,j) ]</M> each consisting of a matrix
##  <M>M(i,j)</M> and its block coordinates in the block matrix to be
##  constructed.
##  All matrices <M>M(i,j)</M> must have the same dimensions.
##  As usual the first coordinate specifies the row and the second one
##  the column.
##  The resulting matrix has <A>nrb</A> row blocks and <A>ncb</A> column
##  blocks.
##  <P/>
##  If <A>blocks</A> is empty (i.e., if the matrix is a zero matrix) then
##  the dimensions of the blocks must be entered as <A>rpb</A> and
##  <A>cpb</A>, and the zero element as <A>zero</A>.
##  <P/>
##  Note that all blocks must be ordinary matrices
##  (see&nbsp;<Ref Func="IsOrdinaryMatrix"/>),
##  and also the block matrix is an ordinary matrix.
##  <Example><![CDATA[
##  gap> M := BlockMatrix([[1,1,[[1, 2],[ 3, 4]]],
##  >                      [1,2,[[9,10],[11,12]]],
##  >                      [2,2,[[5, 6],[ 7, 8]]]],2,2);
##  <block matrix of dimensions (2*2)x(2*2)>
##  gap> Display(M);
##  [ [   1,   2,   9,  10 ],
##    [   3,   4,  11,  12 ],
##    [   0,   0,   5,   6 ],
##    [   0,   0,   7,   8 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "BlockMatrix" );


#############################################################################
##
#A  MatrixByBlockMatrix( <blockmat> ) . . . create matrix from (block) matrix
##
##  <#GAPDoc Label="MatrixByBlockMatrix">
##  <ManSection>
##  <Attr Name="MatrixByBlockMatrix" Arg='blockmat'/>
##
##  <Description>
##  returns a plain ordinary matrix that is equal to the block matrix
##  <A>blockmat</A>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "MatrixByBlockMatrix", IsMatrix );
#T ConvertToPlistRep?


#############################################################################
##
#F  AsBlockMatrix( <m>, <nrb>, <ncb> )  . . . create block matrix from matrix
##
##  <#GAPDoc Label="AsBlockMatrix">
##  <ManSection>
##  <Func Name="AsBlockMatrix" Arg='m, nrb, ncb'/>
##
##  <Description>
##  returns a block matrix with <A>nrb</A> row blocks and <A>ncb</A> column blocks
##  which is equal to the ordinary matrix <A>m</A>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "AsBlockMatrix" );
#T ConvertToBlockMatrixRep?


#############################################################################
##
#E