Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bodono committed Jan 1, 2024
1 parent 49e749a commit 092e9c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/aa.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ aa_float aa_apply(aa_float *f, const aa_float *x, AaWork *a) {

a->iter++;

printf("iter %i.\n", a->iter);

if (a->iter % a->interval == 0) {
/* reset to average */
if (a->verbosity > 0) {
Expand Down
15 changes: 8 additions & 7 deletions src/scs.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,12 +896,13 @@ static ScsWork *init_work(const ScsData *d, const ScsCone *k,
}
if (w->stgs->acceleration_lookback) {
/* TODO(HACK!) negative acceleration_lookback interpreted as type-II */
if (!(w->accel = aa_init(
l, ABS(w->stgs->acceleration_lookback),
w->stgs->acceleration_lookback > 0,
w->stgs->acceleration_lookback > 0 ? AA_REGULARIZATION_TYPE_1
: AA_REGULARIZATION_TYPE_2,
AA_RELAXATION, AA_SAFEGUARD_FACTOR, AA_MAX_WEIGHT_NORM, 1))) {
if (!(w->accel = aa_init(l, ABS(w->stgs->acceleration_lookback),
w->stgs->acceleration_lookback > 0,
w->stgs->acceleration_lookback > 0
? AA_REGULARIZATION_TYPE_1
: AA_REGULARIZATION_TYPE_2,
AA_RELAXATION, AA_SAFEGUARD_FACTOR,
AA_MAX_WEIGHT_NORM, VERBOSITY))) {
if (w->stgs->verbose) {
scs_printf("WARN: aa_init returned NULL, no acceleration applied.\n");
}
Expand Down Expand Up @@ -1067,7 +1068,7 @@ scs_int scs_solve(ScsWork *w, ScsSolution *sol, ScsInfo *info,
/* this ensures the returned iterates always satisfy conic constraints */
if (w->accel) {
SCS(tic)(&accel_timer);
if (i > 0 && i % w->stgs->acceleration_interval == 0) {
if (i > 0) {
/* v overwritten with AA output here */
w->aa_norm = aa_apply(w->v, w->v_prev, w->accel);
}
Expand Down

0 comments on commit 092e9c6

Please sign in to comment.