Settings help

## 1Purpose

f11bd is the AD Library version of the primal routine f11bdf. Based (in the C++ interface) on overload resolution, f11bd can be used for primal, tangent and adjoint evaluation. It supports tangents and adjoints of first order.

## 2Specification

Fortran Interface
 Subroutine f11bd_AD_f ( method, precon, norm, weight, iterm, n, m, tol, maxitn, anorm, sigmax, monit, lwreq, work, lwork, ifail)
 Integer, Intent (In) :: iterm, n, m, maxitn, monit, lwork Integer, Intent (Inout) :: ifail Integer, Intent (Out) :: lwreq ADTYPE, Intent (In) :: tol, anorm, sigmax ADTYPE, Intent (Out) :: work(lwork) Character (*), Intent (In) :: method Character (1), Intent (In) :: precon, norm, weight Type (c_ptr), Intent (Inout) :: ad_handle
Corresponding to the overloaded C++ function, the Fortran interface provides five routines with names reflecting the type used for active real arguments. The actual subroutine and type names are formed by replacing AD and ADTYPE in the above as follows:
C++ Interface
#include <dco.hpp>
namespace nag {
 void f11bd ( handle_t &ad_handle, const char *method, const char *precon, const char *norm, const char *weight, const Integer &iterm, const Integer &n, const Integer &m, const ADTYPE &tol, const Integer &maxitn, const ADTYPE &anorm, const ADTYPE &sigmax, const Integer &monit, Integer &lwreq, ADTYPE work[], const Integer &lwork, Integer &ifail)
}
}
The function is overloaded on ADTYPE which represents the type of active arguments. ADTYPE may be any of the following types:
double,
dco::ga1s<double>::type,
dco::gt1s<double>::type

## 3Description

f11bd is the AD Library version of the primal routine f11bdf.
f11bdf is a setup routine, the first in a suite of three routines for the iterative solution of a real general (nonsymmetric) system of simultaneous linear equations. f11bdf must be called before f11bef, the iterative solver. The third routine in the suite, f11bff, can be used to return additional information about the computation.
These routines are suitable for the solution of large sparse general (nonsymmetric) systems of equations. For further information see Section 3 in the documentation for f11bdf.

## 4References

Arnoldi W (1951) The principle of minimized iterations in the solution of the matrix eigenvalue problem Quart. Appl. Math. 9 17–29
Barrett R, Berry M, Chan T F, Demmel J, Donato J, Dongarra J, Eijkhout V, Pozo R, Romine C and Van der Vorst H (1994) Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods SIAM, Philadelphia
Dias da Cunha R and Hopkins T (1994) PIM 1.1 — the parallel iterative method package for systems of linear equations user's guide — Fortran 77 version Technical Report Computing Laboratory, University of Kent at Canterbury, Kent, UK
Freund R W (1993) A transpose-free quasi-minimal residual algorithm for non-Hermitian linear systems SIAM J. Sci. Comput. 14 470–482
Freund R W and Nachtigal N (1991) QMR: a Quasi-Minimal Residual Method for Non-Hermitian Linear Systems Numer. Math. 60 315–339
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Higham N J (1988) FORTRAN codes for estimating the one-norm of a real or complex matrix, with applications to condition estimation ACM Trans. Math. Software 14 381–396
Saad Y and Schultz M (1986) GMRES: a generalized minimal residual algorithm for solving nonsymmetric linear systems SIAM J. Sci. Statist. Comput. 7 856–869
Sleijpen G L G and Fokkema D R (1993) BiCGSTAB$\left(\ell \right)$ for linear equations involving matrices with complex spectrum ETNA 1 11–32
Sonneveld P (1989) CGS, a fast Lanczos-type solver for nonsymmetric linear systems SIAM J. Sci. Statist. Comput. 10 36–52
Van der Vorst H (1989) Bi-CGSTAB, a fast and smoothly converging variant of Bi-CG for the solution of nonsymmetric linear systems SIAM J. Sci. Statist. Comput. 13 631–644

## 5Arguments

In addition to the arguments present in the interface of the primal routine, f11bd includes some arguments specific to AD.
A brief summary of the AD specific arguments is given below. For the remainder, links are provided to the corresponding argument from the primal routine. A tooltip popup for all arguments can be found by hovering over the argument name in Section 2 and in this section.
On entry: a configuration object that holds information on the differentiation strategy. Details on setting the AD strategy are described in AD handle object in the NAG AD Library Introduction.
2: method – character Input
3: precon – character Input
4: norm – character Input
5: weight – character Input
6: iterm – Integer Input
7: n – Integer Input
8: m – Integer Input
9: Input
10: maxitn – Integer Input
11: Input
12: Input
13: monit – Integer Input
14: lwreq – Integer Output
15: work(lwork) – ADTYPE array Communication Array
16: lwork – Integer Input
17: ifail – Integer Input/Output

## 6Error Indicators and Warnings

f11bd preserves all error codes from f11bdf and in addition can return:
${\mathbf{ifail}}=-89$
See Error Handling in the NAG AD Library Introduction for further information.
${\mathbf{ifail}}=-199$
The routine was called using a strategy that has not yet been implemented.
See AD Strategies in the NAG AD Library Introduction for further information.
${\mathbf{ifail}}=-444$
A C++ exception was thrown.
The error message will show the details of the C++ exception text.
${\mathbf{ifail}}=-899$
Dynamic memory allocation failed for AD.
See Error Handling in the NAG AD Library Introduction for further information.

Not applicable.

## 8Parallelism and Performance

f11bd is not threaded in any implementation.

None.

## 10Example

The following examples are variants of the example for f11bdf, modified to demonstrate calling the NAG AD Library.
Description of the primal example.
This example solves an $8×8$ nonsymmetric system of simultaneous linear equations using the bi-conjugate gradient stabilized method of order $\ell =1$, where the coefficients matrix $A$ has a random sparsity pattern. An incomplete $LU$ preconditioner is used (routines f11da or f11db).

Language Source File Data Results
Fortran f11bd_a1w_fe.f90 f11bd_a1w_fe.d f11bd_a1w_fe.r
C++ f11bd_a1w_hcppe.cpp f11bd_a1w_hcppe.d f11bd_a1w_hcppe.r

### 10.2Tangent modes

Language Source File Data Results
Fortran f11bd_t1w_fe.f90 f11bd_t1w_fe.d f11bd_t1w_fe.r
C++ f11bd_t1w_hcppe.cpp f11bd_t1w_hcppe.d f11bd_t1w_hcppe.r

### 10.3Passive mode

Language Source File Data Results
Fortran f11bd_p0w_fe.f90 f11bd_p0w_fe.d f11bd_p0w_fe.r
C++ f11bd_p0w_hcppe.cpp f11bd_p0w_hcppe.d f11bd_p0w_hcppe.r