
# Module exceptions
class MURGEError(Exception):
    pass

class MURGEIOError(MURGEError):
    pass


cdef inline int CHKERR(int ierr):
    if ierr != MURGE_SUCCESS:
        raise MURGEError("error code %s" % ierr)

# ...
class MURGEReturns(object):
    SUCCESS             = MURGE_SUCCESS
    ERR_ALLOCATE        = MURGE_ERR_ALLOCATE
    ERR_IO              = MURGE_ERR_IO
    ERR_PARAMETER       = MURGE_ERR_PARAMETER
    ERR_ORDER           = MURGE_ERR_ORDER
    ERR_SOLVER          = MURGE_ERR_SOLVER
    ERR_NOT_IMPLEMENTED = MURGE_ERR_NOT_IMPLEMENTED
# ...

# ...
class MURGEIParam(object):
    BASEVAL      = MURGE_IPARAM_BASEVAL
    DOF          = MURGE_IPARAM_DOF
    SYM          = MURGE_IPARAM_SYM
# ...

# ...
class MURGERParam(object):
    EPSILON_ERROR= MURGE_RPARAM_EPSILON_ERROR
# ...

# ...
class MURGEIInfo(object):
    NNZ           = MURGE_IINFO_NNZ
# ...

# ...
class MURGERInfo(object):
    FACT_TIME     = MURGE_RINFO_FACT_TIME
    SOLVE_TIME    = MURGE_RINFO_SOLVE_TIME
# ...

# ...
class MURGEAssemblyMode(object):
    RESPECT    = MURGE_ASSEMBLY_RESPECT
    FOOL       = MURGE_ASSEMBLY_FOOL
# ...

# ...
class MURGEAssemblyOp(object):
    ADD        = MURGE_ASSEMBLY_ADD
    OVW        = MURGE_ASSEMBLY_OVW
    MAX        = MURGE_ASSEMBLY_MAX
    MIN        = MURGE_ASSEMBLY_MIN
# ...

# ...
class MURGESolver(object):
    HIPS         = MURGE_SOLVER_HIPS
    PASTIX       = MURGE_SOLVER_PASTIX
# ...

# ...
class MURGEBoolean(object):
    FALSE       = MURGE_BOOLEAN_FALSE
    TRUE        = MURGE_BOOLEAN_TRUE
# ...

# ...
class MURGENormRules(object):
    MAX_COL        = MURGE_NORM_MAX_COL
    MAX_ROW        = MURGE_NORM_MAX_ROW
    TWO_COL        = MURGE_NORM_2_COL
    TWO_ROW        = MURGE_NORM_2_ROW
# ...

# ...
class MURGEScalModes(object):
    COL            = MURGE_SCAL_COL
    ROW            = MURGE_SCAL_ROW
# ...
