F11 Chapter Contents
F11 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF11MLF

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

F11MLF computes the $1$-norm, the $\infty$-norm or the maximum absolute value of the elements of a real, square, sparse matrix which is held in compressed column (Harwell–Boeing) format.

## 2  Specification

 SUBROUTINE F11MLF ( NORM, ANORM, N, ICOLZP, IROWIX, A, IFAIL)
 INTEGER N, ICOLZP(*), IROWIX(*), IFAIL REAL (KIND=nag_wp) ANORM, A(*) CHARACTER(1) NORM

## 3  Description

F11MLF computes various quantities relating to norms of a real, sparse $n$ by $n$ matrix $A$ presented in compressed column (Harwell–Boeing) format.

None.

## 5  Parameters

1:     NORM – CHARACTER(1)Input
On entry: specifies the value to be returned in ANORM.
${\mathbf{NORM}}=\text{'1'}$ or $\text{'O'}$
The $1$-norm ${‖A‖}_{1}$ of the matrix is computed, that is $\underset{1\le j\le n}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\sum _{i=1}^{n}\left|{A}_{ij}\right|$.
${\mathbf{NORM}}=\text{'I'}$
The $\infty$-norm ${‖A‖}_{\infty }$ of the matrix is computed, that is $\underset{1\le i\le n}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\sum _{j=1}^{n}\left|{A}_{ij}\right|$.
${\mathbf{NORM}}=\text{'M'}$
The value $\underset{1\le i,j\le n}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\left|{A}_{ij}\right|$ (not a norm).
Constraint: ${\mathbf{NORM}}=\text{'1'}$, $\text{'O'}$, $\text{'I'}$ or $\text{'M'}$.
2:     ANORM – REAL (KIND=nag_wp)Output
On exit: the computed quantity relating the matrix.
3:     N – INTEGERInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{N}}\ge 0$.
4:     ICOLZP($*$) – INTEGER arrayInput
Note: the dimension of the array ICOLZP must be at least ${\mathbf{N}}+1$.
On entry: ${\mathbf{ICOLZP}}\left(i\right)$ contains the index in $A$ of the start of a new column. See Section 2.1.3 in the F11 Chapter Introduction.
5:     IROWIX($*$) – INTEGER arrayInput
Note: the dimension of the array IROWIX must be at least ${\mathbf{ICOLZP}}\left({\mathbf{N}}+1\right)-1$, the number of nonzeros of the sparse matrix $A$.
On entry: the row index array of sparse matrix $A$.
6:     A($*$) – REAL (KIND=nag_wp) arrayInput
Note: the dimension of the array A must be at least ${\mathbf{ICOLZP}}\left({\mathbf{N}}+1\right)-1$, the number of nonzeros of the sparse matrix $A$.
On entry: the array of nonzero values in the sparse matrix $A$.
7:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ or ​}1$. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value $-1\text{​ or ​}1$ is recommended. If the output of error messages is undesirable, then the value $1$ is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is $0$. When the value $-\mathbf{1}\text{​ or ​}\mathbf{1}$ is used it is essential to test the value of IFAIL on exit.
On exit: ${\mathbf{IFAIL}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6  Error Indicators and Warnings

If on entry ${\mathbf{IFAIL}}={\mathbf{0}}$ or $-{\mathbf{1}}$, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
${\mathbf{IFAIL}}=1$
 On entry, ${\mathbf{NORM}}\ne \text{'1'}$, $\text{'O'}$, $\text{'I'}$ or $\text{'M'}$, or ${\mathbf{N}}<0$.
${\mathbf{IFAIL}}=301$
Unable to allocate required internal workspace.

Not applicable.

None.

## 9  Example

This example computes norms and maximum absolute value of the matrix $A$, where
 $A= 2.00 1.00 0 0 0 0 0 1.00 -1.00 0 4.00 0 1.00 0 1.00 0 0 0 1.00 2.00 0 -2.00 0 0 3.00 .$

### 9.1  Program Text

Program Text (f11mlfe.f90)

### 9.2  Program Data

Program Data (f11mlfe.d)

### 9.3  Program Results

Program Results (f11mlfe.r)