overview of functions provided#
// namespaces namespace conf; // typedefs typedef float spc_; typedef double rpc_; typedef int ipc_; // structs struct rpd_control_type; struct rpd_inform_type; // global functions void rpd_initialize(void **data, struct rpd_control_type* control, ipc_ *status); void rpd_get_stats( char qplib_file[], ipc_ qplib_file_len, struct rpd_control_type* control, void **data, ipc_ *status, char p_type[4], ipc_ *n, ipc_ *m, ipc_ *h_ne, ipc_ *a_ne, ipc_ *h_c_ne ); void rpd_get_g(void **data, ipc_ *status, ipc_ n, rpc_ g[]); void rpd_get_f(void **data, ipc_ *status, rpc_* f); void rpd_get_xlu( void **data, ipc_ *status, ipc_ n, rpc_ x_l[], rpc_ x_u[] ); void rpd_get_clu( void **data, ipc_ *status, ipc_ m, rpc_ c_l[], rpc_ c_u[] ); void rpd_get_h( void **data, ipc_ *status, ipc_ h_ne, ipc_ h_row[], ipc_ h_col[], rpc_ h_val[] ); void rpd_get_a( void **data, ipc_ *status, ipc_ a_ne, ipc_ a_row[], ipc_ a_col[], rpc_ a_val[] ); void rpd_get_h_c( void **data, ipc_ *status, ipc_ h_c_ne, ipc_ h_c_ptr[], ipc_ h_c_row[], ipc_ h_c_col[], rpc_ h_c_val[] ); void rpd_get_x_type(void **data, ipc_ *status, ipc_ n, ipc_ x_type[]); void rpd_get_x(void **data, ipc_ *status, ipc_ n, rpc_ x[]); void rpd_get_y(void **data, ipc_ *status, ipc_ m, rpc_ y[]); void rpd_get_z(void **data, ipc_ *status, ipc_ n, rpc_ z[]); void rpd_information(void **data, struct rpd_inform_type* inform, ipc_ *status); void rpd_terminate( void **data, struct rpd_control_type* control, struct rpd_inform_type* inform );
typedefs#
typedef float spc_
spc_
is real single precision
typedef double rpc_
rpc_
is the real working precision used, but may be changed to float
by
defining the preprocessor variable REAL_32
or (if supported) to
__real128
using the variable REAL_128
.
typedef int ipc_
ipc_
is the default integer word length used, but may be changed to
int64_t
by defining the preprocessor variable INTEGER_64
.
function calls#
void rpd_initialize(void **data, struct rpd_control_type* control, ipc_ *status)
Set default control values and initialize private data
Parameters:
data |
holds private internal data |
control |
is a struct containing control information (see rpd_control_type) |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are (currently):
|
void rpd_get_stats( char qplib_file[], ipc_ qplib_file_len, struct rpd_control_type* control, void **data, ipc_ *status, char p_type[4], ipc_ *n, ipc_ *m, ipc_ *h_ne, ipc_ *a_ne, ipc_ *h_c_ne )
Read the data from a specified QPLIB file into internal storage, and report the type of problem encoded, along with problem-specific dimensions.
Parameters:
qplib_file |
is a one-dimensional array of type char that specifies the name of the QPLIB file that is to be read. |
qplib_file_len |
is a scalar variable of type ipc_, that gives the number of characters in the name encoded in qplib_file. |
control |
is a struct whose members provide control paramters for the remaining prcedures (see rpd_control_type) |
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
p_type |
is a one-dimensional array of size 4 and type char that specifies the type of quadratic programming problem encoded in the QPLIB file. The first character indicates the type of objective function used. It will be one of the following:
The second character indicates the types of variables that are present. It will be one of the following:
The third character indicates the type of the (most extreme) constraint function used; other constraints may be of a lesser type. It will be one of the following:
Thus for continuous problems, we would have
For integer problems, the second character would be I rather than C, and for mixed integer problems, the second character would by M or G. |
n |
is a scalar variable of type ipc_, that holds the number of variables. |
m |
is a scalar variable of type ipc_, that holds the number of general constraints. |
h_ne |
is a scalar variable of type ipc_, that holds the number of entries in the lower triangular part of \(H\) stored in the sparse symmetric co-ordinate storage scheme. |
a_ne |
is a scalar variable of type ipc_, that holds the number of entries in \(A\) stored in the sparse co-ordinate storage scheme. |
h_c_ne |
is a scalar variable of type ipc_, that holds the number of entries in the lower triangular part of \(H_c\) stored in the joint sparse co-ordinate storage scheme. |
void rpd_get_g(void **data, ipc_ *status, ipc_ n, rpc_ g[])
Recover the linear term \(g\) from in objective function
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
n |
is a scalar variable of type ipc_, that holds the number of variables. |
g |
is a one-dimensional array of size n and type rpc_, that gives the linear term \(g\) of the objective function. The j-th component of g, j = 0, … , n-1, contains \(g_j\). |
void rpd_get_f(void **data, ipc_ *status, rpc_* f)
Recover the constant term \(f\) in the objective function.
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
f |
is a scalar of type rpc_, that gives the constant term \(f\) from the objective function. |
void rpd_get_xlu( void **data, ipc_ *status, ipc_ n, rpc_ x_l[], rpc_ x_u[] )
Recover the variable lower and upper bounds \(x_l\) and \(x_u\).
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
n |
is a scalar variable of type ipc_, that holds the number of variables. |
x_l |
is a one-dimensional array of size n and type rpc_, that gives the lower bounds \(x_l\) on the variables \(x\). The j-th component of x_l, j = 0, … , n-1, contains \((x_l)_j\). |
x_u |
is a one-dimensional array of size n and type rpc_, that gives the upper bounds \(x_u\) on the variables \(x\). The j-th component of x_u, j = 0, … , n-1, contains \((x_u)_j\). |
void rpd_get_clu( void **data, ipc_ *status, ipc_ m, rpc_ c_l[], rpc_ c_u[] )
Recover the constraint lower and upper bounds \(c_l\) and \(c_u\).
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
m |
is a scalar variable of type ipc_, that holds the number of general constraints. |
c_l |
is a one-dimensional array of size m and type rpc_, that gives the lower bounds \(c_l\) on the constraints \(A x\). The i-th component of c_l, i = 0, … , m-1, contains \((c_l)_i\). |
c_u |
is a one-dimensional array of size m and type rpc_, that gives the upper bounds \(c_u\) on the constraints \(A x\). The i-th component of c_u, i = 0, … , m-1, contains \((c_u)_i\). |
void rpd_get_h( void **data, ipc_ *status, ipc_ h_ne, ipc_ h_row[], ipc_ h_col[], rpc_ h_val[] )
Recover the Hessian term \(H\) in the objective function.
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
h_ne |
is a scalar variable of type ipc_, that holds the number of entries in the lower triangular part of the Hessian matrix \(H\). |
h_row |
is a one-dimensional array of size h_ne and type ipc_, that gives the row indices of the lower triangular part of \(H\) in the sparse co-ordinate storage scheme. |
h_col |
is a one-dimensional array of size h_ne and type ipc_, that gives the column indices of the lower triangular part of \(H\) in the sparse co-ordinate storage scheme. |
h_val |
is a one-dimensional array of size h_ne and type rpc_, that holds the values of the entries of the lower triangular part of the Hessian matrix \(H\) in the sparse co-ordinate storage scheme. |
void rpd_get_a( void **data, ipc_ *status, ipc_ a_ne, ipc_ a_row[], ipc_ a_col[], rpc_ a_val[] )
Recover the Jacobian term \(A\) in the constraints.
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
a_ne |
is a scalar variable of type ipc_, that holds the number of entries in the constraint Jacobian matrix \(A\). |
a_row |
is a one-dimensional array of size a_ne and type ipc_, that gives the row indices of \(A\) in the sparse co-ordinate storage scheme. |
a_col |
is a one-dimensional array of size a_ne and type ipc_, that gives the column indices of \(A\) in the sparse co-ordinate, storage scheme. |
a_val |
is a one-dimensional array of size a_ne and type rpc_, that gives the values of the entries of the constraint Jacobian matrix \(A\) in the sparse co-ordinate scheme. |
void rpd_get_h_c( void **data, ipc_ *status, ipc_ h_c_ne, ipc_ h_c_ptr[], ipc_ h_c_row[], ipc_ h_c_col[], rpc_ h_c_val[] )
Recover the Hessian terms \(H_c\) in the constraints.
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
h_c_ne |
is a scalar variable of type ipc_, that holds the number of entries in the lower triangular part of the Hessian matrix \(H\). |
h_c_ptr |
is a one-dimensional array of size h_c_ne and type ipc_, that gives the constraint indices of the lower triangular part of \(H_c\) in the joint sparse co-ordinate storage scheme. |
h_c_row |
is a one-dimensional array of size h_c_ne and type ipc_, that gives the row indices of the lower triangular part of \(H_c\) in the joint sparse co-ordinate storage scheme. |
h_c_col |
is a one-dimensional array of size h_c_ne and type ipc_, that gives the column indices of the lower triangular part of \(H_c\) in the sparse co-ordinate storage scheme. |
h_c_val |
is a one-dimensional array of size h_c_ne and type rpc_, that holds the values of the entries of the lower triangular part of the Hessian matrix \(H_c\) in the sparse co-ordinate storage scheme. |
void rpd_get_x_type(void **data, ipc_ *status, ipc_ n, ipc_ x_type[])
Recover the types of the variables \(x\).
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
n |
is a scalar variable of type ipc_, that holds the number of variables. |
x_type |
is a one-dimensional array of size n and type ipc_, that specifies the type of each variable \(x\). Specifically, for j = 0, … , n-1, x(j) =
|
void rpd_get_x(void **data, ipc_ *status, ipc_ n, rpc_ x[])
Recover the initial values of the variables \(x\).
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
n |
is a scalar variable of type ipc_, that holds the number of variables. |
x |
is a one-dimensional array of size n and type rpc_, that gives the initial values \(x\) of the optimization variables. The j-th component of x, j = 0, … , n-1, contains \(x_j\). |
void rpd_get_y(void **data, ipc_ *status, ipc_ m, rpc_ y[])
Recover the initial values of the Lagrange multipliers \(y\).
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
m |
is a scalar variable of type ipc_, that holds the number of general constraints. |
y |
is a one-dimensional array of size n and type rpc_, that gives the initial values \(y\) of the Lagrange multipliers for the general constraints. The j-th component of y, j = 0, … , n-1, contains \(y_j\). |
void rpd_get_z(void **data, ipc_ *status, ipc_ n, rpc_ z[])
Recover the initial values of the dual variables \(z\).
Parameters:
data |
holds private internal data |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:
|
n |
is a scalar variable of type ipc_, that holds the number of variables. |
z |
is a one-dimensional array of size n and type rpc_, that gives the initial values \(z\) of the dual variables. The j-th component of z, j = 0, … , n-1, contains \(z_j\). |
void rpd_information(void **data, struct rpd_inform_type* inform, ipc_ *status)
Provides output information
Parameters:
data |
holds private internal data |
inform |
is a struct containing output information (see rpd_inform_type) |
status |
is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are (currently):
|
void rpd_terminate( void **data, struct rpd_control_type* control, struct rpd_inform_type* inform )
Deallocate all internal private storage
Parameters:
data |
holds private internal data |
control |
is a struct containing control information (see rpd_control_type) |
inform |
is a struct containing output information (see rpd_inform_type) |