NR2RR
Computes the Frobenius norm of a real rectangular matrix.
Required Arguments
A — Real NRA by NCA rectangular matrix. (Input)
ANORM — Frobenius norm of A. (Output)
Optional Arguments
NRA — Number of rows of A. (Input)
Default: NRA = SIZE (A,1).
NCA — Number of columns of 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).
FORTRAN 90 Interface
Generic: CALL NR2RR (A, ANORM [])
Specific: The specific interface names are S_NR2RR and D_NR2RR.
FORTRAN 77 Interface
Single: CALL NR2RR (NRA, NCA, A, LDA, ANORM)
Double: The double precision name is DNR2RR.
Description
The routine NR2RR computes the Frobenius norm of a real rectangular matrix A. If m = NRA and n = NCA, then the Frobenius norm of A is
Example
Compute the Frobenius norm of a 3 ×  4 real rectangular matrix.
 
USE NR2RR_INT
USE UMACH_INT
 
IMPLICIT NONE
! Declare variables
INTEGER LDA, NCA, NRA
PARAMETER (LDA=3, NCA=4, NRA=3)
!
INTEGER NOUT
REAL A(LDA,NCA), ANORM
!
! Set values for A
! A = ( 1.0 0.0 2.0 0.0 )
! ( 3.0 4.0 -1.0 0.0 )
! ( 2.0 1.0 2.0 1.0 )
!
DATA A/1.0, 3.0, 2.0, 0.0, 4.0, 1.0, 2.0, -1.0, 2.0, 0.0, 0.0, &
1.0/
!
! Compute Frobenius norm of A
CALL NR2RR (A, ANORM)
! Print results
CALL UMACH (2, NOUT)
WRITE (NOUT,*) ' The Frobenius norm of A is ', ANORM
END
Output
 
The Frobenius norm of A is 6.40312
Published date: 03/19/2020
Last modified date: 03/19/2020