DirectSumMat( mat1, ... , matn )
returns the block diagonal direct sum of the matrices mat1, ldots, matn.
gap> C1 := [ [ 2, -1, 0, 0 ],
> [ -1, 2, -1, 0 ],
> [ 0, -1, 2, -1 ],
> [ 0, 0, -1, 2 ] ];;
gap> C2 := [ [ 2, 0, -1, 0 ],
> [ 0, 2, -1, 0 ],
> [ -1, -1, 2, -1 ],
> [ 0, 0, -1, 2 ] ];;
gap> d := DirectSumMat( C1, C2 );;
gap> PrintArray( d );
[ [ 2, -1, 0, 0, 0, 0, 0, 0 ],
[ -1, 2, -1, 0, 0, 0, 0, 0 ],
[ 0, -1, 2, -1, 0, 0, 0, 0 ],
[ 0, 0, -1, 2, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 2, 0, -1, 0 ],
[ 0, 0, 0, 0, 0, 2, -1, 0 ],
[ 0, 0, 0, 0, -1, -1, 2, -1 ],
[ 0, 0, 0, 0, 0, 0, -1, 2 ] ]
One can also use a computed list of matrices as an argument; the function
call then reads ApplyFunc(DirectSumMat, [mat1, ... , matn] ).
Previous Up Top Next
Index
GAP 3.4.4