NAG FL Interfacef11mlf (direct_​real_​gen_​norm)

▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

1Purpose

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.

2Specification

Fortran Interface
 Subroutine f11mlf ( norm, n, a,
 Integer, Intent (In) :: n, icolzp(*), irowix(*) Integer, Intent (Inout) :: ifail Real (Kind=nag_wp), Intent (In) :: a(*) Real (Kind=nag_wp), Intent (Out) :: anorm Character (1), Intent (In) :: norm
C Header Interface
#include <nag.h>
 void f11mlf_ (const char *norm, double *anorm, const Integer *n, const Integer icolzp[], const Integer irowix[], const double a[], Integer *ifail, const Charlen length_norm)
The routine may be called by the names f11mlf or nagf_sparse_direct_real_gen_norm.

3Description

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

None.

5Arguments

1: $\mathbf{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}|{A}_{ij}|$.
${\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}|{A}_{ij}|$.
${\mathbf{norm}}=\text{'M'}$
The value $\underset{1\le i,j\le n}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}|{A}_{ij}|$ (not a norm).
Constraint: ${\mathbf{norm}}=\text{'1'}$, $\text{'O'}$, $\text{'I'}$ or $\text{'M'}$.
2: $\mathbf{anorm}$Real (Kind=nag_wp) Output
On exit: the computed quantity relating the matrix.
3: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
4: $\mathbf{icolzp}\left(*\right)$Integer array Input
Note: the dimension of the array icolzp must be at least ${\mathbf{n}}+1$.
On entry: the new column index array of sparse matrix $A$. See Section 2.1.3 in the F11 Chapter Introduction.
5: $\mathbf{irowix}\left(*\right)$Integer array Input
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$. See Section 2.1.3 in the F11 Chapter Introduction.
6: $\mathbf{a}\left(*\right)$Real (Kind=nag_wp) array Input
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: $\mathbf{ifail}$Integer Input/Output
On entry: ifail must be set to $0$, $-1$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $-1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $-1$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $0$ is recommended. When the value $-\mathbf{1}$ 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).

6Error Indicators and Warnings

If on entry ${\mathbf{ifail}}=0$ or $-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{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{n}}\ge 0$.
On entry, ${\mathbf{norm}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{norm}}=\text{'1'}$, $\text{'O'}$, $\text{'I'}$ or $\text{'M'}$.
${\mathbf{ifail}}=-99$
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

Not applicable.

8Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
f11mlf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

None.

10Example

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 ) .$

10.1Program Text

Program Text (f11mlfe.f90)

10.2Program Data

Program Data (f11mlfe.d)

10.3Program Results

Program Results (f11mlfe.r)