![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#include <stddef.h>
Go to the source code of this file.
Functions | |
struct MathOptInterrupter * | MathOptNewInterrupter () |
void | MathOptFreeInterrupter (struct MathOptInterrupter *interrupter) |
Frees interrupter, has no effect when interrupter is NULL. | |
void | MathOptInterrupt (struct MathOptInterrupter *interrupter) |
int | MathOptIsInterrupted (const struct MathOptInterrupter *interrupter) |
int | MathOptSolve (const void *model, size_t model_size, int solver_type, struct MathOptInterrupter *interrupter, void **solve_result, size_t *solve_result_size, char **status_msg) |
void | MathOptFree (void *ptr) |
void MathOptFree | ( | void * | ptr | ) |
Frees memory allocated by the MathOpt C API, e.g. the solve_result or status_msg output arguments from MathOptSolve(). If ptr is NULL, has no effect.
void MathOptFreeInterrupter | ( | struct MathOptInterrupter * | interrupter | ) |
void MathOptInterrupt | ( | struct MathOptInterrupter * | interrupter | ) |
int MathOptIsInterrupted | ( | const struct MathOptInterrupter * | interrupter | ) |
Checks if the interrupter is triggered.
Will CHECK fail if interrupter is NULL. This is threadsafe.
struct MathOptInterrupter * MathOptNewInterrupter | ( | ) |
Returns a new interrupter that has not been triggered. The caller must free this with MathOptFreeInterrupter().
int MathOptSolve | ( | const void * | model, |
size_t | model_size, | ||
int | solver_type, | ||
struct MathOptInterrupter * | interrupter, | ||
void ** | solve_result, | ||
size_t * | solve_result_size, | ||
char ** | status_msg ) |
Solves an optimization model with MathOpt and returns the result.
Arguments:
Returns 0 if successful and a nonzero value on failure (the value is an absl::StatusCode enum).