📄 superlu_defs.h.bak
字号:
* (xusub,usub): xusub[i] points to the starting location of column i * in usub[]. For each U-segment, only the row index of first nonzero * is stored in usub[]. * * Each U column consists of a number of full segments. Each full segment * starts from a leading nonzero, running up to the supernode (block) * boundary. (Recall that the column-wise supernode partition is also * imposed on the rows.) Because the segment is full, we don't store all * the row indices. Instead, only the leading nonzero index is stored. * The rest can be found together with xsup/supno pair. * For example, * usub[xsub[j+1]] - usub[xsub[j]] = number of segments in column j. * for any i in usub[], * supno[i] = block number in which i belongs to * xsup[supno[i]+1] = first row of the next block * The nonzeros of this segment are: * i, i+1 ... xsup[supno[i]+1]-1 (only i is stored in usub[]) * */typedef struct { int_t *lsub; /* compressed L subscripts */ int_t *xlsub; int_t *usub; /* compressed U subscripts */ int_t *xusub; int_t nzlmax; /* current max size of lsub */ int_t nzumax; /* " " " usub */ LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */} Glu_freeable_t;/* *-- The structure used to store matrix A of the linear system and * several vectors describing the transformations done to matrix A. * * A (SuperMatrix*) * Matrix A in A*X=B, of dimension (A->nrow, A->ncol). * The number of linear equations is A->nrow. The type of A can be: * Stype = SLU_NC; Dtype = SLU_D; Mtype = SLU_GE. * * DiagScale (DiagScale_t) * Specifies the form of equilibration that was done. * = NOEQUIL: No equilibration. * = ROW: Row equilibration, i.e., A was premultiplied by diag(R). * = COL: Column equilibration, i.e., A was postmultiplied by diag(C). * = BOTH: Both row and column equilibration, i.e., A was replaced * by diag(R)*A*diag(C). * * R double*, dimension (A->nrow) * The row scale factors for A. * If DiagScale = ROW or BOTH, A is multiplied on the left by diag(R). * If DiagScale = NOEQUIL or COL, R is not defined. * * C double*, dimension (A->ncol) * The column scale factors for A. * If DiagScale = COL or BOTH, A is multiplied on the right by diag(C). * If DiagScale = NOEQUIL or ROW, C is not defined. * * perm_r (int*) dimension (A->nrow) * Row permutation vector which defines the permutation matrix Pr, * perm_r[i] = j means row i of A is in position j in Pr*A. * * perm_c (int*) dimension (A->ncol) * Column permutation vector, which defines the * permutation matrix Pc; perm_c[i] = j means column i of A is * in position j in A*Pc. * */typedef struct { DiagScale_t DiagScale; double *R; double *C; int_t *perm_r; int_t *perm_c;} ScalePermstruct_t;/* *-- This contains the options used to control the solve process. * * Fact (fact_t) * Specifies whether or not the factored form of the matrix * A is supplied on entry, and if not, how the matrix A should * be factorizaed. * = DOFACT: The matrix A will be factorized from scratch, and the * factors will be stored in L and U. * = SamePattern: The matrix A will be factorized assuming * that a factorization of a matrix with the same sparsity * pattern was performed prior to this one. Therefore, this * factorization will reuse column permutation vector * ScalePermstruct->perm_c and the column elimination tree * LUstruct->etree. * = SamePattern_SameRowPerm: The matrix A will be factorized * assuming that a factorization of a matrix with the same * sparsity pattern and similar numerical values was performed * prior to this one. Therefore, this factorization will reuse * both row and column scaling factors R and C, and the * both row and column permutation vectors perm_r and perm_c, * distributed data structure set up from the previous symbolic * factorization. * = FACTORED: On entry, L, U, perm_r and perm_c contain the * factored form of A. If DiagScale is not NOEQUIL, the matrix * A has been equilibrated with scaling factors R and C. * * Equil (yes_no_t) * Specifies whether to equilibrate the system (scale A's row and * columns to have unit norm). * * ColPerm (colperm_t) * Specifies what type of column permutation to use to reduce fill. * = NATURAL: use the natural ordering * = MMD_ATA: use minimum degree ordering on structure of A'*A * = MMD_AT_PLUS_A: use minimum degree ordering on structure of A'+A * = MY_PERMC: use the ordering specified in ScalePermstruct->perm_c[] * * Trans (trans_t) * Specifies the form of the system of equations: * = NOTRANS: A * X = B (No transpose) * = TRANS: A**T * X = B (Transpose) * = CONJ: A**H * X = B (Transpose) * * IterRefine (IterRefine_t) * Specifies whether to perform iterative refinement. * = NO: no iterative refinement * = WorkingPrec: perform iterative refinement in working precision * = ExtraPrec: perform iterative refinement in extra precision * * PrintStat (yes_no_t) * Specifies whether to print the solver's statistics. * * DiagPivotThresh (double, in [0.0, 1.0]) (only for sequential SuperLU) * Specifies the threshold used for a diagonal entry to be an * acceptable pivot. * * RowPerm (rowperm_t) (only for SuperLU_DIST) * Specifies whether to permute rows of the original matrix. * = NO: not to permute the rows * = LargeDiag: make the diagonal large relative to the off-diagonal * = MY_PERMR: use the permutation given in ScalePermstruct->perm_r[] * * ReplaceTinyPivot (yes_no_t) (only for SuperLU_DIST) * Specifies whether to replace the tiny diagonals by * sqrt(epsilon)*||A|| during LU factorization. * * SolveInitialized (yes_no_t) (only for SuperLU_DIST) * Specifies whether the initialization has been performed to the * triangular solve. * * RefineInitialized (yes_no_t) (only for SuperLU_DIST) * Specifies whether the initialization has been performed to the * sparse matrix-vector multiplication routine needed in iterative * refinement. */typedef struct { fact_t Fact; yes_no_t Equil; yes_no_t ParSymbFact; colperm_t ColPerm; rowperm_t RowPerm; double DiagPivotThresh; IterRefine_t IterRefine; trans_t Trans; yes_no_t ReplaceTinyPivot; yes_no_t SolveInitialized; yes_no_t RefineInitialized; yes_no_t PrintStat;} superlu_options_t;typedef struct { float for_lu; float total; int_t expansions;} mem_usage_t;/*********************************************************************** * Function prototypes ***********************************************************************/#ifdef __cplusplusextern "C" {#endifextern void set_default_options_dist(superlu_options_t *);extern void print_options_dist(superlu_options_t *);extern void Destroy_CompCol_Matrix_dist(SuperMatrix *);extern void Destroy_SuperNode_Matrix_dist(SuperMatrix *);extern void Destroy_CompCol_Permuted_dist(SuperMatrix *);extern void Destroy_CompRowLoc_Matrix_dist(SuperMatrix *);extern void Destroy_CompRow_Matrix_dist(SuperMatrix *);extern void sp_colorder (superlu_options_t*, SuperMatrix*, int_t*, int_t*, SuperMatrix*);extern int_t sp_coletree_dist (int_t *, int_t *, int_t *, int_t, int_t, int_t *);extern void countnz_dist (const int_t, int_t *, int_t *, int_t *, Glu_persist_t *, Glu_freeable_t *);extern int_t fixupL_dist (const int_t, const int_t *, Glu_persist_t *, Glu_freeable_t *);extern int_t *TreePostorder_dist (int_t, int_t *);extern float slamch_(char *);extern double dlamch_(char *);extern void *superlu_malloc_dist (size_t);extern void superlu_free_dist (void*);extern int_t *intMalloc_dist (int_t);extern int_t *intCalloc_dist (int_t);/* Auxiliary routines */extern double SuperLU_timer_ ();extern void superlu_abort_and_exit_dist(char *);extern int_t sp_ienv_dist (int_t);extern int lsame_ (char *, char *);extern int xerbla_ (char *, int *);extern void ifill_dist (int_t *, int_t, int_t);extern void super_stats_dist (int_t, int_t *);extern void ScalePermstructInit(const int_t, const int_t, ScalePermstruct_t *);extern void ScalePermstructFree(ScalePermstruct_t *);extern void superlu_gridinit(MPI_Comm, int_t, int_t, gridinfo_t *);extern void superlu_gridmap(MPI_Comm, int_t, int_t, int_t [], int_t, gridinfo_t *);extern void superlu_gridexit(gridinfo_t *);extern void get_perm_c_dist(int_t, int_t, SuperMatrix *, int_t *);extern void a_plus_at_dist(const int_t, const int_t, int_t *, int_t *, int_t *, int_t **, int_t **);extern void bcast_tree(void *, int, MPI_Datatype, int, int, gridinfo_t *, int, int *);extern int_t symbfact(superlu_options_t *, int, SuperMatrix *, int_t *, int_t *, Glu_persist_t *, Glu_freeable_t *);extern int_t symbfact_SubInit(fact_t, void *, int_t, int_t, int_t, int_t, Glu_persist_t *, Glu_freeable_t *);extern int_t symbfact_SubXpand(int_t, int_t, int_t, MemType, int_t *, Glu_freeable_t *);extern int_t symbfact_SubFree(Glu_freeable_t *);extern void get_diag_procs(int_t, Glu_persist_t *, gridinfo_t *, int_t *, int_t **, int_t **);extern int_t QuerySpace_dist(int_t, int_t, Glu_freeable_t *, mem_usage_t *);extern int xerbla_ (char *, int *);extern void pxerbla (char *, gridinfo_t *, int_t);extern void PStatInit(SuperLUStat_t *);extern void PStatFree(SuperLUStat_t *);extern void PStatPrint(superlu_options_t *, SuperLUStat_t *, gridinfo_t *);/* Prototypes for parallel symbolic factorization */extern float symbfact_dist(int, int, SuperMatrix *, int_t *, int_t *, int_t *, int_t *, Pslu_freeable_t *, MPI_Comm *, MPI_Comm *, mem_usage_t *);/* Get the column permutation using parmetis */extern float get_perm_c_parmetis (SuperMatrix *, int_t *, int_t *, int, int, int_t **, int_t **, gridinfo_t *, MPI_Comm *);/* Auxiliary routines for memory expansions used during the parallel symbolic factorization routine */extern int_t psymbfact_LUXpandMem(int_t, int_t, int_t, int_t, int_t, int_t, int_t, int_t, Pslu_freeable_t *, Llu_symbfact_t *, vtcsInfo_symbfact_t *, psymbfact_stat_t *);extern int_t psymbfact_LUXpand(int_t, int_t, int_t, int_t, int_t *, int_t, int_t, int_t, int_t, Pslu_freeable_t *, Llu_symbfact_t *, vtcsInfo_symbfact_t *, psymbfact_stat_t *);extern int_t psymbfact_LUXpand_RL(int_t, int_t, int_t, int_t, int_t, int_t, Pslu_freeable_t *, Llu_symbfact_t *, vtcsInfo_symbfact_t *, psymbfact_stat_t *);extern int_t psymbfact_prLUXpand(int_t, int_t, MemType, Llu_symbfact_t *, psymbfact_stat_t *);/* Routines for debugging */extern void print_panel_seg_dist(int_t, int_t, int_t, int_t, int_t *, int_t *);extern void check_repfnz_dist(int_t, int_t, int_t, int_t *);extern int_t CheckZeroDiagonal(int_t, int_t *, int_t *, int_t *);extern void PrintDouble5(char *, int_t, double *);extern void PrintInt10(char *, int_t, int_t *);extern int file_PrintInt10(FILE *, char *, int_t, int_t *);#ifdef __cplusplus }#endif#endif /* __SUPERLU_DEFS */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -