Skip to content
Permalink
Browse files

Change brace style to Allman

  • Loading branch information...
roversch committed Apr 19, 2018
1 parent bb4d4b6 commit 820490e3b6b460e2f16be54ca915124d84b10ebf
Showing with 3,956 additions and 2,045 deletions.
  1. +1 −1 .clang-format
  2. +1 −1 CPPLINT.cfg
  3. +28 −14 acados/dense_qp/dense_qp_common.c
  4. +4 −2 acados/dense_qp/dense_qp_common.h
  5. +16 −9 acados/dense_qp/dense_qp_hpipm.c
  6. +4 −2 acados/dense_qp/dense_qp_hpipm.h
  7. +37 −19 acados/dense_qp/dense_qp_qore.c
  8. +4 −2 acados/dense_qp/dense_qp_qore.h
  9. +84 −38 acados/dense_qp/dense_qp_qpoases.c
  10. +4 −2 acados/dense_qp/dense_qp_qpoases.h
  11. +102 −52 acados/ocp_nlp/ocp_nlp_common.c
  12. +12 −6 acados/ocp_nlp/ocp_nlp_common.h
  13. +62 −32 acados/ocp_nlp/ocp_nlp_constraints.c
  14. +12 −6 acados/ocp_nlp/ocp_nlp_constraints.h
  15. +4 −2 acados/ocp_nlp/ocp_nlp_cost_common.c
  16. +2 −1 acados/ocp_nlp/ocp_nlp_cost_common.h
  17. +40 −21 acados/ocp_nlp/ocp_nlp_cost_external.c
  18. +10 −5 acados/ocp_nlp/ocp_nlp_cost_external.h
  19. +40 −20 acados/ocp_nlp/ocp_nlp_cost_ls.c
  20. +10 −5 acados/ocp_nlp/ocp_nlp_cost_ls.h
  21. +45 −23 acados/ocp_nlp/ocp_nlp_cost_nls.c
  22. +10 −5 acados/ocp_nlp/ocp_nlp_cost_nls.h
  23. +4 −2 acados/ocp_nlp/ocp_nlp_dynamics_common.c
  24. +2 −1 acados/ocp_nlp/ocp_nlp_dynamics_common.h
  25. +46 −24 acados/ocp_nlp/ocp_nlp_dynamics_cont.c
  26. +10 −5 acados/ocp_nlp/ocp_nlp_dynamics_cont.h
  27. +44 −23 acados/ocp_nlp/ocp_nlp_dynamics_disc.c
  28. +10 −5 acados/ocp_nlp/ocp_nlp_dynamics_disc.h
  29. +122 −61 acados/ocp_nlp/ocp_nlp_sqp.c
  30. +6 −3 acados/ocp_nlp/ocp_nlp_sqp.h
  31. +52 −26 acados/ocp_qp/ocp_qp_common.c
  32. +8 −4 acados/ocp_qp/ocp_qp_common.h
  33. +215 −214 acados/ocp_qp/ocp_qp_common_frontend.c
  34. +6 −7 acados/ocp_qp/ocp_qp_common_frontend.h
  35. +28 −13 acados/ocp_qp/ocp_qp_full_condensing.c
  36. +4 −2 acados/ocp_qp/ocp_qp_full_condensing.h
  37. +20 −11 acados/ocp_qp/ocp_qp_full_condensing_solver.c
  38. +6 −3 acados/ocp_qp/ocp_qp_full_condensing_solver.h
  39. +16 −8 acados/ocp_qp/ocp_qp_hpipm.c
  40. +4 −2 acados/ocp_qp/ocp_qp_hpipm.h
  41. +43 −21 acados/ocp_qp/ocp_qp_hpmpc.c
  42. +4 −2 acados/ocp_qp/ocp_qp_hpmpc.h
  43. +18 −9 acados/ocp_qp/ocp_qp_partial_condensing.c
  44. +4 −2 acados/ocp_qp/ocp_qp_partial_condensing.h
  45. +71 −31 acados/ocp_qp/ocp_qp_partial_condensing_solver.c
  46. +6 −3 acados/ocp_qp/ocp_qp_partial_condensing_solver.h
  47. +172 −83 acados/ocp_qp/ocp_qp_qpdunes.c
  48. +6 −3 acados/ocp_qp/ocp_qp_qpdunes.h
  49. +115 −56 acados/sim/sim_collocation_utils.c
  50. +8 −2 acados/sim/sim_collocation_utils.h
  51. +16 −8 acados/sim/sim_common.c
  52. +12 −6 acados/sim/sim_common.h
  53. +2 −1 acados/sim/sim_discrete_model.c
  54. +110 −52 acados/sim/sim_erk_integrator.c
  55. +6 −3 acados/sim/sim_erk_integrator.h
  56. +100 −53 acados/sim/sim_irk_integrator.c
  57. +4 −2 acados/sim/sim_irk_integrator.h
  58. +473 −227 acados/sim/sim_lifted_irk_integrator.c
  59. +6 −3 acados/sim/sim_lifted_irk_integrator.h
  60. +60 −31 acados/sim/sim_new_lifted_irk_integrator.c
  61. +6 −3 acados/sim/sim_new_lifted_irk_integrator.h
  62. +3 −1 acados/utils/copy.c
  63. +165 −79 acados/utils/external_function_generic.c
  64. +12 −6 acados/utils/external_function_generic.h
  65. +259 −124 acados/utils/math.c
  66. +22 −11 acados/utils/mem.c
  67. +2 −1 acados/utils/mem.h
  68. +149 −73 acados/utils/print.c
  69. +8 −6 acados/utils/strsep.h
  70. +24 −11 acados/utils/timing.c
  71. +10 −5 acados/utils/timing.h
  72. +7 −1 acados/utils/types.h
  73. +16 −8 interfaces/acados_c/condensing_interface.c
  74. +4 −2 interfaces/acados_c/condensing_interface.h
  75. +26 −13 interfaces/acados_c/dense_qp_interface.c
  76. +4 −2 interfaces/acados_c/dense_qp_interface.h
  77. +24 −12 interfaces/acados_c/external_function_interface.c
  78. +45 −22 interfaces/acados_c/ocp_nlp_interface.c
  79. +4 −2 interfaces/acados_c/ocp_nlp_interface.h
  80. +31 −16 interfaces/acados_c/ocp_qp_interface.c
  81. +4 −2 interfaces/acados_c/ocp_qp_interface.h
  82. +74 −28 interfaces/acados_c/options_interface.c
  83. +24 −12 interfaces/acados_c/sim_interface.c
  84. +4 −2 interfaces/acados_c/sim_interface.h
  85. +190 −82 interfaces/acados_cpp/ocp_qp.cpp
  86. +4 −4 interfaces/acados_cpp/ocp_qp.hpp
  87. +8 −5 interfaces/acados_cpp/ocp_qp_dimensions.cpp
  88. +2 −2 interfaces/acados_cpp/ocp_qp_dimensions.hpp
  89. +30 −16 interfaces/acados_cpp/ocp_qp_solution.cpp
  90. +4 −3 interfaces/acados_cpp/ocp_qp_solution.hpp
  91. +18 −11 interfaces/acados_cpp/options.hpp
  92. +8 −4 interfaces/acados_cpp/utils.hpp
  93. +22 −11 interfaces/simulink/ocp_nlp_s_function.c
  94. +16 −8 interfaces/simulink/ocp_qp_s_function.c
  95. +14 −14 swig/conversions.h
  96. +90 −41 test/ocp_nlp/chain/test_chain.cpp
  97. +51 −24 test/ocp_qp/test_qpsolvers.cpp
  98. +9 −4 test/sim/pendulum/pendulum_helper.cpp
  99. +25 −12 test/sim/pendulum/test_pendulum.cpp
  100. +16 −8 test/test_utils/read_matrix.cpp
  101. +147 −72 test/test_utils/read_ocp_qp_in.c
  102. +4 −2 test/test_utils/zeros.cpp
@@ -1,7 +1,7 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -1
AccessModifierOffset: -3
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
@@ -1,3 +1,3 @@
set noparent
filter=-legal/copyright,-readability/casting,-runtime/int,-whitespace/blank_line,-readability/fn_size,-runtime/printf,-runtime/references,-whitespace/braces
filter=-legal/copyright,-readability/casting,-runtime/int,-whitespace/blank_line,-readability/fn_size,-runtime/printf,-runtime/references,-whitespace/braces,-whitespace/newline
linelength=100
@@ -38,15 +38,17 @@
* config
************************************************/

int dense_qp_solver_config_calculate_size() {
int dense_qp_solver_config_calculate_size()
{
int size = 0;

size += sizeof(qp_solver_config);

return size;
}

qp_solver_config *dense_qp_solver_config_assign(void *raw_memory) {
qp_solver_config *dense_qp_solver_config_assign(void *raw_memory)
{
char *c_ptr = raw_memory;

qp_solver_config *config = (qp_solver_config *)c_ptr;
@@ -59,15 +61,17 @@ qp_solver_config *dense_qp_solver_config_assign(void *raw_memory) {
* dims
************************************************/

int dense_qp_dims_calculate_size() {
int dense_qp_dims_calculate_size()
{
int size = sizeof(dense_qp_dims);

size += d_memsize_dense_qp_dim();

return size;
}

dense_qp_dims *dense_qp_dims_assign(void *raw_memory) {
dense_qp_dims *dense_qp_dims_assign(void *raw_memory)
{
char *c_ptr = (char *)raw_memory;

dense_qp_dims *dims = (dense_qp_dims *)c_ptr;
@@ -85,14 +89,16 @@ dense_qp_dims *dense_qp_dims_assign(void *raw_memory) {
* in
************************************************/

int dense_qp_in_calculate_size(void *config, dense_qp_dims *dims) {
int dense_qp_in_calculate_size(void *config, dense_qp_dims *dims)
{
int size = sizeof(dense_qp_in);
size += sizeof(dense_qp_dims);
size += d_memsize_dense_qp(dims);
return size;
}

dense_qp_in *dense_qp_in_assign(void *config, dense_qp_dims *dims, void *raw_memory) {
dense_qp_in *dense_qp_in_assign(void *config, dense_qp_dims *dims, void *raw_memory)
{
char *c_ptr = (char *)raw_memory;

dense_qp_in *qp_in = (dense_qp_in *)c_ptr;
@@ -121,14 +127,16 @@ dense_qp_in *dense_qp_in_assign(void *config, dense_qp_dims *dims, void *raw_mem
* out
************************************************/

int dense_qp_out_calculate_size(void *config, dense_qp_dims *dims) {
int dense_qp_out_calculate_size(void *config, dense_qp_dims *dims)
{
int size = sizeof(dense_qp_out);
size += d_memsize_dense_qp_sol(dims);
size += sizeof(dense_qp_info);
return size;
}

dense_qp_out *dense_qp_out_assign(void *config, dense_qp_dims *dims, void *raw_memory) {
dense_qp_out *dense_qp_out_assign(void *config, dense_qp_dims *dims, void *raw_memory)
{
char *c_ptr = (char *)raw_memory;

dense_qp_out *qp_out = (dense_qp_out *)c_ptr;
@@ -151,13 +159,15 @@ dense_qp_out *dense_qp_out_assign(void *config, dense_qp_dims *dims, void *raw_m
* res
************************************************/

int dense_qp_res_calculate_size(dense_qp_dims *dims) {
int dense_qp_res_calculate_size(dense_qp_dims *dims)
{
int size = sizeof(dense_qp_res);
size += d_memsize_dense_qp_res(dims);
return size;
}

dense_qp_res *dense_qp_res_assign(dense_qp_dims *dims, void *raw_memory) {
dense_qp_res *dense_qp_res_assign(dense_qp_dims *dims, void *raw_memory)
{
char *c_ptr = (char *)raw_memory;

dense_qp_res *qp_res = (dense_qp_res *)c_ptr;
@@ -171,13 +181,15 @@ dense_qp_res *dense_qp_res_assign(dense_qp_dims *dims, void *raw_memory) {
return qp_res;
}

int dense_qp_res_workspace_calculate_size(dense_qp_dims *dims) {
int dense_qp_res_workspace_calculate_size(dense_qp_dims *dims)
{
int size = sizeof(dense_qp_res_ws);
size += d_memsize_dense_qp_res_workspace(dims);
return size;
}

dense_qp_res_ws *dense_qp_res_workspace_assign(dense_qp_dims *dims, void *raw_memory) {
dense_qp_res_ws *dense_qp_res_workspace_assign(dense_qp_dims *dims, void *raw_memory)
{
char *c_ptr = (char *)raw_memory;

dense_qp_res_ws *res_ws = (dense_qp_res_ws *)c_ptr;
@@ -192,7 +204,8 @@ dense_qp_res_ws *dense_qp_res_workspace_assign(dense_qp_dims *dims, void *raw_me
}

void dense_qp_res_compute(dense_qp_in *qp_in, dense_qp_out *qp_out, dense_qp_res *qp_res,
dense_qp_res_ws *res_ws) {
dense_qp_res_ws *res_ws)
{
int nvd = qp_in->dim->nv;
// int ned = qp_in->dim->ne;
int ngd = qp_in->dim->ng;
@@ -217,7 +230,8 @@ void dense_qp_res_compute(dense_qp_in *qp_in, dense_qp_out *qp_out, dense_qp_res
d_compute_res_dense_qp(qp_in, qp_out, qp_res, res_ws);
}

void dense_qp_res_compute_nrm_inf(dense_qp_res *qp_res, double res[4]) {
void dense_qp_res_compute_nrm_inf(dense_qp_res *qp_res, double res[4])
{
int nv = qp_res->dim->nv;
int nb = qp_res->dim->nb;
int ne = qp_res->dim->ne;
@@ -40,7 +40,8 @@ typedef struct d_dense_qp_res_workspace dense_qp_res_ws;
#ifndef QP_SOLVER_CONFIG_
#define QP_SOLVER_CONFIG_

typedef struct {
typedef struct
{
// TODO(dimitris): pass dims to evaluate?
int (*evaluate)(void *config, void *qp_in, void *qp_out, void *args, void *mem, void *work);
int (*opts_calculate_size)(void *config, void *dims);
@@ -54,7 +55,8 @@ typedef struct {

#endif

typedef struct {
typedef struct
{
double solve_QP_time;
double interface_time;
double total_time;
@@ -33,7 +33,8 @@
* opts
************************************************/

int dense_qp_hpipm_opts_calculate_size(void *config_, void *dims_) {
int dense_qp_hpipm_opts_calculate_size(void *config_, void *dims_)
{
dense_qp_dims *dims = dims_;

int size = 0;
@@ -44,7 +45,8 @@ int dense_qp_hpipm_opts_calculate_size(void *config_, void *dims_) {
return size;
}

void *dense_qp_hpipm_opts_assign(void *config_, void *dims_, void *raw_memory) {
void *dense_qp_hpipm_opts_assign(void *config_, void *dims_, void *raw_memory)
{
dense_qp_dims *dims = dims_;
dense_qp_hpipm_opts *opts;

@@ -66,7 +68,8 @@ void *dense_qp_hpipm_opts_assign(void *config_, void *dims_, void *raw_memory) {
return (void *)opts;
}

void dense_qp_hpipm_opts_initialize_default(void *config_, void *dims_, void *opts_) {
void dense_qp_hpipm_opts_initialize_default(void *config_, void *dims_, void *opts_)
{
dense_qp_hpipm_opts *opts = opts_;

d_set_default_dense_qp_ipm_arg(opts->hpipm_opts);
@@ -83,7 +86,8 @@ void dense_qp_hpipm_opts_initialize_default(void *config_, void *dims_, void *op
return;
}

void dense_qp_hpipm_opts_update(void *config_, void *dims_, void *opts_) {
void dense_qp_hpipm_opts_update(void *config_, void *dims_, void *opts_)
{
// dense_qp_hpipm_opts *opts = (dense_qp_hpipm_opts *)opts_;

return;
@@ -93,7 +97,8 @@ void dense_qp_hpipm_opts_update(void *config_, void *dims_, void *opts_) {
* memory
************************************************/

int dense_qp_hpipm_memory_calculate_size(void *config_, void *dims_, void *opts_) {
int dense_qp_hpipm_memory_calculate_size(void *config_, void *dims_, void *opts_)
{
dense_qp_dims *dims = dims_;
dense_qp_hpipm_opts *opts = opts_;

@@ -106,7 +111,8 @@ int dense_qp_hpipm_memory_calculate_size(void *config_, void *dims_, void *opts_
return size;
}

void *dense_qp_hpipm_memory_assign(void *config_, void *dims_, void *opts_, void *raw_memory) {
void *dense_qp_hpipm_memory_assign(void *config_, void *dims_, void *opts_, void *raw_memory)
{
dense_qp_dims *dims = dims_;
dense_qp_hpipm_opts *opts = opts_;
dense_qp_hpipm_memory *mem;
@@ -134,8 +140,8 @@ void *dense_qp_hpipm_memory_assign(void *config_, void *dims_, void *opts_, void

int dense_qp_hpipm_workspace_calculate_size(void *config_, void *dims_, void *opts_) { return 0; }

int dense_qp_hpipm(void *config, void *qp_in_, void *qp_out_, void *opts_, void *mem_,
void *work_) {
int dense_qp_hpipm(void *config, void *qp_in_, void *qp_out_, void *opts_, void *mem_, void *work_)
{
dense_qp_in *qp_in = qp_in_;
dense_qp_out *qp_out = qp_out_;

@@ -166,7 +172,8 @@ int dense_qp_hpipm(void *config, void *qp_in_, void *qp_out_, void *opts_, void
return acados_status;
}

void dense_qp_hpipm_config_initialize_default(void *config_) {
void dense_qp_hpipm_config_initialize_default(void *config_)
{
qp_solver_config *config = config_;

config->opts_calculate_size = &dense_qp_hpipm_opts_calculate_size;
@@ -32,11 +32,13 @@ extern "C" {
#include "acados/dense_qp/dense_qp_common.h"
#include "acados/utils/types.h"

typedef struct dense_qp_hpipm_opts_ {
typedef struct dense_qp_hpipm_opts_
{
struct d_dense_qp_ipm_arg *hpipm_opts;
} dense_qp_hpipm_opts;

typedef struct dense_qp_hpipm_memory_ {
typedef struct dense_qp_hpipm_memory_
{
struct d_dense_qp_ipm_workspace *hpipm_workspace;
} dense_qp_hpipm_memory;

Oops, something went wrong.

0 comments on commit 820490e

Please sign in to comment.
You can’t perform that action at this time.