Actual source code: cholmodimpl.h

petsc-3.9.4 2018-09-11
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: #else
 26: #  define CHOLMOD_INT_TYPE          CHOLMOD_INT
 27: #  define cholmod_X_start           cholmod_start
 28: #  define cholmod_X_analyze         cholmod_analyze
 29: #  define cholmod_X_analyze_p       cholmod_analyze_p
 30: #  define cholmod_X_copy            cholmod_copy
 31: #  define cholmod_X_factorize       cholmod_factorize
 32: #  define cholmod_X_finish          cholmod_finish
 33: #  define cholmod_X_free_factor     cholmod_free_factor
 34: #  define cholmod_X_free_dense      cholmod_free_dense
 35: #  define cholmod_X_resymbol        cholmod_resymbol
 36: #  define cholmod_X_solve           cholmod_solve
 37: #endif

 39: EXTERN_C_BEGIN
 40: #include <cholmod.h>
 41: EXTERN_C_END

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

 51: PETSC_INTERN PetscErrorCode CholmodStart(Mat);
 52: PETSC_INTERN PetscErrorCode MatView_CHOLMOD(Mat,PetscViewer);
 53: PETSC_INTERN PetscErrorCode MatCholeskyFactorSymbolic_CHOLMOD(Mat,Mat,IS,const MatFactorInfo*);
 54: PETSC_INTERN PetscErrorCode MatDestroy_CHOLMOD(Mat);

 56: #endif /* CHOLMODIMPL_H_ */