Skip to content

Commit

Permalink
SAN now uses ChangeStatsDo()/ChangeStatsUndo() as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
krivit committed Nov 5, 2024
1 parent d562a75 commit 907b6f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/SAN.c.template.do_not_include_directly.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ MCMCStatus DISPATCH_SANMetropolisHastings(DISPATCH_ErgmState *s,

/* Calculate change statistics,
remembering that tail -> head */
PROP_CHANGESTATS;
PROP_CHANGESTATS_DO;

/* Always store the proposal for self-tuning. */
for (unsigned int i = 0; i < nstats; i++){
Expand Down Expand Up @@ -262,8 +262,8 @@ MCMCStatus DISPATCH_SANMetropolisHastings(DISPATCH_ErgmState *s,
Rprintf("Accepted.\n");
}

/* Make proposed toggles (updating timestamps--i.e., for real this time) */
for(unsigned int i=0; i < MHp->ntoggles; i++) PROP_COMMIT;
/* Make the last (or sole) toggle. */
PROP_FINISH;
/* record network statistics for posterity */
Rboolean finished = TRUE;
for (unsigned int i = 0; i < nstats; i++){
Expand All @@ -277,6 +277,8 @@ MCMCStatus DISPATCH_SANMetropolisHastings(DISPATCH_ErgmState *s,
if(verbose>=5){
Rprintf("Rejected.\n");
}

PROP_CHANGESTATS_UNDO;
}
}

Expand Down

0 comments on commit 907b6f4

Please sign in to comment.