Computes the transpose product of a matrix, ATA.
A — Real NRA by NCA rectangular
matrix. (Input)
The transpose product of A is to be
computed.
B — Real NB by NB symmetric matrix containing the transpose product ATA. (Output)
NRA — Number of
rows in A.
(Input)
Default: NRA = size
(A,1).
NCA — Number of
columns in A.
(Input)
Default: NCA = size
(A,2).
LDA — Leading
dimension of A
exactly as specified in the dimension statement of the calling
program. (Input)
Default: LDA = size
(A,1).
NB — Order of the
matrix B. (Input)
NB must be
equal to NCA.
Default: NB = size
(B,1).
LDB — Leading
dimension of B exactly as specified in the dimension statement of the
calling program. (Input)
Default: LDB = size
(B,1).
Generic: CALL MXTXF (A, B [,…])
Specific: The specific interface names are S_MXTXF and D_MXTXF.
Single: CALL MXTXF (NRA, NCA, A, LDA, NB, B, LDB)
Double: The double precision name is DMXTXF.
The routine MXTXF computes the real general matrix B = ATA given the real rectangular matrix A.
Multiply the transpose of a 3 ´ 4 real matrix by itself. The output matrix will be a 4 ´ 4 real symmetric matrix.
USE MXTXF_INT
USE WRRRN_INT
IMPLICIT NONE
! Declare variables
INTEGER NB, NCA, NRA
PARAMETER (NB=4, NCA=4, NRA=3)
!
REAL A(NRA,NCA), B(NB,NB)
! Set values for A
! A = ( 3.0 1.0 4.0 2.0 )
! ( 0.0 2.0 1.0 -1.0 )
! ( 6.0 1.0 3.0 2.0 )
!
DATA A/3.0, 0.0, 6.0, 1.0, 2.0, 1.0, 4.0, 1.0, 3.0, 2.0, -1.0, &
2.0/
! Compute B = trans(A)*A
CALL MXTXF (A, B)
! Print results
CALL WRRRN ('B = trans(A)*A', B)
END
B =
trans(A)*A
1 2
3 4
1 45.00
9.00 30.00 18.00
2
9.00 6.00 9.00
2.00
3 30.00 9.00 26.00
13.00
4 18.00 2.00
13.00 9.00
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |