XEROX Lisp Library Packages 2 4 1 1 NEWMATMULT 1 4 4 4 Interlisp-D contains low-level functions for high-speed matrix multiplication. The NEWMATMULT LispLibrary package provides functions that let you easily manipulate the contents of these matrices. This version of NEWMATMULT uses CMLARRAYs to represent matrices. IT REQUIRES POST-INTERMEZZO MICROCODE TO RUN CORRECTLY ON A DANDETIGER. MATRIX CREATION FUNCTIONS (CREATE1BY3) [Function] Returns a 1 row by 3 column CMLARRAY vector. (CREATE1BY4) [Function] Returns a 1 by 4 vector. (CREATE3BY1) [Function] Returns a 3 by 1 vector. (CREATE3BY3) [Function] Returns a 3 by 3 matrix. (CREATE4BY1) [Function] Returns a 4 by 1 vector. (CREATE4BY4) [Function] Returns a 4 by 4 matrix. (IDENTITY3BY3 M) [Function] Returns a 3 by 3 identity matrix (a matrix with the elements of its main diagonal all set to unity). In this and all following MatrixUse functions, if M is supplied, it is set and returned. (IDENTITY4BY4 M) [Function] Returns a 4 by 4 identity matrix. (ROTATE3BY3 THETA RADIANSFLG M) [Function] Returns a 3 by 3 matrix that, when multiplied by a vector, will rotate that vector an angle of THETA around the origin. THETA is measured in degrees or radians, depending on RADIANSFLG. (ROTATE4BY4.ABOUTX THETA RADIANSFLG M) [Function] Returns a 4 by 4 matrix suitable for rotating a point in 3-space around the X-axis by THETA. (ROTATE4BY4.ABOUTY THETA RADIANSFLG M) [Function] Returns a 4 by 4 matrix suitable for rotating a point in 3-space around the Y-axis by THETA. (ROTATE4BY4.ABOUTZ THETA RADIANSFLG M) [Function] Returns a 4 by 4 matrix suitable for rotating a point in 3-space around the Z-axis by THETA. (SCALE3BY3 Sx Sy M) [Function] Returns a 3 by 3 matrix that will scale by a factor of Sx in the X-axis and Sy in the Y-axis. (SCALE4BY4 Sx Sy Sz M) [Function] Returns a 4 by 4 matrix that will scale by a factor of Sx in the X-axis, Sy in the Y-axis, and Sz in the Z-axis. (TRANSLATE3BY3 Tx Ty M) [Function] Returns a 3 by 3 matrix that will translate by a distance of Tx in the X-axis and Ty in the Y-axis. (TRANSLATE4BY4 Tx Ty Tz M) [Function] Returns a 4 by 4 matrix that will translate by a distance of Tx in the X-axis, Ty in the Y-axis, and Tz in the Z-axis. MATRIX ACCESSOR FUNCTIONS (SET.XCOORD VECTOR VALUE) [Function] Given a vector VECTOR of length 3 or 4, sets the X component to be VALUE. (SET.YCOORD VECTOR VALUE) [Function] Sets the Y component of VECTOR to be VALUE. (SET.ZCOORD VECTOR VALUE) [Function] Sets the Z component of VECTOR to be VALUE. (SET.WCOORD VECTOR VALUE) [Function] Sets the W (fourth) component of VECTOR to be VALUE. (GET.XCOORD VECTOR) [Function] Returns the X component of VECTOR. (GET.YCOORD VECTOR) [Function] Returns the Y component of VECTOR. (GET.ZCOORD VECTOR) [Function] Returns the Z component of VECTOR. (GET.WCOORD VECTOR) [Function] Returns the W component of VECTOR. MATRIX MULTIPLICATION FUNCTIONS (MATMULT MATRIXA MATRIXB MATRIXC K M N) [Function] Multiplies MATRIXA by MATRIXB storing into MATRIXC. The dimensions of MATRIXA are K x M, MATRIXB are M x N, and MATRIXC are K x N. The following functions compile into single instructions. When run on the Dandetiger processor these instructions make use of hardware floating-point unit. The three digits at the end of each function's name describe the dimensions of their arguments in the order K M N. (MATMULT133 MATRIXA MATRIXB MATRIXC) [Function] Multiplies MATRIXA (1 x 3) by MATRIXB (3 x 3) storing into MATRIXC (1 x 3). (MATMULT331 MATRIXA MATRIXB MATRIXC) [Function] Multiplies MATRIXA (3 x 3) by MATRIXB (3 x 1) into MATRIXC (3 x 3). (MATMULT333 MATRIXA MATRIXB MATRIXC) [Function] Multiplies MATRIXA (3 x 3) by MATRIXB (3 x 3) into MATRIXC (3 x 3). (MATMULT144 MATRIXA MATRIXB MATRIXC) [Function] Multiplies MATRIXA (1 x 4) by MATRIXB (4 x 4) into MATRIXC (1 x 4). (MATMULT441 MATRIXA MATRIXB MATRIXC) [Function] Multiplies MATRIXA (4 x 4) by MATRIXB (4 x 1) into MATRIXC (4 x 1). (MATMULT444 MATRIXA MATRIXB MATRIXC) [Function] Multiplies MATRIXA (4 x 4) by MATRIXB (4 x 4) into MATRIXC (4 x 4). MISCELLANEOUS MATRIX FUNCTIONS (MAT.INVERT MATRIX) [Function] Returns the inverse of MATRIX, an n x n matrix of any size. Causes an error if MATRIX is non-invertible. (MAT.INVERT.3BY3 MATRIX) [Function] Returns the inverse of MATRIX, which is presumed to be of dimension 3 x 3. Causes an error if MATRIX is non-invertible. This function is much faster than MAT.INVERT for matrices known to be 3 x 3. (MAT.DETERMINANT MATRIX) [Function] Returns the determinant of MATRIX. Causes an error if MATRIX is not square. (LIST ((PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))),Č Č&ŠŠ8,ŠŠ8 4&ŠŠ8,ŠŠ8Č:ČČ PAGEHEADINGBOO HELVETICA  HELVETICA HELVETICA  HELVETICA LOGO HRULE.GETFN HELVETICA HRULE.GETFN HELVETICA HRULE.GETFN HRULE.GETFN HELVETICA  HRULE.GETFN HELVETICA HRULE.GETFN HRULE.GETFN HRULE.GETFN HELVETICAQ- ˜& "  _1  V V V  7   7 =  =   /         !        3„0}F0F0F0F0Fj$Į$Mzē