INTERFACE R4x4; (* Operations on 4x4 matrices: linear maps of R^4. Created 93-04-31 by Marcos C. Carrard. Based on R4x4.pas by J. Stolfi. Last edited by stolfi *) IMPORT R4, Wr; TYPE T = ARRAY [0..3], [0..3] OF REAL; CONST N = 4; Null = T{R4.Zero, ..}; Identity = T{ R4.T{1.0, 0.0, 0.0, 0.0}, R4.T{0.0, 1.0, 0.0, 0.0}, R4.T{0.0, 0.0, 1.0, 0.0}, R4.T{0.0, 0.0, 0.0, 1.0} }; PROCEDURE MapRow(READONLY a: R4.T; READONLY m: T): R4.T; (* Returns the product of row vector "a" by the matrix "m". *) PROCEDURE MapCol(READONLY m: T; READONLY a: R4.T): R4.T; (* Returns the product of matrix "m" by the column vector "a". *) PROCEDURE Mul(READONLY m, n: T): T; (* Returns the product of matrices "m" and "n", in that order. *) PROCEDURE Det(READONLY m: T): LONGREAL; (* Returns the determinant of matrix "m". *) PROCEDURE Inv(READONLY m: T): T; (* Returns the inverse of matrix "m". Assumes its determinant is non-zero. *) PROCEDURE Adj(READONLY m: T): T; (* Returns the adjoint of matrix "m", such that "m * result = I * Det(m)" *) PROCEDURE Print(wr: Wr.T; READONLY m: T; indent: CARDINAL := 0); (* Prints the matrix to the given writer. Indents continuation lines by at least "indent" blanks. *) END R4x4.