next up previous index
Next: F112 Manipulation of Up: CERNLIB Previous: F105 Rotate a

F110 TC Matrix Manipulation Package

Routine ID: F110
Author(s): TCLibrary: KERNLIB
Submitter: C. LetertreSubmitted: 01.08.1969
Language: FortranRevised: 07.03.1989

OBSOLETE

Please note that this routine has been obsoleted in CNL 194. Users are advised not to use it any longer and to replace it in older programs. No maintenance for it will take place and it will eventually disappear.
Suggested replacement: RVADD (F002), RMADD (F003), RMMLT (F004)

The routines of MXPACK compute the product of two matrices or the product of their transposed matrices and may add or subtract to the resultant matrix a third one, add or subtract one matrix from another, or transfer a matrix, its negative, or a multiple of it, transpose a given matrix, build up a unit matrix, multiply a matrix by a diagonal (from left or from right) and may add the result to another matrix, add to square matrix the multiple of a diagonal matrix, compute the products X=ABA' (A' denotes the transpose of A ) and X=A'BA . It is assumed that matrices are stored row-wise without gaps, contrary to the Fortran convention.

Structure:

SUBROUTINE subprograms
User Entry Names:
MXMAD, MXMAD1, MXMAD2, MXMAD3, MXMPY, MXMPY1, MXMPY2, MXMPY3,
MXMUB, MXMUB1, MXMUB2, MXMUB3, MXTRP, MXUTY, MXMLRT, MXMLTR

Usage:

Matrix Multiplication
CALL MXMPY(A,B,C,NI,NJ,NK)(Aij)(Bjk) ->(Cik)

CALL MXMPY1(A,Q,C,NI,NJ,NK)AQ' ->C (Q is NK xNJ )
CALL MXMPY2(P,B,C,NI,NJ,NK)P'B ->C (P is NJ xNI )
CALL MXMPY3(P,Q,C,NI,NJ,NK)P'Q' ->C


If NJ=0 , C will be filled with zeros.
Matrix Multiplication and Addition
CALL MXMAD(A,B,C,NI,NJ,NK)(Aij)(Bjk)+(Cik) ->(Cik)

CALL MXMAD1(A,Q,C,NI,NJ,NK)AQ'+C ->C

CALL MXMAD2(P,B,C,NI,NJ,NK)P'B+C ->C

CALL MXMAD3(P,Q,C,NI,NJ,NK)P'Q'+C ->C


If NJ=0 , C will not be changed.

Matrix Multiplication and Subtraction
CALL MXMUB(A,B,C,NI,NJ,NK)(Aij)(Bjk)-(Cik) ->(Cik)

CALL MXMUB1(A,Q,C,NI,NJ,NK)AQ'-C ->C

CALL MXMUB2(P,B,C,NI,NJ,NK)P'B-C ->C

CALL MXMUB3(P,Q,C,NI,NJ,NK)P'Q'-C ->C


If NJ=0 , C will be replaced by -C .
Matrix Transposition
CALL MXTRP(A,B,NI,NJ)(Aij) ->(Bji)


Unity Matrix
CALL MXUTY(A,NI)(Aii)=1; (Aij)= 0, (i ≠j)


Matrix Multiplication
CALL MXMLRT(A,B,X,M,N)A[m xn] B[n xn] A'[n xm]->X[m xm]

CALL MXMLTR(A,B,X,N,M)A'[n xm] B[m xm] A[m xn]->X[n xn]

Notes:

In the formulae above, (Aij) etc denotes the ensemble of elements of the matrix A etc with the row index i and the column index j. The Fortran variables NI, NJ and NK specify the dimensions associated with the indices i,j and k. If DIMENSION A(NJ,NI) reserves space for the matrix A , then the element Aij is contained in A(J,I).

F112



next up previous index
Next: F112 Manipulation of Up: CERNLIB Previous: F105 Rotate a


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995