F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06WAF (DLANSF)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

F06WAF (DLANSF) returns the value of the $1$-norm, the $\infty$-norm, the Frobenius norm, or the maximum absolute value of the elements of a real symmetric matrix $A$ stored in Rectangular Full Packed (RFP) format. The RFP storage format is described in Section 3.3.3 in the F07 Chapter Introduction.

## 2  Specification

 FUNCTION F06WAF ( NORM, TRANSR, UPLO, N, A, WORK)
 REAL (KIND=nag_wp) F06WAF
 INTEGER N REAL (KIND=nag_wp) A(N*(N+1)/2), WORK(*) CHARACTER(1) NORM, TRANSR, UPLO
The routine may be called by its LAPACK name dlansf.

## 3  Description

Given a real $n$ by $n$ symmetric matrix, $A$, F06WAF (DLANSF) calculates one of the values given by
 ${‖A‖}_{1}=\underset{j}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\sum _{i=1}^{n}\left|{a}_{ij}\right|$ (the $1$-norm of $A$), ${‖A‖}_{\infty }=\underset{i}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\sum _{j=1}^{n}\left|{a}_{ij}\right|$ (the $\infty$-norm of $A$), ${‖A‖}_{F}={\left(\sum _{i=1}^{n}\sum _{j=1}^{n}{\left|{a}_{ij}\right|}^{2}\right)}^{1/2}$ (the Frobenius norm of $A$),   or $\underset{i,j}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\left|{a}_{ij}\right|$ (the maximum absolute element value of $A$).
$A$ is stored in compact form using the RFP format.

None.

## 5  Parameters

1:     NORM – CHARACTER(1)Input
On entry: specifies the value to be returned.
${\mathbf{NORM}}=\text{'1'}$ or $\text{'O'}$
The $1$-norm.
${\mathbf{NORM}}=\text{'I'}$
The $\infty$-norm.
${\mathbf{NORM}}=\text{'F'}$ or $\text{'E'}$
The Frobenius (or Euclidean) norm.
${\mathbf{NORM}}=\text{'M'}$
The value $\underset{i,j}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\left|{a}_{ij}\right|$ (not a norm).
Constraint: ${\mathbf{NORM}}=\text{'1'}$, $\text{'O'}$, $\text{'I'}$, $\text{'F'}$, $\text{'E'}$ or $\text{'M'}$.
2:     TRANSR – CHARACTER(1)Input
On entry: specifies whether the RFP representation of $A$ is normal or transposed.
${\mathbf{TRANSR}}=\text{'N'}$
The matrix $A$ is stored in normal RFP format.
${\mathbf{TRANSR}}=\text{'T'}$
The matrix $A$ is stored in transposed RFP format.
Constraint: ${\mathbf{TRANSR}}=\text{'N'}$ or $\text{'T'}$.
3:     UPLO – CHARACTER(1)Input
On entry: specifies whether the upper or lower triangular part of $A$ is stored.
${\mathbf{UPLO}}=\text{'U'}$
The upper triangular part of $A$ is stored.
${\mathbf{UPLO}}=\text{'L'}$
The lower triangular part of $A$ is stored.
Constraint: ${\mathbf{UPLO}}=\text{'U'}$ or $\text{'L'}$.
4:     N – INTEGERInput
On entry: $n$, the order of the matrix $A$.
When ${\mathbf{N}}=0$, F06WAF (DLANSF) returns zero.
Constraint: ${\mathbf{N}}\ge 0$.
5:     A(${\mathbf{N}}×\left({\mathbf{N}}+1\right)/2$) – REAL (KIND=nag_wp) arrayInput
On entry: the upper or lower triangular part (as specified by UPLO) of the $n$ by $n$ symmetric matrix $A$, in either normal or transposed RFP format, as described in Section 3.3.3 in the F07 Chapter Introduction.
6:     WORK($*$) – REAL (KIND=nag_wp) arrayWorkspace
Note: the dimension of the array WORK must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$ if ${\mathbf{NORM}}=\text{'1'}$, $\text{'O'}$ or $\text{'I'}$, and at least $1$ otherwise.

None.

Not applicable.

None.

## 9  Example

This example reads in the lower triangular part of a symmetric matrix, converts this to RFP format, then calculates the norm of the matrix for each of the available norm types.

### 9.1  Program Text

Program Text (f06wafe.f90)

### 9.2  Program Data

Program Data (f06wafe.d)

### 9.3  Program Results

Program Results (f06wafe.r)