⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ilupack.h

📁 数学算法的实现库。可以实现常见的线性计算。
💻 H
📖 第 1 页 / 共 5 页
字号:
/*! \file ilupack.h   \brief main header for ILUPACK   This header contains all definitions of functions as well as those of the   constants*/#ifndef _ILU_PACK_H#define _ILU_PACK_H#include <stdlib.h>#include "namesilupack.h"#define LONG_INT integer#define MEDIUM_INT integer//! switch to indicate inverse-based dropping /*! switch to indicate inverse-based dropping. It is used in AMGINIT    AMGGETPARAMS and AMGSETPARAMS. The parameter "flag" is bitwise    modified by flag|=DROP_INVERSE to set and flag&=~DROP_INVERSE to    turn off inverse-based dropping.    In AMGINIT, DROP_INVERSE is set by default */#define DROP_INVERSE                     1//! switch for not shifting away zero pivots/*! switch for not shifting away zero pivots. This switch is used in ILUC    which does not have pivoting prevent small diagonal entries.    The parameter "param" is bitwise modified by param|=NO_SHIFT to     suppress shifts and param&=~NO_SHIFT to allow shifts. */#define NO_SHIFT                         2//! switch for using Tismentsky update/*! switch for using Tismentsky update.  */#define TISMENETSKY_SC                   4/* switch for repeated ILU */#define REPEAT_FACT                      8/* switch for enhanced estimate for the norm of the inverses */#define IMPROVED_ESTIMATE               16/* switch for using diagonal compensation */#define DIAGONAL_COMPENSATION           32/* switch for reducing the partial factorization to the non-coarse part */#define COARSE_REDUCE                   64// switch for using a different pivoting strategy, if the regular reordering// fails and before we switch to ILUTP#define FINAL_PIVOTING                 128// enforce the positve definite property#define ENSURE_SPD                     256// switch for the most simple Schur complement update#define SIMPLE_SC                      512#define PREPROCESS_INITIAL_SYSTEM     1024#define PREPROCESS_SUBSYSTEMS         2048#define MULTI_PILUC                   4096#define RE_FACTOR                     8192#define AGGRESSIVE_DROPPING          16384#define DISCARD_MATRIX               32768//                                   65536// flags for type of the matrix#define GENERAL_TYPE                 0#define REAL_TYPE                    0// Bit 0// real/complex arithmetic#define COMPLEX_TYPE                 1// Bit 1#define POSDEF_TYPE                  2// Bit 2-4...#define SYMMETRIC_TYPE               4#define HERMITIAN_TYPE               8#define SKEW_TYPE                   16#define _D_REAL_MAX_        1.7e+308#define _S_REAL_MAX_        1.7e+38/* ***************************************************** *//* ******      Definitions for preconditioners     ***** */typedef struct {   int nr;   int nc;   int *ia;   int *ja;   doubleprecision *a;} Dmat;typedef struct {   int nr;   int nc;   int *ia;   int *ja;   real *a;} Smat;typedef struct {   int nr;   int nc;   int *ia;   int *ja;   doublecomplex *a;} Zmat;typedef struct {   int nr;   int nc;   int *ia;   int *ja;   complex *a;} Cmat;#define ILUPACK_NIPAR   40#define ILUPACK_NFPAR   40typedef struct {   int              ipar[ILUPACK_NIPAR];   doubleprecision  fpar[ILUPACK_NFPAR];   int              type;   int              *ibuff;   int              *iaux;   doubleprecision  *dbuff;   doubleprecision  *daux;   int              *ju;   int              *jlu;   doubleprecision  *alu;   size_t           nibuff, ndbuff, nju,njlu,nalu, ndaux,niaux;} DILUPACKparam;typedef struct {   int     ipar[ILUPACK_NIPAR];   real    fpar[ILUPACK_NFPAR];   int     type;   int     *ibuff;   int     *iaux;   real    *dbuff;   real    *daux;   int     *ju;   int     *jlu;   real    *alu;   size_t  nibuff, ndbuff, nju,njlu,nalu, ndaux,niaux;} SILUPACKparam;typedef struct {   int              ipar[ILUPACK_NIPAR];   doubleprecision  fpar[ILUPACK_NFPAR];   int              type;   int              *ibuff;   int              *iaux;   doublecomplex    *dbuff;   doublecomplex    *daux;   int              *ju;   int              *jlu;   doublecomplex    *alu;   size_t           nibuff, ndbuff, nju,njlu,nalu, ndaux,niaux;} ZILUPACKparam;typedef struct {   int     ipar[ILUPACK_NIPAR];   real    fpar[ILUPACK_NFPAR];   int     type;   int     *ibuff;   int     *iaux;   complex *dbuff;   complex *daux;   int     *ju;   int     *jlu;   complex *alu;   size_t  nibuff, ndbuff, nju,njlu,nalu, ndaux,niaux;} CILUPACKparam;// typedef struct DAMGlevelmat *PDAMGlevelmat;typedef struct  DAMGLM {  int n;                    int nB;   Dmat LU;  int *LUperm;  Dmat E;  Dmat F;  int *p;  int *invq;  doubleprecision *rowscal;  doubleprecision *colscal;  struct DAMGLM *prev;  struct DAMGLM *next;} DAMGlevelmat; //typedef struct SAMGlevelmat *PSAMGlevelmat;typedef struct  SAMGLM {  int n;                    int nB;   Smat LU;  int *LUperm;  Smat E;  Smat F;  int *p;  int *invq;  real *rowscal;  real *colscal;  struct SAMGLM *prev;  struct SAMGLM *next;} SAMGlevelmat; // typedef struct ZAMGlevelmat *PZAMGlevelmat;typedef struct  ZAMGLM {  int n;                    int nB;   Zmat LU;  int *LUperm;  Zmat E;  Zmat F;  int *p;  int *invq;  doublecomplex *rowscal;  doublecomplex *colscal;  struct ZAMGLM *prev;  struct ZAMGLM *next;} ZAMGlevelmat; // typedef struct CAMGlevelmat *PCAMGlevelmat;typedef struct CAMGLM {  int n;                    int nB;   Cmat LU;  int *LUperm;  Cmat E;  Cmat F;  int *p;  int *invq;  complex *rowscal;  complex *colscal;  struct CAMGLM *prev;  struct CAMGLM *next;} CAMGlevelmat; void DGNLAMGsol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGdlsol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGdusol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGlsol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGusol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGtdlsol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGtdusol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGtlsol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGtusol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGtsol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DSPDAMGsol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DSYMAMGsol(DAMGlevelmat, int, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGextract(Dmat *,Dmat *, Dmat, int *,int *,  int);void DSYMAMGextract(Dmat *, Dmat, int *,int *,  int);void DSSMAMGextract(Dmat *, Dmat, int *,int *,  int);void SGNLAMGsol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);void SGNLAMGdlsol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);void SGNLAMGdusol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);void SGNLAMGusol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);void SGNLAMGlsol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);void SGNLAMGtdlsol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);void SGNLAMGtdusol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);void SGNLAMGtusol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);void SGNLAMGtlsol(SAMGlevelmat, int, SILUPACKparam *, real *, real *, real *);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -