incr-set prlevel 1
if #0=3 START
incr-set prlevel -1
;;; Usage:
;;; 	<direct_sum summand1 summand2 sum
;;;
;;; Takes two maps represented by matrices, and
;;; returns a matrix representing the direct
;;; sum of these maps.  This scripts does *not*
;;; do an automatic `recalculation' of col-degs.
;;;
incr-set prlevel 1
jump END
;;; Parameters: summand1, summand2 - matrices
;;;		representing the two maps
;;;
;;; Output values: sum - a matrix representing
;;;		their sum
;;;
;;; 
;;; Caveats: Note that dsum does mess with col-degs
;;; of the result, so that the dsum of the 0-maps
;;;
;;;			0
;;;		S(0)-------->S(0)
;;; and
;;;			0
;;;		S(-3)------->S(-2)
;;;
;;; results in the map
;;;		  	  0
;;;		S(0)+S(0)--->S(0)+S(-2)
;;; which is between the wrong modules.
;;;	
; created ... 7/14/92 by M.Johnson
START:

col-degs #1 @a1
col-degs #2 @a2
ncols #1 @c1
ncols #2 @c2
row-degs #1 @b1
row-degs #2 @b2
nrows #1 @r1
nrows #2 @r2

<zeromat @r1 @c2 @Z1
setdegs @Z1
	@b1
	@a2
<zeromat @r2 @c1 @Z2
setdegs @Z2
	@b2
	@a1

copy #1 @S1
copy #2 @S2

concat @S1 @Z1
concat @Z2 @S2
transpose @S1 @S1
transpose @Z2 @Z2
concat @S1 @Z2
transpose @S1 @S1
copy @S1 #3


kill @a1 @a2 @b1 @b2 @c1 @c2 @r1 @r2 @S1 @S2 @Z1 @Z2

END:
incr-set prlevel -1

$;;;;;;;; EXAMPLE SECTION ;;;;;;;;;;;;;;;;;;;;;;;;;
