Date: 2021-03-03T22:26:21+00:00

Actual source code: cholmodimpl.h
petsc-3.14.5 2021-03-03
Report Typos and Errors

      1: #if !defined(CHOLMODIMPL_H_)
      2: #define CHOLMODIMPL_H_

      4: #include <petscsys.h>

      6: #if defined(PETSC_USE_COMPLEX)
      7: #  define CHOLMOD_SCALAR_TYPE       CHOLMOD_COMPLEX
      8: #else
      9: #  define CHOLMOD_SCALAR_TYPE       CHOLMOD_REAL
     10: #endif

     12: #if defined(PETSC_USE_64BIT_INDICES)
     13: #  define CHOLMOD_INT_TYPE                CHOLMOD_LONG
     14: #  define cholmod_X_start                 cholmod_l_start
     15: #  define cholmod_X_analyze               cholmod_l_analyze
     16: /* the type casts are needed because PetscInt is long long while SuiteSparse_long is long and compilers warn even when they are identical */
     17: #  define cholmod_X_analyze_p(a,b,c,d,f)  cholmod_l_analyze_p(a,(SuiteSparse_long *)b,(SuiteSparse_long *)c,d,f)
     18: #  define cholmod_X_copy                  cholmod_l_copy
     19: #  define cholmod_X_factorize             cholmod_l_factorize
     20: #  define cholmod_X_finish                cholmod_l_finish
     21: #  define cholmod_X_free_factor           cholmod_l_free_factor
     22: #  define cholmod_X_free_dense            cholmod_l_free_dense
     23: #  define cholmod_X_resymbol(a,b,c,d,f,e) cholmod_l_resymbol(a,(SuiteSparse_long *)b,c,d,f,e)
     24: #  define cholmod_X_solve                 cholmod_l_solve
     25: #  define cholmod_X_solve2                cholmod_l_solve2
     26: #else
     27: #  define CHOLMOD_INT_TYPE          CHOLMOD_INT
     28: #  define cholmod_X_start           cholmod_start
     29: #  define cholmod_X_analyze         cholmod_analyze
     30: #  define cholmod_X_analyze_p       cholmod_analyze_p
     31: #  define cholmod_X_copy            cholmod_copy
     32: #  define cholmod_X_factorize       cholmod_factorize
     33: #  define cholmod_X_finish          cholmod_finish
     34: #  define cholmod_X_free_factor     cholmod_free_factor
     35: #  define cholmod_X_free_dense      cholmod_free_dense
     36: #  define cholmod_X_resymbol        cholmod_resymbol
     37: #  define cholmod_X_solve           cholmod_solve
     38: #  define cholmod_X_solve2          cholmod_solve2
     39: #endif

     41: EXTERN_C_BEGIN
     42: #include <cholmod.h>
     43: EXTERN_C_END

     45: typedef struct {
     46:   PetscErrorCode (*Wrap)(Mat,PetscBool,cholmod_sparse*,PetscBool*,PetscBool*);
     47:   cholmod_sparse *matrix;
     48:   cholmod_factor *factor;
     49:   cholmod_common *common;
     50:   PetscBool      pack;
     51: } Mat_CHOLMOD;

     53: PETSC_INTERN PetscErrorCode CholmodStart(Mat);
     54: PETSC_INTERN PetscErrorCode MatView_CHOLMOD(Mat,PetscViewer);
     55: PETSC_INTERN PetscErrorCode MatCholeskyFactorSymbolic_CHOLMOD(Mat,Mat,IS,const MatFactorInfo*);
     56: PETSC_INTERN PetscErrorCode MatGetInfo_CHOLMOD(Mat,MatInfoType,MatInfo*);
     57: PETSC_INTERN PetscErrorCode MatDestroy_CHOLMOD(Mat);

     59: #endif /* CHOLMODIMPL_H_ */