ocp_qp_interface

Enums

enum ocp_qp_solver_t

QP solver types (Enumeration).

Full list of fields: PARTIAL_CONDENSING_HPIPM PARTIAL_CONDENSING_HPMPC PARTIAL_CONDENSING_OOQP PARTIAL_CONDENSING_OSQP PARTIAL_CONDENSING_QPDUNES FULL_CONDENSING_HPIPM FULL_CONDENSING_QPOASES FULL_CONDENSING_QORE FULL_CONDENSING_OOQP INVALID_QP_SOLVER

Note: In this enumeration the partial condensing solvers have to be specified before the full condensing solvers.

Values:

enumerator PARTIAL_CONDENSING_HPIPM
enumerator FULL_CONDENSING_HPIPM
enumerator INVALID_QP_SOLVER

Functions

void ocp_qp_xcond_solver_config_initialize_from_plan(ocp_qp_solver_t solver_name, ocp_qp_xcond_solver_config *solver_config)

Initializes the qp solver configuration.

TBC should this be private/static - no, used in ocp_nlp

ocp_qp_xcond_solver_config *ocp_qp_xcond_solver_config_create(ocp_qp_solver_plan plan)

Constructs a qp solver config and Initializes with default values.

Parameters
  • plan: The qp solver plan struct.

void ocp_qp_xcond_solver_config_free(ocp_qp_xcond_solver_config *config)

Destructor for config struct, frees memory.

Parameters
  • config: The config object to destroy.

ocp_qp_dims *ocp_qp_dims_create(int N)

Constructs a struct that contains the dimensions for the variables of the qp.

Parameters
  • N: The number of variables.

void ocp_qp_dims_free(void *dims)

Destructor of The dimension struct.

Parameters
  • dims: The dimension struct.

ocp_qp_xcond_solver_dims *ocp_qp_xcond_solver_dims_create(ocp_qp_xcond_solver_config *config, int N)
ocp_qp_xcond_solver_dims *ocp_qp_xcond_solver_dims_create_from_ocp_qp_dims(ocp_qp_xcond_solver_config *config, ocp_qp_dims *dims)
void ocp_qp_xcond_solver_dims_free(ocp_qp_xcond_solver_dims *dims_)
void ocp_qp_xcond_solver_dims_set(void *config_, ocp_qp_xcond_solver_dims *dims, int stage, const char *field, int *value)
ocp_qp_in *ocp_qp_in_create(ocp_qp_dims *dims)

Constructs an input object for the qp.

Parameters
  • dims: The dimension struct.

void ocp_qp_in_set(ocp_qp_xcond_solver_config *config, ocp_qp_in *in, int stage, char *field, void *value)
void ocp_qp_in_free(void *in_)

Destructor of the inputs struct.

Parameters
  • in_: The inputs struct.

ocp_qp_out *ocp_qp_out_create(ocp_qp_dims *dims)

Constructs an outputs object for the qp.

Parameters
  • dims: The dimension struct.

void ocp_qp_out_free(void *out_)

Destructor of the output struct.

Parameters
  • out_: The output struct.

void ocp_qp_out_get(ocp_qp_out *out, const char *field, void *value)

Getter of output struct.

void *ocp_qp_xcond_solver_opts_create(ocp_qp_xcond_solver_config *config, ocp_qp_xcond_solver_dims *dims)

Constructs an options object for the qp.

Parameters
  • config: The configuration struct.

  • dims: The dimension struct.

void ocp_qp_xcond_solver_opts_free(ocp_qp_xcond_solver_opts *opts)

Destructor of the options struct.

Parameters
  • opts: The options struct to destroy.

void ocp_qp_xcond_solver_opts_set(ocp_qp_xcond_solver_config *config, ocp_qp_xcond_solver_opts *opts, const char *field, void *value)

Setter of the options struct.

Parameters
  • opts: The options struct.

int ocp_qp_calculate_size(ocp_qp_xcond_solver_config *config, ocp_qp_xcond_solver_dims *dims, void *opts_)

TBC Should be private/static?

ocp_qp_solver *ocp_qp_assign(ocp_qp_xcond_solver_config *config, ocp_qp_xcond_solver_dims *dims, void *opts_, void *raw_memory)

TBC Reserves memory? TBC Should this be private?

Parameters
  • config: The configuration struct.

  • dims: The dimension struct.

  • opts_: The options struct.

  • raw_memory: Pointer to raw memory to assign to qp solver.

ocp_qp_solver *ocp_qp_create(ocp_qp_xcond_solver_config *config, ocp_qp_xcond_solver_dims *dims, void *opts_)

Creates a qp solver.

Reserves memory.

Parameters
  • config: The configuration struct.

  • dims: The dimension struct.

  • opts_: The options struct.

void ocp_qp_solver_destroy(ocp_qp_solver *solver)

Destroys a qp solver.

Frees memory.

Parameters
  • solver: The qp solver

void ocp_qp_x_cond_solver_free(ocp_qp_xcond_solver_config *config, ocp_qp_xcond_solver_dims *dims, void *opts_)
int ocp_qp_solve(ocp_qp_solver *solver, ocp_qp_in *qp_in, ocp_qp_out *qp_out)

Solves the qp.

Parameters
  • solver: The solver.

  • qp_in: The inputs struct.

  • qp_out: The output struct.

void ocp_qp_inf_norm_residuals(ocp_qp_dims *dims, ocp_qp_in *qp_in, ocp_qp_out *qp_out, double *res)

Calculates the infinity norm of the residuals.

Parameters
  • dims: The dimension struct.

  • qp_in: The inputs struct.

  • qp_out: The output struct.

  • res: Output array for the residuals.

struct ocp_qp_solver_plan
#include <ocp_qp_interface.h>

Struct containing qp solver.

Public Members

ocp_qp_solver_t qp_solver
struct ocp_qp_solver
#include <ocp_qp_interface.h>

Linear ocp configuration.

Public Members

ocp_qp_xcond_solver_config *config
ocp_qp_xcond_solver_dims *dims
void *opts
void *mem
void *work