PIPS-IPM++ C API.
More...
#include <stdbool.h>
#include "TerminationStatus.h"
|
| typedef int(* | PipsFNNZ) (void *user_data, int id, int *val) |
| | Function pointer type for callbacks that return a single integer value (e.g., a size or non-zero count).
|
| typedef int(* | PipsFMAT) (void *user_data, int id, int *krow, int *jcol, double *M) |
| | Function pointer type for callbacks that provide matrix data in compressed sparse row (CSR) format. The matrix is assumed to be row-major.
|
| typedef int(* | PipsFVEC) (void *user_data, int id, double *vec, int len) |
| | Function pointer type for callbacks that provide vector data.
|
| typedef int(* | PipsFSCALAR) (void *user_data, int id, double *scalar) |
| | Function pointer type for callbacks that provide a single scalar value.
|
|
| void * | pips_tree_create (int num_blocks, const PipsNodeCallbacks *root_cb, const PipsNodeCallbacks *block_cb) |
| void | pips_tree_destroy (void *tree) |
| void * | pips_solver_create (void *tree, const char *options_file) |
| void | pips_solver_destroy (void *solver) |
| PipsTerminationStatus | pips_solve (void *solver) |
| double | pips_get_objective (void *solver) |
| int | pips_get_primal (void *solver, double **out, int *size) |
| int | pips_get_dual_eq (void *solver, double **out, int *size) |
| int | pips_get_dual_ineq (void *solver, double **out, int *size) |
| int | pips_get_dual_var_bounds (void *solver, double **out, int *size) |
| int | pips_get_equality_values (void *solver, double **out, int *size) |
| int | pips_get_inequality_values (void *solver, double **out, int *size) |
| int | pips_set_bool_option (const char *name, bool value) |
| int | pips_set_int_option (const char *name, int value) |
| int | pips_set_double_option (const char *name, double value) |
| int | pips_set_string_option (const char *name, const char *value) |
◆ PipsFMAT
| typedef int(* PipsFMAT) (void *user_data, int id, int *krow, int *jcol, double *M) |
Function pointer type for callbacks that provide matrix data in compressed sparse row (CSR) format. The matrix is assumed to be row-major.
- Parameters
-
| user_data | A pointer to user-defined data. |
| id | The ID of the node. |
| [out] | krow | Array of row pointers for the CSR matrix. krowM[i] contains the index of the first non-zero element in row i. |
| [out] | jcol | Array of column indices for the non-zero elements. |
| [out] | M | Array of non-zero matrix values. |
- Returns
- 0 on success, non-zero on failure.
◆ PipsFNNZ
| typedef int(* PipsFNNZ) (void *user_data, int id, int *val) |
Function pointer type for callbacks that return a single integer value (e.g., a size or non-zero count).
- Parameters
-
| user_data | A pointer to user-defined data, passed through from the DistributedInputNode. |
| id | The ID of the node in the problem tree for which data is being requested. |
| [out] | val | A pointer to an integer where the result (e.g., number of variables, non-zeros) will be stored. |
- Returns
- 0 on success, non-zero on failure.
◆ PipsFSCALAR
| typedef int(* PipsFSCALAR) (void *user_data, int id, double *scalar) |
Function pointer type for callbacks that provide a single scalar value.
- Parameters
-
| user_data | A pointer to user-defined data. |
| id | The ID of the node. |
| [out] | scalar | A pointer to a double where the scalar value will be stored. |
- Returns
- 0 on success, non-zero on failure.
◆ PipsFVEC
| typedef int(* PipsFVEC) (void *user_data, int id, double *vec, int len) |
Function pointer type for callbacks that provide vector data.
- Parameters
-
| user_data | A pointer to user-defined data. |
| id | The ID of the node. |
| [out] | vec | A pointer to a pre-allocated array to be filled with vector data. |
| len | The length of the vec array, indicating how many elements to fill. |
- Returns
- 0 on success, non-zero on failure.
◆ pips_get_dual_eq()
| int pips_get_dual_eq |
( |
void * | solver, |
|
|
double ** | out, |
|
|
int * | size ) |
Get values of dual variables of equality constraints. The function will allocate memory to store the solution values. It is in the callers responsibility to free this memory with free().
- Parameters
-
| solver | PIPS-IPM++ solver |
| out | buffer to store pointer to allocated memory |
| size | buffer to store length of array in out |
- Returns
- 0 on success
◆ pips_get_dual_ineq()
| int pips_get_dual_ineq |
( |
void * | solver, |
|
|
double ** | out, |
|
|
int * | size ) |
Get values of dual variables of inequality constraints. The function will allocate memory to store the solution values. It is in the callers responsibility to free this memory with free().
- Parameters
-
| solver | PIPS-IPM++ solver |
| out | buffer to store pointer to allocated memory |
| size | buffer to store length of array in out |
- Returns
- 0 on success
◆ pips_get_dual_var_bounds()
| int pips_get_dual_var_bounds |
( |
void * | solver, |
|
|
double ** | out, |
|
|
int * | size ) |
Get values of dual variables of variable bounds. The function will allocate memory to store the solution values. It is in the callers responsibility to free this memory with free().
- Parameters
-
| solver | PIPS-IPM++ solver |
| out | buffer to store pointer to allocated memory |
| size | buffer to store length of array in out |
- Returns
- 0 on success
◆ pips_get_equality_values()
| int pips_get_equality_values |
( |
void * | solver, |
|
|
double ** | out, |
|
|
int * | size ) |
Get activity of equality constraints. The function will allocate memory to store the solution values. It is in the callers responsibility to free this memory with free().
- Parameters
-
| solver | PIPS-IPM++ solver |
| out | buffer to store pointer to allocated memory |
| size | buffer to store length of array in out |
- Returns
- 0 on success
◆ pips_get_inequality_values()
| int pips_get_inequality_values |
( |
void * | solver, |
|
|
double ** | out, |
|
|
int * | size ) |
Get activity of inequality constraints. The function will allocate memory to store the solution values. It is in the callers responsibility to free this memory with free().
- Parameters
-
| solver | PIPS-IPM++ solver |
| out | buffer to store pointer to allocated memory |
| size | buffer to store length of array in out |
- Returns
- 0 on success
◆ pips_get_objective()
| double pips_get_objective |
( |
void * | solver | ) |
|
Get objective function value.
- Parameters
-
- Returns
- objective function value from last solve
◆ pips_get_primal()
| int pips_get_primal |
( |
void * | solver, |
|
|
double ** | out, |
|
|
int * | size ) |
Get variable values. The function will allocate memory to store the solution values. It is in the callers responsibility to free this memory with free().
- Parameters
-
| solver | PIPS-IPM++ solver |
| out | buffer to store pointer to allocated memory |
| size | buffer to store length of array in out |
- Returns
- 0 on success
◆ pips_set_bool_option()
| int pips_set_bool_option |
( |
const char * | name, |
|
|
bool | value ) |
Set value of a boolean option.
- Parameters
-
| name | Name of option. |
| value | Value the option should be set to. |
- Returns
- 0 on success
◆ pips_set_double_option()
| int pips_set_double_option |
( |
const char * | name, |
|
|
double | value ) |
Set value of a floating-point option.
- Parameters
-
| name | Name of option. |
| value | Value the option should be set to. |
- Returns
- 0 on success
◆ pips_set_int_option()
| int pips_set_int_option |
( |
const char * | name, |
|
|
int | value ) |
Set value of an integer option.
- Parameters
-
| name | Name of option. |
| value | Value the option should be set to. |
- Returns
- 0 on success
◆ pips_set_string_option()
| int pips_set_string_option |
( |
const char * | name, |
|
|
const char * | value ) |
Set value of a string option.
- Parameters
-
| name | Name of option. |
| value | Value the option should be set to. |
- Returns
- 0 on success
◆ pips_solve()
Call the solve method of the PIPS-IPM++ solver.
- Parameters
-
- Returns
- termination status
◆ pips_solver_create()
| void * pips_solver_create |
( |
void * | tree, |
|
|
const char * | options_file ) |
Construct the PIPS-IPM++ solver.
- Parameters
-
| tree | distributed tree structure holding the callbacks that define the problem |
| options_file | name of options file to read, or NULL for default |
- Returns
- PIPS-IPM++ solver
◆ pips_solver_destroy()
| void pips_solver_destroy |
( |
void * | solver | ) |
|
Frees the PIPS-IPM++ solver.
- Parameters
-
◆ pips_tree_create()
Construct a distributed tree structure with given callbacks for root and leaf nodes.
- Parameters
-
| num_blocks | number of blocks |
| root_cb | callbacks for root node |
| block_cb | callbacks for leaf nodes |
- Returns
- tree structure
◆ pips_tree_destroy()
| void pips_tree_destroy |
( |
void * | tree | ) |
|
Frees a distributed tree structure.
- Parameters
-
| tree | tree structure to free |