# NAG FL Interfacef06waf (dlansf)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

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

## 2Specification

Fortran Interface
 Function f06waf ( norm, uplo, n, a, work)
 Real (Kind=nag_wp) :: f06waf Integer, Intent (In) :: n Real (Kind=nag_wp), Intent (In) :: a(n*(n+1)/2) Real (Kind=nag_wp), Intent (Inout) :: work(*) Character (1), Intent (In) :: norm, transr, uplo
#include <nag.h>
 double f06waf_ (const char *norm, const char *transr, const char *uplo, const Integer *n, const double a[], double work[], const Charlen length_norm, const Charlen length_transr, const Charlen length_uplo)
The routine may be called by the names f06waf, nagf_blas_dlansf or its LAPACK name dlansf.

## 3Description

Given a real $n×n$ symmetric matrix, $A$, f06waf calculates one of the values given by
 ${‖A‖}_{1}=\underset{j}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\sum _{i=1}^{n}|{a}_{ij}|$ (the $1$-norm of $A$), ${‖A‖}_{\infty }=\underset{i}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\sum _{j=1}^{n}|{a}_{ij}|$ (the $\infty$-norm of $A$), ${‖A‖}_{F}={\left(\sum _{i=1}^{n}\sum _{j=1}^{n}{|{a}_{ij}|}^{2}\right)}^{1/2}$ (the Frobenius norm of $A$),   or $\underset{i,j}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}|{a}_{ij}|$ (the maximum absolute element value of $A$).
$A$ is stored in compact form using the RFP format. The RFP storage format is described in Section 3.3.3 in the F07 Chapter Introduction.
Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001) Basic Linear Algebra Subprograms Technical (BLAST) Forum Standard University of Tennessee, Knoxville, Tennessee https://www.netlib.org/blas/blast-forum/blas-report.pdf
Gustavson F G, Waśniewski J, Dongarra J J and Langou J (2010) Rectangular full packed format for Cholesky's algorithm: factorization, solution, and inversion ACM Trans. Math. Software 37, 2

## 5Arguments

1: $\mathbf{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}}|{a}_{ij}|$ (not a norm).
Constraint: ${\mathbf{norm}}=\text{'1'}$, $\text{'O'}$, $\text{'I'}$, $\text{'F'}$, $\text{'E'}$ or $\text{'M'}$.
2: $\mathbf{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: $\mathbf{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: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrix $A$.
When ${\mathbf{n}}=0$, f06waf returns zero.
Constraint: ${\mathbf{n}}\ge 0$.
5: $\mathbf{a}\left({\mathbf{n}}×\left({\mathbf{n}}+1\right)/2\right)$Real (Kind=nag_wp) array Input
On entry: the upper or lower triangular part (as specified by uplo) of the $n×n$ symmetric matrix $A$, in either normal or transposed RFP format (as specified by transr). The storage format is described in detail in Section 3.3.3 in the F07 Chapter Introduction.
6: $\mathbf{work}\left(*\right)$Real (Kind=nag_wp) array Workspace
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.

## 7Accuracy

The BLAS standard requires accurate implementations which avoid unnecessary over/underflow (see Section 2.7 of Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001)).

## 8Parallelism and Performance

f06waf is not threaded in any implementation.

None.

## 10Example

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.

### 10.1Program Text

Program Text (f06wafe.f90)

### 10.2Program Data

Program Data (f06wafe.d)

### 10.3Program Results

Program Results (f06wafe.r)