# NAG FL Interfacef07uef (dtptrs)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f07uef solves a real triangular system of linear equations with multiple right-hand sides, $AX=B$ or ${A}^{\mathrm{T}}X=B$, using packed storage.

## 2Specification

Fortran Interface
 Subroutine f07uef ( uplo, diag, n, nrhs, ap, b, ldb, info)
 Integer, Intent (In) :: n, nrhs, ldb Integer, Intent (Out) :: info Real (Kind=nag_wp), Intent (In) :: ap(*) Real (Kind=nag_wp), Intent (Inout) :: b(ldb,*) Character (1), Intent (In) :: uplo, trans, diag
#include <nag.h>
 void f07uef_ (const char *uplo, const char *trans, const char *diag, const Integer *n, const Integer *nrhs, const double ap[], double b[], const Integer *ldb, Integer *info, const Charlen length_uplo, const Charlen length_trans, const Charlen length_diag)
The routine may be called by the names f07uef, nagf_lapacklin_dtptrs or its LAPACK name dtptrs.

## 3Description

f07uef solves a real triangular system of linear equations $AX=B$ or ${A}^{\mathrm{T}}X=B$, using packed storage.

## 4References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Higham N J (1989) The accuracy of solutions to triangular systems SIAM J. Numer. Anal. 26 1252–1265

## 5Arguments

1: $\mathbf{uplo}$Character(1) Input
On entry: specifies whether $A$ is upper or lower triangular.
${\mathbf{uplo}}=\text{'U'}$
$A$ is upper triangular.
${\mathbf{uplo}}=\text{'L'}$
$A$ is lower triangular.
Constraint: ${\mathbf{uplo}}=\text{'U'}$ or $\text{'L'}$.
2: $\mathbf{trans}$Character(1) Input
On entry: indicates the form of the equations.
${\mathbf{trans}}=\text{'N'}$
The equations are of the form $AX=B$.
${\mathbf{trans}}=\text{'T'}$ or $\text{'C'}$
The equations are of the form ${A}^{\mathrm{T}}X=B$.
Constraint: ${\mathbf{trans}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
3: $\mathbf{diag}$Character(1) Input
On entry: indicates whether $A$ is a nonunit or unit triangular matrix.
${\mathbf{diag}}=\text{'N'}$
$A$ is a nonunit triangular matrix.
${\mathbf{diag}}=\text{'U'}$
$A$ is a unit triangular matrix; the diagonal elements are not referenced and are assumed to be $1$.
Constraint: ${\mathbf{diag}}=\text{'N'}$ or $\text{'U'}$.
4: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
5: $\mathbf{nrhs}$Integer Input
On entry: $r$, the number of right-hand sides.
Constraint: ${\mathbf{nrhs}}\ge 0$.
6: $\mathbf{ap}\left(*\right)$Real (Kind=nag_wp) array Input
Note: the dimension of the array ap must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}×\left({\mathbf{n}}+1\right)/2\right)$.
On entry: the $n×n$ triangular matrix $A$, packed by columns.
More precisely,
• if ${\mathbf{uplo}}=\text{'U'}$, the upper triangle of $A$ must be stored with element ${A}_{ij}$ in ${\mathbf{ap}}\left(i+j\left(j-1\right)/2\right)$ for $i\le j$;
• if ${\mathbf{uplo}}=\text{'L'}$, the lower triangle of $A$ must be stored with element ${A}_{ij}$ in ${\mathbf{ap}}\left(i+\left(2n-j\right)\left(j-1\right)/2\right)$ for $i\ge j$.
If ${\mathbf{diag}}=\text{'U'}$, the diagonal elements of $A$ are assumed to be $1$, and are not referenced; the same storage scheme is used whether ${\mathbf{diag}}=\text{'N'}$ or ‘U’.
7: $\mathbf{b}\left({\mathbf{ldb}},*\right)$Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array b must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{nrhs}}\right)$.
On entry: the $n×r$ right-hand side matrix $B$.
On exit: the $n×r$ solution matrix $X$.
8: $\mathbf{ldb}$Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f07uef is called.
Constraint: ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
9: $\mathbf{info}$Integer Output
On exit: ${\mathbf{info}}=0$ unless the routine detects an error (see Section 6).

## 6Error Indicators and Warnings

${\mathbf{info}}<0$
If ${\mathbf{info}}=-i$, argument $i$ had an illegal value. An explanatory message is output, and execution of the program is terminated.
${\mathbf{info}}>0$
Element $⟨\mathit{\text{value}}⟩$ of the diagonal is exactly zero. $A$ is singular and the solution has not been computed.

## 7Accuracy

The solutions of triangular systems of equations are usually computed to high accuracy. See Higham (1989).
For each right-hand side vector $b$, the computed solution $x$ is the exact solution of a perturbed system of equations $\left(A+E\right)x=b$, where
 $|E|≤c(n)ε|A| ,$
$c\left(n\right)$ is a modest linear function of $n$, and $\epsilon$ is the machine precision.
If $\stackrel{^}{x}$ is the true solution, then the computed solution $x$ satisfies a forward error bound of the form
 $‖x-x^‖∞ ‖x‖∞ ≤ c(n)cond(A,x)ε , provided c(n)cond(A,x)ε<1 ,$
where $\mathrm{cond}\left(A,x\right)={‖|{A}^{-1}||A||x|‖}_{\infty }/{‖x‖}_{\infty }$.
Note that $\mathrm{cond}\left(A,x\right)\le \mathrm{cond}\left(A\right)={‖|{A}^{-1}||A|‖}_{\infty }\le {\kappa }_{\infty }\left(A\right)$; $\mathrm{cond}\left(A,x\right)$ can be much smaller than $\mathrm{cond}\left(A\right)$ and it is also possible for $\mathrm{cond}\left({A}^{\mathrm{T}}\right)$ to be much larger (or smaller) than $\mathrm{cond}\left(A\right)$.
Forward and backward error bounds can be computed by calling f07uhf, and an estimate for ${\kappa }_{\infty }\left(A\right)$ can be obtained by calling f07ugf with ${\mathbf{norm}}=\text{'I'}$.

## 8Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
f07uef is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f07uef 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.

The total number of floating-point operations is approximately ${n}^{2}r$.
The complex analogue of this routine is f07usf.

## 10Example

This example solves the system of equations $AX=B$, where
 $A= ( 4.30 0.00 0.00 0.00 -3.96 -4.87 0.00 0.00 0.40 0.31 -8.02 0.00 -0.27 0.07 -5.95 0.12 ) and B= ( -12.90 -21.50 16.75 14.93 -17.55 6.33 -11.04 8.09 ) ,$
using packed storage for $A$.

### 10.1Program Text

Program Text (f07uefe.f90)

### 10.2Program Data

Program Data (f07uefe.d)

### 10.3Program Results

Program Results (f07uefe.r)
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 93, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9738621115684509, "perplexity": 3439.724353379176}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296945242.64/warc/CC-MAIN-20230324020038-20230324050038-00381.warc.gz"}