The rbmat.cpl and cbmat.cpl libraries add matrix algebra to CPL. The same functions and operators are defined in both, for real and complex numbers respectively, and therefore their result type is indicated as just number in what follows. Wherever a square matrix is expected, a banded matrix in compact rectangular form may also be used; the latter is recognized from its dimensions not being equal, and is defined as having the value zero of its second index as the diagonal. Most of the following functions have an equivalent infix form that allows matrix operations to be specified in the usual algebraic notation.
The operands of matrix operations undergo automatic (cpl)realignment.`
SUBROUTINE MatEqu(POINTER TO ARRAY(∗,∗) OF number c; number a)
Assigns the scalar (REAL or COMPLEX) value <a> to the diagonal elements of matrix <c>, and zeros all the non-diagonal elements.
Equivalent infix notation: c = a
SUBROUTINE LeftLUDiv(POINTER TO ARRAY(∗) OF number x; ARRAY(∗,∗) OF number A; ARRAY(∗) OF number t)
Computes the left-hand division of vector <t> by the previously LU-decomposed matrix <A>, that is A^-1∗t. A must have been preventively treated with either LUdecomp or PLU.
Equivalent infix notation: A \ t
SUBROUTINE RightLUDiv(ARRAY(∗) OF number x^,t; ARRAY(∗,∗) OF number A)
Computes the right-hand division of vector <t> by the previously LU-decomposed matrix <A>, that is t∗A^-1. A must have been preventively treated with either LUdecomp or PLU.
Equivalent infix notation: t / A
Page: (matrix)Lanczos, Next: PLU, Prev: RightLUDiv, Up: TopIndex SUBROUTINE Lanczos(POINTER TO ARRAY(∗) OF number x
SUBROUTINE[ARRAY(∗) OF number v2^,v1] A,AT
ARRAY(∗) OF number y1; REAL eps) SUBROUTINE Lanczos(POINTER TO ARRAY(∗) OF number x
ARRAY(∗,∗) OF number M
ARRAY(∗) OF number y1; REAL eps)
POINTER TO INVMAT FUNCTION PLU(ARRAY(∗,∗) OF number m)
Computes the LU decomposition of (necessarily square) matrix A with pivoting. Returns an appropriate INVMAT compound variable containing the LU decomposition of A, which can be passed to either LeftLUDiv or RightLUDiv and must be explicitly freed by FREE:(cpl)NEW. once no longer needed.
Page: (matrix)INVERT, Next: DET, Prev: PLU, Up: TopIndex
SUBROUTINE INVERT(ARRAY(∗,∗) OF number mat^, RESULT^)
Returns the inverse of square matrix <mat> in matrix <RESULT>. Uses PLU internally.
SUBROUTINE INVERT(number m^(∗,∗))
Computes the inverse of square matrix <mat> in place. Uses PLU internally.