# This code was automatically generated by CWrap version 0.0.0

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

    int SMURGE_SetDefaultOptions(int id, int stratnum)

    int SMURGE_SetOptionINT(int id, int number, int value)

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

    int SMURGE_GraphBegin(int id, int N, int edgenbr)

    int SMURGE_GraphEdge(int id, int COL, int ROW)

    int SMURGE_GraphEnd(int id)

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

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

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

    int SMURGE_Save(int id, char *directory)

    int SMURGE_Load(int id, char *directory)

    int SMURGE_GetLocalNodeNbr(int id, int *nodenbr)

    int SMURGE_GetLocalNodeList(int id, int *nodelist)

    int SMURGE_GetLocalUnknownNbr(int id, int *unkownnbr)

    int SMURGE_GetLocalUnknownList(int id, int *unkownlist)

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

    int SMURGE_AssemblySetValue(int id, int ROW, int COL, float value)

    int SMURGE_AssemblySetNodeValues(int id, int ROW, int COL, float *values)

    int SMURGE_AssemblySetBlockValues(int id, int nROW, int *ROWlist, int nCOL, int *COLlist, float *values)

    int SMURGE_AssemblyEnd(int id)

    int SMURGE_MatrixReset(int id)

    int SMURGE_MatrixGlobalCSR(int id, int N, int *rowptr, int *COLS, float *values, int root, int op, int sym)

    int SMURGE_MatrixGlobalCSC(int id, int N, int *COLPTR, int *ROWS, float *values, int root, int op, int sym)

    int SMURGE_MatrixGlobalIJV(int id, int N, int NNZ, int *ROWS, int *COLS, float *values, int root, int op, int sym)

    int SMURGE_SetGlobalRHS(int id, float *b, int root, int op)

    int SMURGE_SetLocalRHS(int id, float *b, int op, int op2)

    int SMURGE_SetRHS(int id, int n, int *coefsidx, float *b, int op, int op2, int mode)

    int SMURGE_RHSReset(int id)

    int SMURGE_GetGlobalSolution(int id, float *x, int root)

    int SMURGE_GetLocalSolution(int id, float *x)

    int SMURGE_GetSolution(int id, int n, int *coefsidx, float *x, int mode)

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

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

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

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

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

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

    int SMURGE_Clean(int id)

    int SMURGE_Finalize()

    int SMURGE_GetSolver(int *solver)

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

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

    int SMURGE_PrintError(int error_number)

    int SMURGE_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 SMURGE_Analyze(int id)

    int SMURGE_Factorize(int id)

    int SMURGE_SetOrdering(int id, int *permutation)

    int SMURGE_ProductSetLocalNodeNbr(int id, int n)

    int SMURGE_ProductSetGlobalNodeNbr(int id, int N)

    int SMURGE_ProductSetLocalNodeList(int id, int *l2g)

    int SMURGE_GetLocalProduct(int id, float *x)

    int SMURGE_GetGlobalProduct(int id, float *x, int root)

    int SMURGE_ForceNoFacto(int id)

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

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

    int SMURGE_AssemblyUseSequence(int id, int id_seq, float *values)

    int SMURGE_AssemblyDeleteSequence(int id, int id_seq)

    int SMURGE_GetCommRank(int id, int *rank)

    int SMURGE_GetCommSize(int id, int *size)

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

    int SMURGE_GetComm(int id, MPI_Comm *comm)

    cdef struct SMURGE_UserData_:
        pass

    ctypedef SMURGE_UserData_ SMURGE_UserData_t

    int SMURGE_GetLocalElementNbr(int id, int N, int globalElementNbr, int *localElementNbr, int mode, SMURGE_UserData_t *d)

    int SMURGE_GetLocalElementList(int id, int *element_list)

    int SMURGE_GraphSetEdge(int id, int ROW, int COL)

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

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

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

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

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

    int SMURGE_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 SMURGE_SetCommunicator(int id, MPI_Comm comm)
