DuQuad  v1.0
Quadratic Programming Optimizations
 All Data Structures Files Functions Variables Typedefs Macros
qp_structs.h
Go to the documentation of this file.
1 /*
2  * qp_structs.h
3  *
4  * Created on: Oct 1, 2014
5  * Author: sverre
6  */
7 
8 /** \file
9  * Contains the declaration of the structs that are common for the algorithms
10  */
11 #ifndef QP_STRUCTS_H_
12 #define QP_STRUCTS_H_
13 #include "typedefs.h"
14 
15 struct Problem {
16  real_t * H; /**< The Hessian matrix. Dimensions n x n, and has to be positive definite */
17  real_t * c; /**< The gradient vector */
18  real_t * A; /**< Linear constraints matrix Dimensions m x n */
19  real_t * A_t; /**< A transposed */
20  real_t * b; /**< Linear constraints vector */
21  real_t * lb_hat; /**< The lower bound for the linear constraints */
22  real_t * ub_hat; /**< The upper bound for the linear constraints */
23  real_t * lb; /**< The lower bound for optimization variable z */
24  real_t * ub; /**< The upper bound for optimization variable z */
25  real_t * z0; /**< The initial point */
26 }; /**< Contains all the matrices and vectors used to describe the general QP */
27 
28 struct Options {
29  uint32_t maxiter_outer; /**< Maximum number of iterations in the outer loop */
30  uint32_t maxiter_inner; /**< Maximum number of iterations in the inner loop */
31  real_t eps_ds; /**< Tolerance for dual suboptimality */
32  real_t eps_pf; /**< Tolerance for primal feasibility */
33  real_t eps_inner; /**< Tolerance for primal feasibility in the inner problem */
34  uint32_t algorithm; /**< Specifies the algorithm used to solve the problem. Values: 1: DGM last, 2: DGM avg, 3: DFGM last, 4: DFGM avg, 5: ALM last, 6: ALM avg, 7: FALM last, 8: FALM avg */
35  real_t rho; /**< Penalty parameter used in ALM and FALM */
36 }; /**< Option specified by the user. Default values can be found in the user manual */
37 
38 struct Info {
39  boolean lb_is_inf; /**< true: no lower bound on optimization variable */
40  boolean ub_is_inf; /**< true: no upper bound on optimization variable */
41  boolean lb_hat_is_inf; /**< true: no lower bound on linear constraints */
42  boolean ub_hat_is_inf; /**< true: no upper bound on linear constraint */
43  real_t eigH_max; /**< Largest eigenvalue of the Hessian H */
44  real_t eigH_min; /**< Smallest eigenvalue of the Hessian H */
45  real_t Ld; /**< Lipschitz constant */
46  uint32_t problem_case; /**< case 1: lb_hat != ub_hat, case 2: lb_hat == ub_hat, case 3: lb_hat = -inf, case 4: ub_hat = inf */
48 }; /**< parameters that are calculated automatically off-line in duquad.m */
49 
50 struct Output {
51  uint32_t iterations; /**< Number of outer iterations */
52  uint32_t iterations_inner_tot; /**< Total number of iterations for the inner problem */
53  real_t time; /**< Runtime of the algorithm after all initialization is done */
54  real_t time_tot_inner; /**< Total time spent on solving the inner problem */
55  uint32_t flag_last_satisfied; /**< Flag spesifies which stopping criteria was resolved last. Value: 0 = dual suboptimality, 1 = primal feasibility */
56  uint32_t niter_feasible_ds; /**< Number of iterations the criterion for dual suboptimality was satisfied */
57  uint32_t niter_feasible_pf; /**< Number of iterations the criterion for primal feasibility was satisfied */
58  uint32_t exitflag_inner; /**< Exitflag for the inner problem. Values: 1 = feasible point found, 2 = Maximum number of iterations exceeded */
59  uint32_t num_exceeded_max_niter_inner; /**< Total number of times the inner problem exceeded the number of iterations */
60  real_t * ds_vector; /**< Vector storing all the value of the dual suboptimality every iteration */
61  real_t * pf_vector; /**< Vector storing all the value of the primal feasibility every iteration */
62 }; /**< Important results are collected in the Output struct */
63 
64 struct Result {
65  real_t * zopt; /**< Optimal point */
66  real_t fopt; /**< Optimal value */
67  uint32_t exitflag; /**< Values: 1 = optimal point found, 2 = maximum number of iterations exceeded, -1 = error */
68  real_t * lambda1; /**< Set of lagrangian multipliers */
69  real_t * lambda2; /**< Set of lagrangian multipliers */
70  struct Output * out; /**< Sruct containing other results */
71 }; /**< Outputs of the algorithms */
72 
73 struct Array{
77 }; /**< for internal use */
78 
79 
80 #endif /* QP_STRUCTS_H_ */
real_t * lambda2
Definition: qp_structs.h:69
real_t time_tot_inner
Definition: qp_structs.h:54
unsigned int uint32_t
Definition: typedefs.h:19
real_t time
Definition: qp_structs.h:53
real_t * A_t
Definition: qp_structs.h:19
uint32_t algorithm
Definition: qp_structs.h:34
real_t Ld
Definition: qp_structs.h:45
struct Output * out
Definition: qp_structs.h:70
boolean ub_is_inf
Definition: qp_structs.h:40
real_t * zopt
Definition: qp_structs.h:65
uint32_t iterations_inner_tot
Definition: qp_structs.h:52
boolean ub_hat_is_inf
Definition: qp_structs.h:42
uint32_t used
Definition: qp_structs.h:75
real_t * lb
Definition: qp_structs.h:23
real_t * ds_vector
Definition: qp_structs.h:60
uint32_t exitflag
Definition: qp_structs.h:67
uint32_t flag_last_satisfied
Definition: qp_structs.h:55
uint32_t pf_vec_length
Definition: qp_structs.h:47
real_t eps_ds
Definition: qp_structs.h:31
uint32_t size
Definition: qp_structs.h:76
real_t * H
Definition: qp_structs.h:16
real_t fopt
Definition: qp_structs.h:66
uint32_t iterations
Definition: qp_structs.h:51
real_t * A
Definition: qp_structs.h:18
real_t * ub
Definition: qp_structs.h:24
uint32_t maxiter_outer
Definition: qp_structs.h:29
uint32_t niter_feasible_pf
Definition: qp_structs.h:57
real_t * lambda1
Definition: qp_structs.h:68
uint32_t num_exceeded_max_niter_inner
Definition: qp_structs.h:59
real_t eps_inner
Definition: qp_structs.h:33
float64_t real_t
Definition: typedefs.h:25
uint32_t exitflag_inner
Definition: qp_structs.h:58
boolean lb_is_inf
Definition: qp_structs.h:39
boolean lb_hat_is_inf
Definition: qp_structs.h:41
uint32_t maxiter_inner
Definition: qp_structs.h:30
real_t rho
Definition: qp_structs.h:35
real_t * z0
Definition: qp_structs.h:25
real_t * ub_hat
Definition: qp_structs.h:22
real_t eigH_min
Definition: qp_structs.h:44
uint32_t problem_case
Definition: qp_structs.h:46
real_t * pf_vector
Definition: qp_structs.h:61
real_t eps_pf
Definition: qp_structs.h:32
real_t eigH_max
Definition: qp_structs.h:43
real_t * array
Definition: qp_structs.h:74
uint32_t niter_feasible_ds
Definition: qp_structs.h:56
real_t * lb_hat
Definition: qp_structs.h:21
real_t * b
Definition: qp_structs.h:20
real_t * c
Definition: qp_structs.h:17