Skip to content

Commit

Permalink
clang-format: allow multiple empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
giaf committed May 17, 2018
1 parent 9e90681 commit 7dcea36
Show file tree
Hide file tree
Showing 16 changed files with 175 additions and 191 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
BinPackArguments: true
Expand All @@ -28,7 +28,7 @@ ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
MaxEmptyLinesToKeep: 3
KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
Expand Down
1 change: 0 additions & 1 deletion acados/dense_qp/dense_qp_hpipm.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ 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_)
{
dense_qp_in *qp_in = qp_in_;
Expand Down
3 changes: 1 addition & 2 deletions acados/ocp_nlp/ocp_nlp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ int ocp_nlp_dims_calculate_size(void *config_)
size += config->dynamics[ii]->dims_calculate_size(config->dynamics[ii]);

// cost
for (ii = 0; ii <= N; ii++)
size += config->cost[ii]->dims_calculate_size(config->cost[ii]);
for (ii = 0; ii <= N; ii++) size += config->cost[ii]->dims_calculate_size(config->cost[ii]);

// constraints
for (ii = 0; ii <= N; ii++)
Expand Down
4 changes: 4 additions & 0 deletions acados/ocp_nlp/ocp_nlp_constraints.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ int ocp_nlp_constraints_config_calculate_size()
return size;
}



ocp_nlp_constraints_config *ocp_nlp_constraints_config_assign(void *raw_memory)
{
char *c_ptr = raw_memory;
Expand All @@ -53,6 +55,8 @@ ocp_nlp_constraints_config *ocp_nlp_constraints_config_assign(void *raw_memory)
return config;
}



/************************************************
* dims
************************************************/
Expand Down
1 change: 0 additions & 1 deletion acados/ocp_nlp/ocp_nlp_dynamics_disc.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ void *ocp_nlp_dynamics_disc_model_assign(void *config_, void *dims_, void *raw_m
}

void ocp_nlp_dynamics_disc_model_set_T(double T, void *model_) { return; }

/************************************************
* functions
************************************************/
Expand Down
18 changes: 9 additions & 9 deletions acados/ocp_nlp/ocp_nlp_sqp.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,15 +815,15 @@ int ocp_nlp_sqp(void *config_, ocp_nlp_dims *dims, ocp_nlp_in *nlp_in, ocp_nlp_o
ocp_nlp_res_compute(dims, nlp_in, nlp_out, mem->nlp_res, mem->nlp_mem);

nlp_out->inf_norm_res = mem->nlp_res->inf_norm_res_g;
nlp_out->inf_norm_res = (mem->nlp_res->inf_norm_res_b > nlp_out->inf_norm_res)
? mem->nlp_res->inf_norm_res_b
: nlp_out->inf_norm_res;
nlp_out->inf_norm_res = (mem->nlp_res->inf_norm_res_d > nlp_out->inf_norm_res)
? mem->nlp_res->inf_norm_res_d
: nlp_out->inf_norm_res;
nlp_out->inf_norm_res = (mem->nlp_res->inf_norm_res_m > nlp_out->inf_norm_res)
? mem->nlp_res->inf_norm_res_m
: nlp_out->inf_norm_res;
nlp_out->inf_norm_res = (mem->nlp_res->inf_norm_res_b > nlp_out->inf_norm_res) ?
mem->nlp_res->inf_norm_res_b :
nlp_out->inf_norm_res;
nlp_out->inf_norm_res = (mem->nlp_res->inf_norm_res_d > nlp_out->inf_norm_res) ?
mem->nlp_res->inf_norm_res_d :
nlp_out->inf_norm_res;
nlp_out->inf_norm_res = (mem->nlp_res->inf_norm_res_m > nlp_out->inf_norm_res) ?
mem->nlp_res->inf_norm_res_m :
nlp_out->inf_norm_res;

// exit conditions on residuals
if ((mem->nlp_res->inf_norm_res_g < opts->min_res_g) &
Expand Down
2 changes: 0 additions & 2 deletions acados/ocp_qp/ocp_qp_full_condensing.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ void ocp_qp_full_condensing_opts_initialize_default(ocp_qp_dims *dims, void *opt
}

void ocp_qp_full_condensing_opts_update(ocp_qp_dims *dims, void *opts_) { return; }

/************************************************
* memory
************************************************/
Expand Down Expand Up @@ -137,7 +136,6 @@ void *ocp_qp_full_condensing_memory_assign(ocp_qp_dims *dims, void *opts_, void
}

int ocp_qp_full_condensing_workspace_calculate_size(ocp_qp_dims *dims, void *opts_) { return 0; }

void ocp_qp_full_condensing(ocp_qp_in *in, dense_qp_in *out, ocp_qp_full_condensing_opts *opts,
ocp_qp_full_condensing_memory *mem, void *work)
{
Expand Down
1 change: 0 additions & 1 deletion acados/ocp_qp/ocp_qp_hpipm.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ void *ocp_qp_hpipm_memory_assign(void *config_, void *dims_, void *opts_, void *
************************************************/

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

/************************************************
* functions
************************************************/
Expand Down
1 change: 0 additions & 1 deletion acados/ocp_qp/ocp_qp_partial_condensing.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ void *ocp_qp_partial_condensing_memory_assign(ocp_qp_dims *dims, void *opts_, vo
************************************************/

int ocp_qp_partial_condensing_workspace_calculate_size(ocp_qp_dims *dims, void *opts_) { return 0; }

/************************************************
* functions
************************************************/
Expand Down
1 change: 0 additions & 1 deletion acados/sim/sim_erk_integrator.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ void sim_erk_opts_update(void *config_, void *dims, void *opts_)
************************************************/

int sim_erk_memory_calculate_size(void *config, void *dims, void *opts_) { return 0; }

void *sim_erk_memory_assign(void *config, void *dims, void *opts_, void *raw_memory)
{
return NULL;
Expand Down
1 change: 0 additions & 1 deletion acados/sim/sim_irk_integrator.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ void sim_irk_opts_update(void *config_, void *dims, void *opts_)
************************************************/

int sim_irk_memory_calculate_size(void *config, void *dims, void *opts_) { return 0; }

void *sim_irk_memory_assign(void *config, void *dims, void *opts_, void *raw_memory)
{
return NULL;
Expand Down
15 changes: 6 additions & 9 deletions acados/sim/sim_lifted_irk_integrator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,8 +1404,7 @@ int sim_lifted_irk(void *config_, sim_in *in, sim_out *out, void *opts_, void *m
#else // TRIPLE_LOOP
// ---- BLASFEO: LU factorization ----
#if defined(LA_HIGH_PERFORMANCE)
blasfeo_pack_dmat(dim_sys, dim_sys, sys_mat, dim_sys, str_mat, 0,
0); // mat2strmat
blasfeo_pack_dmat(dim_sys, dim_sys, sys_mat, dim_sys, str_mat, 0, 0); // mat2strmat
#endif // LA_BLAS | LA_REFERENCE
blasfeo_dgetrf_rowpivot(dim_sys, dim_sys, str_mat, 0, 0, str_mat, 0, 0,
ipiv); // Gauss elimination
Expand Down Expand Up @@ -1582,18 +1581,16 @@ int sim_lifted_irk(void *config_, sim_in *in, sim_out *out, void *opts_, void *m
#else // TRIPLE_LOOP
#if defined(LA_HIGH_PERFORMANCE)
// ---- BLASFEO: row transformations + backsolve ----
blasfeo_pack_dmat(dim_sys, 1 + NF, sys_sol, dim_sys, str_sol, 0,
0); // mat2strmat
blasfeo_pack_dmat(dim_sys, 1 + NF, sys_sol, dim_sys, str_sol, 0, 0); // mat2strmat
blasfeo_drowpe(dim_sys, ipiv, str_sol); // row permutations
blasfeo_dtrsm_llnu(dim_sys, 1 + NF, 1.0, str_mat, 0, 0, str_sol, 0, 0, str_sol, 0,
0); // L backsolve
blasfeo_dtrsm_lunn(dim_sys, 1 + NF, 1.0, str_mat, 0, 0, str_sol, 0, 0, str_sol, 0,
0); // U backsolve
blasfeo_unpack_dmat(dim_sys, 1 + NF, str_sol, 0, 0, sys_sol,
dim_sys); // strmat2mat
// BLASFEO: row transformations + backsolve
0); // U backsolve
blasfeo_unpack_dmat(dim_sys, 1 + NF, str_sol, 0, 0, sys_sol, dim_sys); // strmat2mat
// BLASFEO: row transformations + backsolve
#else // LA_BLAS | LA_REFERENCE
// ---- BLASFEO: row transformations + backsolve ----
// ---- BLASFEO: row transformations + backsolve ----
blasfeo_drowpe(dim_sys, ipiv, str_sol); // row permutations
blasfeo_dtrsm_llnu(dim_sys, 1 + NF, 1.0, str_mat, 0, 0, str_sol, 0, 0, str_sol, 0,
0); // L backsolve
Expand Down
Loading

0 comments on commit 7dcea36

Please sign in to comment.