Skip to content

Commit

Permalink
madnlp updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jgillis committed Jul 15, 2024
1 parent dc33ebc commit 13ca5fa
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions madnlp/include/madnlp_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,31 @@ typedef int (*MadnlpCEvalObjGrad)(const double*, double*, void*);
typedef int (*MadnlpCEvalConstrJac)(const double*, double*, void*);
typedef int (*MadnlpCEvalLagHess)(double, const double*, const double*, double*, void*);

enum MadnlpCStatus {
MADNLP_SOLVE_SUCCEEDED = 1,
MADNLP_SOLVED_TO_ACCEPTABLE_LEVEL = 2,
MADNLP_SEARCH_DIRECTION_BECOMES_TOO_SMALL = 3,
MADNLP_DIVERGING_ITERATES = 4,
MADNLP_INFEASIBLE_PROBLEM_DETECTED = 5,
MADNLP_MAXIMUM_ITERATIONS_EXCEEDED = 6,
MADNLP_MAXIMUM_WALLTIME_EXCEEDED = 7,
MADNLP_INITIAL = 11,
MADNLP_REGULAR = 12,
MADNLP_RESTORE = 13,
MADNLP_ROBUST = 14,
MADNLP_RESTORATION_FAILED = -1,
MADNLP_INVALID_NUMBER_DETECTED = -2,
MADNLP_ERROR_IN_STEP_COMPUTATION = -3,
MADNLP_NOT_ENOUGH_DEGREES_OF_FREEDOM = -4,
MADNLP_USER_REQUESTED_STOP = -5,
MADNLP_INTERNAL_ERROR = -6,
MADNLP_INVALID_NUMBER_OBJECTIVE = -7,
MADNLP_INVALID_NUMBER_GRADIENT = -8,
MADNLP_INVALID_NUMBER_CONSTRAINTS = -9,
MADNLP_INVALID_NUMBER_JACOBIAN = -10,
MADNLP_INVALID_NUMBER_HESSIAN_LAGRANGIAN = -11
};

struct MadnlpCInterface {
MadnlpCEvalObj eval_obj;
MadnlpCEvalConstr eval_constr;
Expand Down Expand Up @@ -84,10 +109,10 @@ struct MadnlpCNumericOut {
};

struct MadnlpCStats {
const madnlp_int iter;
const madnlp_int status;
const double dual_feas;
const double primal_feas;
madnlp_int iter;
madnlp_int status;
double dual_feas;
double primal_feas;
};

MADNLP_SYMBOL_EXPORT struct MadnlpCSolver* madnlp_c_create(struct MadnlpCInterface* nlp_interface);
Expand All @@ -112,4 +137,4 @@ MADNLP_SYMBOL_EXPORT void madnlp_c_destroy(struct MadnlpCSolver*);
}
#endif

#endif // _MADNLP_C_H
#endif // _MADNLP_C_H

0 comments on commit 13ca5fa

Please sign in to comment.