Compile FrogPilot
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_AUX_MEM_H_
|
||||
#define HPIPM_AUX_MEM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void hpipm_zero_memset(hpipm_size_t memsize, void *mem);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_AUX_MEM_H_
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_AUX_STRING_H_
|
||||
#define HPIPM_AUX_STRING_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAX_STR_LEN 5
|
||||
int hpipm_strcmp(char *str1, char *str2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_AUX_STRING_H_
|
||||
@@ -1,76 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_COMMON_H_
|
||||
#define HPIPM_COMMON_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef size_t hpipm_size_t;
|
||||
|
||||
enum hpipm_mode
|
||||
{
|
||||
SPEED_ABS, // focus on speed, absolute IPM formulation
|
||||
SPEED, // focus on speed, relative IPM formulation
|
||||
BALANCE, // balanced mode, relative IPM formulation
|
||||
ROBUST, // focus on robustness, relative IPM formulation
|
||||
};
|
||||
|
||||
enum hpipm_status
|
||||
{
|
||||
SUCCESS, // found solution satisfying accuracy tolerance
|
||||
MAX_ITER, // maximum iteration number reached
|
||||
MIN_STEP, // minimum step length reached
|
||||
NAN_SOL, // NaN in solution detected
|
||||
INCONS_EQ, // unconsistent equality constraints
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_COMMON_H_
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_CAST_QCQP_H_
|
||||
#define HPIPM_D_CAST_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qcqp.h"
|
||||
#include "hpipm_d_dense_qcqp_sol.h"
|
||||
#include "hpipm_d_ocp_qcqp.h"
|
||||
#include "hpipm_d_ocp_qcqp_dim.h"
|
||||
#include "hpipm_d_ocp_qcqp_sol.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_cast_qcqp_compute_dim(struct d_ocp_qcqp_dim *ocp_dim, struct d_dense_qcqp_dim *dense_dim);
|
||||
//
|
||||
void d_cast_qcqp_cond(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp *dense_qp);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_CAST_QCQP_H_
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_COND_H_
|
||||
#define HPIPM_D_COND_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qp.h"
|
||||
#include "hpipm_d_dense_qp_sol.h"
|
||||
#include "hpipm_d_ocp_qp.h"
|
||||
#include "hpipm_d_ocp_qp_dim.h"
|
||||
#include "hpipm_d_ocp_qp_sol.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_cond_qp_arg
|
||||
{
|
||||
int cond_last_stage; // condense last stage
|
||||
int cond_alg; // condensing algorithm: 0 N2-nx3, 1 N3-nx2
|
||||
int comp_prim_sol; // primal solution (v)
|
||||
int comp_dual_sol_eq; // dual solution equality constr (pi)
|
||||
int comp_dual_sol_ineq; // dual solution inequality constr (lam t)
|
||||
int square_root_alg; // square root algorithm (faster but requires RSQ>0)
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_cond_qp_ws
|
||||
{
|
||||
struct blasfeo_dmat *Gamma;
|
||||
struct blasfeo_dmat *GammaQ;
|
||||
struct blasfeo_dmat *L;
|
||||
struct blasfeo_dmat *Lx;
|
||||
struct blasfeo_dmat *AL;
|
||||
struct blasfeo_dvec *Gammab;
|
||||
struct blasfeo_dvec *l;
|
||||
struct blasfeo_dvec *tmp_nbgM;
|
||||
struct blasfeo_dvec *tmp_nuxM;
|
||||
int bs; // block size
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_cond_qp_arg_memsize();
|
||||
//
|
||||
void d_cond_qp_arg_create(struct d_cond_qp_arg *cond_arg, void *mem);
|
||||
//
|
||||
void d_cond_qp_arg_set_default(struct d_cond_qp_arg *cond_arg);
|
||||
// condensing algorithm: 0 N2-nx3, 1 N3-nx2
|
||||
void d_cond_qp_arg_set_cond_alg(int cond_alg, struct d_cond_qp_arg *cond_arg);
|
||||
// set riccati-like algorithm: 0 classical, 1 square-root
|
||||
void d_cond_qp_arg_set_ric_alg(int ric_alg, struct d_cond_qp_arg *cond_arg);
|
||||
// condense last stage: 0 last stage disregarded, 1 last stage condensed too
|
||||
void d_cond_qp_arg_set_cond_last_stage(int cond_last_stage, struct d_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void d_cond_qp_arg_set_comp_prim_sol(int value, struct d_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void d_cond_qp_arg_set_comp_dual_sol_eq(int value, struct d_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void d_cond_qp_arg_set_comp_dual_sol_ineq(int value, struct d_cond_qp_arg *cond_arg);
|
||||
|
||||
//
|
||||
void d_cond_qp_compute_dim(struct d_ocp_qp_dim *ocp_dim, struct d_dense_qp_dim *dense_dim);
|
||||
//
|
||||
hpipm_size_t d_cond_qp_ws_memsize(struct d_ocp_qp_dim *ocp_dim, struct d_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void d_cond_qp_ws_create(struct d_ocp_qp_dim *ocp_dim, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws, void *mem);
|
||||
//
|
||||
void d_cond_qp_cond(struct d_ocp_qp *ocp_qp, struct d_dense_qp *dense_qp, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qp_cond_lhs(struct d_ocp_qp *ocp_qp, struct d_dense_qp *dense_qp, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qp_cond_rhs(struct d_ocp_qp *ocp_qp, struct d_dense_qp *dense_qp, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qp_expand_sol(struct d_ocp_qp *ocp_qp, struct d_dense_qp_sol *dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_sol, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
// TODO remove
|
||||
void d_cond_qp_expand_primal_sol(struct d_ocp_qp *ocp_qp, struct d_dense_qp_sol *dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_sol, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
|
||||
//
|
||||
void d_cond_qp_update(int *idxc, struct d_ocp_qp *ocp_qp, struct d_dense_qp *dense_qp, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_COND_H_
|
||||
@@ -1,92 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_COND_AUX_H_
|
||||
#define HPIPM_D_COND_AUX_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_cond_BAbt(struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *BAbt2, struct blasfeo_dvec *b, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_BAt(struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *BAbt2, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_b(struct d_ocp_qp *ocp_qp, struct blasfeo_dvec *b, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_RSQrq(struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *RSQrq2, struct blasfeo_dvec *rq, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_RSQ(struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *RSQrq2, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_rq(struct d_ocp_qp *ocp_qp, struct blasfeo_dvec *rq, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_DCtd(struct d_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_dmat *DCt2, struct blasfeo_dvec *d2, struct blasfeo_dvec *d_mask2, int *idxs_rev2, struct blasfeo_dvec *Z2, struct blasfeo_dvec *z, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_DCt(struct d_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_dmat *DCt2, int *idxs_rev2, struct blasfeo_dvec *Z2, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_d(struct d_ocp_qp *ocp_qp, struct blasfeo_dvec *d2, struct blasfeo_dvec *d_mask2, struct blasfeo_dvec *z, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_expand_sol(struct d_ocp_qp *ocp_qp, struct d_dense_qp_sol *dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_so, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_expand_primal_sol(struct d_ocp_qp *ocp_qp, struct d_dense_qp_sol *dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_so, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
|
||||
//
|
||||
void d_update_cond_BAbt(int *idxc, struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *BAbt2, struct blasfeo_dvec *b, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_update_cond_RSQrq_N2nx3(int *idxc, struct d_ocp_qp *ocp_qp, struct blasfeo_dmat *RSQrq2, struct blasfeo_dvec *rq, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_update_cond_DCtd(int *idxc, struct d_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_dmat *DCt2, struct blasfeo_dvec *d2, int *idxs2, struct blasfeo_dvec *Z2, struct blasfeo_dvec *z, struct d_cond_qp_arg *cond_arg, struct d_cond_qp_ws *cond_ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_COND_AUX_H_
|
||||
@@ -1,129 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_COND_QCQP_H_
|
||||
#define HPIPM_D_COND_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qcqp.h"
|
||||
#include "hpipm_d_dense_qcqp_sol.h"
|
||||
#include "hpipm_d_ocp_qcqp.h"
|
||||
#include "hpipm_d_ocp_qcqp_dim.h"
|
||||
#include "hpipm_d_ocp_qcqp_sol.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_cond_qcqp_arg
|
||||
{
|
||||
struct d_cond_qp_arg *qp_arg;
|
||||
int cond_last_stage; // condense last stage
|
||||
// int cond_variant; // TODO
|
||||
int comp_prim_sol; // primal solution (v)
|
||||
int comp_dual_sol_eq; // dual solution equality constr (pi)
|
||||
int comp_dual_sol_ineq; // dual solution equality constr (lam t)
|
||||
int square_root_alg; // square root algorithm (faster but requires RSQ>0)
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_cond_qcqp_ws
|
||||
{
|
||||
struct d_cond_qp_ws *qp_ws;
|
||||
struct blasfeo_dmat *hess_array; // TODO remove
|
||||
struct blasfeo_dmat *zero_hess; // TODO remove
|
||||
struct blasfeo_dvec *grad_array; // TODO remove
|
||||
struct blasfeo_dvec *zero_grad; // TODO remove
|
||||
struct blasfeo_dvec *tmp_nvc;
|
||||
struct blasfeo_dvec *tmp_nuxM;
|
||||
struct blasfeo_dmat *GammaQ;
|
||||
struct blasfeo_dmat *tmp_DCt;
|
||||
struct blasfeo_dmat *tmp_nuM_nxM;
|
||||
// struct blasfeo_dvec *d_qp;
|
||||
// struct blasfeo_dvec *d_mask_qp;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_cond_qcqp_arg_memsize();
|
||||
//
|
||||
void d_cond_qcqp_arg_create(struct d_cond_qcqp_arg *cond_arg, void *mem);
|
||||
//
|
||||
void d_cond_qcqp_arg_set_default(struct d_cond_qcqp_arg *cond_arg);
|
||||
// set riccati-like algorithm: 0 classical, 1 square-root
|
||||
void d_cond_qcqp_arg_set_ric_alg(int ric_alg, struct d_cond_qcqp_arg *cond_arg);
|
||||
// condense last stage: 0 last stage disregarded, 1 last stage condensed too
|
||||
void d_cond_qcqp_arg_set_cond_last_stage(int cond_last_stage, struct d_cond_qcqp_arg *cond_arg);
|
||||
|
||||
//
|
||||
void d_cond_qcqp_compute_dim(struct d_ocp_qcqp_dim *ocp_dim, struct d_dense_qcqp_dim *dense_dim);
|
||||
//
|
||||
hpipm_size_t d_cond_qcqp_ws_memsize(struct d_ocp_qcqp_dim *ocp_dim, struct d_cond_qcqp_arg *cond_arg);
|
||||
//
|
||||
void d_cond_qcqp_ws_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws, void *mem);
|
||||
//
|
||||
void d_cond_qcqp_qc(struct d_ocp_qcqp *ocp_qp, struct blasfeo_dmat *Hq2, int *Hq_nzero2, struct blasfeo_dmat *Ct2, struct blasfeo_dvec *d2, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qcqp_qc_lhs(struct d_ocp_qcqp *ocp_qp, struct blasfeo_dmat *Hq2, int *Hq_nzero2, struct blasfeo_dmat *Ct2, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qcqp_qc_rhs(struct d_ocp_qcqp *ocp_qp, struct blasfeo_dvec *d2, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qcqp_cond(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp *dense_qp, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qcqp_cond_rhs(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp *dense_qp, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qcqp_cond_lhs(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp *dense_qp, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_cond_qcqp_expand_sol(struct d_ocp_qcqp *ocp_qp, struct d_dense_qcqp_sol *dense_qp_sol, struct d_ocp_qcqp_sol *ocp_qp_sol, struct d_cond_qcqp_arg *cond_arg, struct d_cond_qcqp_ws *cond_ws);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_COND_QCQP_H_
|
||||
@@ -1,101 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_CORE_QP_IPM_
|
||||
#define HPIPM_D_CORE_QP_IPM_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct d_core_qp_ipm_workspace
|
||||
{
|
||||
double *v; // primal variables
|
||||
double *pi; // equality constraints multipliers
|
||||
double *lam; // inequality constraints multipliers
|
||||
double *t; // inequality constraints slacks
|
||||
double *t_inv; // inverse of t
|
||||
double *v_bkp; // backup of primal variables
|
||||
double *pi_bkp; // backup of equality constraints multipliers
|
||||
double *lam_bkp; // backup of inequality constraints multipliers
|
||||
double *t_bkp; // backup of inequality constraints slacks
|
||||
double *dv; // step in v
|
||||
double *dpi; // step in pi
|
||||
double *dlam; // step in lam
|
||||
double *dt; // step in t
|
||||
double *res_g; // q-residuals
|
||||
double *res_b; // b-residuals
|
||||
double *res_d; // d-residuals
|
||||
double *res_m; // m-residuals
|
||||
double *res_m_bkp; // m-residuals
|
||||
double *Gamma; // Hessian update
|
||||
double *gamma; // gradient update
|
||||
double alpha; // step length
|
||||
double alpha_prim; // step length
|
||||
double alpha_dual; // step length
|
||||
double sigma; // centering XXX
|
||||
double mu; // duality measuere
|
||||
double mu_aff; // affine duality measuere
|
||||
double nc_inv; // 1.0/nc, where nc is the total number of inequality constraints
|
||||
double nc_mask_inv; // 1.0/nc_mask
|
||||
double lam_min; // min value in lam vector
|
||||
double t_min; // min value in t vector
|
||||
double t_min_inv; // inverse of min value in t vector
|
||||
double tau_min; // min value of barrier parameter
|
||||
int nv; // number of primal variables
|
||||
int ne; // number of equality constraints
|
||||
int nc; // (twice the) number of (two-sided) inequality constraints
|
||||
int nc_mask; // total number of ineq constr after masking
|
||||
int split_step; // use different step for primal and dual variables
|
||||
int t_lam_min; // clip t and lam also in solution, or only in Gamma computation
|
||||
hpipm_size_t memsize; // memory size (in bytes) of workspace
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_memsize_core_qp_ipm(int nv, int ne, int nc);
|
||||
//
|
||||
void d_create_core_qp_ipm(int nv, int ne, int nc, struct d_core_qp_ipm_workspace *workspace, void *mem);
|
||||
//
|
||||
void d_core_qp_ipm(struct d_core_qp_ipm_workspace *workspace);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_D_CORE_QP_IPM_
|
||||
@@ -1,68 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_CORE_QP_IPM_AUX_
|
||||
#define HPIPM_S_CORE_QP_IPM_AUX_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
void d_compute_Gamma_gamma_qp(double *res_d, double *res_m, struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_compute_gamma_qp(double *res_d, double *res_m, struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_compute_lam_t_qp(double *res_d, double *res_m, double *dlam, double *dt, struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_compute_alpha_qp(struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_update_var_qp(struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_compute_mu_aff_qp(struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_backup_res_m(struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_compute_centering_correction_qp(struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_compute_centering_qp(struct d_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void d_compute_tau_min_qp(struct d_core_qp_ipm_workspace *rws);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_S_CORE_QP_IPM_AUX_
|
||||
@@ -1,199 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QCQP_H_
|
||||
#define HPIPM_D_DENSE_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qcqp
|
||||
{
|
||||
struct d_dense_qcqp_dim *dim;
|
||||
struct blasfeo_dmat *Hv; // hessian of cost & vector work space
|
||||
struct blasfeo_dmat *A; // equality constraint matrix
|
||||
struct blasfeo_dmat *Ct; // inequality constraints matrix
|
||||
struct blasfeo_dmat *Hq; // hessians of quadratic constraints
|
||||
struct blasfeo_dvec *gz; // gradient of cost & gradient of slacks
|
||||
struct blasfeo_dvec *b; // equality constraint vector
|
||||
struct blasfeo_dvec *d; // inequality constraints vector
|
||||
struct blasfeo_dvec *d_mask; // inequality constraints mask vector
|
||||
struct blasfeo_dvec *m; // rhs of complementarity condition
|
||||
struct blasfeo_dvec *Z; // (diagonal) hessian of slacks
|
||||
int *idxb; // indices of box constrained variables within [u; x]
|
||||
int *idxs_rev; // index of soft constraints (reverse storage)
|
||||
int *Hq_nzero; // for each int, the last 3 bits ...abc, {a,b,c}=0 => {R,S,Q}=0
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qcqp_memsize(struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp *qp, void *memory);
|
||||
|
||||
//
|
||||
void d_dense_qcqp_set(char *field, void *value, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_H(double *H, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_g(double *g, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_A(double *A, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_b(double *b, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_idxb(int *idxb, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_lb(double *lb, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_lb_mask(double *lb, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_ub(double *ub, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_ub_mask(double *ub, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_C(double *C, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_lg(double *lg, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_lg_mask(double *lg, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_ug(double *ug, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_ug_mask(double *ug, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_Hq(double *Hq, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_gq(double *gq, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_uq(double *uq, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_uq_mask(double *uq, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_idxs(int *idxs, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_idxs_rev(int *idxs_rev, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_Zl(double *Zl, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_Zu(double *Zu, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_zl(double *zl, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_zu(double *zu, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_ls(double *ls, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_ls_mask(double *ls, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_us(double *us, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_set_us_mask(double *us, struct d_dense_qcqp *qp);
|
||||
|
||||
// getters (COLMAJ)
|
||||
|
||||
void d_dense_qcqp_get_H(struct d_dense_qcqp *qp, double *H);
|
||||
//
|
||||
void d_dense_qcqp_get_g(struct d_dense_qcqp *qp, double *g);
|
||||
//
|
||||
void d_dense_qcqp_get_A(struct d_dense_qcqp *qp, double *A);
|
||||
//
|
||||
void d_dense_qcqp_get_b(struct d_dense_qcqp *qp, double *b);
|
||||
//
|
||||
void d_dense_qcqp_get_idxb(struct d_dense_qcqp *qp, int *idxb);
|
||||
//
|
||||
void d_dense_qcqp_get_lb(struct d_dense_qcqp *qp, double *lb);
|
||||
//
|
||||
void d_dense_qcqp_get_lb_mask(struct d_dense_qcqp *qp, double *lb);
|
||||
//
|
||||
void d_dense_qcqp_get_ub(struct d_dense_qcqp *qp, double *ub);
|
||||
//
|
||||
void d_dense_qcqp_get_ub_mask(struct d_dense_qcqp *qp, double *ub);
|
||||
//
|
||||
void d_dense_qcqp_get_C(struct d_dense_qcqp *qp, double *C);
|
||||
//
|
||||
void d_dense_qcqp_get_lg(struct d_dense_qcqp *qp, double *lg);
|
||||
//
|
||||
void d_dense_qcqp_get_lg_mask(struct d_dense_qcqp *qp, double *lg);
|
||||
//
|
||||
void d_dense_qcqp_get_ug(struct d_dense_qcqp *qp, double *ug);
|
||||
//
|
||||
void d_dense_qcqp_get_ug_mask(struct d_dense_qcqp *qp, double *ug);
|
||||
//
|
||||
void d_dense_qcqp_get_idxs(struct d_dense_qcqp *qp, int *idxs);
|
||||
//
|
||||
void d_dense_qcqp_get_idxs_rev(struct d_dense_qcqp *qp, int *idxs_rev);
|
||||
//
|
||||
void d_dense_qcqp_get_Zl(struct d_dense_qcqp *qp, double *Zl);
|
||||
//
|
||||
void d_dense_qcqp_get_Zu(struct d_dense_qcqp *qp, double *Zu);
|
||||
//
|
||||
void d_dense_qcqp_get_zl(struct d_dense_qcqp *qp, double *zl);
|
||||
//
|
||||
void d_dense_qcqp_get_zu(struct d_dense_qcqp *qp, double *zu);
|
||||
//
|
||||
void d_dense_qcqp_get_ls(struct d_dense_qcqp *qp, double *ls);
|
||||
//
|
||||
void d_dense_qcqp_get_ls_mask(struct d_dense_qcqp *qp, double *ls);
|
||||
//
|
||||
void d_dense_qcqp_get_us(struct d_dense_qcqp *qp, double *us);
|
||||
//
|
||||
void d_dense_qcqp_get_us_mask(struct d_dense_qcqp *qp, double *us);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QCQP_H_
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QCQP_DIM_H_
|
||||
#define HPIPM_D_DENSE_QCQP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qcqp_dim
|
||||
{
|
||||
struct d_dense_qp_dim *qp_dim; // dim of qp approximation
|
||||
int nv; // number of variables
|
||||
int ne; // number of equality constraints
|
||||
int nb; // number of box constraints
|
||||
int ng; // number of general constraints
|
||||
int nq; // number of quadratic constraints
|
||||
int nsb; // number of softened box constraints
|
||||
int nsg; // number of softened general constraints
|
||||
int nsq; // number of softened quadratic constraints
|
||||
int ns; // number of softened constraints (nsb+nsg+nsq) TODO number of slacks
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qcqp_dim_memsize();
|
||||
//
|
||||
void d_dense_qcqp_dim_create(struct d_dense_qcqp_dim *dim, void *memory);
|
||||
//
|
||||
void d_dense_qcqp_dim_set(char *field_name, int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_nv(int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_ne(int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_nb(int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_ng(int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_nq(int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_nsb(int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_nsg(int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_nsq(int value, struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_dim_set_ns(int value, struct d_dense_qcqp_dim *dim);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QCQP_DIM_H_
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QCQP_IPM_H_
|
||||
#define HPIPM_D_DENSE_QCQP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_dense_qcqp_dim.h>
|
||||
#include <hpipm_d_dense_qcqp.h>
|
||||
#include <hpipm_d_dense_qcqp_res.h>
|
||||
#include <hpipm_d_dense_qcqp_sol.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qcqp_ipm_arg
|
||||
{
|
||||
struct d_dense_qp_ipm_arg *qp_arg;
|
||||
double mu0; // initial value for duality measure
|
||||
double alpha_min; // exit cond on step length
|
||||
double res_g_max; // exit cond on inf norm of residuals
|
||||
double res_b_max; // exit cond on inf norm of residuals
|
||||
double res_d_max; // exit cond on inf norm of residuals
|
||||
double res_m_max; // exit cond on inf norm of residuals
|
||||
double reg_prim; // reg of primal hessian
|
||||
double reg_dual; // reg of dual hessian
|
||||
double lam_min; // min value in lam vector
|
||||
double t_min; // min value in t vector
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int scale; // scale hessian
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1)
|
||||
int comp_res_pred; // compute residuals of prediction
|
||||
int split_step; // use different step for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_dense_qcqp_ipm_ws
|
||||
{
|
||||
struct d_dense_qp_ipm_ws *qp_ws;
|
||||
struct d_dense_qp *qp;
|
||||
struct d_dense_qp_sol *qp_sol;
|
||||
struct d_dense_qcqp_res_ws *qcqp_res_ws;
|
||||
struct d_dense_qcqp_res *qcqp_res;
|
||||
struct blasfeo_dvec *tmp_nv;
|
||||
int iter; // iteration number
|
||||
int status;
|
||||
hpipm_size_t memsize; // memory size (in bytes) of workspace
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qcqp_ipm_arg_memsize(struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set(char *field, void *value, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_iter_max(int *iter_max, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_alpha_min(double *alpha_min, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_mu0(double *mu0, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_tol_stat(double *tol_stat, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_tol_eq(double *tol_eq, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_tol_ineq(double *tol_ineq, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_tol_comp(double *tol_comp, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_reg_prim(double *reg, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_reg_dual(double *reg, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_warm_start(int *warm_start, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_pred_corr(int *pred_corr, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_cond_pred_corr(int *cond_pred_corr, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_comp_res_pred(int *comp_res_pred, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_comp_res_exit(int *comp_res_exit, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_lam_min(double *value, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_t_min(double *value, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_split_step(int *value, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_arg_set_t_lam_min(int *value, struct d_dense_qcqp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qcqp_ipm_ws_memsize(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_ipm_ws_create(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get(char *field, struct d_dense_qcqp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get_status(struct d_dense_qcqp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get_iter(struct d_dense_qcqp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get_max_res_stat(struct d_dense_qcqp_ipm_ws *ws, double *res_stat);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get_max_res_eq(struct d_dense_qcqp_ipm_ws *ws, double *res_eq);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get_max_res_ineq(struct d_dense_qcqp_ipm_ws *ws, double *res_ineq);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get_max_res_comp(struct d_dense_qcqp_ipm_ws *ws, double *res_comp);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get_stat(struct d_dense_qcqp_ipm_ws *ws, double **stat);
|
||||
//
|
||||
void d_dense_qcqp_ipm_get_stat_m(struct d_dense_qcqp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void d_dense_qcqp_init_var(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qcqp_ipm_solve(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws);
|
||||
#if 0
|
||||
//
|
||||
void d_dense_qcqp_ipm_predict(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qcqp_ipm_sens(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_ipm_arg *arg, struct d_dense_qcqp_ipm_ws *ws);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QCQP_IPM_H_
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QCQP_RES_H_
|
||||
#define HPIPM_D_DENSE_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_d_dense_qcqp_dim.h>
|
||||
#include <hpipm_d_dense_qcqp.h>
|
||||
#include <hpipm_d_dense_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qcqp_res
|
||||
{
|
||||
struct d_dense_qcqp_dim *dim;
|
||||
struct blasfeo_dvec *res_g; // q-residuals
|
||||
struct blasfeo_dvec *res_b; // b-residuals
|
||||
struct blasfeo_dvec *res_d; // d-residuals
|
||||
struct blasfeo_dvec *res_m; // m-residuals
|
||||
double res_max[4]; // infinity norm of residuals
|
||||
double res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_dense_qcqp_res_ws
|
||||
{
|
||||
struct blasfeo_dvec *tmp_nv; // work space of size nv
|
||||
struct blasfeo_dvec *tmp_nbgq; // work space of size nbM+ngM+nqM
|
||||
struct blasfeo_dvec *tmp_ns; // work space of size nsM
|
||||
struct blasfeo_dvec *q_fun; // value for evaluation of quadr constr
|
||||
struct blasfeo_dvec *q_adj; // value for adjoint of quadr constr
|
||||
int use_q_fun; // reuse cached value for evaluation of quadr constr
|
||||
int use_q_adj; // reuse cached value for adjoint of quadr constr
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qcqp_res_memsize(struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_res_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t d_dense_qcqp_res_ws_memsize(struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_res_ws_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp_res_ws *workspace, void *mem);
|
||||
//
|
||||
void d_dense_qcqp_res_compute(struct d_dense_qcqp *qp, struct d_dense_qcqp_sol *qp_sol, struct d_dense_qcqp_res *res, struct d_dense_qcqp_res_ws *ws);
|
||||
//
|
||||
void d_dense_qcqp_res_compute_inf_norm(struct d_dense_qcqp_res *res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QCQP_SOL_H_
|
||||
#define HPIPM_D_DENSE_QCQP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qcqp_sol
|
||||
{
|
||||
struct d_dense_qcqp_dim *dim;
|
||||
struct blasfeo_dvec *v;
|
||||
struct blasfeo_dvec *pi;
|
||||
struct blasfeo_dvec *lam;
|
||||
struct blasfeo_dvec *t;
|
||||
void *misc;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qcqp_sol_memsize(struct d_dense_qcqp_dim *dim);
|
||||
//
|
||||
void d_dense_qcqp_sol_create(struct d_dense_qcqp_dim *dim, struct d_dense_qcqp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void d_dense_qcqp_sol_get_v(struct d_dense_qcqp_sol *qp_sol, double *v);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QCQP_SOL_H_
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QCQP_UTILS_H_
|
||||
#define HPIPM_D_DENSE_QCQP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qcqp_dim.h"
|
||||
#include "hpipm_d_dense_qcqp.h"
|
||||
#include "hpipm_d_dense_qcqp_sol.h"
|
||||
//#include "hpipm_d_dense_qcqp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_dense_qcqp_dim_print(struct d_dense_qcqp_dim *qp_dim);
|
||||
//
|
||||
//void d_dense_qcqp_dim_codegen(char *file_name, char *mode, struct d_dense_qcqp_dim *qp_dim);
|
||||
//
|
||||
void d_dense_qcqp_print(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp *qp);
|
||||
//
|
||||
//void d_dense_qcqp_codegen(char *file_name, char *mode, struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp *qp);
|
||||
//
|
||||
void d_dense_qcqp_sol_print(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_sol *dense_qcqp_sol);
|
||||
//
|
||||
//void d_dense_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qcqp_res_print(struct d_dense_qcqp_dim *qp_dim, struct d_dense_qcqp_res *dense_qcqp_res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QCQP_UTILS_H_
|
||||
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QP_H_
|
||||
#define HPIPM_D_DENSE_QP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qp
|
||||
{
|
||||
struct d_dense_qp_dim *dim;
|
||||
struct blasfeo_dmat *Hv; // hessian of cost & vector work space
|
||||
struct blasfeo_dmat *A; // equality constraint matrix
|
||||
struct blasfeo_dmat *Ct; // inequality constraints matrix
|
||||
struct blasfeo_dvec *gz; // gradient of cost & gradient of slacks
|
||||
struct blasfeo_dvec *b; // equality constraint vector
|
||||
struct blasfeo_dvec *d; // inequality constraints vector
|
||||
struct blasfeo_dvec *d_mask; // inequality constraints mask vector
|
||||
struct blasfeo_dvec *m; // rhs of complementarity condition
|
||||
struct blasfeo_dvec *Z; // (diagonal) hessian of slacks
|
||||
int *idxb; // indices of box constrained variables within [u; x]
|
||||
int *idxs_rev; // index of soft constraints (reverse storage)
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qp_memsize(struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_create(struct d_dense_qp_dim *dim, struct d_dense_qp *qp, void *memory);
|
||||
|
||||
// setters - colmaj
|
||||
//
|
||||
void d_dense_qp_set_all(double *H, double *g, double *A, double *b, int *idxb, double *d_lb, double *d_ub, double *C, double *d_lg, double *d_ug, double *Zl, double *Zu, double *zl, double *zu, int *idxs, double *d_ls, double *d_us, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_get_all(struct d_dense_qp *qp, double *H, double *g, double *A, double *b, int *idxb, double *d_lb, double *d_ub, double *C, double *d_lg, double *d_ug, double *Zl, double *Zu, double *zl, double *zu, int *idxs, double *d_ls, double *d_us);
|
||||
//
|
||||
void d_dense_qp_set(char *field, void *value, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_H(double *H, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_g(double *g, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_A(double *A, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_b(double *b, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_idxb(int *idxb, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_Jb(double *Jb, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_lb(double *lb, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_lb_mask(double *lb, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_ub(double *ub, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_ub_mask(double *ub, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_C(double *C, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_lg(double *lg, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_lg_mask(double *lg, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_ug(double *ug, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_ug_mask(double *ug, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_idxs(int *idxs, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_idxs_rev(int *idxs_rev, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_Jsb(double *Jsb, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_Jsg(double *Jsg, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_Zl(double *Zl, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_Zu(double *Zu, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_zl(double *zl, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_zu(double *zu, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_ls(double *ls, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_ls_mask(double *ls, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_us(double *us, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_set_us_mask(double *us, struct d_dense_qp *qp);
|
||||
|
||||
// getters - colmaj
|
||||
//
|
||||
void d_dense_qp_get_H(struct d_dense_qp *qp, double *H);
|
||||
//
|
||||
void d_dense_qp_get_g(struct d_dense_qp *qp, double *g);
|
||||
//
|
||||
void d_dense_qp_get_A(struct d_dense_qp *qp, double *A);
|
||||
//
|
||||
void d_dense_qp_get_b(struct d_dense_qp *qp, double *b);
|
||||
//
|
||||
void d_dense_qp_get_idxb(struct d_dense_qp *qp, int *idxb);
|
||||
//
|
||||
void d_dense_qp_get_lb(struct d_dense_qp *qp, double *lb);
|
||||
//
|
||||
void d_dense_qp_get_lb_mask(struct d_dense_qp *qp, double *lb);
|
||||
//
|
||||
void d_dense_qp_get_ub(struct d_dense_qp *qp, double *ub);
|
||||
//
|
||||
void d_dense_qp_get_ub_mask(struct d_dense_qp *qp, double *ub);
|
||||
//
|
||||
void d_dense_qp_get_C(struct d_dense_qp *qp, double *C);
|
||||
//
|
||||
void d_dense_qp_get_lg(struct d_dense_qp *qp, double *lg);
|
||||
//
|
||||
void d_dense_qp_get_lg_mask(struct d_dense_qp *qp, double *lg);
|
||||
//
|
||||
void d_dense_qp_get_ug(struct d_dense_qp *qp, double *ug);
|
||||
//
|
||||
void d_dense_qp_get_ug_mask(struct d_dense_qp *qp, double *ug);
|
||||
//
|
||||
void d_dense_qp_get_idxs(struct d_dense_qp *qp, int *idxs);
|
||||
//
|
||||
void d_dense_qp_get_idxs_rev(struct d_dense_qp *qp, int *idxs_rev);
|
||||
//
|
||||
void d_dense_qp_get_Zl(struct d_dense_qp *qp, double *Zl);
|
||||
//
|
||||
void d_dense_qp_get_Zu(struct d_dense_qp *qp, double *Zu);
|
||||
//
|
||||
void d_dense_qp_get_zl(struct d_dense_qp *qp, double *zl);
|
||||
//
|
||||
void d_dense_qp_get_zu(struct d_dense_qp *qp, double *zu);
|
||||
//
|
||||
void d_dense_qp_get_ls(struct d_dense_qp *qp, double *ls);
|
||||
//
|
||||
void d_dense_qp_get_ls_mask(struct d_dense_qp *qp, double *ls);
|
||||
//
|
||||
void d_dense_qp_get_us(struct d_dense_qp *qp, double *us);
|
||||
//
|
||||
void d_dense_qp_get_us_mask(struct d_dense_qp *qp, double *us);
|
||||
|
||||
// setters - rowmaj
|
||||
//
|
||||
void d_dense_qp_set_all_rowmaj(double *H, double *g, double *A, double *b, int *idxb, double *d_lb, double *d_ub, double *C, double *d_lg, double *d_ug, double *Zl, double *Zu, double *zl, double *zu, int *idxs, double *d_ls, double *d_us, struct d_dense_qp *qp);
|
||||
|
||||
// getters - rowmaj
|
||||
//
|
||||
void d_dense_qp_get_all_rowmaj(struct d_dense_qp *qp, double *H, double *g, double *A, double *b, int *idxb, double *d_lb, double *d_ub, double *C, double *d_lg, double *d_ug, double *Zl, double *Zu, double *zl, double *zu, int *idxs, double *d_ls, double *d_us);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QP_H_
|
||||
@@ -1,92 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QP_DIM_H_
|
||||
#define HPIPM_D_DENSE_QP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qp_dim
|
||||
{
|
||||
int nv; // number of variables
|
||||
int ne; // number of equality constraints
|
||||
int nb; // number of box constraints
|
||||
int ng; // number of general constraints
|
||||
int nsb; // number of softened box constraints
|
||||
int nsg; // number of softened general constraints
|
||||
int ns; // number of softened constraints (nsb+nsg)
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qp_dim_memsize();
|
||||
//
|
||||
void d_dense_qp_dim_create(struct d_dense_qp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void d_dense_qp_dim_set_all(int nv, int ne, int nb, int ng, int nsb, int nsg, struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_dim_set(char *field_name, int value, struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_dim_set_nv(int value, struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_dim_set_ne(int value, struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_dim_set_nb(int value, struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_dim_set_ng(int value, struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_dim_set_nsb(int value, struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_dim_set_nsg(int value, struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_dim_set_ns(int value, struct d_dense_qp_dim *dim);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QP_DIM_H_
|
||||
@@ -1,260 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QP_IPM_H_
|
||||
#define HPIPM_D_DENSE_QP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_dense_qp_dim.h>
|
||||
#include <hpipm_d_dense_qp.h>
|
||||
#include <hpipm_d_dense_qp_res.h>
|
||||
#include <hpipm_d_dense_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qp_ipm_arg
|
||||
{
|
||||
double mu0; // initial value for duality measure
|
||||
double alpha_min; // exit cond on step length
|
||||
double res_g_max; // exit cond on inf norm of residuals
|
||||
double res_b_max; // exit cond on inf norm of residuals
|
||||
double res_d_max; // exit cond on inf norm of residuals
|
||||
double res_m_max; // exit cond on inf norm of residuals
|
||||
double reg_prim; // reg of primal hessian
|
||||
double reg_dual; // reg of dual hessian
|
||||
double lam_min; // min value in lam vector
|
||||
double t_min; // min value in t vector
|
||||
double tau_min; // min value of barrier parameter
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int scale; // scale hessian
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1)
|
||||
int comp_res_pred; // compute residuals of prediction
|
||||
int kkt_fact_alg; // 0 null-space, 1 schur-complement
|
||||
int remove_lin_dep_eq; // 0 do not, 1 do check and remove linearly dependent equality constraints
|
||||
int compute_obj; // compute obj on exit
|
||||
int split_step; // use different steps for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_dense_qp_ipm_ws
|
||||
{
|
||||
struct d_core_qp_ipm_workspace *core_workspace;
|
||||
struct d_dense_qp_res_ws *res_ws;
|
||||
struct d_dense_qp_sol *sol_step;
|
||||
struct d_dense_qp_sol *sol_itref;
|
||||
struct d_dense_qp *qp_step;
|
||||
struct d_dense_qp *qp_itref;
|
||||
struct d_dense_qp_res *res;
|
||||
struct d_dense_qp_res *res_itref;
|
||||
struct d_dense_qp_res *res_step;
|
||||
struct blasfeo_dvec *Gamma; //
|
||||
struct blasfeo_dvec *gamma; //
|
||||
struct blasfeo_dvec *Zs_inv; //
|
||||
struct blasfeo_dmat *Lv; //
|
||||
struct blasfeo_dmat *AL; //
|
||||
struct blasfeo_dmat *Le; //
|
||||
struct blasfeo_dmat *Ctx; //
|
||||
struct blasfeo_dvec *lv; //
|
||||
struct blasfeo_dvec *sv; // scale for Lv
|
||||
struct blasfeo_dvec *se; // scale for Le
|
||||
struct blasfeo_dvec *tmp_nbg; // work space of size nb+ng
|
||||
struct blasfeo_dvec *tmp_ns; // work space of size ns
|
||||
struct blasfeo_dmat *lq0;
|
||||
struct blasfeo_dmat *lq1;
|
||||
struct blasfeo_dvec *tmp_m;
|
||||
struct blasfeo_dmat *A_LQ;
|
||||
struct blasfeo_dmat *A_Q;
|
||||
struct blasfeo_dmat *Zt;
|
||||
struct blasfeo_dmat *ZtH;
|
||||
struct blasfeo_dmat *ZtHZ;
|
||||
struct blasfeo_dvec *xy;
|
||||
struct blasfeo_dvec *Yxy;
|
||||
struct blasfeo_dvec *xz;
|
||||
struct blasfeo_dvec *tmp_nv;
|
||||
struct blasfeo_dvec *tmp_2ns;
|
||||
struct blasfeo_dvec *tmp_nv2ns;
|
||||
struct blasfeo_dmat *A_li; // A of linearly independent equality constraints
|
||||
struct blasfeo_dvec *b_li; // b of linearly independent equality constraints
|
||||
struct blasfeo_dmat *A_bkp; // pointer to backup A
|
||||
struct blasfeo_dvec *b_bkp; // pointer to backup b
|
||||
struct blasfeo_dmat *Ab_LU;
|
||||
double *stat; // convergence statistics
|
||||
int *ipiv_v;
|
||||
int *ipiv_e;
|
||||
int *ipiv_e1;
|
||||
void *lq_work0;
|
||||
void *lq_work1;
|
||||
void *lq_work_null;
|
||||
void *orglq_work_null;
|
||||
int iter; // iteration number
|
||||
int stat_max; // iterations saved in stat
|
||||
int stat_m; // numer of recorded stat per ipm iter
|
||||
int scale;
|
||||
int use_hess_fact;
|
||||
int use_A_fact;
|
||||
int status;
|
||||
int lq_fact; // cache from arg
|
||||
int mask_constr; // use constr mask
|
||||
int ne_li; // number of linearly independent equality constraints
|
||||
int ne_bkp; // ne backup
|
||||
hpipm_size_t memsize; // memory size (in bytes) of workspace
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qp_ipm_arg_memsize(struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_create(struct d_dense_qp_dim *dim, struct d_dense_qp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_default(enum hpipm_mode mode, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set(char *field, void *value, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_iter_max(int *iter_max, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_alpha_min(double *alpha_min, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_mu0(double *mu0, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_tol_stat(double *tol_stat, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_tol_eq(double *tol_eq, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_tol_ineq(double *tol_ineq, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_tol_comp(double *tol_comp, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_reg_prim(double *reg, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_reg_dual(double *reg, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_warm_start(int *warm_start, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_pred_corr(int *pred_corr, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_cond_pred_corr(int *cond_pred_corr, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_comp_res_pred(int *comp_res_pred, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_comp_res_exit(int *comp_res_exit, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_lam_min(double *value, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_t_min(double *value, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_tau_min(double *value, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_kkt_fact_alg(int *value, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_remove_lin_dep_eq(int *value, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_compute_obj(int *value, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_t_lam_min(int *value, struct d_dense_qp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
void d_dense_qp_ipm_arg_set_split_step(int *value, struct d_dense_qp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qp_ipm_ws_memsize(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_ipm_ws_create(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void d_dense_qp_ipm_get(char *field, struct d_dense_qp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void d_dense_qp_ipm_get_status(struct d_dense_qp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void d_dense_qp_ipm_get_iter(struct d_dense_qp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void d_dense_qp_ipm_get_max_res_stat(struct d_dense_qp_ipm_ws *ws, double *res_stat);
|
||||
//
|
||||
void d_dense_qp_ipm_get_max_res_eq(struct d_dense_qp_ipm_ws *ws, double *res_eq);
|
||||
//
|
||||
void d_dense_qp_ipm_get_max_res_ineq(struct d_dense_qp_ipm_ws *ws, double *res_ineq);
|
||||
//
|
||||
void d_dense_qp_ipm_get_max_res_comp(struct d_dense_qp_ipm_ws *ws, double *res_comp);
|
||||
//
|
||||
void d_dense_qp_ipm_get_stat(struct d_dense_qp_ipm_ws *ws, double **stat);
|
||||
//
|
||||
void d_dense_qp_ipm_get_stat_m(struct d_dense_qp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void d_dense_qp_init_var(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_ipm_abs_step(int kk, struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_ipm_delta_step(int kk, struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_ipm_solve(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_ipm_predict(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_ipm_sens(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_compute_step_length(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QP_IPM_H_
|
||||
@@ -1,72 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QP_KKT_H_
|
||||
#define HPIPM_D_DENSE_QP_KKT_H_
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_fact_solve_kkt_unconstr_dense_qp(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_fact_solve_kkt_step_dense_qp(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_fact_lq_solve_kkt_step_dense_qp(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_solve_kkt_step_dense_qp(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_remove_lin_dep_eq(struct d_dense_qp *qp, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_restore_lin_dep_eq(struct d_dense_qp *qp, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_dense_qp_compute_obj(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_ipm_arg *arg, struct d_dense_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QP_KKT_H_
|
||||
@@ -1,105 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QP_RES_H_
|
||||
#define HPIPM_D_DENSE_QP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_d_dense_qp_dim.h>
|
||||
#include <hpipm_d_dense_qp.h>
|
||||
#include <hpipm_d_dense_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qp_res
|
||||
{
|
||||
struct d_dense_qp_dim *dim;
|
||||
struct blasfeo_dvec *res_g; // q-residuals
|
||||
struct blasfeo_dvec *res_b; // b-residuals
|
||||
struct blasfeo_dvec *res_d; // d-residuals
|
||||
struct blasfeo_dvec *res_m; // m-residuals
|
||||
double res_max[4]; // max of residuals
|
||||
double res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_dense_qp_res_ws
|
||||
{
|
||||
struct blasfeo_dvec *tmp_nbg; // work space of size nbM+ngM
|
||||
struct blasfeo_dvec *tmp_ns; // work space of size nsM
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qp_res_memsize(struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_res_create(struct d_dense_qp_dim *dim, struct d_dense_qp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t d_dense_qp_res_ws_memsize(struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_res_ws_create(struct d_dense_qp_dim *dim, struct d_dense_qp_res_ws *workspace, void *mem);
|
||||
//
|
||||
void d_dense_qp_res_compute(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_res *res, struct d_dense_qp_res_ws *ws);
|
||||
//
|
||||
void d_dense_qp_res_compute_lin(struct d_dense_qp *qp, struct d_dense_qp_sol *qp_sol, struct d_dense_qp_sol *qp_step, struct d_dense_qp_res *res, struct d_dense_qp_res_ws *ws);
|
||||
//
|
||||
void d_dense_qp_res_compute_inf_norm(struct d_dense_qp_res *res);
|
||||
//
|
||||
void d_dense_qp_res_get_all(struct d_dense_qp_res *res, double *res_g, double *res_ls, double *res_us, double *res_b, double *res_d_lb, double *res_d_ub, double *res_d_lg, double *res_d_ug, double *res_d_ls, double *res_d_us, double *res_m_lb, double *res_m_ub, double *res_m_lg, double *res_m_ug, double *res_m_ls, double *res_m_us);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QP_RES_H_
|
||||
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QP_SOL_H_
|
||||
#define HPIPM_D_DENSE_QP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_dense_qp_sol
|
||||
{
|
||||
struct d_dense_qp_dim *dim;
|
||||
struct blasfeo_dvec *v;
|
||||
struct blasfeo_dvec *pi;
|
||||
struct blasfeo_dvec *lam;
|
||||
struct blasfeo_dvec *t;
|
||||
void *misc;
|
||||
double obj;
|
||||
int valid_obj;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_dense_qp_sol_memsize(struct d_dense_qp_dim *dim);
|
||||
//
|
||||
void d_dense_qp_sol_create(struct d_dense_qp_dim *dim, struct d_dense_qp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void d_dense_qp_sol_get_all(struct d_dense_qp_sol *qp_sol, double *v, double *ls, double *us, double *pi, double *lam_lb, double *lam_ub, double *lam_lg, double *lam_ug, double *lam_ls, double *lam_us);
|
||||
//
|
||||
void d_dense_qp_sol_get(char *field, struct d_dense_qp_sol *sol, void *value);
|
||||
//
|
||||
void d_dense_qp_sol_get_v(struct d_dense_qp_sol *sol, double *v);
|
||||
//
|
||||
void d_dense_qp_sol_get_valid_obj(struct d_dense_qp_sol *sol, int *valid_obj);
|
||||
//
|
||||
void d_dense_qp_sol_get_obj(struct d_dense_qp_sol *sol, double *obj);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QP_SOL_H_
|
||||
@@ -1,83 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_DENSE_QP_UTILS_H_
|
||||
#define HPIPM_D_DENSE_QP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qp_dim.h"
|
||||
#include "hpipm_d_dense_qp.h"
|
||||
#include "hpipm_d_dense_qp_sol.h"
|
||||
#include "hpipm_d_dense_qp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_dense_qp_dim_print(struct d_dense_qp_dim *qp_dim);
|
||||
//
|
||||
//void d_dense_qp_dim_codegen(char *file_name, char *mode, struct d_dense_qp_dim *qp_dim);
|
||||
//
|
||||
void d_dense_qp_print(struct d_dense_qp_dim *qp_dim, struct d_dense_qp *qp);
|
||||
//
|
||||
//void d_dense_qp_codegen(char *file_name, char *mode, struct d_dense_qp_dim *qp_dim, struct d_dense_qp *qp);
|
||||
//
|
||||
void d_dense_qp_sol_print(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_sol *dense_qp_sol);
|
||||
//
|
||||
//void d_dense_qp_ipm_arg_codegen(char *file_name, char *mode, struct d_dense_qp_dim *qp_dim, struct d_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_dense_qp_res_print(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_res *dense_qp_res);
|
||||
//
|
||||
void d_dense_qp_arg_print(struct d_dense_qp_dim *qp_dim, struct d_dense_qp_ipm_arg *qp_ipm_arg);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QP_UTILS_H_
|
||||
|
||||
@@ -1,303 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QCQP_H_
|
||||
#define HPIPM_D_OCP_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_ocp_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qcqp
|
||||
{
|
||||
struct d_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_dmat *BAbt; // dynamics matrix & vector work space
|
||||
struct blasfeo_dmat *RSQrq; // hessian of cost & vector work space
|
||||
struct blasfeo_dmat *DCt; // inequality constraints matrix
|
||||
struct blasfeo_dmat **Hq; // hessians of quadratic constraints
|
||||
struct blasfeo_dvec *b; // dynamics vector
|
||||
struct blasfeo_dvec *rqz; // gradient of cost & gradient of slacks
|
||||
struct blasfeo_dvec *d; // inequality constraints vector
|
||||
struct blasfeo_dvec *d_mask; // inequality constraints mask vector
|
||||
struct blasfeo_dvec *m; // rhs of complementarity condition
|
||||
struct blasfeo_dvec *Z; // (diagonal) hessian of slacks
|
||||
int **idxb; // indices of box constrained variables within [u; x]
|
||||
int **idxs_rev; // index of soft constraints (reverse storage)
|
||||
int **Hq_nzero; // for each int, the last 3 bits ...abc, {a,b,c}=0 => {R,S,Q}=0
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_memsize(struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_create(struct d_ocp_qcqp_dim *dim, struct d_ocp_qcqp *qp, void *memory);
|
||||
//
|
||||
void d_ocp_qcqp_copy_all(struct d_ocp_qcqp *qp_orig, struct d_ocp_qcqp *qp_dest);
|
||||
|
||||
// setters
|
||||
//
|
||||
void d_ocp_qcqp_set_all_zero(struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_rhs_zero(struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set(char *field_name, int stage, void *value, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_el(char *field_name, int stage, int index, void *value, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_A(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_B(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_b(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Q(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_S(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_R(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_q(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_r(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lb(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lb_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_ub(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_ub_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lbx(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lbx_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_el_lbx(int stage, int index, double *elem, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_ubx(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_ubx_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_el_ubx(int stage, int index, double *elem, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lbu(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lbu_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_ubu(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_ubu_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_idxb(int stage, int *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_idxbx(int stage, int *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Jbx(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_idxbu(int stage, int *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Jbu(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_C(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_D(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lg(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lg_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_ug(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_ug_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Qq(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Sq(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Rq(int stage, double *mat, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_qq(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_rq(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_uq(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_uq_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Zl(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Zu(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_zl(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_zu(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lls(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lls_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lus(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_lus_mask(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_idxs(int stage, int *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_idxs_rev(int stage, int *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Jsbu(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Jsbx(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Jsg(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_set_Jsq(int stage, double *vec, struct d_ocp_qcqp *qp);
|
||||
|
||||
// getters
|
||||
//
|
||||
void d_ocp_qcqp_get(char *field, int stage, struct d_ocp_qcqp *qp, void *value);
|
||||
//
|
||||
void d_ocp_qcqp_get_A(int stage, struct d_ocp_qcqp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qcqp_get_B(int stage, struct d_ocp_qcqp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qcqp_get_b(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_Q(int stage, struct d_ocp_qcqp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qcqp_get_S(int stage, struct d_ocp_qcqp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qcqp_get_R(int stage, struct d_ocp_qcqp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qcqp_get_q(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_r(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_ub(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_ub_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lb(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lb_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lbx(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lbx_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_ubx(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_ubx_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lbu(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lbu_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_ubu(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_ubu_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_idxb(int stage, struct d_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
//void d_ocp_qcqp_get_idxbx(int stage, struct d_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
//void d_ocp_qcqp_get_Jbx(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
//void d_ocp_qcqp_get_idxbu(int stage, struct d_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
//void d_ocp_qcqp_get_Jbu(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_C(int stage, struct d_ocp_qcqp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qcqp_get_D(int stage, struct d_ocp_qcqp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qcqp_get_lg(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lg_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_ug(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_ug_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_Zl(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_Zu(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_zl(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_zu(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lls(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lls_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lus(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_lus_mask(int stage, struct d_ocp_qcqp *qp, double *vec);
|
||||
// XXX only valid if there is one slack per softed constraint !!!
|
||||
void d_ocp_qcqp_get_idxs(int stage, struct d_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
void d_ocp_qcqp_get_idxs_rev(int stage, struct d_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
//void d_ocp_qcqp_get_Jsbu(int stage, struct d_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
//void d_ocp_qcqp_get_Jsbx(int stage, struct d_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
//void d_ocp_qcqp_get_Jsg(int stage, struct d_ocp_qcqp *qp, float *vec);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QCQP_H_
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QCQP_DIM_H_
|
||||
#define HPIPM_D_OCP_QCQP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qcqp_dim
|
||||
{
|
||||
struct d_ocp_qp_dim *qp_dim; // dim of qp approximation
|
||||
int *nx; // number of states
|
||||
int *nu; // number of inputs
|
||||
int *nb; // number of box constraints
|
||||
int *nbx; // number of (two-sided) state box constraints
|
||||
int *nbu; // number of (two-sided) input box constraints
|
||||
int *ng; // number of (two-sided) general constraints
|
||||
int *nq; // number of (upper) quadratic constraints
|
||||
int *ns; // number of soft constraints
|
||||
int *nsbx; // number of (two-sided) soft state box constraints
|
||||
int *nsbu; // number of (two-sided) soft input box constraints
|
||||
int *nsg; // number of (two-sided) soft general constraints
|
||||
int *nsq; // number of (upper) soft quadratic constraints
|
||||
int N; // horizon length
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_dim_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_dim_memsize(int N);
|
||||
//
|
||||
void d_ocp_qcqp_dim_create(int N, struct d_ocp_qcqp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void d_ocp_qcqp_dim_copy_all(struct d_ocp_qcqp_dim *dim_orig, struct d_ocp_qcqp_dim *dim_dest);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set(char *field, int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nx(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nu(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nbx(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nbu(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_ng(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nq(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_ns(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nsbx(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nsbu(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nsg(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_set_nsq(int stage, int value, struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_get(struct d_ocp_qcqp_dim *dim, char *field, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qcqp_dim_get_N(struct d_ocp_qcqp_dim *dim, int *value);
|
||||
//
|
||||
void d_ocp_qcqp_dim_get_nx(struct d_ocp_qcqp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qcqp_dim_get_nu(struct d_ocp_qcqp_dim *dim, int stage, int *value);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QCQP_DIM_H_
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QCQP_IPM_H_
|
||||
#define HPIPM_D_OCP_QCQP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_ocp_qcqp_dim.h>
|
||||
#include <hpipm_d_ocp_qp.h>
|
||||
#include <hpipm_d_ocp_qcqp_res.h>
|
||||
#include <hpipm_d_ocp_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qcqp_ipm_arg
|
||||
{
|
||||
struct d_ocp_qp_ipm_arg *qp_arg;
|
||||
double mu0; // initial value for complementarity slackness
|
||||
double alpha_min; // exit cond on step length
|
||||
double res_g_max; // exit cond on inf norm of residuals
|
||||
double res_b_max; // exit cond on inf norm of residuals
|
||||
double res_d_max; // exit cond on inf norm of residuals
|
||||
double res_m_max; // exit cond on inf norm of residuals
|
||||
double reg_prim; // reg of primal hessian
|
||||
double lam_min; // min value in lam vector
|
||||
double t_min; // min value in t vector
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int square_root_alg; // 0 classical Riccati, 1 square-root Riccati
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1)
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_dual_sol_eq; // dual solution of equality constrains (only for abs_form==1)
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1)
|
||||
int comp_res_pred; // compute residuals of prediction
|
||||
int split_step; // use different step for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qcqp_ipm_ws
|
||||
{
|
||||
struct d_ocp_qp_ipm_ws *qp_ws;
|
||||
struct d_ocp_qp *qp;
|
||||
struct d_ocp_qp_sol *qp_sol;
|
||||
struct d_ocp_qcqp_res_ws *qcqp_res_ws;
|
||||
struct d_ocp_qcqp_res *qcqp_res;
|
||||
struct blasfeo_dvec *tmp_nuxM;
|
||||
int iter; // iteration number
|
||||
int status;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_ipm_arg_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_ipm_arg_memsize(struct d_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_arg_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_arg_set(char *field, void *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set maximum number of iterations
|
||||
void d_ocp_qcqp_ipm_arg_set_iter_max(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set minimum step lenght
|
||||
void d_ocp_qcqp_ipm_arg_set_alpha_min(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set initial value of barrier parameter
|
||||
void d_ocp_qcqp_ipm_arg_set_mu0(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on stationarity condition
|
||||
void d_ocp_qcqp_ipm_arg_set_tol_stat(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on equality constr
|
||||
void d_ocp_qcqp_ipm_arg_set_tol_eq(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on inequality constr
|
||||
void d_ocp_qcqp_ipm_arg_set_tol_ineq(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on complementarity condition
|
||||
void d_ocp_qcqp_ipm_arg_set_tol_comp(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set regularization of primal variables
|
||||
void d_ocp_qcqp_ipm_arg_set_reg_prim(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set warm start: 0 no warm start, 1 primal var
|
||||
void d_ocp_qcqp_ipm_arg_set_warm_start(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector
|
||||
void d_ocp_qcqp_ipm_arg_set_pred_corr(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector
|
||||
void d_ocp_qcqp_ipm_arg_set_cond_pred_corr(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// set riccati algorithm: 0 classic, 1 square-root
|
||||
void d_ocp_qcqp_ipm_arg_set_ric_alg(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// compute residuals after solution
|
||||
void d_ocp_qcqp_ipm_arg_set_comp_res_exit(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// compute residuals of prediction
|
||||
void d_ocp_qcqp_ipm_arg_set_comp_res_pred(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// min value of lam in the solution
|
||||
void d_ocp_qcqp_ipm_arg_set_lam_min(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// min value of t in the solution
|
||||
void d_ocp_qcqp_ipm_arg_set_t_min(double *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// use different step for primal and dual variables
|
||||
void d_ocp_qcqp_ipm_arg_set_split_step(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
void d_ocp_qcqp_ipm_arg_set_t_lam_min(int *value, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_ipm_ws_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_ipm_ws_memsize(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_ws_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_ipm_arg *arg, struct d_ocp_qcqp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get(char *field, struct d_ocp_qcqp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get_status(struct d_ocp_qcqp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get_iter(struct d_ocp_qcqp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get_max_res_stat(struct d_ocp_qcqp_ipm_ws *ws, double *res_stat);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get_max_res_eq(struct d_ocp_qcqp_ipm_ws *ws, double *res_eq);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get_max_res_ineq(struct d_ocp_qcqp_ipm_ws *ws, double *res_ineq);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get_max_res_comp(struct d_ocp_qcqp_ipm_ws *ws, double *res_comp);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get_stat(struct d_ocp_qcqp_ipm_ws *ws, double **stat);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_get_stat_m(struct d_ocp_qcqp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void d_ocp_qcqp_init_var(struct d_ocp_qcqp *qp, struct d_ocp_qcqp_sol *qp_sol, struct d_ocp_qcqp_ipm_arg *arg, struct d_ocp_qcqp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_solve(struct d_ocp_qcqp *qp, struct d_ocp_qcqp_sol *qp_sol, struct d_ocp_qcqp_ipm_arg *arg, struct d_ocp_qcqp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QCQP_IPM_H_
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QCQP_RES_H_
|
||||
#define HPIPM_D_OCP_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_ocp_qcqp_dim.h>
|
||||
#include <hpipm_d_ocp_qcqp.h>
|
||||
#include <hpipm_d_ocp_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qcqp_res
|
||||
{
|
||||
struct d_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_dvec *res_g; // q-residuals
|
||||
struct blasfeo_dvec *res_b; // b-residuals
|
||||
struct blasfeo_dvec *res_d; // d-residuals
|
||||
struct blasfeo_dvec *res_m; // m-residuals
|
||||
double res_max[4]; // max of residuals
|
||||
double res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qcqp_res_ws
|
||||
{
|
||||
struct blasfeo_dvec *tmp_nuxM; // work space of size nuM+nxM
|
||||
struct blasfeo_dvec *tmp_nbgqM; // work space of size nbM+ngM+nqM
|
||||
struct blasfeo_dvec *tmp_nsM; // work space of size nsM
|
||||
struct blasfeo_dvec *q_fun; // value for evaluation of quadr constr
|
||||
struct blasfeo_dvec *q_adj; // value for adjoint of quadr constr
|
||||
int use_q_fun; // reuse cached value for evaluation of quadr constr
|
||||
int use_q_adj; // reuse cached value for adjoint of quadr constr
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_res_memsize(struct d_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void d_ocp_qcqp_res_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_res_ws_memsize(struct d_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void d_ocp_qcqp_res_ws_create(struct d_ocp_qcqp_dim *ocp_dim, struct d_ocp_qcqp_res_ws *workspace, void *mem);
|
||||
//
|
||||
void d_ocp_qcqp_res_compute(struct d_ocp_qcqp *qp, struct d_ocp_qcqp_sol *qp_sol, struct d_ocp_qcqp_res *res, struct d_ocp_qcqp_res_ws *ws);
|
||||
//
|
||||
void d_ocp_qcqp_res_compute_inf_norm(struct d_ocp_qcqp_res *res);
|
||||
//
|
||||
void d_ocp_qcqp_res_get_max_res_stat(struct d_ocp_qcqp_res *res, double *value);
|
||||
//
|
||||
void d_ocp_qcqp_res_get_max_res_eq(struct d_ocp_qcqp_res *res, double *value);
|
||||
//
|
||||
void d_ocp_qcqp_res_get_max_res_ineq(struct d_ocp_qcqp_res *res, double *value);
|
||||
//
|
||||
void d_ocp_qcqp_res_get_max_res_comp(struct d_ocp_qcqp_res *res, double *value);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QCQP_RES_H_
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QCQP_SOL_H_
|
||||
#define HPIPM_D_OCP_QCQP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_ocp_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qcqp_sol
|
||||
{
|
||||
struct d_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_dvec *ux;
|
||||
struct blasfeo_dvec *pi;
|
||||
struct blasfeo_dvec *lam;
|
||||
struct blasfeo_dvec *t;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_sol_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qcqp_sol_memsize(struct d_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_ocp_qcqp_sol_create(struct d_ocp_qcqp_dim *dim, struct d_ocp_qcqp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void d_ocp_qcqp_sol_copy_all(struct d_ocp_qcqp_sol *qp_sol_orig, struct d_ocp_qcqp_sol *qp_sol_dest);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get(char *field, int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_u(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_x(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_sl(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_su(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_pi(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_lam_lb(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_lam_ub(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_lam_lg(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_get_lam_ug(int stage, struct d_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qcqp_sol_set(char *field, int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qcqp_sol_set_u(int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qcqp_sol_set_x(int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qcqp_sol_set_sl(int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qcqp_sol_set_su(int stage, double *vec, struct d_ocp_qcqp_sol *qp_sol);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QCQP_SOL_H_
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QCQP_UTILS_H_
|
||||
#define HPIPM_D_OCP_QCQP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_ocp_qcqp_dim.h"
|
||||
#include "hpipm_d_ocp_qp.h"
|
||||
#include "hpipm_d_ocp_qcqp_sol.h"
|
||||
#include "hpipm_d_ocp_qcqp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_ocp_qcqp_dim_print(struct d_ocp_qcqp_dim *qcqp_dim);
|
||||
//
|
||||
void d_ocp_qcqp_dim_codegen(char *file_name, char *mode, struct d_ocp_qcqp_dim *qcqp_dim);
|
||||
//
|
||||
void d_ocp_qcqp_print(struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_codegen(char *file_name, char *mode, struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp *qp);
|
||||
//
|
||||
void d_ocp_qcqp_sol_print(struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp_sol *ocp_qcqp_sol);
|
||||
//
|
||||
void d_ocp_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_ocp_qcqp_res_print(struct d_ocp_qcqp_dim *qcqp_dim, struct d_ocp_qcqp_res *ocp_qcqp_res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QCQP_UTILS_H_
|
||||
|
||||
@@ -1,306 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QP_H_
|
||||
#define HPIPM_D_OCP_QP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_ocp_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp
|
||||
{
|
||||
struct d_ocp_qp_dim *dim;
|
||||
struct blasfeo_dmat *BAbt; // dynamics matrix & vector work space
|
||||
struct blasfeo_dmat *RSQrq; // hessian of cost & vector work space
|
||||
struct blasfeo_dmat *DCt; // inequality constraints matrix
|
||||
struct blasfeo_dvec *b; // dynamics vector
|
||||
struct blasfeo_dvec *rqz; // gradient of cost & gradient of slacks
|
||||
struct blasfeo_dvec *d; // inequality constraints vector
|
||||
struct blasfeo_dvec *d_mask; // inequality constraints mask vector
|
||||
struct blasfeo_dvec *m; // rhs of complementarity condition
|
||||
struct blasfeo_dvec *Z; // (diagonal) hessian of slacks
|
||||
int **idxb; // indices of box constrained variables within [u; x]
|
||||
int **idxs_rev; // index of soft constraints (reverse storage)
|
||||
int **idxe; // indices of constraints within [bu, bx, g] that are equalities, subset of [0, ..., nbu+nbx+ng-1]
|
||||
int *diag_H_flag; // flag the fact that Hessian is diagonal
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_memsize(struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_create(struct d_ocp_qp_dim *dim, struct d_ocp_qp *qp, void *memory);
|
||||
//
|
||||
void d_ocp_qp_copy_all(struct d_ocp_qp *qp_orig, struct d_ocp_qp *qp_dest);
|
||||
|
||||
// setters
|
||||
//
|
||||
void d_ocp_qp_set_all_zero(struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_rhs_zero(struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_all(double **A, double **B, double **b, double **Q, double **S, double **R, double **q, double **r, int **idxbx, double **lbx, double **ubx, int **idxbu, double **lbu, double **ubu, double **C, double **D, double **lg, double **ug, double **Zl, double **Zu, double **zl, double **zu, int **idxs, double **ls, double **us, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_all_rowmaj(double **A, double **B, double **b, double **Q, double **S, double **R, double **q, double **r, int **idxbx, double **lbx, double **ubx, int **idxbu, double **lbu, double **ubu, double **C, double **D, double **lg, double **ug, double **Zl, double **Zu, double **zl, double **zu, int **idxs, double **ls, double **us, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set(char *field_name, int stage, void *value, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_el(char *field_name, int stage, int index, void *value, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_A(int stage, double *mat, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_B(int stage, double *mat, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_b(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Q(int stage, double *mat, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_S(int stage, double *mat, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_R(int stage, double *mat, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_q(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_r(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lb(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lb_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_ub(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_ub_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lbx(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lbx_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_el_lbx(int stage, int index, double *elem, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_ubx(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_ubx_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_el_ubx(int stage, int index, double *elem, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lbu(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lbu_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_ubu(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_ubu_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxb(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxbx(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Jbx(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxbu(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Jbu(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_C(int stage, double *mat, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_D(int stage, double *mat, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lg(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lg_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_ug(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_ug_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Zl(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Zu(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_zl(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_zu(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lls(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lls_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lus(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_lus_mask(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxs(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxs_rev(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Jsbu(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Jsbx(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Jsg(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxe(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxbxe(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxbue(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_idxge(int stage, int *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Jbxe(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Jbue(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_Jge(int stage, double *vec, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_set_diag_H_flag(int stage, int *value, struct d_ocp_qp *qp);
|
||||
|
||||
// getters
|
||||
//
|
||||
void d_ocp_qp_get(char *field, int stage, struct d_ocp_qp *qp, void *value);
|
||||
//
|
||||
void d_ocp_qp_get_A(int stage, struct d_ocp_qp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qp_get_B(int stage, struct d_ocp_qp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qp_get_b(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_Q(int stage, struct d_ocp_qp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qp_get_S(int stage, struct d_ocp_qp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qp_get_R(int stage, struct d_ocp_qp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qp_get_q(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_r(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_ub(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_ub_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lb(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lb_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lbx(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lbx_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_ubx(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_ubx_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lbu(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lbu_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_ubu(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_ubu_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_idxb(int stage, struct d_ocp_qp *qp, int *vec);
|
||||
//
|
||||
//void d_ocp_qp_get_idxbx(int stage, struct d_ocp_qp *qp, int *vec);
|
||||
//
|
||||
//void d_ocp_qp_get_Jbx(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
//void d_ocp_qp_get_idxbu(int stage, struct d_ocp_qp *qp, int *vec);
|
||||
//
|
||||
//void d_ocp_qp_get_Jbu(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_C(int stage, struct d_ocp_qp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qp_get_D(int stage, struct d_ocp_qp *qp, double *mat);
|
||||
//
|
||||
void d_ocp_qp_get_lg(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lg_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_ug(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_ug_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_Zl(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_Zu(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_zl(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_zu(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lls(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lls_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lus(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
//
|
||||
void d_ocp_qp_get_lus_mask(int stage, struct d_ocp_qp *qp, double *vec);
|
||||
// XXX only valid if there is one slack per softed constraint !!!
|
||||
void d_ocp_qp_get_idxs(int stage, struct d_ocp_qp *qp, int *vec);
|
||||
//
|
||||
void d_ocp_qp_get_idxs_rev(int stage, struct d_ocp_qp *qp, int *vec);
|
||||
//
|
||||
//void d_ocp_qp_get_Jsbu(int stage, struct d_ocp_qp *qp, float *vec);
|
||||
//
|
||||
//void d_ocp_qp_get_Jsbx(int stage, struct d_ocp_qp *qp, float *vec);
|
||||
//
|
||||
//void d_ocp_qp_get_Jsg(int stage, struct d_ocp_qp *qp, float *vec);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_H_
|
||||
@@ -1,142 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QP_DIM_H_
|
||||
#define HPIPM_D_OCP_QP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp_dim
|
||||
{
|
||||
int *nx; // number of states
|
||||
int *nu; // number of inputs
|
||||
int *nb; // number of box constraints
|
||||
int *nbx; // number of state box constraints
|
||||
int *nbu; // number of input box constraints
|
||||
int *ng; // number of general constraints
|
||||
int *ns; // number of soft constraints
|
||||
int *nsbx; // number of soft state box constraints
|
||||
int *nsbu; // number of soft input box constraints
|
||||
int *nsg; // number of soft general constraints
|
||||
int *nbxe; // number of state box constraints which are equality
|
||||
int *nbue; // number of input box constraints which are equality
|
||||
int *nge; // number of general constraints which are equality
|
||||
int N; // horizon length
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_dim_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_dim_memsize(int N);
|
||||
//
|
||||
void d_ocp_qp_dim_create(int N, struct d_ocp_qp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void d_ocp_qp_dim_copy_all(struct d_ocp_qp_dim *dim_orig, struct d_ocp_qp_dim *dim_dest);
|
||||
//
|
||||
void d_ocp_qp_dim_set_all(int *nx, int *nu, int *nbx, int *nbu, int *ng, int *nsbx, int *nsbu, int *nsg, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set(char *field, int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nx(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nu(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nbx(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nbu(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_ng(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_ns(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nsbx(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nsbu(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nsg(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nbxe(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nbue(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_set_nge(int stage, int value, struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_dim_get(struct d_ocp_qp_dim *dim, char *field, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_N(struct d_ocp_qp_dim *dim, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nx(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nu(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nbx(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nbu(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_ng(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_ns(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nsbx(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nsbu(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nsg(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nbxe(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nbue(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void d_ocp_qp_dim_get_nge(struct d_ocp_qp_dim *dim, int stage, int *value);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_DIM_H_
|
||||
@@ -1,250 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QP_IPM_H_
|
||||
#define HPIPM_D_OCP_QP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_ocp_qp_dim.h>
|
||||
#include <hpipm_d_ocp_qp.h>
|
||||
#include <hpipm_d_ocp_qp_res.h>
|
||||
#include <hpipm_d_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp_ipm_arg
|
||||
{
|
||||
double mu0; // initial value for complementarity slackness
|
||||
double alpha_min; // exit cond on step length
|
||||
double res_g_max; // exit cond on inf norm of residuals
|
||||
double res_b_max; // exit cond on inf norm of residuals
|
||||
double res_d_max; // exit cond on inf norm of residuals
|
||||
double res_m_max; // exit cond on inf norm of residuals
|
||||
double reg_prim; // reg of primal hessian
|
||||
double lam_min; // min value in lam vector
|
||||
double t_min; // min value in t vector
|
||||
double tau_min; // min value of barrier parameter
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int square_root_alg; // 0 classical Riccati, 1 square-root Riccati
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1)
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_dual_sol_eq; // dual solution of equality constraints (only for abs_form==1)
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1)
|
||||
int comp_res_pred; // compute residuals of prediction
|
||||
int split_step; // use different steps for primal and dual variables
|
||||
int var_init_scheme; // variables initialization scheme
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp_ipm_ws
|
||||
{
|
||||
double qp_res[4]; // infinity norm of residuals
|
||||
struct d_core_qp_ipm_workspace *core_workspace;
|
||||
struct d_ocp_qp_dim *dim; // cache dim
|
||||
struct d_ocp_qp_res_ws *res_workspace;
|
||||
struct d_ocp_qp_sol *sol_step;
|
||||
struct d_ocp_qp_sol *sol_itref;
|
||||
struct d_ocp_qp *qp_step;
|
||||
struct d_ocp_qp *qp_itref;
|
||||
struct d_ocp_qp_res *res_itref;
|
||||
struct d_ocp_qp_res *res;
|
||||
struct blasfeo_dvec *Gamma; // hessian update
|
||||
struct blasfeo_dvec *gamma; // hessian update
|
||||
struct blasfeo_dvec *tmp_nuxM; // work space of size nxM
|
||||
struct blasfeo_dvec *tmp_nbgM; // work space of size nbM+ngM
|
||||
struct blasfeo_dvec *tmp_nsM; // work space of size nsM
|
||||
struct blasfeo_dvec *Pb; // Pb
|
||||
struct blasfeo_dvec *Zs_inv;
|
||||
struct blasfeo_dvec *tmp_m;
|
||||
struct blasfeo_dvec *l; // cache linear part for _get_ric_xxx
|
||||
struct blasfeo_dmat *L;
|
||||
struct blasfeo_dmat *Ls;
|
||||
struct blasfeo_dmat *P;
|
||||
struct blasfeo_dmat *Lh;
|
||||
struct blasfeo_dmat *AL;
|
||||
struct blasfeo_dmat *lq0;
|
||||
struct blasfeo_dmat *tmp_nxM_nxM;
|
||||
double *stat; // convergence statistics
|
||||
int *use_hess_fact;
|
||||
void *lq_work0;
|
||||
int iter; // iteration number
|
||||
int stat_max; // iterations saved in stat
|
||||
int stat_m; // number of recorded stat per IPM iter
|
||||
int use_Pb;
|
||||
int status; // solver status
|
||||
int square_root_alg; // cache from arg
|
||||
int lq_fact; // cache from arg
|
||||
int mask_constr; // use constr mask
|
||||
int valid_ric_vec; // meaningful riccati vectors
|
||||
int valid_ric_p; // form of riccati p: 0 p*inv(L), 1 p
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_ipm_arg_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_ipm_arg_memsize(struct d_ocp_qp_dim *ocp_dim);
|
||||
//
|
||||
void d_ocp_qp_ipm_arg_create(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void d_ocp_qp_ipm_arg_set_default(enum hpipm_mode mode, struct d_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_ocp_qp_ipm_arg_set(char *field, void *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set maximum number of iterations
|
||||
void d_ocp_qp_ipm_arg_set_iter_max(int *iter_max, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set minimum step lenght
|
||||
void d_ocp_qp_ipm_arg_set_alpha_min(double *alpha_min, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set initial value of barrier parameter
|
||||
void d_ocp_qp_ipm_arg_set_mu0(double *mu0, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set exit tolerance on stationarity condition
|
||||
void d_ocp_qp_ipm_arg_set_tol_stat(double *tol_stat, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set exit tolerance on equality constr
|
||||
void d_ocp_qp_ipm_arg_set_tol_eq(double *tol_eq, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set exit tolerance on inequality constr
|
||||
void d_ocp_qp_ipm_arg_set_tol_ineq(double *tol_ineq, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set exit tolerance on complementarity condition
|
||||
void d_ocp_qp_ipm_arg_set_tol_comp(double *tol_comp, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set regularization of primal variables
|
||||
void d_ocp_qp_ipm_arg_set_reg_prim(double *tol_comp, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set warm start: 0 no warm start, 1 primal var
|
||||
void d_ocp_qp_ipm_arg_set_warm_start(int *warm_start, struct d_ocp_qp_ipm_arg *arg);
|
||||
// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector
|
||||
void d_ocp_qp_ipm_arg_set_pred_corr(int *pred_corr, struct d_ocp_qp_ipm_arg *arg);
|
||||
// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector
|
||||
void d_ocp_qp_ipm_arg_set_cond_pred_corr(int *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set riccati algorithm: 0 classic, 1 square-root
|
||||
void d_ocp_qp_ipm_arg_set_ric_alg(int *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// dual solution of equality constraints (only for abs_form==1)
|
||||
void d_ocp_qp_ipm_arg_set_comp_dual_sol_eq(int *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// compute residuals after solution
|
||||
void d_ocp_qp_ipm_arg_set_comp_res_exit(int *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// compute residuals of prediction
|
||||
void d_ocp_qp_ipm_arg_set_comp_res_pred(int *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// min value of lam in the solution
|
||||
void d_ocp_qp_ipm_arg_set_lam_min(double *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// min value of t in the solution
|
||||
void d_ocp_qp_ipm_arg_set_t_min(double *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// min value of tau in the solution
|
||||
void d_ocp_qp_ipm_arg_set_tau_min(double *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// set split step: 0 same step, 1 different step for primal and dual variables
|
||||
void d_ocp_qp_ipm_arg_set_split_step(int *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// variables initialization scheme
|
||||
void d_ocp_qp_ipm_arg_set_var_init_scheme(int *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
void d_ocp_qp_ipm_arg_set_t_lam_min(int *value, struct d_ocp_qp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_ipm_ws_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_ipm_ws_memsize(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_ocp_qp_ipm_ws_create(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void d_ocp_qp_ipm_get(char *field, struct d_ocp_qp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_status(struct d_ocp_qp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_iter(struct d_ocp_qp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_max_res_stat(struct d_ocp_qp_ipm_ws *ws, double *res_stat);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_max_res_eq(struct d_ocp_qp_ipm_ws *ws, double *res_eq);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_max_res_ineq(struct d_ocp_qp_ipm_ws *ws, double *res_ineq);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_max_res_comp(struct d_ocp_qp_ipm_ws *ws, double *res_comp);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_stat(struct d_ocp_qp_ipm_ws *ws, double **stat);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_stat_m(struct d_ocp_qp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_ric_Lr(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *Lr);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_ric_Ls(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *Ls);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_ric_P(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *P);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_ric_lr(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *lr);
|
||||
//
|
||||
void d_ocp_qp_ipm_get_ric_p(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *p);
|
||||
// feedback control gain in the form u = K x + k
|
||||
void d_ocp_qp_ipm_get_ric_K(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *K);
|
||||
// feedback control gain in the form u = K x + k
|
||||
void d_ocp_qp_ipm_get_ric_k(struct d_ocp_qp *qp, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws, int stage, double *k);
|
||||
//
|
||||
void d_ocp_qp_init_var(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_ipm_abs_step(int kk, struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_ipm_delta_step(int kk, struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_ipm_solve(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_ipm_predict(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_ipm_sens(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_IPM_H_
|
||||
@@ -1,66 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QP_KKT_H_
|
||||
#define HPIPM_D_OCP_QP_KKT_H_
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_ocp_qp.h>
|
||||
#include <hpipm_d_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
void d_ocp_qp_fact_solve_kkt_unconstr(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_fact_solve_kkt_step(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_fact_lq_solve_kkt_step(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_solve_kkt_step(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_ipm_arg *arg, struct d_ocp_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_KKT_H_
|
||||
@@ -1,117 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QP_RED_H_
|
||||
#define HPIPM_D_OCP_QP_RED_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_d_ocp_qp_dim.h>
|
||||
#include <hpipm_d_ocp_qp.h>
|
||||
#include <hpipm_d_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp_reduce_eq_dof_arg
|
||||
{
|
||||
double lam_min;
|
||||
double t_min;
|
||||
int alias_unchanged; // do not keep copy unchanged stage
|
||||
int comp_prim_sol; // primal solution (v)
|
||||
int comp_dual_sol_eq; // dual solution equality constr (pi)
|
||||
int comp_dual_sol_ineq; // dual solution inequality constr (lam t)
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp_reduce_eq_dof_ws
|
||||
{
|
||||
struct blasfeo_dvec *tmp_nuxM;
|
||||
struct blasfeo_dvec *tmp_nbgM;
|
||||
int *e_imask_ux;
|
||||
int *e_imask_d;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_ocp_qp_dim_reduce_eq_dof(struct d_ocp_qp_dim *dim, struct d_ocp_qp_dim *dim_red);
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_reduce_eq_dof_arg_memsize();
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_arg_create(struct d_ocp_qp_reduce_eq_dof_arg *arg, void *mem);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_arg_set_default(struct d_ocp_qp_reduce_eq_dof_arg *arg);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_arg_set_alias_unchanged(struct d_ocp_qp_reduce_eq_dof_arg *arg, int value);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_arg_set_comp_prim_sol(struct d_ocp_qp_reduce_eq_dof_arg *arg, int value);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_arg_set_comp_dual_sol_eq(struct d_ocp_qp_reduce_eq_dof_arg *arg, int value);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_arg_set_comp_dual_sol_ineq(struct d_ocp_qp_reduce_eq_dof_arg *arg, int value);
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_reduce_eq_dof_ws_memsize(struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_ws_create(struct d_ocp_qp_dim *dim, struct d_ocp_qp_reduce_eq_dof_ws *work, void *mem);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof(struct d_ocp_qp *qp, struct d_ocp_qp *qp_red, struct d_ocp_qp_reduce_eq_dof_arg *arg, struct d_ocp_qp_reduce_eq_dof_ws *work);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_lhs(struct d_ocp_qp *qp, struct d_ocp_qp *qp_red, struct d_ocp_qp_reduce_eq_dof_arg *arg, struct d_ocp_qp_reduce_eq_dof_ws *work);
|
||||
//
|
||||
void d_ocp_qp_reduce_eq_dof_rhs(struct d_ocp_qp *qp, struct d_ocp_qp *qp_red, struct d_ocp_qp_reduce_eq_dof_arg *arg, struct d_ocp_qp_reduce_eq_dof_ws *work);
|
||||
//
|
||||
void d_ocp_qp_restore_eq_dof(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol_red, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_reduce_eq_dof_arg *arg, struct d_ocp_qp_reduce_eq_dof_ws *work);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_RED_H_
|
||||
@@ -1,112 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QP_RES_H_
|
||||
#define HPIPM_D_OCP_QP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_ocp_qp_dim.h>
|
||||
#include <hpipm_d_ocp_qp.h>
|
||||
#include <hpipm_d_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp_res
|
||||
{
|
||||
struct d_ocp_qp_dim *dim;
|
||||
struct blasfeo_dvec *res_g; // q-residuals
|
||||
struct blasfeo_dvec *res_b; // b-residuals
|
||||
struct blasfeo_dvec *res_d; // d-residuals
|
||||
struct blasfeo_dvec *res_m; // m-residuals
|
||||
double res_max[4]; // max of residuals
|
||||
double res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp_res_ws
|
||||
{
|
||||
struct blasfeo_dvec *tmp_nbgM; // work space of size nbM+ngM
|
||||
struct blasfeo_dvec *tmp_nsM; // work space of size nsM
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_res_memsize(struct d_ocp_qp_dim *ocp_dim);
|
||||
//
|
||||
void d_ocp_qp_res_create(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_res_ws_memsize(struct d_ocp_qp_dim *ocp_dim);
|
||||
//
|
||||
void d_ocp_qp_res_ws_create(struct d_ocp_qp_dim *ocp_dim, struct d_ocp_qp_res_ws *workspace, void *mem);
|
||||
//
|
||||
void d_ocp_qp_res_compute(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_res *res, struct d_ocp_qp_res_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_res_compute_lin(struct d_ocp_qp *qp, struct d_ocp_qp_sol *qp_sol, struct d_ocp_qp_sol *qp_step, struct d_ocp_qp_res *res, struct d_ocp_qp_res_ws *ws);
|
||||
//
|
||||
void d_ocp_qp_res_compute_inf_norm(struct d_ocp_qp_res *res);
|
||||
//
|
||||
void d_ocp_qp_res_get_all(struct d_ocp_qp_res *res, double **res_r, double **res_q, double **res_ls, double **res_us, double **res_b, double **res_d_lb, double **res_d_ub, double **res_d_lg, double **res_d_ug, double **res_d_ls, double **res_d_us, double **res_m_lb, double **res_m_ub, double **res_m_lg, double **res_m_ug, double **res_m_ls, double **res_m_us);
|
||||
//
|
||||
void d_ocp_qp_res_get_max_res_stat(struct d_ocp_qp_res *res, double *value);
|
||||
//
|
||||
void d_ocp_qp_res_get_max_res_eq(struct d_ocp_qp_res *res, double *value);
|
||||
//
|
||||
void d_ocp_qp_res_get_max_res_ineq(struct d_ocp_qp_res *res, double *value);
|
||||
//
|
||||
void d_ocp_qp_res_get_max_res_comp(struct d_ocp_qp_res *res, double *value);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_RES_H_
|
||||
@@ -1,128 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QP_SOL_H_
|
||||
#define HPIPM_D_OCP_QP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_ocp_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_ocp_qp_sol
|
||||
{
|
||||
struct d_ocp_qp_dim *dim;
|
||||
struct blasfeo_dvec *ux;
|
||||
struct blasfeo_dvec *pi;
|
||||
struct blasfeo_dvec *lam;
|
||||
struct blasfeo_dvec *t;
|
||||
void *misc;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_sol_strsize();
|
||||
//
|
||||
hpipm_size_t d_ocp_qp_sol_memsize(struct d_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_ocp_qp_sol_create(struct d_ocp_qp_dim *dim, struct d_ocp_qp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void d_ocp_qp_sol_copy_all(struct d_ocp_qp_sol *qp_sol_orig, struct d_ocp_qp_sol *qp_sol_dest);
|
||||
//
|
||||
void d_ocp_qp_sol_get_all(struct d_ocp_qp_sol *qp_sol, double **u, double **x, double **ls, double **us, double **pi, double **lam_lb, double **lam_ub, double **lam_lg, double **lam_ug, double **lam_ls, double **lam_us);
|
||||
//
|
||||
void d_ocp_qp_sol_get_all_rowmaj(struct d_ocp_qp_sol *qp_sol, double **u, double **x, double **ls, double **us, double **pi, double **lam_lb, double **lam_ub, double **lam_lg, double **lam_ug, double **lam_ls, double **lam_us);
|
||||
//
|
||||
void d_ocp_qp_sol_set_all(double **u, double **x, double **ls, double **us, double **pi, double **lam_lb, double **lam_ub, double **lam_lg, double **lam_ug, double **lam_ls, double **lam_us, struct d_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qp_sol_get(char *field, int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_u(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_x(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_sl(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_su(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_pi(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_lam_lb(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_lam_lbu(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_lam_lbx(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_lam_ub(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_lam_ubu(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_lam_ubx(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_lam_lg(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_get_lam_ug(int stage, struct d_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_ocp_qp_sol_set(char *field, int stage, double *vec, struct d_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qp_sol_set_u(int stage, double *vec, struct d_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qp_sol_set_x(int stage, double *vec, struct d_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qp_sol_set_sl(int stage, double *vec, struct d_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void d_ocp_qp_sol_set_su(int stage, double *vec, struct d_ocp_qp_sol *qp_sol);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_SOL_H_
|
||||
@@ -1,82 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_OCP_QP_UTILS_H_
|
||||
#define HPIPM_D_OCP_QP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_ocp_qp_dim.h"
|
||||
#include "hpipm_d_ocp_qp.h"
|
||||
#include "hpipm_d_ocp_qp_sol.h"
|
||||
#include "hpipm_d_ocp_qp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_ocp_qp_dim_print(struct d_ocp_qp_dim *qp_dim);
|
||||
//
|
||||
void d_ocp_qp_dim_codegen(char *file_name, char *mode, struct d_ocp_qp_dim *qp_dim);
|
||||
//
|
||||
void d_ocp_qp_print(struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_codegen(char *file_name, char *mode, struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp *qp);
|
||||
//
|
||||
void d_ocp_qp_sol_print(struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp_sol *ocp_qp_sol);
|
||||
//
|
||||
void d_ocp_qp_ipm_arg_print(struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_ocp_qp_ipm_arg_codegen(char *file_name, char *mode, struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_ocp_qp_res_print(struct d_ocp_qp_dim *qp_dim, struct d_ocp_qp_res *ocp_qp_res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_UTILS_H_
|
||||
@@ -1,115 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_PART_COND_H_
|
||||
#define HPIPM_D_PART_COND_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_common.h"
|
||||
#include "hpipm_d_cond.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_part_cond_qp_arg
|
||||
{
|
||||
struct d_cond_qp_arg *cond_arg;
|
||||
int N2;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_part_cond_qp_ws
|
||||
{
|
||||
struct d_cond_qp_ws *cond_workspace;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_part_cond_qp_arg_memsize(int N2);
|
||||
//
|
||||
void d_part_cond_qp_arg_create(int N2, struct d_part_cond_qp_arg *cond_arg, void *mem);
|
||||
//
|
||||
void d_part_cond_qp_arg_set_default(struct d_part_cond_qp_arg *cond_arg);
|
||||
// set riccati-like algorithm: 0 classical, 1 squre-root
|
||||
void d_part_cond_qp_arg_set_ric_alg(int ric_alg, struct d_part_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void d_part_cond_qp_arg_set_comp_prim_sol(int value, struct d_part_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void d_part_cond_qp_arg_set_comp_dual_sol_eq(int value, struct d_part_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void d_part_cond_qp_arg_set_comp_dual_sol_ineq(int value, struct d_part_cond_qp_arg *cond_arg);
|
||||
|
||||
//
|
||||
void d_part_cond_qp_compute_block_size(int N, int N2, int *block_size);
|
||||
//
|
||||
void d_part_cond_qp_compute_dim(struct d_ocp_qp_dim *ocp_dim, int *block_size, struct d_ocp_qp_dim *part_dense_dim);
|
||||
//
|
||||
hpipm_size_t d_part_cond_qp_ws_memsize(struct d_ocp_qp_dim *ocp_dim, int *block_size, struct d_ocp_qp_dim *part_dense_dim, struct d_part_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void d_part_cond_qp_ws_create(struct d_ocp_qp_dim *ocp_dim, int *block_size, struct d_ocp_qp_dim *part_dense_dim, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws, void *mem);
|
||||
//
|
||||
void d_part_cond_qp_cond(struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_part_cond_qp_cond_lhs(struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_part_cond_qp_cond_rhs(struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void d_part_cond_qp_expand_sol(struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_ocp_qp_sol *part_dense_qp_sol, struct d_ocp_qp_sol *ocp_qp_sol, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws);
|
||||
|
||||
//
|
||||
void d_part_cond_qp_update(int *idxc, struct d_ocp_qp *ocp_qp, struct d_ocp_qp *part_dense_qp, struct d_part_cond_qp_arg *cond_arg, struct d_part_cond_qp_ws *cond_ws);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_PART_COND_H_
|
||||
@@ -1,106 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_PART_COND_QCQP_H_
|
||||
#define HPIPM_D_PART_COND_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_cond_qcqp.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_part_cond_qcqp_arg
|
||||
{
|
||||
struct d_cond_qcqp_arg *cond_arg;
|
||||
int N2;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_part_cond_qcqp_ws
|
||||
{
|
||||
struct d_cond_qcqp_ws *cond_ws;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_part_cond_qcqp_arg_memsize(int N2);
|
||||
//
|
||||
void d_part_cond_qcqp_arg_create(int N2, struct d_part_cond_qcqp_arg *cond_arg, void *mem);
|
||||
//
|
||||
void d_part_cond_qcqp_arg_set_default(struct d_part_cond_qcqp_arg *cond_arg);
|
||||
// set riccati-like algorithm: 0 classical, 1 squre-root
|
||||
void d_part_cond_qcqp_arg_set_ric_alg(int ric_alg, struct d_part_cond_qcqp_arg *cond_arg);
|
||||
|
||||
//
|
||||
void d_part_cond_qcqp_compute_block_size(int N, int N2, int *block_size);
|
||||
//
|
||||
void d_part_cond_qcqp_compute_dim(struct d_ocp_qcqp_dim *ocp_dim, int *block_size, struct d_ocp_qcqp_dim *part_dense_dim);
|
||||
//
|
||||
hpipm_size_t d_part_cond_qcqp_ws_memsize(struct d_ocp_qcqp_dim *ocp_dim, int *block_size, struct d_ocp_qcqp_dim *part_dense_dim, struct d_part_cond_qcqp_arg *cond_arg);
|
||||
//
|
||||
void d_part_cond_qcqp_ws_create(struct d_ocp_qcqp_dim *ocp_dim, int *block_size, struct d_ocp_qcqp_dim *part_dense_dim, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws, void *mem);
|
||||
//
|
||||
void d_part_cond_qcqp_cond(struct d_ocp_qcqp *ocp_qp, struct d_ocp_qcqp *part_dense_qp, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_part_cond_qcqp_cond_lhs(struct d_ocp_qcqp *ocp_qp, struct d_ocp_qcqp *part_dense_qp, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_part_cond_qcqp_cond_rhs(struct d_ocp_qcqp *ocp_qp, struct d_ocp_qcqp *part_dense_qp, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void d_part_cond_qcqp_expand_sol(struct d_ocp_qcqp *ocp_qp, struct d_ocp_qcqp *part_dense_qp, struct d_ocp_qcqp_sol *part_dense_qp_sol, struct d_ocp_qcqp_sol *ocp_qp_sol, struct d_part_cond_qcqp_arg *cond_arg, struct d_part_cond_qcqp_ws *cond_ws);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_PART_COND_H_
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_SIM_ERK_H_
|
||||
#define HPIPM_D_SIM_ERK_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct d_sim_erk_arg
|
||||
{
|
||||
struct d_sim_rk_data *rk_data; // integrator data
|
||||
double h; // step size
|
||||
int steps; // number of steps
|
||||
// int for_sens; // compute adjoint sensitivities
|
||||
// int adj_sens; // compute adjoint sensitivities
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_sim_erk_ws
|
||||
{
|
||||
void (*ode)(int t, double *x, double *p, void *ode_args, double *xdot); // function pointer to ode
|
||||
void (*vde_for)(int t, double *x, double *p, void *ode_args, double *xdot); // function pointer to forward vde
|
||||
void (*vde_adj)(int t, double *adj_in, void *ode_args, double *adj_out); // function pointer to adjoint vde
|
||||
void *ode_args; // pointer to ode args
|
||||
struct d_sim_erk_arg *erk_arg; // erk arg
|
||||
double *K; // internal variables
|
||||
double *x_for; // states and forward sensitivities
|
||||
double *x_traj; // states at all steps
|
||||
double *l; // adjoint sensitivities
|
||||
double *p; // parameter
|
||||
double *x_tmp; // temporary states and forward sensitivities
|
||||
double *adj_in;
|
||||
double *adj_tmp;
|
||||
int nx; // number of states
|
||||
int np; // number of parameters
|
||||
int nf; // number of forward sensitivities
|
||||
int na; // number of adjoint sensitivities
|
||||
int nf_max; // max number of forward sensitivities
|
||||
int na_max; // max number of adjoint sensitivities
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_sim_erk_arg_memsize();
|
||||
//
|
||||
void d_sim_erk_arg_create(struct d_sim_erk_arg *erk_arg, void *mem);
|
||||
//
|
||||
void d_sim_erk_arg_set_all(struct d_sim_rk_data *rk_data, double h, int steps, struct d_sim_erk_arg *erk_arg);
|
||||
|
||||
//
|
||||
hpipm_size_t d_sim_erk_ws_memsize(struct d_sim_erk_arg *erk_arg, int nx, int np, int nf_max, int na_max);
|
||||
//
|
||||
void d_sim_erk_ws_create(struct d_sim_erk_arg *erk_arg, int nx, int np, int nf_max, int na_max, struct d_sim_erk_ws *work, void *memory);
|
||||
//
|
||||
void d_sim_erk_ws_set_all(int nf, int na, double *x, double *fs, double *bs, double *p, void (*ode)(int t, double *x, double *p, void *ode_args, double *xdot), void (*vde_for)(int t, double *x, double *p, void *ode_args, double *xdot), void (*vde_adj)(int t, double *adj_in, void *ode_args, double *adj_out), void *ode_args, struct d_sim_erk_ws *work);
|
||||
// number of directions for forward sensitivities
|
||||
void d_sim_erk_ws_set_nf(int *nf, struct d_sim_erk_ws *work);
|
||||
// parameters (e.g. inputs)
|
||||
void d_sim_erk_ws_set_p(double *p, struct d_sim_erk_ws *work);
|
||||
// state
|
||||
void d_sim_erk_ws_set_x(double *x, struct d_sim_erk_ws *work);
|
||||
// forward sensitivities
|
||||
void d_sim_erk_ws_set_fs(double *fs, struct d_sim_erk_ws *work);
|
||||
// ode funtion
|
||||
void d_sim_erk_ws_set_ode(void (*ode)(int t, double *x, double *p, void *ode_args, double *xdot), struct d_sim_erk_ws *work);
|
||||
// forward vde function
|
||||
void d_sim_erk_ws_set_vde_for(void (*ode)(int t, double *x, double *p, void *ode_args, double *xdot), struct d_sim_erk_ws *work);
|
||||
// ode_args, passed straight to the ode/vde_for/vde_adj functions
|
||||
void d_sim_erk_ws_set_ode_args(void *ode_args, struct d_sim_erk_ws *work);
|
||||
// state
|
||||
void d_sim_erk_ws_get_x(struct d_sim_erk_ws *work, double *x);
|
||||
// forward sensitivities
|
||||
void d_sim_erk_ws_get_fs(struct d_sim_erk_ws *work, double *fs);
|
||||
//
|
||||
void d_sim_erk_solve(struct d_sim_erk_arg *arg, struct d_sim_erk_ws *work);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_D_SIM_ERK_H_
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_SIM_RK_H_
|
||||
#define HPIPM_D_SIM_RK_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct d_sim_rk_data
|
||||
{
|
||||
double *A_rk; // A in butcher tableau
|
||||
double *B_rk; // b in butcher tableau
|
||||
double *C_rk; // c in butcher tableau
|
||||
int expl; // erk vs irk
|
||||
int ns; // number of stages
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_sim_rk_data_memsize(int ns);
|
||||
//
|
||||
void d_sim_rk_data_create(int ns, struct d_sim_rk_data *rk_data, void *memory);
|
||||
//
|
||||
void d_sim_rk_data_init_default(char *field, struct d_sim_rk_data *rk_data);
|
||||
//
|
||||
void d_sim_rk_data_set_all(int expl, double *A_rk, double *B_rk, double *C_rk, struct d_sim_rk_data *rk_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_D_SIM_RK_H_
|
||||
|
||||
@@ -1,213 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QCQP_H_
|
||||
#define HPIPM_D_TREE_OCP_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_common.h"
|
||||
#include "hpipm_d_tree_ocp_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qcqp
|
||||
{
|
||||
struct d_tree_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_dmat *BAbt; // Nn-1
|
||||
struct blasfeo_dmat *RSQrq; // Nn
|
||||
struct blasfeo_dmat *DCt; // Nn
|
||||
struct blasfeo_dmat **Hq; // Nn
|
||||
struct blasfeo_dvec *b; // Nn-1
|
||||
struct blasfeo_dvec *rqz; // Nn
|
||||
struct blasfeo_dvec *d; // Nn
|
||||
struct blasfeo_dvec *d_mask; // Nn
|
||||
struct blasfeo_dvec *m; // Nn
|
||||
struct blasfeo_dvec *Z; // Nn
|
||||
int **idxb; // indices of box constrained variables within [u; x] // Nn
|
||||
int **idxs_rev; // index of soft constraints
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_memsize(struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_create(struct d_tree_ocp_qcqp_dim *dim, struct d_tree_ocp_qcqp *qp, void *memory);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_all(double **A, double **B, double **b, double **Q, double **S, double **R, double **q, double **r, int **idxb, double **d_lb, double **d_ub, double **C, double **D, double **d_lg, double **d_ug, double **Zl, double **Zu, double **zl, double **zu, int **idxs, double **d_ls, double **d_us, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set(char *field_name, int node_edge, void *value, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_A(int edge, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_B(int edge, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_b(int edge, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Q(int node, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_S(int node, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_R(int node, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_q(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_r(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lb(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lb_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_ub(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_ub_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lbx(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lbx_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_ubx(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_ubx_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lbu(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lbu_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_ubu(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_ubu_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_idxb(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_idxbx(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Jbx(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_idxbu(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Jbu(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_C(int node, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_D(int node, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lg(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lg_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_ug(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_ug_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Qq(int node, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Sq(int node, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Rq(int node, double *mat, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_qq(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_rq(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_uq(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_uq_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Zl(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Zu(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_zl(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_zu(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lls(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lls_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lus(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_lus_mask(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_idxs(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_idxs_rev(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Jsbu(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Jsbx(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Jsg(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_set_Jsq(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_set_idxe(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_set_idxbxe(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_set_idxbue(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_set_idxge(int node, int *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_set_Jbxe(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_set_Jbue(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_set_Jge(int node, double *vec, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_set_diag_H_flag(int node, int *value, struct d_tree_ocp_qcqp *qp);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QCQP_H_
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QCQP_DIM_H_
|
||||
#define HPIPM_D_TREE_OCP_QCQP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qcqp_dim
|
||||
{
|
||||
struct d_tree_ocp_qp_dim *qp_dim; // dim of qp approximation
|
||||
struct tree *ttree; // tree describing node conndection
|
||||
int *nx; // number of states // Nn
|
||||
int *nu; // number of inputs // Nn
|
||||
int *nb; // number of box constraints // Nn
|
||||
int *nbx; // number of state box constraints // Nn
|
||||
int *nbu; // number of input box constraints // Nn
|
||||
int *ng; // number of general constraints // Nn
|
||||
int *nq; // number of (upper) quadratic constraints
|
||||
int *ns; // number of soft constraints // Nn
|
||||
int *nsbx; // number of soft state box constraints
|
||||
int *nsbu; // number of soft input box constraints
|
||||
int *nsg; // number of soft general constraints
|
||||
int *nsq; // number of (upper) soft quadratic constraints
|
||||
int Nn; // number of nodes
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_dim_strsize();
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_dim_memsize(int Nn);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_create(int Nn, struct d_tree_ocp_qcqp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_tree(struct tree *ttree, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set(char *field, int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nx(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nu(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nbx(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nbu(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_ng(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nq(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_ns(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nsbx(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nsbu(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nsg(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_set_nsq(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_dim_set_nbxe(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_dim_set_nbue(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_dim_set_nge(int stage, int value, struct d_tree_ocp_qcqp_dim *dim);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QCQP_DIM_H_
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QCQP_IPM_H_
|
||||
#define HPIPM_D_TREE_OCP_QCQP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_tree_ocp_qcqp_dim.h>
|
||||
#include <hpipm_d_tree_ocp_qp.h>
|
||||
#include <hpipm_d_tree_ocp_qcqp_res.h>
|
||||
#include <hpipm_d_tree_ocp_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qcqp_ipm_arg
|
||||
{
|
||||
struct d_tree_ocp_qp_ipm_arg *qp_arg;
|
||||
double mu0; // initial value for complementarity slackness
|
||||
double alpha_min; // exit cond on step length
|
||||
double res_g_max; // exit cond on inf norm of residuals
|
||||
double res_b_max; // exit cond on inf norm of residuals
|
||||
double res_d_max; // exit cond on inf norm of residuals
|
||||
double res_m_max; // exit cond on inf norm of residuals
|
||||
double reg_prim; // reg of primal hessian
|
||||
double lam_min; // min value in lam vector
|
||||
double t_min; // min value in t vector
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
// int square_root_alg; // 0 classical Riccati, 1 square-root Riccati
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1)
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_dual_sol_eq; // dual solution of equality constrains (only for abs_form==1)
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1)
|
||||
// int comp_res_pred; // compute residuals of prediction
|
||||
int split_step; // use different step for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qcqp_ipm_ws
|
||||
{
|
||||
struct d_tree_ocp_qp_ipm_ws *qp_ws;
|
||||
struct d_tree_ocp_qp *qp;
|
||||
struct d_tree_ocp_qp_sol *qp_sol;
|
||||
struct d_tree_ocp_qcqp_res_ws *qcqp_res_ws;
|
||||
struct d_tree_ocp_qcqp_res *qcqp_res;
|
||||
struct blasfeo_dvec *tmp_nuxM;
|
||||
int iter; // iteration number
|
||||
int status;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_ipm_arg_strsize();
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_ipm_arg_memsize(struct d_tree_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_arg_create(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_arg_set(char *field, void *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set maximum number of iterations
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_iter_max(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set minimum step lenght
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_alpha_min(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set initial value of barrier parameter
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_mu0(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on stationarity condition
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_tol_stat(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on equality constr
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_tol_eq(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on inequality constr
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_tol_ineq(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on complementarity condition
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_tol_comp(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set regularization of primal variables
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_reg_prim(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set warm start: 0 no warm start, 1 primal var
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_warm_start(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_pred_corr(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_cond_pred_corr(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set riccati algorithm: 0 classic, 1 square-root
|
||||
//void d_tree_ocp_qcqp_ipm_arg_set_ric_alg(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// compute residuals after solution
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_comp_res_exit(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// compute residuals of prediction
|
||||
//void d_tree_ocp_qcqp_ipm_arg_set_comp_res_pred(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// min value of lam in the solution
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_lam_min(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// min value of t in the solution
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_t_min(double *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// use different step for primal and dual variables
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_split_step(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
void d_tree_ocp_qcqp_ipm_arg_set_t_lam_min(int *value, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_ipm_ws_strsize();
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_ipm_ws_memsize(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_ws_create(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg, struct d_tree_ocp_qcqp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get(char *field, struct d_tree_ocp_qcqp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get_status(struct d_tree_ocp_qcqp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get_iter(struct d_tree_ocp_qcqp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get_max_res_stat(struct d_tree_ocp_qcqp_ipm_ws *ws, double *res_stat);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get_max_res_eq(struct d_tree_ocp_qcqp_ipm_ws *ws, double *res_eq);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get_max_res_ineq(struct d_tree_ocp_qcqp_ipm_ws *ws, double *res_ineq);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get_max_res_comp(struct d_tree_ocp_qcqp_ipm_ws *ws, double *res_comp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get_stat(struct d_tree_ocp_qcqp_ipm_ws *ws, double **stat);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_get_stat_m(struct d_tree_ocp_qcqp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void d_tree_ocp_qcqp_init_var(struct d_tree_ocp_qcqp *qp, struct d_tree_ocp_qcqp_sol *qp_sol, struct d_tree_ocp_qcqp_ipm_arg *arg, struct d_tree_ocp_qcqp_ipm_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_solve(struct d_tree_ocp_qcqp *qp, struct d_tree_ocp_qcqp_sol *qp_sol, struct d_tree_ocp_qcqp_ipm_arg *arg, struct d_tree_ocp_qcqp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QCQP_IPM_H_
|
||||
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QCQP_RES_H_
|
||||
#define HPIPM_D_TREE_OCP_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_tree_ocp_qcqp_dim.h>
|
||||
#include <hpipm_d_tree_ocp_qcqp.h>
|
||||
#include <hpipm_d_tree_ocp_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qcqp_res
|
||||
{
|
||||
struct d_tree_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_dvec *res_g; // q-residuals
|
||||
struct blasfeo_dvec *res_b; // b-residuals
|
||||
struct blasfeo_dvec *res_d; // d-residuals
|
||||
struct blasfeo_dvec *res_m; // m-residuals
|
||||
double res_max[4]; // max of residuals
|
||||
double res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qcqp_res_ws
|
||||
{
|
||||
struct blasfeo_dvec *tmp_nuxM; // work space of size nuM+nxM
|
||||
struct blasfeo_dvec *tmp_nbgqM; // work space of size nbM+ngM+nqM
|
||||
struct blasfeo_dvec *tmp_nsM; // work space of size nsM
|
||||
struct blasfeo_dvec *q_fun; // value for evaluation of quadr constr
|
||||
struct blasfeo_dvec *q_adj; // value for adjoint of quadr constr
|
||||
int use_q_fun; // reuse cached value for evaluation of quadr constr
|
||||
int use_q_adj; // reuse cached value for adjoint of quadr constr
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_res_memsize(struct d_tree_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_res_create(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_res_ws_memsize(struct d_tree_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_res_ws_create(struct d_tree_ocp_qcqp_dim *ocp_dim, struct d_tree_ocp_qcqp_res_ws *ws, void *mem);
|
||||
//
|
||||
void d_tree_ocp_qcqp_res_compute(struct d_tree_ocp_qcqp *qp, struct d_tree_ocp_qcqp_sol *qp_sol, struct d_tree_ocp_qcqp_res *res, struct d_tree_ocp_qcqp_res_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qcqp_res_compute_inf_norm(struct d_tree_ocp_qcqp_res *res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QCQP_SOL_H_
|
||||
#define HPIPM_D_TREE_OCP_QCQP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_tree_ocp_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct d_tree_ocp_qcqp_sol
|
||||
{
|
||||
struct d_tree_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_dvec *ux;
|
||||
struct blasfeo_dvec *pi;
|
||||
struct blasfeo_dvec *lam;
|
||||
struct blasfeo_dvec *t;
|
||||
void *misc;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qcqp_sol_memsize(struct d_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_create(struct d_tree_ocp_qcqp_dim *dim, struct d_tree_ocp_qcqp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get(char *field, int node_edge, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_u(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_x(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_sl(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_su(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_pi(int edge, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_lam_lb(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_lam_ub(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_lam_lg(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_get_lam_ug(int node, struct d_tree_ocp_qcqp_sol *qp_sol, double *vec);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QCQP_SOL_H_
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QP_UTILS_H_
|
||||
#define HPIPM_D_TREE_OCP_QP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_tree_ocp_qcqp_dim.h"
|
||||
#include "hpipm_d_tree_ocp_qcqp.h"
|
||||
#include "hpipm_d_tree_ocp_qcqp_sol.h"
|
||||
#include "hpipm_d_tree_ocp_qcqp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_tree_ocp_qcqp_dim_print(struct d_tree_ocp_qcqp_dim *qp_dim);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_dim_codegen(char *file_name, char *mode, struct d_tree_ocp_qcqp_dim *qp_dim);
|
||||
//
|
||||
void d_tree_ocp_qcqp_print(struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_codegen(char *file_name, char *mode, struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void d_tree_ocp_qcqp_sol_print(struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp_sol *ocp_qcqp_sol);
|
||||
//
|
||||
void d_tree_ocp_qcqp_ipm_arg_print(struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
//void d_tree_ocp_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qcqp_res_print(struct d_tree_ocp_qcqp_dim *qp_dim, struct d_tree_ocp_qcqp_res *ocp_qcqp_res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QP_UTILS_H_
|
||||
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QP_H_
|
||||
#define HPIPM_D_TREE_OCP_QP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_tree_ocp_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qp
|
||||
{
|
||||
struct d_tree_ocp_qp_dim *dim;
|
||||
struct blasfeo_dmat *BAbt; // Nn-1
|
||||
struct blasfeo_dmat *RSQrq; // Nn
|
||||
struct blasfeo_dmat *DCt; // Nn
|
||||
struct blasfeo_dvec *b; // Nn-1
|
||||
struct blasfeo_dvec *rqz; // Nn
|
||||
struct blasfeo_dvec *d; // Nn
|
||||
struct blasfeo_dvec *d_mask; // Nn
|
||||
struct blasfeo_dvec *m; // Nn
|
||||
struct blasfeo_dvec *Z; // Nn
|
||||
int **idxb; // indices of box constrained variables within [u; x] // Nn
|
||||
// int **idxs; // index of soft constraints
|
||||
int **idxs_rev; // index of soft constraints
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qp_memsize(struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_create(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp *qp, void *memory);
|
||||
//
|
||||
void d_tree_ocp_qp_set_all(double **A, double **B, double **b, double **Q, double **S, double **R, double **q, double **r, int **idxb, double **d_lb, double **d_ub, double **C, double **D, double **d_lg, double **d_ug, double **Zl, double **Zu, double **zl, double **zu, int **idxs, double **d_ls, double **d_us, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set(char *field_name, int node_edge, void *value, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_A(int edge, double *mat, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_B(int edge, double *mat, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_b(int edge, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_Q(int node, double *mat, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_S(int node, double *mat, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_R(int node, double *mat, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_q(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_r(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lb(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lb_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_ub(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_ub_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lbx(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lbx_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_ubx(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_ubx_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lbu(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lbu_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_ubu(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_ubu_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_idxb(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_idxbx(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_Jbx(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_idxbu(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_Jbu(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_C(int node, double *mat, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_D(int node, double *mat, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lg(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lg_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_ug(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_ug_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_Zl(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_Zu(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_zl(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_zu(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lls(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lls_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lus(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_lus_mask(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_idxs(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_idxs_rev(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_Jsbu(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_Jsbx(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_set_Jsg(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_set_idxe(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_set_idxbxe(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_set_idxbue(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_set_idxge(int node, int *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_set_Jbxe(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_set_Jbue(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_set_Jge(int node, double *vec, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_set_diag_H_flag(int node, int *value, struct d_tree_ocp_qp *qp);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QP_H_
|
||||
@@ -1,111 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QP_DIM_H_
|
||||
#define HPIPM_D_TREE_OCP_QP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qp_dim
|
||||
{
|
||||
struct tree *ttree; // tree describing node conndection
|
||||
int *nx; // number of states // Nn
|
||||
int *nu; // number of inputs // Nn
|
||||
int *nb; // number of box constraints // Nn
|
||||
int *nbx; // number of state box constraints // Nn
|
||||
int *nbu; // number of input box constraints // Nn
|
||||
int *ng; // number of general constraints // Nn
|
||||
int *ns; // number of soft constraints // Nn
|
||||
int *nsbx; // number of soft state box constraints
|
||||
int *nsbu; // number of soft input box constraints
|
||||
int *nsg; // number of soft general constraints
|
||||
int Nn; // number of nodes
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qp_dim_strsize();
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qp_dim_memsize(int Nn);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_create(int Nn, struct d_tree_ocp_qp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_all(struct tree *ttree, int *nx, int *nu, int *nbx, int *nbu, int *ng, int *nsbx, int *nsbu, int *nsg, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_tree(struct tree *ttree, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set(char *field, int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nx(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nu(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nbx(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nbu(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_ng(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_ns(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nsbx(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nsbu(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nsg(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nbxe(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nbue(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_dim_set_nge(int stage, int value, struct d_tree_ocp_qp_dim *dim);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QP_DIM_H_
|
||||
@@ -1,209 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QP_IPM_H_
|
||||
#define HPIPM_D_TREE_OCP_QP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_tree_ocp_qp_dim.h>
|
||||
#include <hpipm_d_tree_ocp_qp.h>
|
||||
#include <hpipm_d_tree_ocp_qp_res.h>
|
||||
#include <hpipm_d_tree_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qp_ipm_arg
|
||||
{
|
||||
double mu0; // initial value for duality measure
|
||||
double alpha_min; // exit cond on step length
|
||||
double res_g_max; // exit cond on inf norm of residuals
|
||||
double res_b_max; // exit cond on inf norm of residuals
|
||||
double res_d_max; // exit cond on inf norm of residuals
|
||||
double res_m_max; // exit cond on inf norm of residuals
|
||||
double reg_prim; // reg of primal hessian
|
||||
double lam_min; // min value in lam vector
|
||||
double t_min; // min value in t vector
|
||||
double tau_min; // min value of barrier parameter
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_dual_sol_eq; // dual solution (only for abs_form==1)
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol==1)
|
||||
int split_step; // use different steps for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qp_ipm_ws
|
||||
{
|
||||
struct d_core_qp_ipm_workspace *core_workspace;
|
||||
struct d_tree_ocp_qp_res_ws *res_workspace;
|
||||
struct d_tree_ocp_qp_sol *sol_step;
|
||||
struct d_tree_ocp_qp_sol *sol_itref;
|
||||
struct d_tree_ocp_qp *qp_step;
|
||||
struct d_tree_ocp_qp *qp_itref;
|
||||
struct d_tree_ocp_qp_res *res_itref;
|
||||
struct d_tree_ocp_qp_res *res;
|
||||
struct blasfeo_dvec *Gamma; // hessian update
|
||||
struct blasfeo_dvec *gamma; // hessian update
|
||||
struct blasfeo_dvec *tmp_nxM; // work space of size nxM
|
||||
struct blasfeo_dvec *tmp_nbgM; // work space of size nbgM
|
||||
struct blasfeo_dvec *tmp_nsM; // work space of size nsM
|
||||
struct blasfeo_dvec *Pb; // Pb
|
||||
struct blasfeo_dvec *Zs_inv;
|
||||
struct blasfeo_dmat *L;
|
||||
struct blasfeo_dmat *Lh;
|
||||
struct blasfeo_dmat *AL;
|
||||
struct blasfeo_dmat *lq0;
|
||||
struct blasfeo_dvec *tmp_m;
|
||||
double *stat; // convergence statistics
|
||||
int *use_hess_fact;
|
||||
void *lq_work0;
|
||||
double qp_res[4]; // infinity norm of residuals
|
||||
int iter; // iteration number
|
||||
int stat_max; // iterations saved in stat
|
||||
int stat_m; // number of recorded stat per IPM iter
|
||||
int use_Pb;
|
||||
int status; // solver status
|
||||
int lq_fact; // cache from arg
|
||||
int mask_constr; // use constr mask
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qp_ipm_arg_memsize(struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_create(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_default(enum hpipm_mode mode, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_iter_max(int *iter_max, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_alpha_min(double *alpha_min, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_mu0(double *mu0, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_tol_stat(double *tol_stat, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_tol_eq(double *tol_eq, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_tol_ineq(double *tol_ineq, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_tol_comp(double *tol_comp, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_reg_prim(double *reg, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_warm_start(int *warm_start, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_pred_corr(int *pred_corr, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_cond_pred_corr(int *value, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_comp_dual_sol_eq(int *value, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_comp_res_exit(int *value, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_lam_min(double *value, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_t_min(double *value, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_tau_min(double *value, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_split_step(int *value, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_set_t_lam_min(int *value, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qp_ipm_ws_memsize(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_ws_create(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_get_status(struct d_tree_ocp_qp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_get_iter(struct d_tree_ocp_qp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_get_max_res_stat(struct d_tree_ocp_qp_ipm_ws *ws, double *res_stat);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_get_max_res_eq(struct d_tree_ocp_qp_ipm_ws *ws, double *res_eq);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_get_max_res_ineq(struct d_tree_ocp_qp_ipm_ws *ws, double *res_ineq);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_get_max_res_comp(struct d_tree_ocp_qp_ipm_ws *ws, double *res_comp);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_get_stat(struct d_tree_ocp_qp_ipm_ws *ws, double **stat);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_get_stat_m(struct d_tree_ocp_qp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void d_tree_ocp_qp_init_var(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_abs_step(int kk, struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_delta_step(int kk, struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_solve(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QP_IPM_H_
|
||||
@@ -1,52 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
void d_tree_ocp_qp_fact_solve_kkt_unconstr(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qp_fact_solve_kkt_step(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qp_fact_lq_solve_kkt_step(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qp_solve_kkt_step(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_ipm_arg *arg, struct d_tree_ocp_qp_ipm_ws *ws);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
@@ -1,106 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QP_RES_H_
|
||||
#define HPIPM_D_TREE_OCP_QP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_d_tree_ocp_qp_dim.h>
|
||||
#include <hpipm_d_tree_ocp_qp.h>
|
||||
#include <hpipm_d_tree_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qp_res
|
||||
{
|
||||
struct d_tree_ocp_qp_dim *dim;
|
||||
struct blasfeo_dvec *res_g; // q-residuals
|
||||
struct blasfeo_dvec *res_b; // b-residuals
|
||||
struct blasfeo_dvec *res_d; // d-residuals
|
||||
struct blasfeo_dvec *res_m; // m-residuals
|
||||
double res_max[4]; // max of residuals
|
||||
double res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct d_tree_ocp_qp_res_ws
|
||||
{
|
||||
struct blasfeo_dvec *tmp_nbgM; // work space of size nbM+ngM
|
||||
struct blasfeo_dvec *tmp_nsM; // work space of size nsM
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qp_res_memsize(struct d_tree_ocp_qp_dim *ocp_dim);
|
||||
//
|
||||
void d_tree_ocp_qp_res_create(struct d_tree_ocp_qp_dim *ocp_dim, struct d_tree_ocp_qp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qp_res_ws_memsize(struct d_tree_ocp_qp_dim *ocp_dim);
|
||||
//
|
||||
void d_tree_ocp_qp_res_ws_create(struct d_tree_ocp_qp_dim *ocp_dim, struct d_tree_ocp_qp_res_ws *ws, void *mem);
|
||||
//
|
||||
void d_tree_ocp_qp_res_get_all(struct d_tree_ocp_qp_res *res, double **res_r, double **res_q, double **res_ls, double **res_us, double **res_b, double **res_d_lb, double **res_d_ub, double **res_d_lg, double **res_d_ug, double **res_d_ls, double **res_d_us, double **res_m_lb, double **res_m_ub, double **res_m_lg, double **res_m_ug, double **res_m_ls, double **res_m_us);
|
||||
//
|
||||
void d_tree_ocp_qp_res_compute(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_res *res, struct d_tree_ocp_qp_res_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qp_res_compute_lin(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, struct d_tree_ocp_qp_sol *qp_step, struct d_tree_ocp_qp_res *res, struct d_tree_ocp_qp_res_ws *ws);
|
||||
//
|
||||
void d_tree_ocp_qp_res_compute_inf_norm(struct d_tree_ocp_qp_res *res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QP_RES_H_
|
||||
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QP_SOL_H_
|
||||
#define HPIPM_D_TREE_OCP_QP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_tree_ocp_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct d_tree_ocp_qp_sol
|
||||
{
|
||||
struct d_tree_ocp_qp_dim *dim;
|
||||
struct blasfeo_dvec *ux;
|
||||
struct blasfeo_dvec *pi;
|
||||
struct blasfeo_dvec *lam;
|
||||
struct blasfeo_dvec *t;
|
||||
void *misc;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t d_tree_ocp_qp_sol_memsize(struct d_tree_ocp_qp_dim *dim);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_create(struct d_tree_ocp_qp_dim *dim, struct d_tree_ocp_qp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_all(struct d_tree_ocp_qp *qp, struct d_tree_ocp_qp_sol *qp_sol, double **u, double **x, double **ls, double **us, double **pi, double **lam_lb, double **lam_ub, double **lam_lg, double **lam_ug, double **lam_ls, double **lam_us);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get(char *field, int node_edge, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_u(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_x(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_sl(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_su(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_pi(int edge, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_lam_lb(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_lam_ub(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_lam_lg(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_get_lam_ug(int node, struct d_tree_ocp_qp_sol *qp_sol, double *vec);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QP_SOL_H_
|
||||
@@ -1,83 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_D_TREE_OCP_QP_UTILS_H_
|
||||
#define HPIPM_D_TREE_OCP_QP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_tree_ocp_qp_dim.h"
|
||||
#include "hpipm_d_tree_ocp_qp.h"
|
||||
#include "hpipm_d_tree_ocp_qp_sol.h"
|
||||
#include "hpipm_d_tree_ocp_qp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void d_tree_ocp_qp_dim_print(struct d_tree_ocp_qp_dim *qp_dim);
|
||||
//
|
||||
//void d_tree_ocp_qp_dim_codegen(char *file_name, char *mode, struct d_tree_ocp_qp_dim *qp_dim);
|
||||
//
|
||||
void d_tree_ocp_qp_print(struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
//void d_tree_ocp_qp_codegen(char *file_name, char *mode, struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp *qp);
|
||||
//
|
||||
void d_tree_ocp_qp_sol_print(struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp_sol *ocp_qp_sol);
|
||||
//
|
||||
void d_tree_ocp_qp_ipm_arg_print(struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
//void d_tree_ocp_qp_ipm_arg_codegen(char *file_name, char *mode, struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void d_tree_ocp_qp_res_print(struct d_tree_ocp_qp_dim *qp_dim, struct d_tree_ocp_qp_res *ocp_qp_res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_TREE_OCP_QP_UTILS_H_
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_M_DENSE_QP_H_
|
||||
#define HPIPM_M_DENSE_QP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qp.h"
|
||||
#include "hpipm_s_dense_qp.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void cvt_d2s_dense_qp(struct d_dense_qp *qpd, struct s_dense_qp *qps);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_M_DENSE_QP_H_
|
||||
@@ -1,68 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_M_DENSE_QP_DIM_H_
|
||||
#define HPIPM_M_DENSE_QP_DIM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_d_dense_qp_dim.h"
|
||||
#include "hpipm_s_dense_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void cvt_d2s_dense_qp_dim(struct d_dense_qp_dim *qpd, struct s_dense_qp_dim *qps);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_M_DENSE_QP_DIM_H_
|
||||
@@ -1,49 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void m_cvt_d_ocp_qp_to_s_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
@@ -1,115 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
struct m_ipm_hard_ocp_qp_workspace
|
||||
{
|
||||
struct d_ipm_hard_core_qp_workspace *core_workspace;
|
||||
struct blasfeo_dvec *dux;
|
||||
struct blasfeo_dvec *dpi;
|
||||
struct blasfeo_dvec *dt_lb;
|
||||
struct blasfeo_dvec *dt_lg;
|
||||
struct blasfeo_svec *sdux; // XXX
|
||||
struct blasfeo_svec *sdpi; // XXX
|
||||
struct blasfeo_dvec *res_g; // q-residuals
|
||||
struct blasfeo_dvec *res_b; // b-residuals
|
||||
struct blasfeo_dvec *res_d; // d-residuals XXX remove ???
|
||||
struct blasfeo_dvec *res_d_lb; // d-residuals
|
||||
struct blasfeo_dvec *res_d_ub; // d-residuals
|
||||
struct blasfeo_dvec *res_d_lg; // d-residuals
|
||||
struct blasfeo_dvec *res_d_ug; // d-residuals
|
||||
struct blasfeo_dvec *res_m; // m-residuals
|
||||
struct blasfeo_dvec *res_m_lb; // m-residuals
|
||||
struct blasfeo_dvec *res_m_ub; // m-residuals
|
||||
struct blasfeo_dvec *res_m_lg; // m-residuals
|
||||
struct blasfeo_dvec *res_m_ug; // m-residuals
|
||||
struct blasfeo_svec *sres_g; // q-residuals // XXX
|
||||
struct blasfeo_svec *sres_b; // b-residuals // XXX
|
||||
struct blasfeo_dvec *Qx_lb; // hessian update
|
||||
struct blasfeo_dvec *Qx_lg; // hessian update
|
||||
struct blasfeo_dvec *qx_lb; // gradient update
|
||||
struct blasfeo_dvec *qx_lg; // gradient update
|
||||
struct blasfeo_svec *sQx_lb; // hessian update // XXX
|
||||
struct blasfeo_svec *sQx_lg; // hessian update // XXX
|
||||
struct blasfeo_svec *sqx_lb; // gradient update // XXX
|
||||
struct blasfeo_svec *sqx_lg; // gradient update // XXX
|
||||
struct blasfeo_dvec *tmp_nbM; // work space of size nbM
|
||||
struct blasfeo_svec *tmp_nxM; // work space of size nxM // XXX
|
||||
struct blasfeo_dvec *tmp_ngM; // work space of size ngM
|
||||
struct blasfeo_svec *Pb; // Pb // XXX
|
||||
struct blasfeo_smat *L; // XXX
|
||||
struct blasfeo_smat *AL; // XXX
|
||||
struct blasfeo_svec *sSx; // scaling
|
||||
struct blasfeo_svec *sSi; // scaling inverted
|
||||
double *stat; // convergence statistics
|
||||
double res_mu; // mu-residual
|
||||
int iter; // iteration number
|
||||
int compute_Pb;
|
||||
int scale;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct m_ipm_hard_ocp_qp_arg
|
||||
{
|
||||
double alpha_min; // exit cond on step length
|
||||
double mu_max; // exit cond on duality measure
|
||||
double mu0; // initial value for duality measure
|
||||
int iter_max; // exit cond in iter number
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t m_memsize_ipm_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct m_ipm_hard_ocp_qp_arg *arg);
|
||||
//
|
||||
void m_create_ipm_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct m_ipm_hard_ocp_qp_arg *arg, struct m_ipm_hard_ocp_qp_workspace *ws, void *mem);
|
||||
//
|
||||
void m_solve_ipm_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct d_ocp_qp_sol *qp_sol, struct m_ipm_hard_ocp_qp_workspace *ws);
|
||||
//
|
||||
void m_solve_ipm2_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct d_ocp_qp_sol *qp_sol, struct m_ipm_hard_ocp_qp_workspace *ws);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
@@ -1,45 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void m_fact_solve_kkt_step_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct m_ipm_hard_ocp_qp_workspace *ws);
|
||||
void m_solve_kkt_step_hard_ocp_qp(struct d_ocp_qp *d_qp, struct s_ocp_qp *s_qp, struct m_ipm_hard_ocp_qp_workspace *ws);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
@@ -1,72 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_CAST_QCQP_H_
|
||||
#define HPIPM_S_CAST_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qcqp.h"
|
||||
#include "hpipm_s_dense_qcqp_sol.h"
|
||||
#include "hpipm_s_ocp_qcqp.h"
|
||||
#include "hpipm_s_ocp_qcqp_dim.h"
|
||||
#include "hpipm_s_ocp_qcqp_sol.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void s_cast_qcqp_compute_dim(struct s_ocp_qcqp_dim *ocp_dim, struct s_dense_qcqp_dim *dense_dim);
|
||||
//
|
||||
void s_cast_qcqp_cond(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp *dense_qp);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_CAST_QCQP_H_
|
||||
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_COND_H_
|
||||
#define HPIPM_S_COND_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qp.h"
|
||||
#include "hpipm_s_dense_qp_sol.h"
|
||||
#include "hpipm_s_ocp_qp.h"
|
||||
#include "hpipm_s_ocp_qp_dim.h"
|
||||
#include "hpipm_s_ocp_qp_sol.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_cond_qp_arg
|
||||
{
|
||||
int cond_last_stage; // condense last stage
|
||||
int cond_alg; // condensing algorithm: 0 N2-nx3, 1 N3-nx2
|
||||
int comp_prim_sol; // primal solution (v)
|
||||
int comp_dual_sol_eq; // dual solution equality constr (pi)
|
||||
int comp_dual_sol_ineq; // dual solution inequality constr (lam t)
|
||||
int square_root_alg; // square root algorithm (faster but requires RSQ>0)
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_cond_qp_ws
|
||||
{
|
||||
struct blasfeo_smat *Gamma;
|
||||
struct blasfeo_smat *GammaQ;
|
||||
struct blasfeo_smat *L;
|
||||
struct blasfeo_smat *Lx;
|
||||
struct blasfeo_smat *AL;
|
||||
struct blasfeo_svec *Gammab;
|
||||
struct blasfeo_svec *l;
|
||||
struct blasfeo_svec *tmp_nbgM;
|
||||
struct blasfeo_svec *tmp_nuxM;
|
||||
int bs; // block size
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_cond_qp_arg_memsize();
|
||||
//
|
||||
void s_cond_qp_arg_create(struct s_cond_qp_arg *cond_arg, void *mem);
|
||||
//
|
||||
void s_cond_qp_arg_set_default(struct s_cond_qp_arg *cond_arg);
|
||||
// condensing algorithm: 0 N2-nx3, 1 N3-nx2
|
||||
void s_cond_qp_arg_set_cond_alg(int cond_alg, struct s_cond_qp_arg *cond_arg);
|
||||
// set riccati-like algorithm: 0 classical, 1 square-root
|
||||
void s_cond_qp_arg_set_ric_alg(int ric_alg, struct s_cond_qp_arg *cond_arg);
|
||||
// condense last stage: 0 last stage disregarded, 1 last stage condensed too
|
||||
void s_cond_qp_arg_set_cond_last_stage(int cond_last_stage, struct s_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void s_cond_qp_arg_set_comp_prim_sol(int value, struct s_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void s_cond_qp_arg_set_comp_dual_sol_eq(int value, struct s_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void s_cond_qp_arg_set_comp_dual_sol_ineq(int value, struct s_cond_qp_arg *cond_arg);
|
||||
|
||||
//
|
||||
void s_cond_qp_compute_dim(struct s_ocp_qp_dim *ocp_dim, struct s_dense_qp_dim *dense_dim);
|
||||
//
|
||||
hpipm_size_t s_cond_qp_ws_memsize(struct s_ocp_qp_dim *ocp_dim, struct s_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void s_cond_qp_ws_create(struct s_ocp_qp_dim *ocp_dim, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws, void *mem);
|
||||
//
|
||||
void s_cond_qp_cond(struct s_ocp_qp *ocp_qp, struct s_dense_qp *dense_qp, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qp_cond_lhs(struct s_ocp_qp *ocp_qp, struct s_dense_qp *dense_qp, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qp_cond_rhs(struct s_ocp_qp *ocp_qp, struct s_dense_qp *dense_qp, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qp_expand_sol(struct s_ocp_qp *ocp_qp, struct s_dense_qp_sol *dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
// TODO remove
|
||||
void s_cond_qp_expand_primal_sol(struct s_ocp_qp *ocp_qp, struct s_dense_qp_sol *dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
|
||||
//
|
||||
void s_cond_qp_update(int *idxc, struct s_ocp_qp *ocp_qp, struct s_dense_qp *dense_qp, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_COND_H_
|
||||
@@ -1,92 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_COND_AUX_H_
|
||||
#define HPIPM_S_COND_AUX_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void s_cond_BAbt(struct s_ocp_qp *ocp_qp, struct blasfeo_smat *BAbt2, struct blasfeo_svec *b2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_BAt(struct s_ocp_qp *ocp_qp, struct blasfeo_smat *BAbt2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_b(struct s_ocp_qp *ocp_qp, struct blasfeo_svec *b2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_RSQrq(struct s_ocp_qp *ocp_qp, struct blasfeo_smat *RSQrq2, struct blasfeo_svec *rq2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_RSQ(struct s_ocp_qp *ocp_qp, struct blasfeo_smat *RSQrq2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_rq(struct s_ocp_qp *ocp_qp, struct blasfeo_svec *rq2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_DCtd(struct s_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_smat *DCt2, struct blasfeo_svec *d2, struct blasfeo_svec *d_mask2, int *idxs_rev2, struct blasfeo_svec *Z2, struct blasfeo_svec *z2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_DCt(struct s_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_smat *DCt2, int *idxs_rev2, struct blasfeo_svec *Z2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_d(struct s_ocp_qp *ocp_qp, struct blasfeo_svec *d2, struct blasfeo_svec *d_mask2, struct blasfeo_svec *z2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_expand_sol(struct s_ocp_qp *ocp_qp, struct s_dense_qp_sol *dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_expand_primal_sol(struct s_ocp_qp *ocp_qp, struct s_dense_qp_sol *dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
|
||||
//
|
||||
void s_update_cond_BAbt(int *idxc, struct s_ocp_qp *ocp_qp, struct blasfeo_smat *BAbt2, struct blasfeo_svec *b2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_update_cond_RSQrq_N2nx3(int *idxc, struct s_ocp_qp *ocp_qp, struct blasfeo_smat *RSQrq2, struct blasfeo_svec *rq2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_update_cond_DCtd(int *idxc, struct s_ocp_qp *ocp_qp, int *idxb2, struct blasfeo_smat *DCt2, struct blasfeo_svec *d2, int *idxs2, struct blasfeo_svec *Z2, struct blasfeo_svec *z2, struct s_cond_qp_arg *cond_arg, struct s_cond_qp_ws *cond_ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_COND_AUX_H_
|
||||
@@ -1,130 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_COND_QCQP_H_
|
||||
#define HPIPM_S_COND_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qcqp.h"
|
||||
#include "hpipm_s_dense_qcqp_sol.h"
|
||||
#include "hpipm_s_ocp_qcqp.h"
|
||||
#include "hpipm_s_ocp_qcqp_dim.h"
|
||||
#include "hpipm_s_ocp_qcqp_sol.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_cond_qcqp_arg
|
||||
{
|
||||
struct s_cond_qp_arg *qp_arg;
|
||||
int cond_last_stage; // condense last stage
|
||||
// int cond_variant; // TODO
|
||||
int comp_prim_sol; // primal solution (v)
|
||||
int comp_dual_sol_eq; // dual solution equality constr (pi)
|
||||
int comp_dual_sol_ineq; // dual solution equality constr (lam t)
|
||||
int square_root_alg; // square root algorithm (faster but requires RSQ>0)
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_cond_qcqp_ws
|
||||
{
|
||||
struct s_cond_qp_ws *qp_ws;
|
||||
struct blasfeo_smat *hess_array; // TODO remove
|
||||
struct blasfeo_smat *zero_hess; // TODO remove
|
||||
struct blasfeo_svec *zero_grad; // TODO remove
|
||||
struct blasfeo_svec *grad_array; // TODO remove
|
||||
struct blasfeo_svec *tmp_nvc;
|
||||
struct blasfeo_svec *tmp_nuxM;
|
||||
struct blasfeo_smat *GammaQ;
|
||||
struct blasfeo_smat *tmp_DCt;
|
||||
struct blasfeo_smat *tmp_nuM_nxM;
|
||||
// struct blasfeo_svec *d_qp;
|
||||
// struct blasfeo_svec *d_mask_qp;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_cond_qcqp_arg_memsize();
|
||||
//
|
||||
void s_cond_qcqp_arg_create(struct s_cond_qcqp_arg *cond_arg, void *mem);
|
||||
//
|
||||
void s_cond_qcqp_arg_set_default(struct s_cond_qcqp_arg *cond_arg);
|
||||
// set riccati-like algorithm: 0 classical, 1 square-root
|
||||
void s_cond_qcqp_arg_set_ric_alg(int ric_alg, struct s_cond_qcqp_arg *cond_arg);
|
||||
// condense last stage: 0 last stage disregarded, 1 last stage condensed too
|
||||
void s_cond_qcqp_arg_set_cond_last_stage(int cond_last_stage, struct s_cond_qcqp_arg *cond_arg);
|
||||
|
||||
//
|
||||
void s_cond_qcqp_compute_dim(struct s_ocp_qcqp_dim *ocp_dim, struct s_dense_qcqp_dim *dense_dim);
|
||||
//
|
||||
hpipm_size_t s_cond_qcqp_ws_memsize(struct s_ocp_qcqp_dim *ocp_dim, struct s_cond_qcqp_arg *cond_arg);
|
||||
//
|
||||
void s_cond_qcqp_ws_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws, void *mem);
|
||||
//
|
||||
void s_cond_qcqp_qc(struct s_ocp_qcqp *ocp_qp, struct blasfeo_smat *Hq2, int *Hq_nzero2, struct blasfeo_smat *Ct2, struct blasfeo_svec *d2, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qcqp_qc_lhs(struct s_ocp_qcqp *ocp_qp, struct blasfeo_smat *Hq2, int *Hq_nzero2, struct blasfeo_smat *Ct2, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qcqp_qc_rhs(struct s_ocp_qcqp *ocp_qp, struct blasfeo_svec *d2, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qcqp_cond(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp *dense_qp, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qcqp_cond_rhs(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp *dense_qp, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qcqp_cond_lhs(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp *dense_qp, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_cond_qcqp_expand_sol(struct s_ocp_qcqp *ocp_qp, struct s_dense_qcqp_sol *dense_qp_sol, struct s_ocp_qcqp_sol *ocp_qp_sol, struct s_cond_qcqp_arg *cond_arg, struct s_cond_qcqp_ws *cond_ws);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_COND_QCQP_H_
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_CORE_QP_IPM_
|
||||
#define HPIPM_S_CORE_QP_IPM_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct s_core_qp_ipm_workspace
|
||||
{
|
||||
float *v; // primal variables
|
||||
float *pi; // equality constraints multipliers
|
||||
float *lam; // inequality constraints multipliers
|
||||
float *t; // inequality constraints slacks
|
||||
float *t_inv; // inverse of t
|
||||
float *v_bkp; // backup of primal variables
|
||||
float *pi_bkp; // backup of equality constraints multipliers
|
||||
float *lam_bkp; // backup of inequality constraints multipliers
|
||||
float *t_bkp; // backup of inequality constraints slacks
|
||||
float *dv; // step in v
|
||||
float *dpi; // step in pi
|
||||
float *dlam; // step in lam
|
||||
float *dt; // step in t
|
||||
float *res_g; // q-residuals
|
||||
float *res_b; // b-residuals
|
||||
float *res_d; // d-residuals
|
||||
float *res_m; // m-residuals
|
||||
float *res_m_bkp; // m-residuals
|
||||
float *Gamma; // Hessian update
|
||||
float *gamma; // gradient update
|
||||
float alpha_prim; // step length
|
||||
float alpha_dual; // step length
|
||||
float alpha; // step length
|
||||
float sigma; // centering XXX
|
||||
float mu; // duality measuere
|
||||
float mu_aff; // affine duality measuere
|
||||
float nc_inv; // 1.0/nc, where nc is the total number of constraints
|
||||
float nc_mask_inv; // 1.0/nc_mask
|
||||
float lam_min; // min value in lam vector
|
||||
float t_min; // min value in t vector
|
||||
float t_min_inv; // inverse of min value in t vector
|
||||
float tau_min; // min value of barrier parameter
|
||||
int nv; // number of primal variables
|
||||
int ne; // number of equality constraints
|
||||
int nc; // (twice the) number of (two-sided) inequality constraints
|
||||
int nc_mask; // total number of ineq constr after masking
|
||||
int split_step; // use different step for primal and dual variables
|
||||
int t_lam_min; // clip t and lam also in solution, or only in Gamma computation
|
||||
hpipm_size_t memsize; // memory size (in bytes) of workspace
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_memsize_core_qp_ipm(int nv, int ne, int nc);
|
||||
//
|
||||
void s_create_core_qp_ipm(int nv, int ne, int nc, struct s_core_qp_ipm_workspace *workspace, void *mem);
|
||||
//
|
||||
void s_core_qp_ipm(struct s_core_qp_ipm_workspace *workspace);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_S_CORE_QP_IPM_
|
||||
@@ -1,68 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_CORE_QP_IPM_AUX_
|
||||
#define HPIPM_S_CORE_QP_IPM_AUX_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
void s_compute_Gamma_gamma_qp(float *res_d, float *res_m, struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_compute_gamma_qp(float *res_d, float *res_m, struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_compute_lam_t_qp(float *res_d, float *res_m, float *dlam, float *dt, struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_compute_alpha_qp(struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_update_var_qp(struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_compute_mu_aff_qp(struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_backup_res_m(struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_compute_centering_correction_qp(struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_compute_centering_qp(struct s_core_qp_ipm_workspace *rws);
|
||||
//
|
||||
void s_compute_tau_min_qp(struct s_core_qp_ipm_workspace *rws);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_S_CORE_QP_IPM_AUX_
|
||||
@@ -1,200 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QCQP_H_
|
||||
#define HPIPM_S_DENSE_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qcqp
|
||||
{
|
||||
struct s_dense_qcqp_dim *dim;
|
||||
struct blasfeo_smat *Hv; // hessian of cost & vector work space
|
||||
struct blasfeo_smat *A; // equality constraint matrix
|
||||
struct blasfeo_smat *Ct; // inequality constraints matrix
|
||||
struct blasfeo_smat *Hq; // hessians of quadratic constraints
|
||||
struct blasfeo_svec *gz; // gradient of cost & gradient of slacks
|
||||
struct blasfeo_svec *b; // equality constraint vector
|
||||
struct blasfeo_svec *d; // inequality constraints vector
|
||||
struct blasfeo_svec *d_mask; // inequality constraints mask vector
|
||||
struct blasfeo_svec *m; // rhs of complementarity condition
|
||||
struct blasfeo_svec *Z; // (diagonal) hessian of slacks
|
||||
int *idxb; // indices of box constrained variables within [u; x]
|
||||
int *idxs_rev; // index of soft constraints (reverse storage)
|
||||
int *Hq_nzero; // for each int, the last 3 bits ...abc, {a,b,c}=0 => {R,S,Q}=0
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qcqp_memsize(struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp *qp, void *memory);
|
||||
|
||||
//
|
||||
void s_dense_qcqp_set(char *field, void *value, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_H(float *H, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_g(float *g, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_A(float *A, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_b(float *b, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_idxb(int *idxb, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_lb(float *lb, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_lb_mask(float *lb, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_ub(float *ub, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_ub_mask(float *ub, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_C(float *C, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_lg(float *lg, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_lg_mask(float *lg, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_ug(float *ug, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_ug_mask(float *ug, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_Hq(float *Hq, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_gq(float *gq, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_uq(float *uq, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_uq_mask(float *uq, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_idxs(int *idxs, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_idxs_rev(int *idxs_rev, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_Zl(float *Zl, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_Zu(float *Zu, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_zl(float *zl, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_zu(float *zu, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_ls(float *ls, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_ls_mask(float *ls, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_us(float *us, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_set_us_mask(float *us, struct s_dense_qcqp *qp);
|
||||
|
||||
// getters (COLMAJ)
|
||||
|
||||
void s_dense_qcqp_get_H(struct s_dense_qcqp *qp, float *H);
|
||||
//
|
||||
void s_dense_qcqp_get_g(struct s_dense_qcqp *qp, float *g);
|
||||
//
|
||||
void s_dense_qcqp_get_A(struct s_dense_qcqp *qp, float *A);
|
||||
//
|
||||
void s_dense_qcqp_get_b(struct s_dense_qcqp *qp, float *b);
|
||||
//
|
||||
void s_dense_qcqp_get_idxb(struct s_dense_qcqp *qp, int *idxb);
|
||||
//
|
||||
void s_dense_qcqp_get_lb(struct s_dense_qcqp *qp, float *lb);
|
||||
//
|
||||
void s_dense_qcqp_get_lb_mask(struct s_dense_qcqp *qp, float *lb);
|
||||
//
|
||||
void s_dense_qcqp_get_ub(struct s_dense_qcqp *qp, float *ub);
|
||||
//
|
||||
void s_dense_qcqp_get_ub_mask(struct s_dense_qcqp *qp, float *ub);
|
||||
//
|
||||
void s_dense_qcqp_get_C(struct s_dense_qcqp *qp, float *C);
|
||||
//
|
||||
void s_dense_qcqp_get_lg(struct s_dense_qcqp *qp, float *lg);
|
||||
//
|
||||
void s_dense_qcqp_get_lg_mask(struct s_dense_qcqp *qp, float *lg);
|
||||
//
|
||||
void s_dense_qcqp_get_ug(struct s_dense_qcqp *qp, float *ug);
|
||||
//
|
||||
void s_dense_qcqp_get_ug_mask(struct s_dense_qcqp *qp, float *ug);
|
||||
//
|
||||
void s_dense_qcqp_get_idxs(struct s_dense_qcqp *qp, int *idxs);
|
||||
//
|
||||
void s_dense_qcqp_get_idxs_rev(struct s_dense_qcqp *qp, int *idxs_rev);
|
||||
//
|
||||
void s_dense_qcqp_get_Zl(struct s_dense_qcqp *qp, float *Zl);
|
||||
//
|
||||
void s_dense_qcqp_get_Zu(struct s_dense_qcqp *qp, float *Zu);
|
||||
//
|
||||
void s_dense_qcqp_get_zl(struct s_dense_qcqp *qp, float *zl);
|
||||
//
|
||||
void s_dense_qcqp_get_zu(struct s_dense_qcqp *qp, float *zu);
|
||||
//
|
||||
void s_dense_qcqp_get_ls(struct s_dense_qcqp *qp, float *ls);
|
||||
//
|
||||
void s_dense_qcqp_get_ls_mask(struct s_dense_qcqp *qp, float *ls);
|
||||
//
|
||||
void s_dense_qcqp_get_us(struct s_dense_qcqp *qp, float *us);
|
||||
//
|
||||
void s_dense_qcqp_get_us_mask(struct s_dense_qcqp *qp, float *us);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QCQP_H_
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QCQP_DIM_H_
|
||||
#define HPIPM_S_DENSE_QCQP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qcqp_dim
|
||||
{
|
||||
struct s_dense_qp_dim *qp_dim; // dim of qp approximation
|
||||
int nv; // number of variables
|
||||
int ne; // number of equality constraints
|
||||
int nb; // number of box constraints
|
||||
int ng; // number of general constraints
|
||||
int nq; // number of quadratic constraints
|
||||
int nsb; // number of softened box constraints
|
||||
int nsg; // number of softened general constraints
|
||||
int nsq; // number of softened quadratic constraints
|
||||
int ns; // number of softened constraints (nsb+nsg+nsq) TODO number of slacks
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qcqp_dim_memsize();
|
||||
//
|
||||
void s_dense_qcqp_dim_create(struct s_dense_qcqp_dim *dim, void *memory);
|
||||
//
|
||||
void s_dense_qcqp_dim_set(char *fiels_name, int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_nv(int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_ne(int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_nb(int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_ng(int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_nq(int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_nsb(int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_nsg(int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_nsq(int value, struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_dim_set_ns(int value, struct s_dense_qcqp_dim *dim);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QCQP_DIM_H_
|
||||
|
||||
|
||||
@@ -1,204 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QCQP_IPM_H_
|
||||
#define HPIPM_S_DENSE_QCQP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_dense_qcqp_dim.h>
|
||||
#include <hpipm_s_dense_qcqp.h>
|
||||
#include <hpipm_s_dense_qcqp_res.h>
|
||||
#include <hpipm_s_dense_qcqp_sol.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qcqp_ipm_arg
|
||||
{
|
||||
struct s_dense_qp_ipm_arg *qp_arg;
|
||||
float mu0; // initial value for duality measure
|
||||
float alpha_min; // exit cond on step length
|
||||
float res_g_max; // exit cond on inf norm of residuals
|
||||
float res_b_max; // exit cond on inf norm of residuals
|
||||
float res_d_max; // exit cond on inf norm of residuals
|
||||
float res_m_max; // exit cond on inf norm of residuals
|
||||
float reg_prim; // reg of primal hessian
|
||||
float reg_dual; // reg of dual hessian
|
||||
float lam_min; // min value in lam vector
|
||||
float t_min; // min value in t vector
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int scale; // scale hessian
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1)
|
||||
int comp_res_pred; // compute residuals of prediction
|
||||
int split_step; // use different step for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_dense_qcqp_ipm_ws
|
||||
{
|
||||
// float qp_res[4]; // infinity norm of residuals
|
||||
struct s_dense_qp_ipm_ws *qp_ws;
|
||||
struct s_dense_qp *qp;
|
||||
struct s_dense_qp_sol *qp_sol;
|
||||
struct s_dense_qcqp_res_ws *qcqp_res_ws;
|
||||
struct s_dense_qcqp_res *qcqp_res;
|
||||
struct blasfeo_svec *tmp_nv;
|
||||
// float *stat; // convergence statistics
|
||||
// void *lq_work0;
|
||||
// void *lq_work1;
|
||||
int iter; // iteration number
|
||||
// int stat_max; // iterations saved in stat
|
||||
// int stat_m; // numer of recorded stat per ipm iter
|
||||
// int scale;
|
||||
// int use_hess_fact;
|
||||
int status;
|
||||
hpipm_size_t memsize; // memory size (in bytes) of workspace
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qcqp_ipm_arg_memsize(struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set(char *field, void *value, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_iter_max(int *iter_max, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_alpha_min(float *alpha_min, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_mu0(float *mu0, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_tol_stat(float *tol_stat, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_tol_eq(float *tol_eq, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_tol_ineq(float *tol_ineq, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_tol_comp(float *tol_comp, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_reg_prim(float *reg, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_reg_dual(float *reg, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_warm_start(int *warm_start, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_pred_corr(int *pred_corr, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_cond_pred_corr(int *cond_pred_corr, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_comp_res_pred(int *comp_res_pred, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_comp_res_exit(int *comp_res_exit, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_lam_min(float *value, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_t_min(float *value, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_split_step(int *value, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_arg_set_t_lam_min(int *value, struct s_dense_qcqp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qcqp_ipm_ws_memsize(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_ipm_ws_create(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get(char *field, struct s_dense_qcqp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get_status(struct s_dense_qcqp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get_iter(struct s_dense_qcqp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get_max_res_stat(struct s_dense_qcqp_ipm_ws *ws, float *res_stat);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get_max_res_eq(struct s_dense_qcqp_ipm_ws *ws, float *res_eq);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get_max_res_ineq(struct s_dense_qcqp_ipm_ws *ws, float *res_ineq);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get_max_res_comp(struct s_dense_qcqp_ipm_ws *ws, float *res_comp);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get_stat(struct s_dense_qcqp_ipm_ws *ws, float **stat);
|
||||
//
|
||||
void s_dense_qcqp_ipm_get_stat_m(struct s_dense_qcqp_ipm_ws *ws, int *stat_m);
|
||||
#if 0
|
||||
//
|
||||
void s_dense_qcqp_init_var(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws);
|
||||
#endif
|
||||
//
|
||||
void s_dense_qcqp_ipm_solve(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws);
|
||||
#if 0
|
||||
//
|
||||
void s_dense_qcqp_ipm_predict(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qcqp_ipm_sens(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_ipm_arg *arg, struct s_dense_qcqp_ipm_ws *ws);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QCQP_IPM_H_
|
||||
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QCQP_RES_H_
|
||||
#define HPIPM_S_DENSE_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_s_dense_qcqp_dim.h>
|
||||
#include <hpipm_s_dense_qcqp.h>
|
||||
#include <hpipm_s_dense_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qcqp_res
|
||||
{
|
||||
struct s_dense_qcqp_dim *dim;
|
||||
struct blasfeo_svec *res_g; // q-residuals
|
||||
struct blasfeo_svec *res_b; // b-residuals
|
||||
struct blasfeo_svec *res_d; // d-residuals
|
||||
struct blasfeo_svec *res_m; // m-residuals
|
||||
float res_max[4]; // infinity norm of residuals
|
||||
float res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_dense_qcqp_res_ws
|
||||
{
|
||||
struct blasfeo_svec *tmp_nv; // work space of size nv
|
||||
struct blasfeo_svec *tmp_nbgq; // work space of size nbM+ngM+nqM
|
||||
struct blasfeo_svec *tmp_ns; // work space of size nsM
|
||||
struct blasfeo_svec *q_fun; // value for evaluation of quadr constr
|
||||
struct blasfeo_svec *q_adj; // value for adjoint of quadr constr
|
||||
int use_q_fun; // reuse cached value for evaluation of quadr constr
|
||||
int use_q_adj; // reuse cached value for adjoint of quadr constr
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qcqp_res_memsize(struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_res_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t s_dense_qcqp_res_ws_memsize(struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_res_ws_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp_res_ws *workspace, void *mem);
|
||||
//
|
||||
void s_dense_qcqp_res_compute(struct s_dense_qcqp *qp, struct s_dense_qcqp_sol *qp_sol, struct s_dense_qcqp_res *res, struct s_dense_qcqp_res_ws *ws);
|
||||
//
|
||||
void s_dense_qcqp_res_compute_inf_norm(struct s_dense_qcqp_res *res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QCQP_SOL_H_
|
||||
#define HPIPM_S_DENSE_QCQP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qcqp_sol
|
||||
{
|
||||
struct s_dense_qcqp_dim *dim;
|
||||
struct blasfeo_svec *v;
|
||||
struct blasfeo_svec *pi;
|
||||
struct blasfeo_svec *lam;
|
||||
struct blasfeo_svec *t;
|
||||
void *misc;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qcqp_sol_memsize(struct s_dense_qcqp_dim *dim);
|
||||
//
|
||||
void s_dense_qcqp_sol_create(struct s_dense_qcqp_dim *dim, struct s_dense_qcqp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void s_dense_qcqp_sol_get_v(struct s_dense_qcqp_sol *qp_sol, float *v);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QCQP_SOL_H_
|
||||
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QCQP_UTILS_H_
|
||||
#define HPIPM_S_DENSE_QCQP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qcqp_dim.h"
|
||||
#include "hpipm_s_dense_qcqp.h"
|
||||
#include "hpipm_s_dense_qcqp_sol.h"
|
||||
//#include "hpipm_s_dense_qcqp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void s_dense_qcqp_dim_print(struct s_dense_qcqp_dim *qp_dim);
|
||||
//
|
||||
//void s_dense_qcqp_dim_codegen(char *file_name, char *mode, struct s_dense_qcqp_dim *qp_dim);
|
||||
//
|
||||
void s_dense_qcqp_print(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp *qp);
|
||||
//
|
||||
//void s_dense_qcqp_codegen(char *file_name, char *mode, struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp *qp);
|
||||
//
|
||||
void s_dense_qcqp_sol_print(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_sol *dense_qcqp_sol);
|
||||
//
|
||||
//void s_dense_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qcqp_res_print(struct s_dense_qcqp_dim *qp_dim, struct s_dense_qcqp_res *dense_qcqp_res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QCQP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QP_H_
|
||||
#define HPIPM_S_DENSE_QP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qp
|
||||
{
|
||||
struct s_dense_qp_dim *dim;
|
||||
struct blasfeo_smat *Hv; // hessian & gradient
|
||||
struct blasfeo_smat *A; // dynamics matrix
|
||||
struct blasfeo_smat *Ct; // constraints matrix
|
||||
struct blasfeo_svec *gz; // gradient & gradient of slacks
|
||||
struct blasfeo_svec *b; // dynamics vector
|
||||
struct blasfeo_svec *d; // constraints vector
|
||||
struct blasfeo_svec *d_mask; // inequality constraints mask vector
|
||||
struct blasfeo_svec *m; // rhs of complementarity condition
|
||||
struct blasfeo_svec *Z; // (diagonal) hessian of slacks
|
||||
int *idxb; // indices of box constrained variables within [u; x]
|
||||
int *idxs_rev; // index of soft constraints (reverse storage)
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qp_memsize(struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_create(struct s_dense_qp_dim *dim, struct s_dense_qp *qp, void *memory);
|
||||
|
||||
// setters - colmaj
|
||||
//
|
||||
void s_dense_qp_set_all(float *H, float *g, float *A, float *b, int *idxb, float *d_lb, float *d_ub, float *C, float *d_lg, float *d_ug, float *Zl, float *Zu, float *zl, float *zu, int *idxs, float *d_ls, float *d_us, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_get_all(struct s_dense_qp *qp, float *H, float *g, float *A, float *b, int *idxb, float *d_lb, float *d_ub, float *C, float *d_lg, float *d_ug, float *Zl, float *Zu, float *zl, float *zu, int *idxs, float *d_ls, float *d_us);
|
||||
//
|
||||
void s_dense_qp_set(char *field, void *value, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_H(float *H, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_g(float *g, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_A(float *A, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_b(float *b, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_idxb(int *idxb, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_Jb(float *Jb, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_lb(float *lb, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_lb_mask(float *lb, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_ub(float *ub, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_ub_mask(float *ub, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_C(float *C, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_lg(float *lg, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_lg_mask(float *lg, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_ug(float *ug, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_ug_mask(float *ug, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_idxs(int *idxs, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_idxs_rev(int *idxs_rev, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_Jsb(float *Jsb, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_Jsg(float *Jsg, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_Zl(float *Zl, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_Zu(float *Zu, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_zl(float *zl, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_zu(float *zu, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_ls(float *ls, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_ls_mask(float *ls, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_us(float *us, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_set_us_mask(float *us, struct s_dense_qp *qp);
|
||||
|
||||
// getters - colmaj
|
||||
//
|
||||
void s_dense_qp_get_H(struct s_dense_qp *qp, float *H);
|
||||
//
|
||||
void s_dense_qp_get_g(struct s_dense_qp *qp, float *g);
|
||||
//
|
||||
void s_dense_qp_get_A(struct s_dense_qp *qp, float *A);
|
||||
//
|
||||
void s_dense_qp_get_b(struct s_dense_qp *qp, float *b);
|
||||
//
|
||||
void s_dense_qp_get_idxb(struct s_dense_qp *qp, int *idxb);
|
||||
//
|
||||
void s_dense_qp_get_lb(struct s_dense_qp *qp, float *lb);
|
||||
//
|
||||
void s_dense_qp_get_lb_mask(struct s_dense_qp *qp, float *lb);
|
||||
//
|
||||
void s_dense_qp_get_ub(struct s_dense_qp *qp, float *ub);
|
||||
//
|
||||
void s_dense_qp_get_ub_mask(struct s_dense_qp *qp, float *ub);
|
||||
//
|
||||
void s_dense_qp_get_C(struct s_dense_qp *qp, float *C);
|
||||
//
|
||||
void s_dense_qp_get_lg(struct s_dense_qp *qp, float *lg);
|
||||
//
|
||||
void s_dense_qp_get_lg_mask(struct s_dense_qp *qp, float *lg);
|
||||
//
|
||||
void s_dense_qp_get_ug(struct s_dense_qp *qp, float *ug);
|
||||
//
|
||||
void s_dense_qp_get_ug_mask(struct s_dense_qp *qp, float *ug);
|
||||
//
|
||||
void s_dense_qp_get_idxs(struct s_dense_qp *qp, int *idxs);
|
||||
//
|
||||
void s_dense_qp_get_idxs_rev(struct s_dense_qp *qp, int *idxs_rev);
|
||||
//
|
||||
void s_dense_qp_get_Zl(struct s_dense_qp *qp, float *Zl);
|
||||
//
|
||||
void s_dense_qp_get_Zu(struct s_dense_qp *qp, float *Zu);
|
||||
//
|
||||
void s_dense_qp_get_zl(struct s_dense_qp *qp, float *zl);
|
||||
//
|
||||
void s_dense_qp_get_zu(struct s_dense_qp *qp, float *zu);
|
||||
//
|
||||
void s_dense_qp_get_ls(struct s_dense_qp *qp, float *ls);
|
||||
//
|
||||
void s_dense_qp_get_ls_mask(struct s_dense_qp *qp, float *ls);
|
||||
//
|
||||
void s_dense_qp_get_us(struct s_dense_qp *qp, float *us);
|
||||
//
|
||||
void s_dense_qp_get_us_mask(struct s_dense_qp *qp, float *us);
|
||||
|
||||
// setters - rowmaj
|
||||
//
|
||||
void s_dense_qp_set_all_rowmaj(float *H, float *g, float *A, float *b, int *idxb, float *d_lb, float *d_ub, float *C, float *d_lg, float *d_ug, float *Zl, float *Zu, float *zl, float *zu, int *idxs, float *d_ls, float *d_us, struct s_dense_qp *qp);
|
||||
|
||||
// getters - rowmaj
|
||||
//
|
||||
void s_dense_qp_get_all_rowmaj(struct s_dense_qp *qp, float *H, float *g, float *A, float *b, int *idxb, float *d_lb, float *d_ub, float *C, float *d_lg, float *d_ug, float *Zl, float *Zu, float *zl, float *zu, int *idxs, float *d_ls, float *d_us);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QP_H_
|
||||
@@ -1,94 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QP_DIM_H_
|
||||
#define HPIPM_S_DENSE_QP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qp_dim
|
||||
{
|
||||
int nv; // number of variables
|
||||
int ne; // number of equality constraints
|
||||
int nb; // number of box constraints
|
||||
int ng; // number of general constraints
|
||||
int nsb; // number of softened box constraints
|
||||
int nsg; // number of softened general constraints
|
||||
int ns; // number of softened constraints (nsb+nsg)
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qp_dim_memsize();
|
||||
//
|
||||
void s_dense_qp_dim_create(struct s_dense_qp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void s_dense_qp_dim_set_all(int nv, int ne, int nb, int ng, int nsb, int nsg, struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_dim_set(char *fiels_name, int value, struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_dim_set_nv(int value, struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_dim_set_ne(int value, struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_dim_set_nb(int value, struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_dim_set_ng(int value, struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_dim_set_nsb(int value, struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_dim_set_nsg(int value, struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_dim_set_ns(int value, struct s_dense_qp_dim *dim);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QP_DIM_H_
|
||||
|
||||
|
||||
@@ -1,260 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QP_IPM_H_
|
||||
#define HPIPM_S_DENSE_QP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_dense_qp_dim.h>
|
||||
#include <hpipm_s_dense_qp.h>
|
||||
#include <hpipm_s_dense_qp_res.h>
|
||||
#include <hpipm_s_dense_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qp_ipm_arg
|
||||
{
|
||||
float mu0; // initial value for duality measure
|
||||
float alpha_min; // exit cond on step length
|
||||
float res_g_max; // exit cond on inf norm of residuals
|
||||
float res_b_max; // exit cond on inf norm of residuals
|
||||
float res_d_max; // exit cond on inf norm of residuals
|
||||
float res_m_max; // exit cond on inf norm of residuals
|
||||
float reg_prim; // reg of primal hessian
|
||||
float reg_dual; // reg of dual hessian
|
||||
float lam_min; // min value in lam vector
|
||||
float t_min; // min value in t vector
|
||||
float tau_min; // min value of barrier parameter
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int scale; // scale hessian
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1)
|
||||
int comp_res_pred; // compute residuals of prediction
|
||||
int kkt_fact_alg; // 0 null-space, 1 schur-complement
|
||||
int remove_lin_dep_eq; // 0 do not, 1 do check and remove linearly dependent equality constraints
|
||||
int compute_obj; // compute obj on exit
|
||||
int split_step; // use different steps for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_dense_qp_ipm_ws
|
||||
{
|
||||
struct s_core_qp_ipm_workspace *core_workspace;
|
||||
struct s_dense_qp_res_ws *res_ws;
|
||||
struct s_dense_qp_sol *sol_step;
|
||||
struct s_dense_qp_sol *sol_itref;
|
||||
struct s_dense_qp *qp_step;
|
||||
struct s_dense_qp *qp_itref;
|
||||
struct s_dense_qp_res *res;
|
||||
struct s_dense_qp_res *res_itref;
|
||||
struct s_dense_qp_res *res_step;
|
||||
struct blasfeo_svec *Gamma; //
|
||||
struct blasfeo_svec *gamma; //
|
||||
struct blasfeo_svec *Zs_inv; //
|
||||
struct blasfeo_smat *Lv; //
|
||||
struct blasfeo_smat *AL; //
|
||||
struct blasfeo_smat *Le; //
|
||||
struct blasfeo_smat *Ctx; //
|
||||
struct blasfeo_svec *lv; //
|
||||
struct blasfeo_svec *sv; // scale for Lv
|
||||
struct blasfeo_svec *se; // scale for Le
|
||||
struct blasfeo_svec *tmp_nbg; // work space of size nb+ng
|
||||
struct blasfeo_svec *tmp_ns; // work space of size ns
|
||||
struct blasfeo_smat *lq0;
|
||||
struct blasfeo_smat *lq1;
|
||||
struct blasfeo_svec *tmp_m;
|
||||
struct blasfeo_smat *A_LQ;
|
||||
struct blasfeo_smat *A_Q;
|
||||
struct blasfeo_smat *Zt;
|
||||
struct blasfeo_smat *ZtH;
|
||||
struct blasfeo_smat *ZtHZ;
|
||||
struct blasfeo_svec *xy;
|
||||
struct blasfeo_svec *Yxy;
|
||||
struct blasfeo_svec *xz;
|
||||
struct blasfeo_svec *tmp_nv;
|
||||
struct blasfeo_svec *tmp_2ns;
|
||||
struct blasfeo_svec *tmp_nv2ns;
|
||||
struct blasfeo_smat *A_li; // A of linearly independent equality constraints
|
||||
struct blasfeo_svec *b_li; // b of linearly independent equality constraints
|
||||
struct blasfeo_smat *A_bkp; // pointer to backup A
|
||||
struct blasfeo_svec *b_bkp; // pointer to backup b
|
||||
struct blasfeo_smat *Ab_LU;
|
||||
float *stat; // convergence statistics
|
||||
int *ipiv_v;
|
||||
int *ipiv_e;
|
||||
int *ipiv_e1;
|
||||
void *lq_work0;
|
||||
void *lq_work1;
|
||||
void *lq_work_null;
|
||||
void *orglq_work_null;
|
||||
int iter; // iteration number
|
||||
int stat_max; // iterations saved in stat
|
||||
int stat_m; // numer of recorded stat per ipm iter
|
||||
int scale;
|
||||
int use_hess_fact;
|
||||
int use_A_fact;
|
||||
int status;
|
||||
int lq_fact; // cache from arg
|
||||
int mask_constr; // use constr mask
|
||||
int ne_li; // number of linearly independent equality constraints
|
||||
int ne_bkp; // ne backup
|
||||
hpipm_size_t memsize; // memory size (in bytes) of workspace
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qp_ipm_arg_memsize(struct s_dense_qp_dim *qp_dim);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_create(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_default(enum hpipm_mode mode, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set(char *field, void *value, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_iter_max(int *iter_max, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_alpha_min(float *alpha_min, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_mu0(float *mu0, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_tol_stat(float *tol_stat, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_tol_eq(float *tol_eq, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_tol_ineq(float *tol_ineq, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_tol_comp(float *tol_comp, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_reg_prim(float *reg, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_reg_dual(float *reg, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_warm_start(int *warm_start, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_pred_corr(int *pred_corr, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_cond_pred_corr(int *cond_pred_corr, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_comp_res_pred(int *comp_res_pred, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_comp_res_exit(int *comp_res_exit, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_lam_min(float *value, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_t_min(float *value, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_tau_min(float *value, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_kkt_fact_alg(int *value, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_remove_lin_dep_eq(int *value, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_compute_obj(int *value, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_split_step(int *value, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_arg_set_t_lam_min(int *value, struct s_dense_qp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qp_ipm_ws_memsize(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_ipm_ws_create(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void s_dense_qp_ipm_get(char *field, struct s_dense_qp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void s_dense_qp_ipm_get_status(struct s_dense_qp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void s_dense_qp_ipm_get_iter(struct s_dense_qp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void s_dense_qp_ipm_get_max_res_stat(struct s_dense_qp_ipm_ws *ws, float *res_stat);
|
||||
//
|
||||
void s_dense_qp_ipm_get_max_res_eq(struct s_dense_qp_ipm_ws *ws, float *res_eq);
|
||||
//
|
||||
void s_dense_qp_ipm_get_max_res_ineq(struct s_dense_qp_ipm_ws *ws, float *res_ineq);
|
||||
//
|
||||
void s_dense_qp_ipm_get_max_res_comp(struct s_dense_qp_ipm_ws *ws, float *res_comp);
|
||||
//
|
||||
void s_dense_qp_ipm_get_stat(struct s_dense_qp_ipm_ws *ws, float **stat);
|
||||
//
|
||||
void s_dense_qp_ipm_get_stat_m(struct s_dense_qp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void s_dense_qp_init_var(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_ipm_abs_step(int kk, struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_ipm_delta_step(int kk, struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_ipm_solve(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_ipm_predict(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_ipm_sens(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_compute_step_length(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QP_IPM_H_
|
||||
@@ -1,72 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QP_KKT_H_
|
||||
#define HPIPM_S_DENSE_QP_KKT_H_
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void s_fact_solve_kkt_unconstr_dense_qp(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_fact_solve_kkt_step_dense_qp(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_fact_lq_solve_kkt_step_dense_qp(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_solve_kkt_step_dense_qp(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_remove_lin_dep_eq(struct s_dense_qp *qp, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_restore_lin_dep_eq(struct s_dense_qp *qp, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_dense_qp_compute_obj(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_ipm_arg *arg, struct s_dense_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QP_KKT_H_
|
||||
@@ -1,106 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QP_RES_H_
|
||||
#define HPIPM_S_DENSE_QP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_s_dense_qp_dim.h>
|
||||
#include <hpipm_s_dense_qp.h>
|
||||
#include <hpipm_s_dense_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qp_res
|
||||
{
|
||||
struct s_dense_qp_dim *dim;
|
||||
struct blasfeo_svec *res_g; // q-residuals
|
||||
struct blasfeo_svec *res_b; // b-residuals
|
||||
struct blasfeo_svec *res_d; // d-residuals
|
||||
struct blasfeo_svec *res_m; // m-residuals
|
||||
float res_max[4]; // max of residuals
|
||||
float res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_dense_qp_res_ws
|
||||
{
|
||||
struct blasfeo_svec *tmp_nbg; // work space of size nbM+ngM
|
||||
struct blasfeo_svec *tmp_ns; // work space of size nsM
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qp_res_memsize(struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_res_create(struct s_dense_qp_dim *dim, struct s_dense_qp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t s_dense_qp_res_ws_memsize(struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_res_ws_create(struct s_dense_qp_dim *dim, struct s_dense_qp_res_ws *workspace, void *mem);
|
||||
//
|
||||
void s_dense_qp_res_compute(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_res *res, struct s_dense_qp_res_ws *ws);
|
||||
//
|
||||
void s_dense_qp_res_compute_lin(struct s_dense_qp *qp, struct s_dense_qp_sol *qp_sol, struct s_dense_qp_sol *qp_step, struct s_dense_qp_res *res, struct s_dense_qp_res_ws *ws);
|
||||
//
|
||||
void s_dense_qp_res_compute_inf_norm(struct s_dense_qp_res *res);
|
||||
//
|
||||
void s_dense_qp_res_get_all(struct s_dense_qp_res *res, float *res_g, float *res_ls, float *res_us, float *res_b, float *res_d_lb, float *res_d_ub, float *res_d_lg, float *res_d_ug, float *res_d_ls, float *res_d_us, float *res_m_lb, float *res_m_ub, float *res_m_lg, float *res_m_ug, float *res_m_ls, float *res_m_us);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_D_DENSE_QP_RES_H_
|
||||
|
||||
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QP_SOL_H_
|
||||
#define HPIPM_S_DENSE_QP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_dense_qp_sol
|
||||
{
|
||||
struct s_dense_qp_dim *dim;
|
||||
struct blasfeo_svec *v;
|
||||
struct blasfeo_svec *pi;
|
||||
struct blasfeo_svec *lam;
|
||||
struct blasfeo_svec *t;
|
||||
void *misc;
|
||||
float obj;
|
||||
int valid_obj;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_dense_qp_sol_memsize(struct s_dense_qp_dim *dim);
|
||||
//
|
||||
void s_dense_qp_sol_create(struct s_dense_qp_dim *dim, struct s_dense_qp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void s_dense_qp_sol_get_all(struct s_dense_qp_sol *qp_sol, float *v, float *ls, float *us, float *pi, float *lam_lb, float *lam_ub, float *lam_lg, float *lam_ug, float *lam_ls, float *lam_us);
|
||||
//
|
||||
void s_dense_qp_sol_get(char *field, struct s_dense_qp_sol *sol, void *value);
|
||||
//
|
||||
void s_dense_qp_sol_get_v(struct s_dense_qp_sol *sol, float *v);
|
||||
//
|
||||
void s_dense_qp_sol_get_valid_obj(struct s_dense_qp_sol *sol, int *valid_obj);
|
||||
//
|
||||
void s_dense_qp_sol_get_obj(struct s_dense_qp_sol *sol, float *obj);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QP_SOL_H_
|
||||
@@ -1,84 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_DENSE_QP_UTILS_H_
|
||||
#define HPIPM_S_DENSE_QP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_dense_qp_dim.h"
|
||||
#include "hpipm_s_dense_qp.h"
|
||||
#include "hpipm_s_dense_qp_sol.h"
|
||||
#include "hpipm_s_dense_qp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void s_dense_qp_dim_print(struct s_dense_qp_dim *qp_dim);
|
||||
//
|
||||
//void s_dense_qp_dim_codegen(char *file_name, char *mode, struct s_dense_qp_dim *qp_dim);
|
||||
//
|
||||
void s_dense_qp_print(struct s_dense_qp_dim *qp_dim, struct s_dense_qp *qp);
|
||||
//
|
||||
//void s_dense_qp_codegen(char *file_name, char *mode, struct s_dense_qp_dim *qp_dim, struct s_dense_qp *qp);
|
||||
//
|
||||
void s_dense_qp_sol_print(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_sol *dense_qp_sol);
|
||||
//
|
||||
//void s_dense_qp_ipm_arg_codegen(char *file_name, char *mode, struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_dense_qp_res_print(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_res *dense_qp_res);
|
||||
//
|
||||
void s_dense_qp_arg_print(struct s_dense_qp_dim *qp_dim, struct s_dense_qp_ipm_arg *qp_ipm_arg);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_DENSE_QP_UTILS_H_
|
||||
|
||||
|
||||
@@ -1,303 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QCQP_H_
|
||||
#define HPIPM_S_OCP_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_ocp_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qcqp
|
||||
{
|
||||
struct s_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_smat *BAbt; // dynamics matrix & vector work space
|
||||
struct blasfeo_smat *RSQrq; // hessian of cost & vector work space
|
||||
struct blasfeo_smat *DCt; // inequality constraints matrix
|
||||
struct blasfeo_smat **Hq; // hessians of quadratic constraints
|
||||
struct blasfeo_svec *b; // dynamics vector
|
||||
struct blasfeo_svec *rqz; // gradient of cost & gradient of slacks
|
||||
struct blasfeo_svec *d; // inequality constraints vector
|
||||
struct blasfeo_svec *d_mask; // inequality constraints mask vector
|
||||
struct blasfeo_svec *m; // rhs of complementarity condition
|
||||
struct blasfeo_svec *Z; // (diagonal) hessian of slacks
|
||||
int **idxb; // indices of box constrained variables within [u; x]
|
||||
int **idxs_rev; // index of soft constraints (reverse storage)
|
||||
int **Hq_nzero; // for each int, the last 3 bits ...abc, {a,b,c}=0 => {R,S,Q}=0
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_memsize(struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_create(struct s_ocp_qcqp_dim *dim, struct s_ocp_qcqp *qp, void *memory);
|
||||
//
|
||||
void s_ocp_qcqp_copy_all(struct s_ocp_qcqp *qp_orig, struct s_ocp_qcqp *qp_dest);
|
||||
|
||||
// setters
|
||||
//
|
||||
void s_ocp_qcqp_set_all_zero(struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_rhs_zero(struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set(char *fiels_name, int stage, void *value, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_el(char *fiels_name, int stage, int index, void *value, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_A(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_B(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_b(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Q(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_S(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_R(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_q(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_r(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lb(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lb_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_ub(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_ub_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lbx(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lbx_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_el_lbx(int stage, int index, float *elem, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_ubx(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_ubx_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_el_ubx(int stage, int index, float *elem, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lbu(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lbu_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_ubu(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_ubu_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_idxb(int stage, int *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_idxbx(int stage, int *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Jbx(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_idxbu(int stage, int *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Jbu(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_C(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_D(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lg(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lg_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_ug(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_ug_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Qq(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Sq(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Rq(int stage, float *mat, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_qq(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_rq(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_uq(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_uq_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Zl(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Zu(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_zl(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_zu(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lls(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lls_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lus(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_lus_mask(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_idxs(int stage, int *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_idxs_rev(int stage, int *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Jsbu(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Jsbx(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Jsg(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_set_Jsq(int stage, float *vec, struct s_ocp_qcqp *qp);
|
||||
|
||||
// getters
|
||||
//
|
||||
void s_ocp_qcqp_get(char *field, int stage, struct s_ocp_qcqp *qp, void *value);
|
||||
//
|
||||
void s_ocp_qcqp_get_A(int stage, struct s_ocp_qcqp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qcqp_get_B(int stage, struct s_ocp_qcqp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qcqp_get_b(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_Q(int stage, struct s_ocp_qcqp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qcqp_get_S(int stage, struct s_ocp_qcqp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qcqp_get_R(int stage, struct s_ocp_qcqp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qcqp_get_q(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_r(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_ub(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_ub_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lb(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lb_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lbx(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lbx_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_ubx(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_ubx_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lbu(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lbu_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_ubu(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_ubu_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_idxb(int stage, struct s_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
//void s_ocp_qcqp_get_idxbx(int stage, struct s_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
//void s_ocp_qcqp_get_Jbx(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
//void s_ocp_qcqp_get_idxbu(int stage, struct s_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
//void s_ocp_qcqp_get_Jbu(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_C(int stage, struct s_ocp_qcqp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qcqp_get_D(int stage, struct s_ocp_qcqp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qcqp_get_lg(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lg_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_ug(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_ug_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_Zl(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_Zu(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_zl(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_zu(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lls(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lls_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lus(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_lus_mask(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
// XXX only valid if there is one slack per softed constraint !!!
|
||||
void s_ocp_qcqp_get_idxs(int stage, struct s_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
void s_ocp_qcqp_get_idxs_rev(int stage, struct s_ocp_qcqp *qp, int *vec);
|
||||
//
|
||||
//void s_ocp_qcqp_get_Jsbu(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
//void s_ocp_qcqp_get_Jsbx(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
//
|
||||
//void s_ocp_qcqp_get_Jsg(int stage, struct s_ocp_qcqp *qp, float *vec);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QCQP_H_
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QCQP_DIM_H_
|
||||
#define HPIPM_S_OCP_QCQP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qcqp_dim
|
||||
{
|
||||
struct s_ocp_qp_dim *qp_dim; // dim of qp approximation
|
||||
int *nx; // number of states
|
||||
int *nu; // number of inputs
|
||||
int *nb; // number of box constraints
|
||||
int *nbx; // number of (two-sided) state box constraints
|
||||
int *nbu; // number of (two-sided) input box constraints
|
||||
int *ng; // number of (two-sided) general constraints
|
||||
int *nq; // number of (upper) quadratic constraints
|
||||
int *ns; // number of soft constraints
|
||||
int *nsbx; // number of (two-sided) soft state box constraints
|
||||
int *nsbu; // number of (two-sided) soft input box constraints
|
||||
int *nsg; // number of (two-sided) soft general constraints
|
||||
int *nsq; // number of (upper) soft quadratic constraints
|
||||
int N; // horizon length
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_dim_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_dim_memsize(int N);
|
||||
//
|
||||
void s_ocp_qcqp_dim_create(int N, struct s_ocp_qcqp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void s_ocp_qcqp_dim_copy_all(struct s_ocp_qcqp_dim *dim_orig, struct s_ocp_qcqp_dim *dim_dest);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set(char *field, int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nx(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nu(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nbx(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nbu(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_ng(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nq(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_ns(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nsbx(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nsbu(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nsg(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_set_nsq(int stage, int value, struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_get(struct s_ocp_qcqp_dim *dim, char *field, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qcqp_dim_get_N(struct s_ocp_qcqp_dim *dim, int *value);
|
||||
//
|
||||
void s_ocp_qcqp_dim_get_nx(struct s_ocp_qcqp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qcqp_dim_get_nu(struct s_ocp_qcqp_dim *dim, int stage, int *value);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QCQP_DIM_H_
|
||||
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QCQP_IPM_H_
|
||||
#define HPIPM_S_OCP_QCQP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_ocp_qcqp_dim.h>
|
||||
#include <hpipm_s_ocp_qp.h>
|
||||
#include <hpipm_s_ocp_qcqp_res.h>
|
||||
#include <hpipm_s_ocp_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qcqp_ipm_arg
|
||||
{
|
||||
struct s_ocp_qp_ipm_arg *qp_arg;
|
||||
float mu0; // initial value for complementarity slackness
|
||||
float alpha_min; // exit cond on step length
|
||||
float res_g_max; // exit cond on inf norm of residuals
|
||||
float res_b_max; // exit cond on inf norm of residuals
|
||||
float res_d_max; // exit cond on inf norm of residuals
|
||||
float res_m_max; // exit cond on inf norm of residuals
|
||||
float reg_prim; // reg of primal hessian
|
||||
float lam_min; // min value in lam vector
|
||||
float t_min; // min value in t vector
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int square_root_alg; // 0 classical Riccati, 1 square-root Riccati
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1)
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_dual_sol_eq; // dual solution of equality constraints (only for abs_form==1)
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1)
|
||||
int comp_res_pred; // compute residuals of prediction
|
||||
int split_step; // use different step for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qcqp_ipm_ws
|
||||
{
|
||||
struct s_ocp_qp_ipm_ws *qp_ws;
|
||||
struct s_ocp_qp *qp;
|
||||
struct s_ocp_qp_sol *qp_sol;
|
||||
struct s_ocp_qcqp_res_ws *qcqp_res_ws;
|
||||
struct s_ocp_qcqp_res *qcqp_res;
|
||||
struct blasfeo_svec *tmp_nuxM;
|
||||
int iter; // iteration number
|
||||
int status;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_ipm_arg_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_ipm_arg_memsize(struct s_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_arg_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_arg_set(char *field, void *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set maximum number of iterations
|
||||
void s_ocp_qcqp_ipm_arg_set_iter_max(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set minimum step lenght
|
||||
void s_ocp_qcqp_ipm_arg_set_alpha_min(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set initial value of barrier parameter
|
||||
void s_ocp_qcqp_ipm_arg_set_mu0(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on stationarity condition
|
||||
void s_ocp_qcqp_ipm_arg_set_tol_stat(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on equality constr
|
||||
void s_ocp_qcqp_ipm_arg_set_tol_eq(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on inequality constr
|
||||
void s_ocp_qcqp_ipm_arg_set_tol_ineq(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on complementarity condition
|
||||
void s_ocp_qcqp_ipm_arg_set_tol_comp(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set regularization of primal variables
|
||||
void s_ocp_qcqp_ipm_arg_set_reg_prim(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set warm start: 0 no warm start, 1 primal var
|
||||
void s_ocp_qcqp_ipm_arg_set_warm_start(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector
|
||||
void s_ocp_qcqp_ipm_arg_set_pred_corr(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector
|
||||
void s_ocp_qcqp_ipm_arg_set_cond_pred_corr(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// set riccati algorithm: 0 classic, 1 square-root
|
||||
void s_ocp_qcqp_ipm_arg_set_ric_alg(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// compute residuals after solution
|
||||
void s_ocp_qcqp_ipm_arg_set_comp_res_exit(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// compute residuals of prediction
|
||||
void s_ocp_qcqp_ipm_arg_set_comp_res_pred(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// min value of lam in the solution
|
||||
void s_ocp_qcqp_ipm_arg_set_lam_min(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// min value of t in the solution
|
||||
void s_ocp_qcqp_ipm_arg_set_t_min(float *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// use different step for primal and dual variables
|
||||
void s_ocp_qcqp_ipm_arg_set_split_step(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
void s_ocp_qcqp_ipm_arg_set_t_lam_min(int *value, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_ipm_ws_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_ipm_ws_memsize(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_ws_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_ipm_arg *arg, struct s_ocp_qcqp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get(char *field, struct s_ocp_qcqp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get_status(struct s_ocp_qcqp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get_iter(struct s_ocp_qcqp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get_max_res_stat(struct s_ocp_qcqp_ipm_ws *ws, float *res_stat);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get_max_res_eq(struct s_ocp_qcqp_ipm_ws *ws, float *res_eq);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get_max_res_ineq(struct s_ocp_qcqp_ipm_ws *ws, float *res_ineq);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get_max_res_comp(struct s_ocp_qcqp_ipm_ws *ws, float *res_comp);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get_stat(struct s_ocp_qcqp_ipm_ws *ws, float **stat);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_get_stat_m(struct s_ocp_qcqp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void s_ocp_qcqp_init_var(struct s_ocp_qcqp *qp, struct s_ocp_qcqp_sol *qp_sol, struct s_ocp_qcqp_ipm_arg *arg, struct s_ocp_qcqp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_solve(struct s_ocp_qcqp *qp, struct s_ocp_qcqp_sol *qp_sol, struct s_ocp_qcqp_ipm_arg *arg, struct s_ocp_qcqp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QCQP_IPM_H_
|
||||
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QCQP_RES_H_
|
||||
#define HPIPM_S_OCP_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_ocp_qcqp_dim.h>
|
||||
#include <hpipm_s_ocp_qcqp.h>
|
||||
#include <hpipm_s_ocp_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qcqp_res
|
||||
{
|
||||
struct s_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_svec *res_g; // q-residuals
|
||||
struct blasfeo_svec *res_b; // b-residuals
|
||||
struct blasfeo_svec *res_d; // d-residuals
|
||||
struct blasfeo_svec *res_m; // m-residuals
|
||||
float res_max[4]; // max of residuals
|
||||
float res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qcqp_res_ws
|
||||
{
|
||||
struct blasfeo_svec *tmp_nuxM; // work space of size nuM+nxM
|
||||
struct blasfeo_svec *tmp_nbgqM; // work space of size nbM+ngM+nqM
|
||||
struct blasfeo_svec *tmp_nsM; // work space of size nsM
|
||||
struct blasfeo_svec *q_fun; // value for evaluation of quadr constr
|
||||
struct blasfeo_svec *q_adj; // value for adjoint of quadr constr
|
||||
int use_q_fun; // reuse cached value for evaluation of quadr constr
|
||||
int use_q_adj; // reuse cached value for adjoint of quadr constr
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_res_memsize(struct s_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void s_ocp_qcqp_res_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_res_ws_memsize(struct s_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void s_ocp_qcqp_res_ws_create(struct s_ocp_qcqp_dim *ocp_dim, struct s_ocp_qcqp_res_ws *workspace, void *mem);
|
||||
//
|
||||
void s_ocp_qcqp_res_compute(struct s_ocp_qcqp *qp, struct s_ocp_qcqp_sol *qp_sol, struct s_ocp_qcqp_res *res, struct s_ocp_qcqp_res_ws *ws);
|
||||
//
|
||||
void s_ocp_qcqp_res_compute_inf_norm(struct s_ocp_qcqp_res *res);
|
||||
//
|
||||
void s_ocp_qcqp_res_get_max_res_stat(struct s_ocp_qcqp_res *res, float *value);
|
||||
//
|
||||
void s_ocp_qcqp_res_get_max_res_eq(struct s_ocp_qcqp_res *res, float *value);
|
||||
//
|
||||
void s_ocp_qcqp_res_get_max_res_ineq(struct s_ocp_qcqp_res *res, float *value);
|
||||
//
|
||||
void s_ocp_qcqp_res_get_max_res_comp(struct s_ocp_qcqp_res *res, float *value);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QCQP_RES_H_
|
||||
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QCQP_SOL_H_
|
||||
#define HPIPM_S_OCP_QCQP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_ocp_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qcqp_sol
|
||||
{
|
||||
struct s_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_svec *ux;
|
||||
struct blasfeo_svec *pi;
|
||||
struct blasfeo_svec *lam;
|
||||
struct blasfeo_svec *t;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_sol_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qcqp_sol_memsize(struct s_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_ocp_qcqp_sol_create(struct s_ocp_qcqp_dim *dim, struct s_ocp_qcqp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void s_ocp_qcqp_sol_copy_all(struct s_ocp_qcqp_sol *qp_sol_orig, struct s_ocp_qcqp_sol *qp_sol_dest);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get(char *field, int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_u(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_x(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_sl(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_su(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_pi(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_lam_lb(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_lam_ub(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_lam_lg(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_get_lam_ug(int stage, struct s_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qcqp_sol_set(char *field, int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qcqp_sol_set_u(int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qcqp_sol_set_x(int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qcqp_sol_set_sl(int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qcqp_sol_set_su(int stage, float *vec, struct s_ocp_qcqp_sol *qp_sol);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QCQP_SOL_H_
|
||||
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QCQP_UTILS_H_
|
||||
#define HPIPM_S_OCP_QCQP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_ocp_qcqp_dim.h"
|
||||
#include "hpipm_s_ocp_qp.h"
|
||||
#include "hpipm_s_ocp_qcqp_sol.h"
|
||||
#include "hpipm_s_ocp_qcqp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void s_ocp_qcqp_dim_print(struct s_ocp_qcqp_dim *qcqp_dim);
|
||||
//
|
||||
void s_ocp_qcqp_dim_codegen(char *file_name, char *mode, struct s_ocp_qcqp_dim *qcqp_dim);
|
||||
//
|
||||
void s_ocp_qcqp_print(struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_codegen(char *file_name, char *mode, struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp *qp);
|
||||
//
|
||||
void s_ocp_qcqp_sol_print(struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp_sol *ocp_qcqp_sol);
|
||||
//
|
||||
void s_ocp_qcqp_ipm_arg_codegen(char *file_name, char *mode, struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_ocp_qcqp_res_print(struct s_ocp_qcqp_dim *qcqp_dim, struct s_ocp_qcqp_res *ocp_qcqp_res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QCQP_UTILS_H_
|
||||
|
||||
|
||||
@@ -1,306 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QP_H_
|
||||
#define HPIPM_S_OCP_QP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_ocp_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp
|
||||
{
|
||||
struct s_ocp_qp_dim *dim;
|
||||
struct blasfeo_smat *BAbt; // dynamics matrix & vector work space
|
||||
struct blasfeo_smat *RSQrq; // hessian of cost & vector work space
|
||||
struct blasfeo_smat *DCt; // inequality constraints matrix
|
||||
struct blasfeo_svec *b; // dynamics vector
|
||||
struct blasfeo_svec *rqz; // gradient of cost & gradient of slacks
|
||||
struct blasfeo_svec *d; // inequality constraints vector
|
||||
struct blasfeo_svec *d_mask; // inequality constraints mask vector
|
||||
struct blasfeo_svec *m; // rhs of complementarity condition
|
||||
struct blasfeo_svec *Z; // (diagonal) hessian of slacks
|
||||
int **idxb; // indices of box constrained variables within [u; x]
|
||||
int **idxs_rev; // index of soft constraints (reverse storage)
|
||||
int **idxe; // indices of constraints within [bu, bx, g] that are equalities, subset of [0, ..., nbu+nbx+ng-1]
|
||||
int *diag_H_flag; // flag the fact that Hessian is diagonal
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_memsize(struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_create(struct s_ocp_qp_dim *dim, struct s_ocp_qp *qp, void *memory);
|
||||
//
|
||||
void s_ocp_qp_copy_all(struct s_ocp_qp *qp_orig, struct s_ocp_qp *qp_dest);
|
||||
|
||||
// setters
|
||||
//
|
||||
void s_ocp_qp_set_all_zero(struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_rhs_zero(struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_all(float **A, float **B, float **b, float **Q, float **S, float **R, float **q, float **r, int **idxbx, float **lbx, float **ubx, int **idxbu, float **lbu, float **ubu, float **C, float **D, float **lg, float **ug, float **Zl, float **Zu, float **zl, float **zu, int **idxs, float **ls, float **us, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_all_rowmaj(float **A, float **B, float **b, float **Q, float **S, float **R, float **q, float **r, int **idxbx, float **lbx, float **ubx, int **idxbu, float **lbu, float **ubu, float **C, float **D, float **lg, float **ug, float **Zl, float **Zu, float **zl, float **zu, int **idxs, float **ls, float **us, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set(char *fiels_name, int stage, void *value, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_el(char *fiels_name, int stage, int index, void *value, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_A(int stage, float *mat, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_B(int stage, float *mat, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_b(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Q(int stage, float *mat, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_S(int stage, float *mat, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_R(int stage, float *mat, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_q(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_r(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lb(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lb_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_ub(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_ub_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lbx(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lbx_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_el_lbx(int stage, int index, float *elem, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_ubx(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_ubx_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_el_ubx(int stage, int index, float *elem, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lbu(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lbu_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_ubu(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_ubu_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxb(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxbx(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Jbx(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxbu(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Jbu(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_C(int stage, float *mat, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_D(int stage, float *mat, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lg(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lg_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_ug(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_ug_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Zl(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Zu(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_zl(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_zu(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lls(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lls_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lus(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_lus_mask(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxs(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxs_rev(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Jsbu(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Jsbx(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Jsg(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxe(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxbxe(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxbue(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_idxge(int stage, int *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Jbxe(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Jbue(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_Jge(int stage, float *vec, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_set_diag_H_flag(int stage, int *value, struct s_ocp_qp *qp);
|
||||
|
||||
// getters
|
||||
//
|
||||
void s_ocp_qp_get(char *field, int stage, struct s_ocp_qp *qp, void *value);
|
||||
//
|
||||
void s_ocp_qp_get_A(int stage, struct s_ocp_qp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qp_get_B(int stage, struct s_ocp_qp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qp_get_b(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_Q(int stage, struct s_ocp_qp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qp_get_S(int stage, struct s_ocp_qp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qp_get_R(int stage, struct s_ocp_qp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qp_get_q(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_r(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_ub(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_ub_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lb(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lb_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lbx(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lbx_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_ubx(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_ubx_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lbu(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lbu_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_ubu(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_ubu_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_idxb(int stage, struct s_ocp_qp *qp, int *vec);
|
||||
//
|
||||
//void s_ocp_qp_get_idxbx(int stage, struct s_ocp_qp *qp, int *vec);
|
||||
//
|
||||
//void s_ocp_qp_get_Jbx(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
//void s_ocp_qp_get_idxbu(int stage, struct s_ocp_qp *qp, int *vec);
|
||||
//
|
||||
//void s_ocp_qp_get_Jbu(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_C(int stage, struct s_ocp_qp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qp_get_D(int stage, struct s_ocp_qp *qp, float *mat);
|
||||
//
|
||||
void s_ocp_qp_get_lg(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lg_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_ug(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_ug_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_Zl(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_Zu(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_zl(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_zu(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lls(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lls_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lus(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
void s_ocp_qp_get_lus_mask(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
// XXX only valid if there is one slack per softed constraint !!!
|
||||
void s_ocp_qp_get_idxs(int stage, struct s_ocp_qp *qp, int *vec);
|
||||
//
|
||||
void s_ocp_qp_get_idxs_rev(int stage, struct s_ocp_qp *qp, int *vec);
|
||||
//
|
||||
//void s_ocp_qp_get_Jsbu(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
//void s_ocp_qp_get_Jsbx(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
//
|
||||
//void s_ocp_qp_get_Jsg(int stage, struct s_ocp_qp *qp, float *vec);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QP_H_
|
||||
@@ -1,141 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QP_DIM_H_
|
||||
#define HPIPM_S_OCP_QP_DIM_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp_dim
|
||||
{
|
||||
int *nx; // number of states
|
||||
int *nu; // number of inputs
|
||||
int *nb; // number of box constraints
|
||||
int *nbx; // number of state box constraints
|
||||
int *nbu; // number of input box constraints
|
||||
int *ng; // number of general constraints
|
||||
int *ns; // number of soft constraints
|
||||
int *nsbx; // number of soft state box constraints
|
||||
int *nsbu; // number of soft input box constraints
|
||||
int *nsg; // number of soft general constraints
|
||||
int *nbxe; // number of state box constraints which are equality
|
||||
int *nbue; // number of input box constraints which are equality
|
||||
int *nge; // number of general constraints which are equality
|
||||
int N; // horizon length
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_dim_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_dim_memsize(int N);
|
||||
//
|
||||
void s_ocp_qp_dim_create(int N, struct s_ocp_qp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void s_ocp_qp_dim_copy_all(struct s_ocp_qp_dim *dim_orig, struct s_ocp_qp_dim *dim_dest);
|
||||
//
|
||||
void s_ocp_qp_dim_set_all(int *nx, int *nu, int *nbx, int *nbu, int *ng, int *nsbx, int *nsbu, int *nsg, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set(char *field, int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nx(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nu(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nbx(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nbu(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_ng(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_ns(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nsbx(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nsbu(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nsg(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nbxe(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nbue(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_set_nge(int stage, int value, struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_dim_get(struct s_ocp_qp_dim *dim, char *field, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_N(struct s_ocp_qp_dim *dim, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nx(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nu(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nbx(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nbu(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_ng(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_ns(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nsbx(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nsbu(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nsg(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nbxe(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nbue(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
//
|
||||
void s_ocp_qp_dim_get_nge(struct s_ocp_qp_dim *dim, int stage, int *value);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QP_DIM_H_
|
||||
@@ -1,250 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QP_IPM_H_
|
||||
#define HPIPM_S_OCP_QP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_ocp_qp_dim.h>
|
||||
#include <hpipm_s_ocp_qp.h>
|
||||
#include <hpipm_s_ocp_qp_res.h>
|
||||
#include <hpipm_s_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp_ipm_arg
|
||||
{
|
||||
float mu0; // initial value for complementarity slackness
|
||||
float alpha_min; // exit cond on step length
|
||||
float res_g_max; // exit cond on inf norm of residuals
|
||||
float res_b_max; // exit cond on inf norm of residuals
|
||||
float res_d_max; // exit cond on inf norm of residuals
|
||||
float res_m_max; // exit cond on inf norm of residuals
|
||||
float reg_prim; // reg of primal hessian
|
||||
float lam_min; // min value in lam vector
|
||||
float t_min; // min value in t vector
|
||||
float tau_min; // min value of barrier parameter
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
int square_root_alg; // 0 classical Riccati, 1 square-root Riccati
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1)
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_dual_sol_eq; // dual solution of equality constraints (only for abs_form==1)
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1)
|
||||
int comp_res_pred; // compute residuals of prediction
|
||||
int split_step; // use different steps for primal and dual variables
|
||||
int var_init_scheme; // variables initialization scheme
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp_ipm_ws
|
||||
{
|
||||
struct s_core_qp_ipm_workspace *core_workspace;
|
||||
struct s_ocp_qp_res_ws *res_workspace;
|
||||
struct s_ocp_qp_dim *dim; // cache dim
|
||||
struct s_ocp_qp_sol *sol_step;
|
||||
struct s_ocp_qp_sol *sol_itref;
|
||||
struct s_ocp_qp *qp_step;
|
||||
struct s_ocp_qp *qp_itref;
|
||||
struct s_ocp_qp_res *res;
|
||||
struct s_ocp_qp_res *res_itref;
|
||||
struct blasfeo_svec *Gamma; // hessian update
|
||||
struct blasfeo_svec *gamma; // hessian update
|
||||
struct blasfeo_svec *tmp_nuxM; // work space of size nxM
|
||||
struct blasfeo_svec *tmp_nbgM; // work space of size nbM+ngM
|
||||
struct blasfeo_svec *tmp_nsM; // work space of size nsM
|
||||
struct blasfeo_svec *Pb; // Pb
|
||||
struct blasfeo_svec *Zs_inv;
|
||||
struct blasfeo_svec *tmp_m;
|
||||
struct blasfeo_svec *l; // cache linear part for _get_ric_xxx
|
||||
struct blasfeo_smat *L;
|
||||
struct blasfeo_smat *Ls;
|
||||
struct blasfeo_smat *P;
|
||||
struct blasfeo_smat *Lh;
|
||||
struct blasfeo_smat *AL;
|
||||
struct blasfeo_smat *lq0;
|
||||
struct blasfeo_smat *tmp_nxM_nxM;
|
||||
float *stat; // convergence statistics
|
||||
int *use_hess_fact;
|
||||
void *lq_work0;
|
||||
float qp_res[4]; // infinity norm of residuals
|
||||
int iter; // iteration number
|
||||
int stat_max; // iterations saved in stat
|
||||
int stat_m; // number of recorded stat per IPM iter
|
||||
int use_Pb;
|
||||
int status; // solver status
|
||||
int square_root_alg; // cache from arg
|
||||
int lq_fact; // cache from arg
|
||||
int mask_constr; // use constr mask
|
||||
int valid_ric_vec; // meaningful riccati vectors
|
||||
int valid_ric_p; // form of riccati p: 0 p*inv(L), 1 p
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_ipm_arg_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_ipm_arg_memsize(struct s_ocp_qp_dim *ocp_dim);
|
||||
//
|
||||
void s_ocp_qp_ipm_arg_create(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void s_ocp_qp_ipm_arg_set_default(enum hpipm_mode mode, struct s_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_ocp_qp_ipm_arg_set(char *field, void *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set maximum number of iterations
|
||||
void s_ocp_qp_ipm_arg_set_iter_max(int *iter_max, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set minimum step lenght
|
||||
void s_ocp_qp_ipm_arg_set_alpha_min(float *alpha_min, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set initial value of barrier parameter
|
||||
void s_ocp_qp_ipm_arg_set_mu0(float *mu0, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set exit tolerance on stationarity condition
|
||||
void s_ocp_qp_ipm_arg_set_tol_stat(float *tol_stat, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set exit tolerance on equality constr
|
||||
void s_ocp_qp_ipm_arg_set_tol_eq(float *tol_eq, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set exit tolerance on inequality constr
|
||||
void s_ocp_qp_ipm_arg_set_tol_ineq(float *tol_ineq, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set exit tolerance on complementarity condition
|
||||
void s_ocp_qp_ipm_arg_set_tol_comp(float *tol_comp, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set regularization of primal variables
|
||||
void s_ocp_qp_ipm_arg_set_reg_prim(float *tol_comp, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set warm start: 0 no warm start, 1 primal var
|
||||
void s_ocp_qp_ipm_arg_set_warm_start(int *warm_start, struct s_ocp_qp_ipm_arg *arg);
|
||||
// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector
|
||||
void s_ocp_qp_ipm_arg_set_pred_corr(int *pred_corr, struct s_ocp_qp_ipm_arg *arg);
|
||||
// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector
|
||||
void s_ocp_qp_ipm_arg_set_cond_pred_corr(int *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set riccati algorithm: 0 classic, 1 square-root
|
||||
void s_ocp_qp_ipm_arg_set_ric_alg(int *alg, struct s_ocp_qp_ipm_arg *arg);
|
||||
// dual solution of equality constraints (only for abs_form==1)
|
||||
void s_ocp_qp_ipm_arg_set_comp_dual_sol_eq(int *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// compute residuals after solution
|
||||
void s_ocp_qp_ipm_arg_set_comp_res_exit(int *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// compute residuals of prediction
|
||||
void s_ocp_qp_ipm_arg_set_comp_res_pred(int *alg, struct s_ocp_qp_ipm_arg *arg);
|
||||
// min value of lam in the solution
|
||||
void s_ocp_qp_ipm_arg_set_lam_min(float *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// min value of t in the solution
|
||||
void s_ocp_qp_ipm_arg_set_t_min(float *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// min value of tau in the solution
|
||||
void s_ocp_qp_ipm_arg_set_tau_min(float *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// set split step: 0 same step, 1 different step for primal and dual variables
|
||||
void s_ocp_qp_ipm_arg_set_split_step(int *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// variables initialization scheme
|
||||
void s_ocp_qp_ipm_arg_set_var_init_scheme(int *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
void s_ocp_qp_ipm_arg_set_t_lam_min(int *value, struct s_ocp_qp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_ipm_ws_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_ipm_ws_memsize(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_ocp_qp_ipm_ws_create(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void s_ocp_qp_ipm_get(char *field, struct s_ocp_qp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_status(struct s_ocp_qp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_iter(struct s_ocp_qp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_max_res_stat(struct s_ocp_qp_ipm_ws *ws, float *res_stat);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_max_res_eq(struct s_ocp_qp_ipm_ws *ws, float *res_eq);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_max_res_ineq(struct s_ocp_qp_ipm_ws *ws, float *res_ineq);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_max_res_comp(struct s_ocp_qp_ipm_ws *ws, float *res_comp);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_stat(struct s_ocp_qp_ipm_ws *ws, float **stat);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_stat_m(struct s_ocp_qp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_ric_Lr(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *Lr);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_ric_Ls(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *Ls);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_ric_P(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *P);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_ric_lr(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *lr);
|
||||
//
|
||||
void s_ocp_qp_ipm_get_ric_p(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *p);
|
||||
// feedback control gain in the form u = K x + k
|
||||
void s_ocp_qp_ipm_get_ric_K(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *K);
|
||||
// feedback control gain in the form u = K x + k
|
||||
void s_ocp_qp_ipm_get_ric_k(struct s_ocp_qp *qp, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws, int stage, float *k);
|
||||
//
|
||||
void s_ocp_qp_init_var(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_ipm_abs_step(int kk, struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_ipm_delta_step(int kk, struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_ipm_solve(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_ipm_predict(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_ipm_sens(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QP_IPM_H_
|
||||
@@ -1,66 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
#ifndef HPIPM_S_OCP_QP_KKT_H_
|
||||
#define HPIPM_S_OCP_QP_KKT_H_
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_ocp_qp.h>
|
||||
#include <hpipm_s_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
void s_ocp_qp_fact_solve_kkt_unconstr(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_fact_solve_kkt_step(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_fact_lq_solve_kkt_step(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_solve_kkt_step(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_ipm_arg *arg, struct s_ocp_qp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QP_KKT_H_
|
||||
@@ -1,118 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QP_RED_H_
|
||||
#define HPIPM_S_OCP_QP_RED_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_s_ocp_qp_dim.h>
|
||||
#include <hpipm_s_ocp_qp.h>
|
||||
#include <hpipm_s_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp_reduce_eq_dof_arg
|
||||
{
|
||||
float lam_min;
|
||||
float t_min;
|
||||
int alias_unchanged; // do not keep copy unchanged stage
|
||||
int comp_prim_sol; // primal solution (v)
|
||||
int comp_dual_sol_eq; // dual solution equality constr (pi)
|
||||
int comp_dual_sol_ineq; // dual solution inequality constr (lam t)
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp_reduce_eq_dof_ws
|
||||
{
|
||||
struct blasfeo_svec *tmp_nuxM;
|
||||
struct blasfeo_svec *tmp_nbgM;
|
||||
int *e_imask_ux;
|
||||
int *e_imask_d;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
void s_ocp_qp_dim_reduce_eq_dof(struct s_ocp_qp_dim *dim, struct s_ocp_qp_dim *dim_red);
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_reduce_eq_dof_arg_memsize();
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_arg_create(struct s_ocp_qp_reduce_eq_dof_arg *arg, void *mem);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_arg_set_default(struct s_ocp_qp_reduce_eq_dof_arg *arg);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_arg_set_alias_unchanged(struct s_ocp_qp_reduce_eq_dof_arg *arg, int value);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_arg_set_comp_prim_sol(struct s_ocp_qp_reduce_eq_dof_arg *arg, int value);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_arg_set_comp_dual_sol_eq(struct s_ocp_qp_reduce_eq_dof_arg *arg, int value);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_arg_set_comp_dual_sol_ineq(struct s_ocp_qp_reduce_eq_dof_arg *arg, int value);
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_reduce_eq_dof_ws_memsize(struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_ws_create(struct s_ocp_qp_dim *dim, struct s_ocp_qp_reduce_eq_dof_ws *work, void *mem);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof(struct s_ocp_qp *qp, struct s_ocp_qp *qp_red, struct s_ocp_qp_reduce_eq_dof_arg *arg, struct s_ocp_qp_reduce_eq_dof_ws *work);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_lhs(struct s_ocp_qp *qp, struct s_ocp_qp *qp_red, struct s_ocp_qp_reduce_eq_dof_arg *arg, struct s_ocp_qp_reduce_eq_dof_ws *work);
|
||||
//
|
||||
void s_ocp_qp_reduce_eq_dof_rhs(struct s_ocp_qp *qp, struct s_ocp_qp *qp_red, struct s_ocp_qp_reduce_eq_dof_arg *arg, struct s_ocp_qp_reduce_eq_dof_ws *work);
|
||||
//
|
||||
void s_ocp_qp_restore_eq_dof(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol_red, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_reduce_eq_dof_arg *arg, struct s_ocp_qp_reduce_eq_dof_ws *work);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QP_RED_H_
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QP_RES_H_
|
||||
#define HPIPM_S_OCP_QP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_ocp_qp_dim.h>
|
||||
#include <hpipm_s_ocp_qp.h>
|
||||
#include <hpipm_s_ocp_qp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp_res
|
||||
{
|
||||
struct s_ocp_qp_dim *dim;
|
||||
struct blasfeo_svec *res_g; // q-residuals
|
||||
struct blasfeo_svec *res_b; // b-residuals
|
||||
struct blasfeo_svec *res_d; // d-residuals
|
||||
struct blasfeo_svec *res_m; // m-residuals
|
||||
float res_max[4]; // max of residuals
|
||||
float res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp_res_ws
|
||||
{
|
||||
struct blasfeo_svec *tmp_nbgM; // work space of size nbM+ngM
|
||||
struct blasfeo_svec *tmp_nsM; // work space of size nsM
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_res_memsize(struct s_ocp_qp_dim *ocp_dim);
|
||||
//
|
||||
void s_ocp_qp_res_create(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_res_ws_memsize(struct s_ocp_qp_dim *ocp_dim);
|
||||
//
|
||||
void s_ocp_qp_res_ws_create(struct s_ocp_qp_dim *ocp_dim, struct s_ocp_qp_res_ws *workspace, void *mem);
|
||||
//
|
||||
void s_ocp_qp_res_compute(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_res *res, struct s_ocp_qp_res_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_res_compute_lin(struct s_ocp_qp *qp, struct s_ocp_qp_sol *qp_sol, struct s_ocp_qp_sol *qp_step, struct s_ocp_qp_res *res, struct s_ocp_qp_res_ws *ws);
|
||||
//
|
||||
void s_ocp_qp_res_compute_inf_norm(struct s_ocp_qp_res *res);
|
||||
//
|
||||
void s_ocp_qp_res_get_all(struct s_ocp_qp_res *res, float **res_r, float **res_q, float **res_ls, float **res_us, float **res_b, float **res_d_lb, float **res_d_ub, float **res_d_lg, float **res_d_ug, float **res_d_ls, float **res_d_us, float **res_m_lb, float **res_m_ub, float **res_m_lg, float **res_m_ug, float **res_m_ls, float **res_m_us);
|
||||
//
|
||||
void s_ocp_qp_res_get_max_res_stat(struct s_ocp_qp_res *res, float *value);
|
||||
//
|
||||
void s_ocp_qp_res_get_max_res_eq(struct s_ocp_qp_res *res, float *value);
|
||||
//
|
||||
void s_ocp_qp_res_get_max_res_ineq(struct s_ocp_qp_res *res, float *value);
|
||||
//
|
||||
void s_ocp_qp_res_get_max_res_comp(struct s_ocp_qp_res *res, float *value);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QP_RES_H_
|
||||
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QP_SOL_H_
|
||||
#define HPIPM_S_OCP_QP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_ocp_qp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_ocp_qp_sol
|
||||
{
|
||||
struct s_ocp_qp_dim *dim;
|
||||
struct blasfeo_svec *ux;
|
||||
struct blasfeo_svec *pi;
|
||||
struct blasfeo_svec *lam;
|
||||
struct blasfeo_svec *t;
|
||||
void *misc;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_sol_strsize();
|
||||
//
|
||||
hpipm_size_t s_ocp_qp_sol_memsize(struct s_ocp_qp_dim *dim);
|
||||
//
|
||||
void s_ocp_qp_sol_create(struct s_ocp_qp_dim *dim, struct s_ocp_qp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void s_ocp_qp_sol_copy_all(struct s_ocp_qp_sol *qp_sol_orig, struct s_ocp_qp_sol *qp_sol_dest);
|
||||
//
|
||||
void s_qp_sol_get_all(struct s_ocp_qp_sol *qp_sol, float **u, float **x, float **ls, float **us, float **pi, float **lam_lb, float **lam_ub, float **lam_lg, float **lam_ug, float **lam_ls, float **lam_us);
|
||||
//
|
||||
void s_qp_sol_get_all_rowmaj(struct s_ocp_qp_sol *qp_sol, float **u, float **x, float **ls, float **us, float **pi, float **lam_lb, float **lam_ub, float **lam_lg, float **lam_ug, float **lam_ls, float **lam_us);
|
||||
//
|
||||
void s_ocp_qp_sol_set_all(float **u, float **x, float **ls, float **us, float **pi, float **lam_lb, float **lam_ub, float **lam_lg, float **lam_ug, float **lam_ls, float **lam_us, struct s_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qp_sol_get(char *field, int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_u(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_x(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_sl(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_su(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_pi(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_lam_lb(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_lam_lbu(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_lam_lbx(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_lam_ub(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_lam_ubu(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_lam_ubx(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_lam_lg(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_get_lam_ug(int stage, struct s_ocp_qp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_ocp_qp_sol_set(char *field, int stage, float *vec, struct s_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qp_sol_set_u(int stage, float *vec, struct s_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qp_sol_set_x(int stage, float *vec, struct s_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qp_sol_set_sl(int stage, float *vec, struct s_ocp_qp_sol *qp_sol);
|
||||
//
|
||||
void s_ocp_qp_sol_set_su(int stage, float *vec, struct s_ocp_qp_sol *qp_sol);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_OCP_QP_SOL_H_
|
||||
@@ -1,83 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_OCP_QP_UTILS_H_
|
||||
#define HPIPM_S_OCP_QP_UTILS_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_ocp_qp_dim.h"
|
||||
#include "hpipm_s_ocp_qp.h"
|
||||
#include "hpipm_s_ocp_qp_sol.h"
|
||||
#include "hpipm_s_ocp_qp_ipm.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
void s_ocp_qp_dim_print(struct s_ocp_qp_dim *qp_dim);
|
||||
//
|
||||
void s_ocp_qp_dim_codegen(char *file_name, char *mode, struct s_ocp_qp_dim *qp_dim);
|
||||
//
|
||||
void s_ocp_qp_print(struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_codegen(char *file_name, char *mode, struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp *qp);
|
||||
//
|
||||
void s_ocp_qp_sol_print(struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp_sol *ocp_qp_sol);
|
||||
//
|
||||
void s_ocp_qp_ipm_arg_print(struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_ocp_qp_ipm_arg_codegen(char *file_name, char *mode, struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp_ipm_arg *arg);
|
||||
//
|
||||
void s_ocp_qp_res_print(struct s_ocp_qp_dim *qp_dim, struct s_ocp_qp_res *ocp_qp_res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_OCP_QP_UTILS_H_
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_PART_COND_H_
|
||||
#define HPIPM_S_PART_COND_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_cond.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_part_cond_qp_arg
|
||||
{
|
||||
struct s_cond_qp_arg *cond_arg;
|
||||
int N2;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_part_cond_qp_ws
|
||||
{
|
||||
struct s_cond_qp_ws *cond_workspace;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_part_cond_qp_arg_memsize(int N2);
|
||||
//
|
||||
void s_part_cond_qp_arg_create(int N2, struct s_part_cond_qp_arg *cond_arg, void *mem);
|
||||
//
|
||||
void s_part_cond_qp_arg_set_default(struct s_part_cond_qp_arg *cond_arg);
|
||||
// set riccati-like algorithm: 0 classical, 1 squre-root
|
||||
void s_part_cond_qp_arg_set_ric_alg(int ric_alg, struct s_part_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void s_part_cond_qp_arg_set_comp_prim_sol(int value, struct s_part_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void s_part_cond_qp_arg_set_comp_dual_sol_eq(int value, struct s_part_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void s_part_cond_qp_arg_set_comp_dual_sol_ineq(int value, struct s_part_cond_qp_arg *cond_arg);
|
||||
|
||||
//
|
||||
void s_part_cond_qp_compute_block_size(int N, int N2, int *block_size);
|
||||
//
|
||||
void s_part_cond_qp_compute_dim(struct s_ocp_qp_dim *ocp_dim, int *block_size, struct s_ocp_qp_dim *part_dense_dim);
|
||||
//
|
||||
hpipm_size_t s_part_cond_qp_ws_memsize(struct s_ocp_qp_dim *ocp_dim, int *block_size, struct s_ocp_qp_dim *part_dense_dim, struct s_part_cond_qp_arg *cond_arg);
|
||||
//
|
||||
void s_part_cond_qp_ws_create(struct s_ocp_qp_dim *ocp_dim, int *block_size, struct s_ocp_qp_dim *part_dense_dim, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws, void *mem);
|
||||
//
|
||||
void s_part_cond_qp_cond(struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_part_cond_qp_cond_lhs(struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_part_cond_qp_cond_rhs(struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws);
|
||||
//
|
||||
void s_part_cond_qp_expand_sol(struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_ocp_qp_sol *part_dense_qp_sol, struct s_ocp_qp_sol *ocp_qp_sol, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws);
|
||||
|
||||
//
|
||||
void s_part_cond_qp_update(int *idxc, struct s_ocp_qp *ocp_qp, struct s_ocp_qp *part_dense_qp, struct s_part_cond_qp_arg *cond_arg, struct s_part_cond_qp_ws *cond_ws);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_PART_COND_H_
|
||||
@@ -1,107 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef HPIPM_S_PART_COND_QCQP_H_
|
||||
#define HPIPM_S_PART_COND_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_cond_qcqp.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_part_cond_qcqp_arg
|
||||
{
|
||||
struct s_cond_qcqp_arg *cond_arg;
|
||||
int N2;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_part_cond_qcqp_ws
|
||||
{
|
||||
struct s_cond_qcqp_ws *cond_ws;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_part_cond_qcqp_arg_memsize(int N2);
|
||||
//
|
||||
void s_part_cond_qcqp_arg_create(int N2, struct s_part_cond_qcqp_arg *cond_arg, void *mem);
|
||||
//
|
||||
void s_part_cond_qcqp_arg_set_default(struct s_part_cond_qcqp_arg *cond_arg);
|
||||
// set riccati-like algorithm: 0 classical, 1 squre-root
|
||||
void s_part_cond_qcqp_arg_set_ric_alg(int ric_alg, struct s_part_cond_qcqp_arg *cond_arg);
|
||||
|
||||
//
|
||||
void s_part_cond_qcqp_compute_block_size(int N, int N2, int *block_size);
|
||||
//
|
||||
void s_part_cond_qcqp_compute_dim(struct s_ocp_qcqp_dim *ocp_dim, int *block_size, struct s_ocp_qcqp_dim *part_dense_dim);
|
||||
//
|
||||
hpipm_size_t s_part_cond_qcqp_ws_memsize(struct s_ocp_qcqp_dim *ocp_dim, int *block_size, struct s_ocp_qcqp_dim *part_dense_dim, struct s_part_cond_qcqp_arg *cond_arg);
|
||||
//
|
||||
void s_part_cond_qcqp_ws_create(struct s_ocp_qcqp_dim *ocp_dim, int *block_size, struct s_ocp_qcqp_dim *part_dense_dim, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws, void *mem);
|
||||
//
|
||||
void s_part_cond_qcqp_cond(struct s_ocp_qcqp *ocp_qp, struct s_ocp_qcqp *part_dense_qp, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_part_cond_qcqp_cond_lhs(struct s_ocp_qcqp *ocp_qp, struct s_ocp_qcqp *part_dense_qp, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_part_cond_qcqp_cond_rhs(struct s_ocp_qcqp *ocp_qp, struct s_ocp_qcqp *part_dense_qp, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws);
|
||||
//
|
||||
void s_part_cond_qcqp_expand_sol(struct s_ocp_qcqp *ocp_qp, struct s_ocp_qcqp *part_dense_qp, struct s_ocp_qcqp_sol *part_dense_qp_sol, struct s_ocp_qcqp_sol *ocp_qp_sol, struct s_part_cond_qcqp_arg *cond_arg, struct s_part_cond_qcqp_ws *cond_ws);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_D_PART_COND_H_
|
||||
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_SIM_ERK_H_
|
||||
#define HPIPM_S_SIM_ERK_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct s_sim_erk_arg
|
||||
{
|
||||
struct s_sim_rk_data *rk_data; // integrator data
|
||||
float h; // step size
|
||||
int steps; // number of steps
|
||||
// int for_sens; // compute adjoint sensitivities
|
||||
// int adj_sens; // compute adjoint sensitivities
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_sim_erk_ws
|
||||
{
|
||||
void (*ode)(int t, float *x, float *p, void *ode_args, float *xdot); // function pointer to ode
|
||||
void (*vde_for)(int t, float *x, float *p, void *ode_args, float *xdot); // function pointer to forward vde
|
||||
void (*vde_adj)(int t, float *adj_in, void *ode_args, float *adj_out); // function pointer to adjoint vde
|
||||
void *ode_args; // pointer to ode args
|
||||
struct s_sim_erk_arg *erk_arg; // erk arg
|
||||
float *K; // internal variables
|
||||
float *x_for; // states and forward sensitivities
|
||||
float *x_traj; // states at all steps
|
||||
float *l; // adjoint sensitivities
|
||||
float *p; // parameter
|
||||
float *x_tmp; // temporary states and forward sensitivities
|
||||
float *adj_in;
|
||||
float *adj_tmp;
|
||||
int nx; // number of states
|
||||
int np; // number of parameters
|
||||
int nf; // number of forward sensitivities
|
||||
int na; // number of adjoint sensitivities
|
||||
int nf_max; // max number of forward sensitivities
|
||||
int na_max; // max number of adjoint sensitivities
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_sim_erk_arg_memsize();
|
||||
//
|
||||
void s_sim_erk_arg_create(struct s_sim_erk_arg *erk_arg, void *mem);
|
||||
//
|
||||
void s_sim_erk_arg_set_all(struct s_sim_rk_data *rk_data, float h, int steps, struct s_sim_erk_arg *erk_arg);
|
||||
|
||||
//
|
||||
hpipm_size_t s_sim_erk_ws_memsize(struct s_sim_erk_arg *erk_arg, int nx, int np, int nf_max, int na_max);
|
||||
//
|
||||
void s_sim_erk_ws_create(struct s_sim_erk_arg *erk_arg, int nx, int np, int nf_max, int na_max, struct s_sim_erk_ws *work, void *memory);
|
||||
//
|
||||
void s_sim_erk_ws_set_all(int nf, int na, float *x, float *fs, float *bs, float *p, void (*ode)(int t, float *x, float *p, void *ode_args, float *xdot), void (*vde_for)(int t, float *x, float *p, void *ode_args, float *xdot), void (*vde_adj)(int t, float *adj_in, void *ode_args, float *adj_out), void *ode_args, struct s_sim_erk_ws *work);
|
||||
// number of directions for forward sensitivities
|
||||
void s_sim_erk_ws_set_nf(int *nf, struct s_sim_erk_ws *work);
|
||||
// parameters (e.g. inputs)
|
||||
void s_sim_erk_ws_set_p(float *p, struct s_sim_erk_ws *work);
|
||||
// state
|
||||
void s_sim_erk_ws_set_x(float *x, struct s_sim_erk_ws *work);
|
||||
// forward sensitivities
|
||||
void s_sim_erk_ws_set_fs(float *fs, struct s_sim_erk_ws *work);
|
||||
// ode funtion
|
||||
void s_sim_erk_ws_set_ode(void (*ode)(int t, float *x, float *p, void *ode_args, float *xdot), struct s_sim_erk_ws *work);
|
||||
// forward vde function
|
||||
void s_sim_erk_ws_set_vde_for(void (*ode)(int t, float *x, float *p, void *ode_args, float *xdot), struct s_sim_erk_ws *work);
|
||||
// ode_args, passed straight to the ode/vde_for/vde_adj functions
|
||||
void s_sim_erk_ws_set_ode_args(void *ode_args, struct s_sim_erk_ws *work);
|
||||
// state
|
||||
void s_sim_erk_ws_get_x(struct s_sim_erk_ws *work, float *x);
|
||||
// forward sensitivities
|
||||
void s_sim_erk_ws_get_fs(struct s_sim_erk_ws *work, float *fs);
|
||||
//
|
||||
void s_sim_erk_solve(struct s_sim_erk_arg *arg, struct s_sim_erk_ws *work);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_D_SIM_ERK_H_
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_SIM_RK_H_
|
||||
#define HPIPM_S_SIM_RK_H_
|
||||
|
||||
#include "hpipm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct s_sim_rk_data
|
||||
{
|
||||
float *A_rk; // A in butcher tableau
|
||||
float *B_rk; // b in butcher tableau
|
||||
float *C_rk; // c in butcher tableau
|
||||
int expl; // erk vs irk
|
||||
int ns; // number of stages
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_sim_rk_data_memsize(int ns);
|
||||
//
|
||||
void s_sim_rk_data_create(int ns, struct s_sim_rk_data *rk_data, void *memory);
|
||||
//
|
||||
void s_sim_rk_data_init_default(char *field, struct s_sim_rk_data *rk_data);
|
||||
//
|
||||
void s_sim_rk_data_set_all(int expl, float *A_rk, float *B_rk, float *C_rk, struct s_sim_rk_data *rk_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif // HPIPM_S_SIM_RK_H_
|
||||
|
||||
|
||||
@@ -1,213 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_TREE_OCP_QCQP_H_
|
||||
#define HPIPM_S_TREE_OCP_QCQP_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_tree_ocp_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_tree_ocp_qcqp
|
||||
{
|
||||
struct s_tree_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_smat *BAbt; // Nn-1
|
||||
struct blasfeo_smat *RSQrq; // Nn
|
||||
struct blasfeo_smat *DCt; // Nn
|
||||
struct blasfeo_smat **Hq; // Nn
|
||||
struct blasfeo_svec *b; // Nn-1
|
||||
struct blasfeo_svec *rqz; // Nn
|
||||
struct blasfeo_svec *d; // Nn
|
||||
struct blasfeo_svec *d_mask; // Nn
|
||||
struct blasfeo_svec *m; // Nn
|
||||
struct blasfeo_svec *Z; // Nn
|
||||
int **idxb; // indices of box constrained variables within [u; x] // Nn
|
||||
int **idxs_rev; // index of soft constraints
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_memsize(struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_create(struct s_tree_ocp_qcqp_dim *dim, struct s_tree_ocp_qcqp *qp, void *memory);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_all(float **A, float **B, float **b, float **Q, float **S, float **R, float **q, float **r, int **idxb, float **d_lb, float **d_ub, float **C, float **D, float **d_lg, float **d_ug, float **Zl, float **Zu, float **zl, float **zu, int **idxs, float **d_ls, float **d_us, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set(char *field_name, int node_edge, void *value, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_A(int edge, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_B(int edge, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_b(int edge, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Q(int node, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_S(int node, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_R(int node, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_q(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_r(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lb(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lb_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_ub(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_ub_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lbx(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lbx_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_ubx(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_ubx_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lbu(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lbu_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_ubu(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_ubu_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_idxb(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_idxbx(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Jbx(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_idxbu(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Jbu(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_C(int node, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_D(int node, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lg(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lg_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_ug(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_ug_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Qq(int node, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Sq(int node, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Rq(int node, float *mat, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_qq(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_rq(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_uq(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_uq_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Zl(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Zu(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_zl(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_zu(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lls(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lls_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lus(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_lus_mask(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_idxs(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_idxs_rev(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Jsbu(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Jsbx(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Jsg(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_set_Jsq(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_set_idxe(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_set_idxbxe(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_set_idxbue(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_set_idxge(int node, int *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_set_Jbxe(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_set_Jbue(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_set_Jge(int node, float *vec, struct s_tree_ocp_qcqp *qp);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_set_diag_H_flag(int node, int *value, struct s_tree_ocp_qcqp *qp);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_TREE_OCP_QCQP_H_
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_TREE_OCP_QCQP_DIM_H_
|
||||
#define HPIPM_S_TREE_OCP_QCQP_DIM_H_
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_tree_ocp_qcqp_dim
|
||||
{
|
||||
struct s_tree_ocp_qp_dim *qp_dim; // dim of qp approximation
|
||||
struct tree *ttree; // tree describing node conndection
|
||||
int *nx; // number of states // Nn
|
||||
int *nu; // number of inputs // Nn
|
||||
int *nb; // number of box constraints // Nn
|
||||
int *nbx; // number of state box constraints // Nn
|
||||
int *nbu; // number of input box constraints // Nn
|
||||
int *ng; // number of general constraints // Nn
|
||||
int *nq; // number of (upper) quadratic constraints
|
||||
int *ns; // number of soft constraints // Nn
|
||||
int *nsbx; // number of soft state box constraints
|
||||
int *nsbu; // number of soft input box constraints
|
||||
int *nsg; // number of soft general constraints
|
||||
int *nsq; // number of (upper) soft quadratic constraints
|
||||
int Nn; // number of nodes
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_dim_strsize();
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_dim_memsize(int Nn);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_create(int Nn, struct s_tree_ocp_qcqp_dim *qp_dim, void *memory);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_tree(struct tree *ttree, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set(char *field, int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nx(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nu(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nbx(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nbu(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_ng(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nq(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_ns(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nsbx(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nsbu(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nsg(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_dim_set_nsq(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_dim_set_nbxe(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_dim_set_nbue(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
//void s_tree_ocp_qcqp_dim_set_nge(int stage, int value, struct s_tree_ocp_qcqp_dim *dim);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_TREE_OCP_QCQP_DIM_H_
|
||||
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_TREE_OCP_QCQP_IPM_H_
|
||||
#define HPIPM_S_TREE_OCP_QCQP_IPM_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_tree_ocp_qcqp_dim.h>
|
||||
#include <hpipm_s_tree_ocp_qp.h>
|
||||
#include <hpipm_s_tree_ocp_qcqp_res.h>
|
||||
#include <hpipm_s_tree_ocp_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_tree_ocp_qcqp_ipm_arg
|
||||
{
|
||||
struct s_tree_ocp_qp_ipm_arg *qp_arg;
|
||||
float mu0; // initial value for complementarity slackness
|
||||
float alpha_min; // exit cond on step length
|
||||
float res_g_max; // exit cond on inf norm of residuals
|
||||
float res_b_max; // exit cond on inf norm of residuals
|
||||
float res_d_max; // exit cond on inf norm of residuals
|
||||
float res_m_max; // exit cond on inf norm of residuals
|
||||
float reg_prim; // reg of primal hessian
|
||||
float lam_min; // min value in lam vector
|
||||
float t_min; // min value in t vector
|
||||
int iter_max; // exit cond in iter number
|
||||
int stat_max; // iterations saved in stat
|
||||
int pred_corr; // use Mehrotra's predictor-corrector IPM algirthm
|
||||
int cond_pred_corr; // conditional Mehrotra's predictor-corrector
|
||||
int itref_pred_max; // max number of iterative refinement steps for predictor step
|
||||
int itref_corr_max; // max number of iterative refinement steps for corrector step
|
||||
int warm_start; // 0 no warm start, 1 warm start primal sol, 2 warm start primal and dual sol
|
||||
// int square_root_alg; // 0 classical Riccati, 1 square-root Riccati
|
||||
int lq_fact; // 0 syrk+potrf, 1 mix, 2 lq (for square_root_alg==1)
|
||||
int abs_form; // absolute IPM formulation
|
||||
int comp_dual_sol_eq; // dual solution of equality constraints (only for abs_form==1)
|
||||
int comp_res_exit; // compute residuals on exit (only for abs_form==1 and comp_dual_sol_eq==1)
|
||||
// int comp_res_pred; // compute residuals of prediction
|
||||
int split_step; // use different step for primal and dual variables
|
||||
int t_lam_min; // clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
int mode;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_tree_ocp_qcqp_ipm_ws
|
||||
{
|
||||
struct s_tree_ocp_qp_ipm_ws *qp_ws;
|
||||
struct s_tree_ocp_qp *qp;
|
||||
struct s_tree_ocp_qp_sol *qp_sol;
|
||||
struct s_tree_ocp_qcqp_res_ws *qcqp_res_ws;
|
||||
struct s_tree_ocp_qcqp_res *qcqp_res;
|
||||
struct blasfeo_svec *tmp_nuxM;
|
||||
int iter; // iteration number
|
||||
int status;
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_ipm_arg_strsize();
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_ipm_arg_memsize(struct s_tree_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_arg_create(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_ipm_arg *arg, void *mem);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_default(enum hpipm_mode mode, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_arg_set(char *field, void *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set maximum number of iterations
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_iter_max(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set minimum step lenght
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_alpha_min(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set initial value of barrier parameter
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_mu0(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on stationarity condition
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_tol_stat(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on equality constr
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_tol_eq(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on inequality constr
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_tol_ineq(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set exit tolerance on complementarity condition
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_tol_comp(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set regularization of primal variables
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_reg_prim(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set warm start: 0 no warm start, 1 primal var
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_warm_start(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// Mehrotra's predictor-corrector IPM algorithm: 0 no predictor-corrector, 1 use predictor-corrector
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_pred_corr(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// conditional predictor-corrector: 0 no conditinal predictor-corrector, 1 conditional predictor-corrector
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_cond_pred_corr(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// set riccati algorithm: 0 classic, 1 square-root
|
||||
//void s_tree_ocp_qcqp_ipm_arg_set_ric_alg(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// compute residuals after solution
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_comp_res_exit(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// compute residuals of prediction
|
||||
//void s_tree_ocp_qcqp_ipm_arg_set_comp_res_pred(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// min value of lam in the solution
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_lam_min(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// min value of t in the solution
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_t_min(float *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// use different step for primal and dual variables
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_split_step(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
// clip t and lam: 0 no, 1 in Gamma computation, 2 in solution
|
||||
void s_tree_ocp_qcqp_ipm_arg_set_t_lam_min(int *value, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_ipm_ws_strsize();
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_ipm_ws_memsize(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_ipm_arg *arg);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_ws_create(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_ipm_arg *arg, struct s_tree_ocp_qcqp_ipm_ws *ws, void *mem);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get(char *field, struct s_tree_ocp_qcqp_ipm_ws *ws, void *value);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get_status(struct s_tree_ocp_qcqp_ipm_ws *ws, int *status);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get_iter(struct s_tree_ocp_qcqp_ipm_ws *ws, int *iter);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get_max_res_stat(struct s_tree_ocp_qcqp_ipm_ws *ws, float *res_stat);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get_max_res_eq(struct s_tree_ocp_qcqp_ipm_ws *ws, float *res_eq);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get_max_res_ineq(struct s_tree_ocp_qcqp_ipm_ws *ws, float *res_ineq);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get_max_res_comp(struct s_tree_ocp_qcqp_ipm_ws *ws, float *res_comp);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get_stat(struct s_tree_ocp_qcqp_ipm_ws *ws, float **stat);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_get_stat_m(struct s_tree_ocp_qcqp_ipm_ws *ws, int *stat_m);
|
||||
//
|
||||
void s_tree_ocp_qcqp_init_var(struct s_tree_ocp_qcqp *qp, struct s_tree_ocp_qcqp_sol *qp_sol, struct s_tree_ocp_qcqp_ipm_arg *arg, struct s_tree_ocp_qcqp_ipm_ws *ws);
|
||||
//
|
||||
void s_tree_ocp_qcqp_ipm_solve(struct s_tree_ocp_qcqp *qp, struct s_tree_ocp_qcqp_sol *qp_sol, struct s_tree_ocp_qcqp_ipm_arg *arg, struct s_tree_ocp_qcqp_ipm_ws *ws);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_S_TREE_OCP_QCQP_IPM_H_
|
||||
|
||||
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_TREE_OCP_QCQP_RES_H_
|
||||
#define HPIPM_S_TREE_OCP_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include <hpipm_common.h>
|
||||
#include <hpipm_s_tree_ocp_qcqp_dim.h>
|
||||
#include <hpipm_s_tree_ocp_qcqp.h>
|
||||
#include <hpipm_s_tree_ocp_qcqp_sol.h>
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct s_tree_ocp_qcqp_res
|
||||
{
|
||||
struct s_tree_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_svec *res_g; // q-residuals
|
||||
struct blasfeo_svec *res_b; // b-residuals
|
||||
struct blasfeo_svec *res_d; // d-residuals
|
||||
struct blasfeo_svec *res_m; // m-residuals
|
||||
float res_max[4]; // max of residuals
|
||||
float res_mu; // mu-residual
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct s_tree_ocp_qcqp_res_ws
|
||||
{
|
||||
struct blasfeo_svec *tmp_nuxM; // work space of size nuM+nxM
|
||||
struct blasfeo_svec *tmp_nbgqM; // work space of size nbM+ngM+nqM
|
||||
struct blasfeo_svec *tmp_nsM; // work space of size nsM
|
||||
struct blasfeo_svec *q_fun; // value for evaluation of quadr constr
|
||||
struct blasfeo_svec *q_adj; // value for adjoint of quadr constr
|
||||
int use_q_fun; // reuse cached value for evaluation of quadr constr
|
||||
int use_q_adj; // reuse cached value for adjoint of quadr constr
|
||||
hpipm_size_t memsize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_res_memsize(struct s_tree_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_res_create(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_res *res, void *mem);
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_res_ws_memsize(struct s_tree_ocp_qcqp_dim *ocp_dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_res_ws_create(struct s_tree_ocp_qcqp_dim *ocp_dim, struct s_tree_ocp_qcqp_res_ws *ws, void *mem);
|
||||
//
|
||||
void s_tree_ocp_qcqp_res_compute(struct s_tree_ocp_qcqp *qp, struct s_tree_ocp_qcqp_sol *qp_sol, struct s_tree_ocp_qcqp_res *res, struct s_tree_ocp_qcqp_res_ws *ws);
|
||||
//
|
||||
void s_tree_ocp_qcqp_res_compute_inf_norm(struct s_tree_ocp_qcqp_res *res);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // #extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // HPIPM_S_TREE_OCP_QCQP_RES_H_
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
* *
|
||||
* This file is part of HPIPM. *
|
||||
* *
|
||||
* HPIPM -- High-Performance Interior Point Method. *
|
||||
* Copyright (C) 2019 by Gianluca Frison. *
|
||||
* Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* The 2-Clause BSD License *
|
||||
* *
|
||||
* Redistribution and use in source and binary forms, with or without *
|
||||
* modification, are permitted provided that the following conditions are met: *
|
||||
* *
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this *
|
||||
* list of conditions and the following disclaimer. *
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, *
|
||||
* this list of conditions and the following disclaimer in the documentation *
|
||||
* and/or other materials provided with the distribution. *
|
||||
* *
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de *
|
||||
* *
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef HPIPM_S_TREE_OCP_QCQP_SOL_H_
|
||||
#define HPIPM_S_TREE_OCP_QCQP_SOL_H_
|
||||
|
||||
|
||||
|
||||
#include <blasfeo_target.h>
|
||||
#include <blasfeo_common.h>
|
||||
|
||||
#include "hpipm_s_tree_ocp_qcqp_dim.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct s_tree_ocp_qcqp_sol
|
||||
{
|
||||
struct s_tree_ocp_qcqp_dim *dim;
|
||||
struct blasfeo_svec *ux;
|
||||
struct blasfeo_svec *pi;
|
||||
struct blasfeo_svec *lam;
|
||||
struct blasfeo_svec *t;
|
||||
void *misc;
|
||||
hpipm_size_t memsize; // memory size in bytes
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
hpipm_size_t s_tree_ocp_qcqp_sol_memsize(struct s_tree_ocp_qcqp_dim *dim);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_create(struct s_tree_ocp_qcqp_dim *dim, struct s_tree_ocp_qcqp_sol *qp_sol, void *memory);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_u(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_x(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_sl(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_su(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_pi(int edge, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_lam_lb(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_lam_ub(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_lam_lg(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
//
|
||||
void s_tree_ocp_qcqp_sol_get_lam_ug(int node, struct s_tree_ocp_qcqp_sol *qp_sol, float *vec);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // HPIPM_S_TREE_OCP_QCQP_SOL_H_
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user