SuperLU: EXAMPLE/zitersol1.c File Reference

SuperLU 6.0.0

Functions | Variables
zitersol1.c File Reference
Example

Example #2 showing how to use ILU to precondition GMRES. More...

`#include <unistd.h>`
`#include "slu_zdefs.h"`
Include dependency graph for zitersol1.c:

## Functions
void | zpsolve (int n, doublecomplex x[], doublecomplex y[])
| Performs zgsisx with original matrix A. More...
void | zmatvec_mult (doublecomplex alpha, doublecomplex x[], doublecomplex beta, doublecomplex y[])
| Performs matrix-vector multipliation sp_zgem with original matrix A. More...
int | main (int argc, char *argv[])

## Variables
char * | GLOBAL_EQUED
superlu_options_t * | GLOBAL_OPTIONS
double * | GLOBAL_R
double * | GLOBAL_C
int * | GLOBAL_PERM_C
int * | GLOBAL_PERM_R
SuperMatrix * | GLOBAL_A
SuperMatrix * | GLOBAL_A_ORIG
SuperMatrix * | GLOBAL_L
SuperMatrix * | GLOBAL_U
SuperLUStat_t * | GLOBAL_STAT
mem_usage_t * | GLOBAL_MEM_USAGE

## Detailed Description

This example shows that ILU is computed from the equilibrated matrix, but the preconditioned GMRES is applied to the original system. The driver routine ZGSISX is called twice to perform factorization and apply preconditioner separately.

Note that ZGSISX performs the following factorization: Pr*Dr*A*Dc*Pc^T ~= LU with Pr being obtained from MC64 statically then partial pivoting dynamically. On return, A is overwritten as A1 = Dr*A*Dc.

We need to save a copy of the original matrix A, then solve the original system, A*x = B, using FGMRES. Each GMRES step requires requires 2 procedures: 1) Apply preconditioner M^{-1} = Dc*Pc^T*U^{-1}*L^{-1}*Pr*Dr 2) Matrix-vector multiplication: w = A*v

## Function Documentation

## ◆ main()

int main | ( | int | argc,
|  | char * | argv[]
| ) |  |

Here is the call graph for this function:

## ◆ zmatvec_mult()

void zmatvec_mult | ( | doublecomplex | alpha,
|  | doublecomplex | x[],
|  | doublecomplex | beta,
|  | doublecomplex | y[]
| ) |  |

The operations is y := alpha*A*x + beta*y. See documentation of sp_zgem for further details.

Parameters

  [in] | alpha | Scalar factor for A*x
  [in] | x | Vector to multiply with A
  [in] | beta | Scalar factor for y
  [in,out] | y | Vector to add to to matrix-vector multiplication and storage for result.

Here is the call graph for this function:

## ◆ zpsolve()

void zpsolve | ( | int | n,
|  | doublecomplex | x[],
|  | doublecomplex | y[]
| ) |  |

See documentation of zgsisx for more details.

Parameters

  [in] | n | Dimension of matrices
  [out] | x | Solution
  [in,out] | y | Right-hand side

Here is the call graph for this function:

## Variable Documentation

## ◆ GLOBAL_A

SuperMatrix* GLOBAL_A

## ◆ GLOBAL_A_ORIG

SuperMatrix * GLOBAL_A_ORIG

## ◆ GLOBAL_C

double * GLOBAL_C

## ◆ GLOBAL_EQUED

char* GLOBAL_EQUED

## ◆ GLOBAL_L

SuperMatrix * GLOBAL_L

## ◆ GLOBAL_MEM_USAGE

mem_usage_t* GLOBAL_MEM_USAGE

## ◆ GLOBAL_OPTIONS

superlu_options_t* GLOBAL_OPTIONS

## ◆ GLOBAL_PERM_C

int* GLOBAL_PERM_C

## ◆ GLOBAL_PERM_R

int * GLOBAL_PERM_R

## ◆ GLOBAL_R

double* GLOBAL_R

## ◆ GLOBAL_STAT

SuperLUStat_t* GLOBAL_STAT

## ◆ GLOBAL_U

SuperMatrix * GLOBAL_U