SuperLU 6.0.1
Functions | Variables
ditersol.c File Reference

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

#include "slu_ddefs.h"
Include dependency graph for ditersol.c:

Functions

void dpsolve (int n, double x[], double y[])
 Performs dgsisx with original matrix A. More...
 
void dmatvec_mult (double alpha, double x[], double beta, double y[])
 Performs matrix-vector multipliation sp_dgemv with original matrix A. More...
 
int main (int argc, char *argv[])
 

Variables

superlu_options_tGLOBAL_OPTIONS
 
double * GLOBAL_R
 
double * GLOBAL_C
 
int * GLOBAL_PERM_C
 
int * GLOBAL_PERM_R
 
SuperMatrixGLOBAL_A
 
SuperMatrixGLOBAL_L
 
SuperMatrixGLOBAL_U
 
SuperLUStat_tGLOBAL_STAT
 
mem_usage_tGLOBAL_MEM_USAGE
 

Detailed Description

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

Note that DGSISX 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 can solve the transformed system, A1*y = Dr*B, using FGMRES. B is first overwritten as Dr*B. Then GMRES step requires requires 2 procedures: 1) Apply preconditioner M^{-1} = Pc^T*U^{-1}*L^{-1}*Pr 2) Matrix-vector multiplication: w = A1*v

Function Documentation

◆ dmatvec_mult()

void dmatvec_mult ( double  alpha,
double  x[],
double  beta,
double  y[] 
)

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

Parameters
[in]alphaScalar factor for A*x
[in]xVector to multiply with A
[in]betaScalar factor for y
[in,out]yVector to add to to matrix-vector multiplication and storage for result.
Here is the call graph for this function:

◆ dpsolve()

void dpsolve ( int  n,
double  x[],
double  y[] 
)

See documentation of dgsisx for more details.

Parameters
[in]nDimension of matrices
[out]xSolution
[in,out]yRight-hand side
Here is the call graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)
Here is the call graph for this function:

Variable Documentation

◆ GLOBAL_A

SuperMatrix* GLOBAL_A

◆ GLOBAL_C

double * GLOBAL_C

◆ 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