Skip to content

Commit

Permalink
Macro for initializing DyadGen and bounded degree in C now takes an o…
Browse files Browse the repository at this point in the history
…ption whether or not to create a tracking edge list; randomtoggle proposal disables it.
  • Loading branch information
krivit committed Dec 17, 2023
1 parent 06cb7ed commit 8744a9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/MHproposals.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Default MH algorithm with dyad generator API.
*********************/
MH_I_FN(Mi_randomtoggle){
INIT_DYADGEN_AND_DEGREE_BOUND;
INIT_DYADGEN_AND_DEGREE_BOUND(FALSE);
MHp->ntoggles = storage->gen->ndyads!=0 ? 1 : MH_FAILED;
}

Expand Down Expand Up @@ -55,7 +55,7 @@ MH_F_FN(Mf_randomtoggle){
***********************/

MH_I_FN(Mi_TNT){
INIT_DYADGEN_AND_DEGREE_BOUND;
INIT_DYADGEN_AND_DEGREE_BOUND(TRUE);
MHp->ntoggles = storage->gen->ndyads!=0 ? 1 : MH_FAILED;
}

Expand Down Expand Up @@ -493,7 +493,7 @@ MH_F_FN(Mf_TNT10){
datasets are sparse, so this is not likely to be an issue.
*********************/
MH_I_FN(Mi_ConstantEdges){
INIT_DYADGEN_AND_DEGREE_BOUND;
INIT_DYADGEN_AND_DEGREE_BOUND(TRUE);
Edge nedges = DyadGenEdgecount(storage->gen);
MHp->ntoggles = nedges>0 && nedges<storage->gen->ndyads && storage->gen->ndyads>=2 ? 2 : MH_FAILED;
}
Expand Down
4 changes: 2 additions & 2 deletions src/MHproposals.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

typedef struct{DyadGen *gen; DegreeBound *bd;} StoreDyadGenAndDegreeBound;

#define INIT_DYADGEN_AND_DEGREE_BOUND \
#define INIT_DYADGEN_AND_DEGREE_BOUND(el) \
ALLOC_STORAGE(1, StoreDyadGenAndDegreeBound, storage); \
storage->gen = DyadGenInitializeR(MHp->R, nwp, TRUE); \
storage->gen = DyadGenInitializeR(MHp->R, nwp, el); \
storage->bd = DegreeBoundInitializeR(MHp->R, nwp);

#define DESTROY_DYADGEN_AND_DEGREE_BOUND \
Expand Down

0 comments on commit 8744a9d

Please sign in to comment.