# This code was automatically generated by CWrap version 0.0.0

cdef extern from "cmurge.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 CMURGE_Initialize(int idnbr)

    int CMURGE_SetDefaultOptions(int id, int stratnum)

    int CMURGE_SetOptionINT(int id, int number, int value)

    int CMURGE_SetOptionREAL(int id, int number, float value)

    int CMURGE_GraphBegin(int id, int N, int edgenbr)

    int CMURGE_GraphEdge(int id, int COL, int ROW)

    int CMURGE_GraphEnd(int id)

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

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

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

    int CMURGE_Save(int id, char *directory)

    int CMURGE_Load(int id, char *directory)

    int CMURGE_GetLocalNodeNbr(int id, int *nodenbr)

    int CMURGE_GetLocalNodeList(int id, int *nodelist)

    int CMURGE_GetLocalUnknownNbr(int id, int *unkownnbr)

    int CMURGE_GetLocalUnknownList(int id, int *unkownlist)

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

    int CMURGE_AssemblySetValue(int id, int ROW, int COL, complex value)

    int CMURGE_AssemblySetNodeValues(int id, int ROW, int COL, complex *values)

    int CMURGE_AssemblySetBlockValues(int id, int nROW, int *ROWlist, int nCOL, int *COLlist, complex *values)

    int CMURGE_AssemblyEnd(int id)

    int CMURGE_MatrixReset(int id)

    int CMURGE_MatrixGlobalCSR(int id, int N, int *rowptr, int *COLS, complex *values, int root, int op, int sym)

    int CMURGE_MatrixGlobalCSC(int id, int N, int *COLPTR, int *ROWS, complex *values, int root, int op, int sym)

    int CMURGE_MatrixGlobalIJV(int id, int N, int NNZ, int *ROWS, int *COLS, complex *values, int root, int op, int sym)

    int CMURGE_SetGlobalRHS(int id, complex *b, int root, int op)

    int CMURGE_SetLocalRHS(int id, complex *b, int op, int op2)

    int CMURGE_SetRHS(int id, int n, int *coefsidx, complex *b, int op, int op2, int mode)

    int CMURGE_RHSReset(int id)

    int CMURGE_GetGlobalSolution(int id, complex *x, int root)

    int CMURGE_GetLocalSolution(int id, complex *x)

    int CMURGE_GetSolution(int id, int n, int *coefsidx, complex *x, int mode)

    int CMURGE_GetGlobalNorm(int id, float *norm, int root, int rule)

    int CMURGE_GetLocalNorm(int id, float *norm, int rule)

    int CMURGE_GetNorm(int id, int n, int *coefsidx, float *norm, int rule, int mode)

    int CMURGE_ApplyGlobalScaling(int id, float *scal, int root, int sc_mode)

    int CMURGE_ApplyLocalScaling(int id, float *scal, int sc_mode)

    int CMURGE_ApplyScaling(int id, int n, int *coefsidx, float *scal, int sc_mode, int mode)

    int CMURGE_Clean(int id)

    int CMURGE_Finalize()

    int CMURGE_GetSolver(int *solver)

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

    int CMURGE_GetInfoREAL(int id, int metric, float *value)

    int CMURGE_PrintError(int error_number)

    int CMURGE_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 CMURGE_Analyze(int id)

    int CMURGE_Factorize(int id)

    int CMURGE_SetOrdering(int id, int *permutation)

    int CMURGE_ProductSetLocalNodeNbr(int id, int n)

    int CMURGE_ProductSetGlobalNodeNbr(int id, int N)

    int CMURGE_ProductSetLocalNodeList(int id, int *l2g)

    int CMURGE_GetLocalProduct(int id, complex *x)

    int CMURGE_GetGlobalProduct(int id, complex *x, int root)

    int CMURGE_ForceNoFacto(int id)

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

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

    int CMURGE_AssemblyUseSequence(int id, int id_seq, complex *values)

    int CMURGE_AssemblyDeleteSequence(int id, int id_seq)

    int CMURGE_GetCommRank(int id, int *rank)

    int CMURGE_GetCommSize(int id, int *size)

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

    int CMURGE_GetComm(int id, MPI_Comm *comm)

    cdef struct CMURGE_UserData_:
        pass

    ctypedef CMURGE_UserData_ CMURGE_UserData_t

    int CMURGE_GetLocalElementNbr(int id, int N, int globalElementNbr, int *localElementNbr, int mode, CMURGE_UserData_t *d)

    int CMURGE_GetLocalElementList(int id, int *element_list)

    int CMURGE_GraphSetEdge(int id, int ROW, int COL)

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

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

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

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

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

    int CMURGE_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 CMURGE_SetCommunicator(int id, MPI_Comm comm)
