# This code was automatically generated by CWrap version 0.0.0

cdef extern from "dmurge.h":

    complex cacos(complex)

    complex casin(complex)

    complex catan(complex)

    complex ccos(complex)

    complex csin(complex)

    complex ctan(complex)

    complex cacosh(complex)

    complex casinh(complex)

    complex catanh(complex)

    complex ccosh(complex)

    complex csinh(complex)

    complex ctanh(complex)

    complex cexp(complex)

    complex clog(complex)

    double cabs(complex)

    complex cpow(complex, complex)

    complex csqrt(complex)

    double carg(complex)

    double cimag(complex)

    complex conj(complex)

    complex cproj(complex)

    double creal(complex)

    complex cacosl(complex)

    complex casinl(complex)

    complex catanl(complex)

    complex ccosl(complex)

    complex csinl(complex)

    complex ctanl(complex)

    complex cacoshl(complex)

    complex casinhl(complex)

    complex catanhl(complex)

    complex ccoshl(complex)

    complex csinhl(complex)

    complex ctanhl(complex)

    complex cexpl(complex)

    complex clogl(complex)

    long double cabsl(complex)

    complex cpowl(complex, complex)

    complex csqrtl(complex)

    long double cargl(complex)

    long double cimagl(complex)

    complex conjl(complex)

    complex cprojl(complex)

    long double creall(complex)

    complex cacosf(complex)

    complex casinf(complex)

    complex catanf(complex)

    complex ccosf(complex)

    complex csinf(complex)

    complex ctanf(complex)

    complex cacoshf(complex)

    complex casinhf(complex)

    complex catanhf(complex)

    complex ccoshf(complex)

    complex csinhf(complex)

    complex ctanhf(complex)

    complex cexpf(complex)

    complex clogf(complex)

    float cabsf(complex)

    complex cpowf(complex, complex)

    complex csqrtf(complex)

    float cargf(complex)

    float cimagf(complex)

    complex conjf(complex)

    complex cprojf(complex)

    float crealf(complex)

    int DMURGE_Initialize(int idnbr)

    int DMURGE_SetDefaultOptions(int id, int stratnum)

    int DMURGE_SetOptionINT(int id, int number, int value)

    int DMURGE_SetOptionREAL(int id, int number, double value)

    int DMURGE_GraphBegin(int id, int N, int edgenbr)

    int DMURGE_GraphEdge(int id, int COL, int ROW)

    int DMURGE_GraphEnd(int id)

    int DMURGE_GraphGlobalCSR(int id, int N, int *rowptr, int *COLS, int root)

    int DMURGE_GraphGlobalCSC(int id, int N, int *colptr, int *ROWS, int root)

    int DMURGE_GraphGlobalIJV(int id, int N, int NNZ, int *ROW, int *COL, int root)

    int DMURGE_Save(int id, char *directory)

    int DMURGE_Load(int id, char *directory)

    int DMURGE_GetLocalNodeNbr(int id, int *nodenbr)

    int DMURGE_GetLocalNodeList(int id, int *nodelist)

    int DMURGE_GetLocalUnknownNbr(int id, int *unkownnbr)

    int DMURGE_GetLocalUnknownList(int id, int *unkownlist)

    int DMURGE_AssemblyBegin(int id, int N, int coefnbr, int op, int op2, int mode, int sym)

    int DMURGE_AssemblySetValue(int id, int ROW, int COL, double value)

    int DMURGE_AssemblySetNodeValues(int id, int ROW, int COL, double *values)

    int DMURGE_AssemblySetBlockValues(int id, int nROW, int *ROWlist, int nCOL, int *COLlist, double *values)

    int DMURGE_AssemblyEnd(int id)

    int DMURGE_MatrixReset(int id)

    int DMURGE_MatrixGlobalCSR(int id, int N, int *rowptr, int *COLS, double *values, int root, int op, int sym)

    int DMURGE_MatrixGlobalCSC(int id, int N, int *COLPTR, int *ROWS, double *values, int root, int op, int sym)

    int DMURGE_MatrixGlobalIJV(int id, int N, int NNZ, int *ROWS, int *COLS, double *values, int root, int op, int sym)

    int DMURGE_SetGlobalRHS(int id, double *b, int root, int op)

    int DMURGE_SetLocalRHS(int id, double *b, int op, int op2)

    int DMURGE_SetRHS(int id, int n, int *coefsidx, double *b, int op, int op2, int mode)

    int DMURGE_RHSReset(int id)

    int DMURGE_GetGlobalSolution(int id, double *x, int root)

    int DMURGE_GetLocalSolution(int id, double *x)

    int DMURGE_GetSolution(int id, int n, int *coefsidx, double *x, int mode)

    int DMURGE_GetGlobalNorm(int id, double *norm, int root, int rule)

    int DMURGE_GetLocalNorm(int id, double *norm, int rule)

    int DMURGE_GetNorm(int id, int n, int *coefsidx, double *norm, int rule, int mode)

    int DMURGE_ApplyGlobalScaling(int id, double *scal, int root, int sc_mode)

    int DMURGE_ApplyLocalScaling(int id, double *scal, int sc_mode)

    int DMURGE_ApplyScaling(int id, int n, int *coefsidx, double *scal, int sc_mode, int mode)

    int DMURGE_Clean(int id)

    int DMURGE_Finalize()

    int DMURGE_GetSolver(int *solver)

    int DMURGE_GetInfoINT(int id, int metric, int *value)

    int DMURGE_GetInfoREAL(int id, int metric, double *value)

    int DMURGE_PrintError(int error_number)

    int DMURGE_ExitOnError(int error_number)

    cdef enum MURGE_RETURNS:
        MURGE_SUCCESS
        MURGE_ERR_ALLOCATE
        MURGE_ERR_IO
        MURGE_ERR_PARAMETER
        MURGE_ERR_ORDER
        MURGE_ERR_SOLVER
        MURGE_ERR_NOT_IMPLEMENTED

    cdef enum MURGE_IPARAM:
        MURGE_IPARAM_BASEVAL
        MURGE_IPARAM_DOF
        MURGE_IPARAM_SYM

    cdef enum MURGE_RPARAM:
        MURGE_RPARAM_EPSILON_ERROR

    cdef enum MURGE_IINFO:
        MURGE_IINFO_NNZ

    cdef enum MURGE_RINFO:
        MURGE_RINFO_FACT_TIME
        MURGE_RINFO_SOLVE_TIME

    cdef enum MURGE_ASSEMBLY_MODE:
        MURGE_ASSEMBLY_RESPECT
        MURGE_ASSEMBLY_FOOL

    cdef enum MURGE_ASSEMBLY_OP:
        MURGE_ASSEMBLY_ADD
        MURGE_ASSEMBLY_OVW
        MURGE_ASSEMBLY_MAX
        MURGE_ASSEMBLY_MIN

    cdef enum MURGE_SOLVER:
        MURGE_SOLVER_HIPS
        MURGE_SOLVER_PASTIX

    cdef enum MURGE_BOOLEAN:
        MURGE_BOOLEAN_FALSE
        MURGE_BOOLEAN_TRUE

    cdef enum MURGE_NORM_RULES:
        MURGE_NORM_MAX_COL
        MURGE_NORM_MAX_ROW
        MURGE_NORM_2_COL
        MURGE_NORM_2_ROW

    cdef enum MURGE_SCAL_MODES:
        MURGE_SCAL_COL
        MURGE_SCAL_ROW

    int DMURGE_Analyze(int id)

    int DMURGE_Factorize(int id)

    int DMURGE_SetOrdering(int id, int *permutation)

    int DMURGE_ProductSetLocalNodeNbr(int id, int n)

    int DMURGE_ProductSetGlobalNodeNbr(int id, int N)

    int DMURGE_ProductSetLocalNodeList(int id, int *l2g)

    int DMURGE_GetLocalProduct(int id, double *x)

    int DMURGE_GetGlobalProduct(int id, double *x, int root)

    int DMURGE_ForceNoFacto(int id)

    int DMURGE_SetLocalNodeList(int id, int n, int *list)

    int DMURGE_AssemblySetSequence(int id, int coefnbr, int *ROWs, int *COLs, int op, int op2, int mode, int nodes, int *id_seq)

    int DMURGE_AssemblyUseSequence(int id, int id_seq, double *values)

    int DMURGE_AssemblyDeleteSequence(int id, int id_seq)

    int DMURGE_GetCommRank(int id, int *rank)

    int DMURGE_GetCommSize(int id, int *size)

    int DMURGE_GetOptionINT(int id, int index, int *value)

    int DMURGE_GetComm(int id, MPI_Comm *comm)

    cdef struct DMURGE_UserData_:
        pass

    ctypedef DMURGE_UserData_ DMURGE_UserData_t

    int DMURGE_GetLocalElementNbr(int id, int N, int globalElementNbr, int *localElementNbr, int mode, DMURGE_UserData_t *d)

    int DMURGE_GetLocalElementList(int id, int *element_list)

    int DMURGE_GraphSetEdge(int id, int ROW, int COL)

    int DMURGE_GraphSetBlockEdges(int id, int nROW, int *ROWlist, int nCOL, int *COLlist)

    int DMURGE_SetDropNodes(int id, int nodenbr, int *dropmask)

    int DMURGE_SetDropCols(int id, int nodenbr, int *dropmask)

    int DMURGE_SetDropRows(int id, int nodenbr, int *dropmask)

    int DMURGE_ColGetNonZerosNbr(int id, int COL, int *nnzNbr)

    int DMURGE_ColGetNonZerosIdx(int id, int COL, int *indexes)

    cdef enum MURGE_PASTIX_ERR:
        MURGE_ERR_MPI
        MURGE_ERR_INTERNAL

    cdef enum MURGE_ELEMENT_DIST:
        MURGE_DUPLICATE_ELEMENTS
        MURGE_DISTRIBUTE_ELEMENTS


    int DMURGE_SetCommunicator(int id, MPI_Comm comm)
