PIPS-IPM++ Solver and Tools
a parallel interior-point method for doubly bordered block diagonal linear programs
PIPSIPMppInterface.h File Reference

PIPS-IPM++ C API. More...

#include <stdbool.h>
#include "TerminationStatus.h"

Classes

struct  PipsNodeCallbacks

Typedefs

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.

Functions

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)

Detailed Description

PIPS-IPM++ C API.

Typedef Documentation

◆ 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_dataA pointer to user-defined data.
idThe ID of the node.
[out]krowArray of row pointers for the CSR matrix. krowM[i] contains the index of the first non-zero element in row i.
[out]jcolArray of column indices for the non-zero elements.
[out]MArray 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_dataA pointer to user-defined data, passed through from the DistributedInputNode.
idThe ID of the node in the problem tree for which data is being requested.
[out]valA 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_dataA pointer to user-defined data.
idThe ID of the node.
[out]scalarA 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_dataA pointer to user-defined data.
idThe ID of the node.
[out]vecA pointer to a pre-allocated array to be filled with vector data.
lenThe length of the vec array, indicating how many elements to fill.
Returns
0 on success, non-zero on failure.

Function Documentation

◆ 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
solverPIPS-IPM++ solver
outbuffer to store pointer to allocated memory
sizebuffer 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
solverPIPS-IPM++ solver
outbuffer to store pointer to allocated memory
sizebuffer 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
solverPIPS-IPM++ solver
outbuffer to store pointer to allocated memory
sizebuffer 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
solverPIPS-IPM++ solver
outbuffer to store pointer to allocated memory
sizebuffer 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
solverPIPS-IPM++ solver
outbuffer to store pointer to allocated memory
sizebuffer 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
solverPIPS-IPM++ solver
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
solverPIPS-IPM++ solver
outbuffer to store pointer to allocated memory
sizebuffer 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
nameName of option.
valueValue 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
nameName of option.
valueValue 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
nameName of option.
valueValue 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
nameName of option.
valueValue the option should be set to.
Returns
0 on success

◆ pips_solve()

PipsTerminationStatus pips_solve ( void * solver)

Call the solve method of the PIPS-IPM++ solver.

Parameters
solverPIPS-IPM++ solver
Returns
termination status

◆ pips_solver_create()

void * pips_solver_create ( void * tree,
const char * options_file )

Construct the PIPS-IPM++ solver.

Parameters
treedistributed tree structure holding the callbacks that define the problem
options_filename 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
solverSolver to free

◆ pips_tree_create()

void * pips_tree_create ( int num_blocks,
const PipsNodeCallbacks * root_cb,
const PipsNodeCallbacks * block_cb )

Construct a distributed tree structure with given callbacks for root and leaf nodes.

Parameters
num_blocksnumber of blocks
root_cbcallbacks for root node
block_cbcallbacks for leaf nodes
Returns
tree structure

◆ pips_tree_destroy()

void pips_tree_destroy ( void * tree)

Frees a distributed tree structure.

Parameters
treetree structure to free