incr-set prlevel 1
if #0=7 START
incr-set prlevel -1
;;; Usage:
;;; 	<smult_complex w w1 w2 p d d1 d2
;;;
;;; An element of the ring p induces a
;;; map from a complex F[-1] to F.
;;; smult_complex constructs the array
;;; of matrices giving this map
;;;
incr-set prlevel 1
jump END
;;; Parameters: (w,w1,w2) - an array of
;;;		matrices which form a
;;;		complex.
;;;	p - a polynomial
;;;
;;; Output values: (d,d1,d2) - an array
;;;		of matrices giving the
;;;		map of complexes.
;;;
;;;  The Array of Matrices Data Type:
;;;
;;; An array of matrices is a triple (M,v1,v2) of matrices.
;;; The first coordinate is a direct sum of matrices such
;;; that the upper left hand corner is thought of as the
;;; first matrix, and so on.
;;;
;;; The second coordinate is an n by 0 matrix whose row
;;; degrees give the ranks of the free modules which are
;;; the sources of the maps.
;;;
;;; The third coordinate is an n by 0 matrix whose row de-
;;; grees give the ranks of the free modules which are the
;;; targets of the maps.
;;;
; created ... 6/29/92 by M. Johnson
START:

	int @i 1
	nrows #3 @length
	<zeromat 0 0 #5
	<zeromat 0 0 #6
	<zeromat 0 0 #7

	LOOP:
		row-degree #3 @i @rk
		<extract_matrix #1 #2 #3 @i @mat
		row-degs @mat @rdegs
		iden @rk @M
		setdegs @M
			@rdegs
			;
		smult @M {#4} @M
		<add_matrix_to_array #5 #6 #7 @M
		int @i @i+1
		if @i<@length+1 LOOP

	row-degree #2 @i-1 @rk
	col-degs @mat @rdegs
	iden @rk @M
	setdegs @M
		@rdegs
		;
	smult @M {#4} @M
	<add_matrix_to_array #5 #6 #7 @M

kill @M @rk @i @length @mat @rdegs
END:
incr-set prlevel -1

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



