XEROX MATRIXOPS 2 4 1 MATRIXOPS 1 4 By: Jan Pedersen (Pedersen.PA @ Xerox.com) used in conjunction with BLAS MATRIXOPS implements a subset of the LINPACK subroutine library (c.f. "LINPACK Users' Guide" by Dongarra et al. (SIAM 1979)) . MATRIXOPS provides several common matrix factorizations as well as high several functions to solve systems of linear equations, invert matrices, etc. These functions operate on two-dimensional cmlarrays of element type single-float. Conformability of arguments is always checked. Although reasonable defaulting occurs, for efficiency result arrays may be passed as arguments to be side-effected. Matrices factorizations are not checked for stability, so results for singular or near singular matrices will be unreliable. (MTIMES a b product) [Function] Given two matrices, A and B, computes the matrix product A * B. If A is a vector, it is assumed to be a row vector. If B is a vector, it is assumed to be a column vector. If PRODUCT is provided, it is overwritten with the result. Returns PRODUCT. (MTRANSPOSE a transpose) [Function] Given an matrix A, computes the matrix transpose of A. If TRANSPOSE is provided, it is overwritten with the result. Returns TRANSPOSE. (MINVERT a inverse) [Function] Given an matrix A, computes the matrix inverse of A. If INVERSE is provided, it is overwritten with the result. Returns INVERSE. (MSOLVE a b solution) [Function] Given an matrix A, and a vector B, solves the system of linear equations Ax = b. If SOLUTION is provided, it is overwritten with the result. Returns SOLUTION. (MREGRESS y x b rsd yhat) [Function] Given a vector Y, a design matrix X, computes the regression of Y on X. If B is provided, it is overwritten with the vector of fitted parameters. If RSD is provided it is overwritten with the residuals of Y from the fit. If YHAT is provided it is overwritten with the fitted values of Y. Returns B. (LUFACTOR a pivotvector factormatrix) [Function] Given an N x N matrix A, and an N pointer vector PIVOTVECTOR, computes the LU (lower upper) factorization of A by gaussian elimination with row pivoting. PIVOTVECTOR is overwritten with the row permutation. If FACTORMATRIX is provided it is overwritten with the (packed) result. Returns FACTORMATRIX (LUSOLV lumatrix pivotvector b solution) [Function] Given the results from an LU decompositions, LUMATRIX and PIVOTVECTOR, and a vector of constants B, solves the system of equations Ax = b. If SOLUTION is provided, it is overwritten with the result. Returns SOLUTION. (LUINVERSE lumatrix pivotvector solution) [Function] Given the results from an LU decompositions, LUMATRIX and PIVOTVECTOR, computes the inverse of the factored matrix. If SOLUTION is provided, it is overwritten with the result. Returns SOLUTION. (QRFACTOR a qraux factormatrix) [Function] Given an N x M matrix A, and an MIN(N,M) float vector QRAUX, computes the QR factorization of A by successive Householder transformations. QRAUX is overwritten with diagonal elements of R. If FACTORMATRIX is provided it is overwritten with the (packed) result. Returns FACTORMATRIX (QRQTYqrmatrix qraux y product) [Function] Given the results of a QR factorization and an N float vector Y, computes transpose(Q) * Y. If PRODUCT is provided it is overwritten with the product. Returns PRODUCT. (QRQYqrmatrix qraux y product) [Function] Given the results of a QR factorization and an N float vector Y, computes Q * Y. If PRODUCT is provided it is overwritten with the product. Returns PRODUCT. (QRSOLV qrmatrix qraux b solution) [Function] Given the results of a QR factorization, and a vector of constants B, solves the system of equations Ax = b. If SOLUTION is provided, it is overwritten with the result. Returns SOLUTION. (QROLSqrmatrix qraux y qty b rsd yhat) [Function] Given the results of a QR factorization and an N vector Y, computes the regression of Y on X. If B is provided, it is overwritten with the vector of fitted parameters. If QTY is provided, it is overwritten with the product transpose(Q) * Y. If RSD is provided it is overwritten with the residuals of Y from the fit. If YHAT is provided it is overwritten with the fitted values of Y. Returns B. (CHOLESKYFACTOR a factormatrix) [Function] Given an N x N positive definite matrix A, computes the LLt (Choleskyfactor) factorization of A. If FACTORMATRIX is provided it is overwritten with the Lt in the upper corner. Returns FACTORMATRIX. (SVDFACTOR a s u v) [Function] Given an N x M matrix A, computes the SVD (Singular value) factorization of A by Nash's algorithm. If S is provided it is overwritten with the MIN(N,M) singular values. If U is provided it is overwritten with the N x M matrix of the first M right eigen vectors. If U is provided it is overwritten with the M x M matrix of the left eigen vectors. Returns S (LSOLV a b solution) [Function] Given a lower triangular matrix A, and a vector of constants B, solves the system of equations Ax = b by back substitution. If SOLUTION is provided, it is overwritten with the result. Returns SOLUTION. (RSOLV a b solution) [Function] Given an upper triangular matrix A, and a vector of constants B, solves the system of equations Ax = b by back substitution. If SOLUTION is provided, it is overwritten with the result. Returns SOLUTION. (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# NIL) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# NIL) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))((8(8D PAGEHEADING RUNNINGHEAD1 1$MODERN MODERN MODERN MODERNLOGOMODERN MODERN GACHA   HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN , v }            -  ,          :^,  e    z