f06pj solves a real triangular system of equations with a single right hand side.

# Syntax

C#
```public static void f06pj(
string uplo,
string trans,
string diag,
int n,
double[,] a,
double[] x,
int incx,
out int ifail
)```
Visual Basic
```Public Shared Sub f06pj ( _
uplo As String, _
trans As String, _
diag As String, _
n As Integer, _
a As Double(,), _
x As Double(), _
incx As Integer, _
<OutAttribute> ByRef ifail As Integer _
)```
Visual C++
```public:
static void f06pj(
String^ uplo,
String^ trans,
String^ diag,
int n,
array<double,2>^ a,
array<double>^ x,
int incx,
[OutAttribute] int% ifail
)```
F#
```static member f06pj :
uplo : string *
trans : string *
diag : string *
n : int *
a : float[,] *
x : float[] *
incx : int *
ifail : int byref -> unit
```

#### Parameters

uplo
Type: System..::..String
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"}$.
trans
Type: System..::..String
On entry: specifies the operation to be performed.
${\mathbf{trans}}=\text{"N"}$
$x←{A}^{-1}x$.
${\mathbf{trans}}=\text{"T"}$ or $\text{"C"}$
$x←{A}^{-\mathrm{T}}x$.
Constraint: ${\mathbf{trans}}=\text{"N"}$, $\text{"T"}$ or $\text{"C"}$.
diag
Type: System..::..String
On entry: specifies whether $A$ has nonunit or unit diagonal elements.
${\mathbf{diag}}=\text{"N"}$
The diagonal elements are stored explicitly.
${\mathbf{diag}}=\text{"U"}$
The diagonal elements are assumed to be $1$, and are not referenced.
Constraint: ${\mathbf{diag}}=\text{"N"}$ or $\text{"U"}$.
n
Type: System..::..Int32
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
a
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
Note: the second dimension of the array a must be at least ${\mathbf{n}}$.
On entry: the $n$ by $n$ triangular matrix $A$.
• If ${\mathbf{uplo}}=\text{"U"}$, $A$ is upper triangular and the elements of the array below the diagonal are not referenced.
• If ${\mathbf{uplo}}=\text{"L"}$, $A$ is lower triangular and the elements of the array above the diagonal are not referenced.
• If ${\mathbf{diag}}=\text{"U"}$, the diagonal elements of $A$ are assumed to be $1$, and are not referenced.
x
Type: array<System..::..Double>[]()[][]
An array of size [dim1]
Note: the dimension of the array x must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{n}}-1\right)×\left|{\mathbf{incx}}\right|\right)$.
On entry: the $n$-element vector $x$.
If ${\mathbf{incx}}>0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{x}}\left[1+\left(\mathit{i}–1\right)×{\mathbf{incx}}-1\right]$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$.
If ${\mathbf{incx}}<0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{x}}\left[1–\left({\mathbf{n}}–\mathit{i}\right)×{\mathbf{incx}}-1\right]$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$.
On exit: the updated vector $x$ stored in the array elements used to supply the original vector $x$.
incx
Type: System..::..Int32
On entry: the increment in the subscripts of x between successive elements of $x$.
Constraint: ${\mathbf{incx}}\ne 0$.
ifail
Type: System..::..Int32%
On exit: $\mathbf{ifail}=0$ unless the method detects an error (see [Error Indicators and Warnings]).

# Description

f06pj performs one of the matrix-vector operations
 $x←A-1x or x←A-Tx,$
where $A$ is an $n$ by $n$ real triangular matrix, and $x$ is an $n$-element real vector. ${A}^{-\mathrm{T}}$ denotes ${\left({A}^{\mathrm{T}}\right)}^{-1}$ or equivalently ${\left({A}^{-1}\right)}^{\mathrm{T}}$.
No test for singularity or near-singularity of $A$ is included in this method. Such tests must be performed before calling this method.

None.

# Error Indicators and Warnings

${\mathbf{ifail}}=-9000$
An error occured, see message report.
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-4000$
Invalid dimension for array $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-8000$
Negative dimension for array $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$

Not applicable.

None.