MXTXF

 


   more...

Computes the transpose product of a matrix, ATA.

Required Arguments

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)

Optional Arguments

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).

FORTRAN 90 Interface

Generic: CALL MXTXF (A, B [])

Specific: The specific interface names are S_MXTXF and D_MXTXF.

FORTRAN 77 Interface

Single: CALL MXTXF (NRA, NCA, A, LDA, NB, B, LDB)

Double: The double precision name is DMXTXF.

Description

The routine MXTXF computes the real general matrix B = ATA given the real rectangular matrix A.

Example

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

Output

 

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