1 /************************************************************************************************** 2 * * 3 * This file is part of HPIPM. * 4 * * 5 * HPIPM -- High-Performance Interior Point Method. * 6 * Copyright (C) 2017-2018 by Gianluca Frison. * 7 * Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * 8 * All rights reserved. * 9 * * 10 * This program is free software: you can redistribute it and/or modify * 11 * it under the terms of the GNU General Public License as published by * 12 * the Free Software Foundation, either version 3 of the License, or * 13 * (at your option) any later version *. 14 * * 15 * This program is distributed in the hope that it will be useful, * 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 18 * GNU General Public License for more details. * 19 * * 20 * You should have received a copy of the GNU General Public License * 21 * along with this program. If not, see <https://www.gnu.org/licenses/>. * 22 * * 23 * The authors designate this particular file as subject to the "Classpath" exception * 24 * as provided by the authors in the LICENSE file that accompained this code. * 25 * * 26 * Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * 27 * * 28 **************************************************************************************************/ 29 30 31 32 #include <blasfeo_target.h> 33 #include <blasfeo_common.h> 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 40 struct d_ocp_nlp_ipm_arg 41 { 42 struct d_erk_arg *erk_arg; 43 double mu0; // initial value for duality measure 44 double alpha_min; // exit cond on step length 45 double nlp_res_g_max; // exit cond on inf norm of residuals 46 double nlp_res_b_max; // exit cond on inf norm of residuals 47 double nlp_res_d_max; // exit cond on inf norm of residuals 48 double nlp_res_m_max; // exit cond on inf norm of residuals 49 int nlp_iter_max; // exit cond in iter number 50 int stat_max; // iterations saved in stat 51 int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm 52 int memsize; 53 }; 54 55 56 57 struct d_ocp_nlp_ipm_workspace 58 { 59 struct d_ocp_qp *qp; 60 struct d_ocp_qp_sol *qp_sol; 61 struct d_ocp_qp_ipm_workspace *ipm_workspace; 62 struct d_erk_workspace *erk_workspace; 63 double nlp_res_g; // exit inf norm of residuals 64 double nlp_res_b; // exit inf norm of residuals 65 double nlp_res_d; // exit inf norm of residuals 66 double nlp_res_m; // exit inf norm of residuals 67 int iter; // iteration number 68 int memsize; 69 }; 70 71 72 73 // 74 int d_memsize_ocp_nlp_ipm_arg(struct d_ocp_nlp *nlp); 75 // 76 void d_create_ocp_nlp_ipm_arg(struct d_ocp_nlp *nlp, struct d_ocp_nlp_ipm_arg *arg, void *mem); 77 // 78 void d_set_default_ocp_nlp_ipm_arg(struct d_ocp_nlp_ipm_arg *arg); 79 80 // 81 int d_memsize_ocp_nlp_ipm(struct d_ocp_nlp *nlp, struct d_ocp_nlp_ipm_arg *arg); 82 // 83 void d_create_ocp_nlp_ipm(struct d_ocp_nlp *nlp, struct d_ocp_nlp_ipm_arg *arg, struct d_ocp_nlp_ipm_workspace *ws, void *mem); 84 // 85 int d_solve_ocp_nlp_ipm(struct d_ocp_nlp *nlp, struct d_ocp_nlp_sol *nlp_sol, struct d_ocp_nlp_ipm_arg *arg, struct d_ocp_nlp_ipm_workspace *ws); 86 87 #ifdef __cplusplus 88 } /* extern "C" */ 89 #endif 90