# NAG Library Routine Document

## 1Purpose

f16rbf calculates the value of the $1$-norm, the $\infty$-norm, the Frobenius norm or the maximum absolute value of the elements of a real $m$ by $n$ band matrix stored in banded form.
It can also be used to compute the value of the $2$-norm of a row $n$-vector or a column $m$-vector.

## 2Specification

Fortran Interface
 Function f16rbf ( m, n, kl, ku, ab, ldab)
 Real (Kind=nag_wp) :: f16rbf Integer, Intent (In) :: inorm, m, n, kl, ku, ldab Real (Kind=nag_wp), Intent (In) :: ab(ldab,*)
#include nagmk26.h
 double f16rbf_ (const Integer *inorm, const Integer *m, const Integer *n, const Integer *kl, const Integer *ku, const double ab[], const Integer *ldab)

## 3Description

Given a real $m$ by $n$ banded matrix, $A$, f16rbf calculates one of the values given by
 ${‖A‖}_{1}=\underset{j}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\sum _{i=1}^{m}\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}^{m}\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$).
If $m$ or $n$ is $1$ then additionally f16rbf can calculate the value ${‖A‖}_{2}=\sqrt{\sum {a}_{i}^{2}}$ (the $2$-norm of $A$).
Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001) Basic Linear Algebra Subprograms Technical (BLAST) Forum Standard University of Tennessee, Knoxville, Tennessee http://www.netlib.org/blas/blast-forum/blas-report.pdf

## 5Arguments

1:     $\mathbf{inorm}$ – IntegerInput
On entry: specifies the value to be returned. The integer codes shown below can be replaced by the equivalent named constants of the form NAG_?_NORM. These named constants are available via the nag_library module and are also used in the example program for clarity.
${\mathbf{inorm}}=171$ (NAG_ONE_NORM)
The $1$-norm.
${\mathbf{inorm}}=173$ (NAG_TWO_NORM)
The $2$-norm of a row or column vector.
${\mathbf{inorm}}=174$ (NAG_FROBENIUS_NORM)
The Frobenius (or Euclidean) norm.
${\mathbf{inorm}}=175$ (NAG_INF_NORM)
The $\infty$-norm.
${\mathbf{inorm}}=177$ (NAG_MAX_NORM)
The value $\underset{i,j}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\left|{a}_{ij}\right|$ (not a norm).
Constraints:
• ${\mathbf{inorm}}=171$, $173$, $174$, $175$ or $177$;
• if ${\mathbf{inorm}}=173$, ${\mathbf{m}}=1$ or ${\mathbf{n}}=1$.
2:     $\mathbf{m}$ – IntegerInput
On entry: $m$, the number of rows of the matrix $A$. If ${\mathbf{m}}\le 0$ on input, f16rbf returns $0$.
3:     $\mathbf{n}$ – IntegerInput
On entry: $n$, the number of columns of the matrix $A$. If ${\mathbf{n}}\le 0$ on input, f16rbf returns $0$.
4:     $\mathbf{kl}$ – IntegerInput
On entry: ${k}_{l}$, the number of subdiagonals within the band of $A$. If ${\mathbf{kl}}\le 0$ on input, f16rbf returns $0$.
5:     $\mathbf{ku}$ – IntegerInput
On entry: ${k}_{u}$, the number of superdiagonals within the band of $A$. If ${\mathbf{ku}}\le 0$ on input, f16rbf returns $0$.
6:     $\mathbf{ab}\left({\mathbf{ldab}},*\right)$ – Real (Kind=nag_wp) arrayInput
Note: the second dimension of the array ab must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $m$ by $n$ band matrix $A$.
The matrix is stored in rows $1$ to ${k}_{l}+{k}_{u}+1$, more precisely, the element ${A}_{ij}$ must be stored in
 $abku+1+i-jj for ​max1,j-ku≤i≤minm,j+kl.$
7:     $\mathbf{ldab}$ – IntegerInput
On entry: the first dimension of the array ab as declared in the (sub)program from which f16rbf is called.
Constraint: ${\mathbf{ldab}}\ge {\mathbf{kl}}+{\mathbf{ku}}+1$.

## 6Error Indicators and Warnings

If any constraint on an input parameter is violated, an error message is printed and program execution is terminated.

## 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

f16rbf is not threaded in any implementation.

None.

## 10Example

Calculates the various norms of a $6$ by $4$ banded matrix with two subdiagonals and one superdiagonal.

### 10.1Program Text

Program Text (f16rbfe.f90)

### 10.2Program Data

Program Data (f16rbfe.d)

### 10.3Program Results

Program Results (f16rbfe.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017
{"ft_lang_label":"__label__en","ft_lang_prob":0.59905875,"math_prob":0.9997193,"size":3218,"snap":"2023-40-2023-50","text_gpt3_token_len":926,"char_repetition_ratio":0.12476665,"word_repetition_ratio":0.13296904,"special_character_ratio":0.2771908,"punctuation_ratio":0.17355372,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.999959,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-04T02:51:57Z\",\"WARC-Record-ID\":\"<urn:uuid:eb51bf3c-0604-48ae-879a-4ca08b106638>\",\"Content-Length\":\"20998\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9ae01bc7-414a-4c9e-a721-5ee3908b2bda>\",\"WARC-Concurrent-To\":\"<urn:uuid:981a223f-e312-4cdf-9b5b-f254c71f9c50>\",\"WARC-IP-Address\":\"78.129.168.4\",\"WARC-Target-URI\":\"https://support.nag.com/numeric/nl/nagdoc_26.1/nagdoc_fl26.1/html/f16/f16rbf.html\",\"WARC-Payload-Digest\":\"sha1:F5MMSGKIGLOTGXA425QRL6VSG3YJZUZ6\",\"WARC-Block-Digest\":\"sha1:BKPVFYTQ7YTRF3BBJ2VIHZERQMDFIXE2\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100523.4_warc_CC-MAIN-20231204020432-20231204050432-00078.warc.gz\"}"}