(FILECREATED " 4-Sep-85 18:53:10" {ERIS}<LISPUSERS>GKSMATRIX.;2 4021   

      changes to:  (RECORDS MATTYP.2D)
		   (VARS GKSMATRIXCOMS CLEANUPOPTIONS)

      previous date: " 4-Sep-85 18:49:48" {ERIS}<LISPUSERS>GKSMATRIX.;1)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT GKSMATRIXCOMS)

(RPAQQ GKSMATRIXCOMS ((* * GKS generic interface to matrix routines * *)
		      (RECORDS MATTYP.2D MATTYP.VEC2 MATTYP.ROW1 MATTYP.ROW2)
		      (FNS MATFN.NEWVEC2 MATFN.NEWMAT2 MATFN.MULT2 MATFN.TRAN2 MATFN.TRANLIST)))
(* * GKS generic interface to matrix routines * *)

[DECLARE: EVAL@COMPILE 

(RECORD MATTYP.2D (MATTYP.ROW1 MATTYP.ROW2))

(RECORD MATTYP.VEC2 (E1 E2 E3))

(RECORD MATTYP.ROW1 (E11 E12 E13))

(RECORD MATTYP.ROW2 (E21 E22 E23))
]
(DEFINEQ

(MATFN.NEWVEC2
  [LAMBDA (X Y N)                                            (* edited: "10-May-85 11:15")

          (* * comment)


    (PROG (NEWOBJ)
          (SETQ NEWOBJ (create MATTYP.VEC2))
          (with MATTYP.VEC2 NEWOBJ (NILL)
		(SETQ E1 X)
		(SETQ E2 Y)
		(SETQ E3 N))
          (RETURN NEWOBJ])

(MATFN.NEWMAT2
  [LAMBDA NIL                                                (* edited: "10-May-85 12:19")

          (* * comment)


    (PROG (NEWOBJ)
          (SETQ NEWOBJ (create MATTYP.2D))
          (with MATTYP.2D NEWOBJ (NILL)
		(SETQ MATTYP.ROW1 (MATFN.NEWVEC2 1 0 0))
		(SETQ MATTYP.ROW2 (MATFN.NEWVEC2 0 1 0)))
          (RETURN NEWOBJ])

(MATFN.MULT2
  [LAMBDA (MAT1 MAT2)                                        (* edited: "10-May-85 11:19")

          (* * comment)


    (PROG (NEWOBJ A B C A11 A12 A13 A21 A22 A23 B11 B12 B13 B21 B22 B23)
          (with MATTYP.2D MAT1 (NILL)
		(with MATTYP.ROW1 MATTYP.ROW1 (SETQ A11 E11)
		      (SETQ A12 E12)
		      (SETQ A13 E13))
		(with MATTYP.ROW2 MATTYP.ROW2 (SETQ A21 E21)
		      (SETQ A22 E22)
		      (SETQ A23 E23)))
          (with MATTYP.2D MAT2 (NILL)
		(with MATTYP.ROW1 MATTYP.ROW1 (SETQ B11 E11)
		      (SETQ B12 E12)
		      (SETQ B13 E13))
		(with MATTYP.ROW2 MATTYP.ROW2 (SETQ B21 E21)
		      (SETQ B22 E22)
		      (SETQ B23 E23)))
          (SETQ NEWOBJ (MATFN.NEWMAT2))
          [with MATTYP.2D NEWOBJ (NILL)
		(with MATTYP.ROW1 MATTYP.ROW1 (SETQ E11 (PLUS (TIMES A11 B11)
							      (TIMES A12 B21)))
		      (SETQ E12 (PLUS (TIMES A11 B12)
				      (TIMES A12 B22)))
		      (SETQ E13 (PLUS (TIMES A11 B13)
				      (TIMES A12 B23)
				      A13)))
		(with MATTYP.ROW2 MATTYP.ROW2 (SETQ E21 (PLUS (TIMES A21 B11)
							      (TIMES A22 B21)))
		      (SETQ E22 (PLUS (TIMES A21 B12)
				      (TIMES A22 B22)))
		      (SETQ E23 (PLUS (TIMES A21 B13)
				      (TIMES A22 B23)
				      A23]
          (RETURN NEWOBJ])

(MATFN.TRAN2
  [LAMBDA (MAT X Y)                                          (* edited: "16-May-85 15:45")

          (* * comment)


    (PROG (U V)
          [with MATTYP.2D MAT (NILL)
		(with MATTYP.ROW1 MATTYP.ROW1 (SETQ U (PLUS (TIMES E11 X)
							    (TIMES E12 Y)
							    E13)))
		(with MATTYP.ROW2 MATTYP.ROW2 (SETQ V (PLUS (TIMES E21 X)
							    (TIMES E22 Y)
							    E23]
          (RETURN (CONS U V])

(MATFN.TRANLIST
  [LAMBDA (MAT KLIST)                                        (* edited: "10-May-85 11:26")

          (* * comment)


    (PROG (NLIST)
          (SETQ NLIST NIL)
          [MAPC KLIST (QUOTE (LAMBDA (X)
				     (SETQ NLIST (CONS (MATFN.TRAN2 MAT (CAR X)
								    (CDR X))
						       NLIST]
          (RETURN NLIST])
)
(PUTPROPS GKSMATRIX COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (808 3941 (MATFN.NEWVEC2 818 . 1174) (MATFN.NEWMAT2 1176 . 1576) (MATFN.MULT2 1578 . 
3052) (MATFN.TRAN2 3054 . 3543) (MATFN.TRANLIST 3545 . 3939)))))
STOP