f11 Chapter Contents
f11 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_superlu_matrix_norm (f11mlc)

## 1  Purpose

nag_superlu_matrix_norm (f11mlc) 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

 #include #include
 void nag_superlu_matrix_norm (Nag_NormType norm, double *anorm, Integer n, const Integer icolzp[], const Integer irowix[], const double a[], NagError *fail)

## 3  Description

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

None.

## 5  Arguments

1:     normNag_NormTypeInput
On entry: specifies the value to be returned in anorm.
${\mathbf{norm}}=\mathrm{Nag_RealOneNorm}$
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}}=\mathrm{Nag_RealInfNorm}$
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}}=\mathrm{Nag_RealMaxNorm}$
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}}=\mathrm{Nag_RealOneNorm}$, $\mathrm{Nag_RealInfNorm}$ or $\mathrm{Nag_RealMaxNorm}$.
2:     anormdouble *Output
On exit: the computed quantity relating the matrix.
3:     nIntegerInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
4:     icolzp[$\mathit{dim}$]const IntegerInput
Note: the dimension, dim, of the array icolzp must be at least ${\mathbf{n}}+1$.
On entry: ${\mathbf{icolzp}}\left[i-1\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[$\mathit{dim}$]const IntegerInput
Note: the dimension, dim, of the array irowix must be at least ${\mathbf{icolzp}}\left[{\mathbf{n}}\right]-1$, the number of nonzeros of the sparse matrix $A$.
On entry: the row index array of the sparse matrix $A$.
6:     a[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array a must be at least ${\mathbf{icolzp}}\left[{\mathbf{n}}\right]-1$, the number of nonzeros of the sparse matrix $A$.
On entry: the array of nonzero values in the sparse matrix $A$.
7:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
On entry, argument number $〈\mathit{\text{value}}〉$ had an illegal value.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INT
On entry, ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{n}}\ge 0$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.

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 (f11mlce.c)

### 9.2  Program Data

Program Data (f11mlce.d)

### 9.3  Program Results

Program Results (f11mlce.r)