Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_det_withdraw_complex_gen (f03ad)

## Purpose

nag_det_withdraw_complex_gen (f03ad) calculates the determinant of a complex matrix using an LU$LU$ factorization with partial pivoting.
Note: this function is scheduled to be withdrawn, please see f03ad in Advice on Replacement Calls for Withdrawn/Superseded Routines..

## Syntax

[a, detr, deti, ifail] = f03ad(a, 'n', n)
[a, detr, deti, ifail] = nag_det_withdraw_complex_gen(a, 'n', n)

## Description

nag_det_withdraw_complex_gen (f03ad) calculates the determinant of A$A$ using the LU$LU$ factorization with partial pivoting, PA = LU$PA=LU$, where P$P$ is a permutation matrix, L$L$ is lower triangular and U$U$ is unit upper triangular. The determinant of A$A$ is the product of the diagonal elements of L$L$, with the correct sign determined by the row interchanges.

## References

Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag

## Parameters

### Compulsory Input Parameters

1:     a(lda, : $:$) – complex array
The first dimension of the array a must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The second dimension of the array must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The n$n$ by n$n$ matrix A$A$.

### Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array a The second dimension of the array a.
n$n$, the order of the matrix A$A$.
Constraint: n0${\mathbf{n}}\ge 0$.

lda wkspce

### Output Parameters

1:     a(lda, : $:$) – complex array
The first dimension of the array a will be max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The second dimension of the array will be max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
ldamax (1,n)$\mathit{lda}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
A$A$ stores the factors L$L$ and U$U$, except that the unit diagonal elements of U$U$ are not stored.
2:     detr – double scalar
3:     deti – double scalar
The real part and imaginary parts of the determinant of A$A$.
4:     ifail – int64int32nag_int scalar
${\mathrm{ifail}}={\mathbf{0}}$ unless the function detects an error (see [Error Indicators and Warnings]).

## Error Indicators and Warnings

Errors or warnings detected by the function:
ifail = 1${\mathbf{ifail}}=1$
The matrix A$A$ is singular, possibly due to rounding errors. The factorization could not be completed. detr and deti are set to 0.0$0.0$.
ifail = 2${\mathbf{ifail}}=2$
Overflow. The value of the determinant is too large to be held in the computer.
ifail = 3${\mathbf{ifail}}=3$
Underflow. The value of the determinant is too small to be held in the computer.
ifail = 4${\mathbf{ifail}}=4$
 On entry, n < 0${\mathbf{n}}<0$, or lda < max (1,n)$\mathit{lda}<\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.

## Accuracy

The accuracy of the determinant depends on the conditioning of the original matrix. For a detailed error analysis, see page 107 of Wilkinson and Reinsch (1971).

## Further Comments

The time taken by nag_det_withdraw_complex_gen (f03ad) is approximately proportional to n3${n}^{3}$.

## Example

```function nag_det_withdraw_complex_gen_example
a = [1,  1 + 2i,  2 + 10i;
1 + 1i,  0 + 3i,  -5 + 14i;
1 + 1i,  0 + 5i,  -8 + 20i];
[aOut, detr, deti, ifail] = nag_det_withdraw_complex_gen(a)
```
```

aOut =

1.0000 + 0.0000i   1.0000 + 2.0000i   2.0000 +10.0000i
1.0000 + 1.0000i   1.0000 + 2.0000i   3.2000 + 1.6000i
1.0000 + 1.0000i   1.0000 + 0.0000i  -0.2000 + 0.4000i

detr =

1

deti =

4.4409e-16

ifail =

0

```
```function f03ad_example
a = [1,  1 + 2i,  2 + 10i;
1 + 1i,  0 + 3i,  -5 + 14i;
1 + 1i,  0 + 5i,  -8 + 20i];
[aOut, detr, deti, ifail] = f03ad(a)
```
```

aOut =

1.0000 + 0.0000i   1.0000 + 2.0000i   2.0000 +10.0000i
1.0000 + 1.0000i   1.0000 + 2.0000i   3.2000 + 1.6000i
1.0000 + 1.0000i   1.0000 + 0.0000i  -0.2000 + 0.4000i

detr =

1

deti =

4.4409e-16

ifail =

0

```

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013