7.1.5. Solution management

All API I/O functions related to controlling a model are declared in this file, including

  • solving the loaded problem;

  • accessing and explaining the solution status;

  • populating the solution summary report.

Functions

MdoResult Mdo_solveProb(MdoMdlPtr mdl)

This function solves the loaded optimization problem.

Parameters
  • mdl – Pointer to the model.

Return

A response code that specifies the status of the function.

See

Mdo_displayResults(), Mdo_getStatus(), Mdo_explainResult()

void Mdo_displayResults(const MdoMdlPtr mdl)

This function displays current solver results, including

  • primal and dual objective values;

  • variable bound and constraint violations.

Parameters
  • mdl – Pointer to the model.

MdoStatus Mdo_getStatus(const MdoMdlPtr mdl)

This function returns the problem status code.

Parameters
  • mdl – Pointer to the model.

Return

Problem status code.

void Mdo_explainStatus(const MdoMdlPtr mdl, MdoStatus status, char *reason)

This function explains the details of a solver status code. Specifically, if MindOpt optimize the loaded problem to successfully, users may use this function to populate the solution status.

Parameters
  • mdl – Pointer to the model.

  • status – Solver status code to be explained.

  • reason – A string that holds the explanation of the given solver status code.

Note

The length of the C-string shall be reasonably large, for example, at least 1024 elements.

void Mdo_explainResult(const MdoMdlPtr mdl, MdoResult result, char *reason)

This function explains the details of a solver result code. Specifically, if MindOpt fails to optimize the loaded problem to optimality, users may use this function to populate the details of the result code.

Parameters
  • mdl – Pointer to the model.

  • result – Solver result code to be explained.

  • reason – A string that holds the explanation of the given solver result code.

Note

The length of the C-string shall be reasonably large, for example, at least 1024 elements.

MdoResult Mdo_computeIIS(MdoMdlPtr mdl, MdoI32 *num_rows, MdoI32 *idx_rows, MdoI32 *num_cols, MdoI32 *idx_cols)

This function computes a subsystem that contains at least an IIS (irreduciable infeasible system). The cardinality of the subsystem is supposed to be small. Note that the problem is supposed to be infeasible. The buffer arrays idx_rows and idx_cols must be pre-allocated, and their length must be at least number of rows and number of columns of the optimization problem.

Parameters
  • mdl – Pointer to the model.

  • num_rows – Number of constraints involved in an IIS.

  • idx_rows – A pointer array that holds all constraints involved in an IIS.

  • num_cols – Number of variables involved in an IIS.

  • idx_cols – A pointer array that holds all variables involved in an IIS.

Return

A response code that specifies the status of the function.

Note

This is an experimental API.