Skip to content

Commit

Permalink
Weighted MHproposal u_func is now passed the edge state; some unneces…
Browse files Browse the repository at this point in the history
…sary parameter names have been removed.
  • Loading branch information
krivit committed Nov 4, 2024
1 parent 7cd01d6 commit 450a1bf
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ergm
Version: 4.7-7451
Date: 2024-11-01
Version: 4.7-7458
Date: 2024-11-04
Title: Fit, Simulate and Diagnose Exponential-Family Models for Networks
Authors@R: c(
person(c("Mark", "S."), "Handcock", role=c("aut"), email="[email protected]"),
Expand Down
4 changes: 2 additions & 2 deletions inst/include/ergm_MHproposal.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ typedef struct MHProposalstruct {
SEXP R;
void (*i_func)(struct MHProposalstruct*, Network*);
void (*p_func)(struct MHProposalstruct*, Network*);
void (*u_func)(Vertex tail, Vertex head, struct MHProposalstruct*, Network*, Rboolean);
void (*u_func)(Vertex, Vertex, struct MHProposalstruct*, Network*, Rboolean);
void (*f_func)(struct MHProposalstruct*, Network*);
void (*x_func)(unsigned int type, void *data, struct MHProposalstruct*, Network*);
void (*x_func)(unsigned int, void *, struct MHProposalstruct*, Network*);
Edge ntoggles;
Vertex *toggletail;
Vertex *togglehead;
Expand Down
2 changes: 1 addition & 1 deletion inst/include/ergm_changestat.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef struct ModelTermstruct {
void (*f_func)(struct ModelTermstruct*, Network*);
void (*s_func)(struct ModelTermstruct*, Network*);
SEXP (*w_func)(struct ModelTermstruct*, Network*);
void (*x_func)(unsigned int type, void *data, struct ModelTermstruct*, Network*);
void (*x_func)(unsigned int, void *, struct ModelTermstruct*, Network*);
void (*z_func)(struct ModelTermstruct*, Network*, Rboolean);
double *attrib; /* Ptr to vector of covariates (if necessary; generally unused) */
int *iattrib; /* Ptr to vector of integer covariates (if necessary; generally unused) */
Expand Down
6 changes: 3 additions & 3 deletions inst/include/ergm_wtMHproposal.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ typedef struct WtMHProposalstruct {
SEXP R;
void (*i_func)(struct WtMHProposalstruct*, WtNetwork*);
void (*p_func)(struct WtMHProposalstruct*, WtNetwork*);
void (*u_func)(Vertex tail, Vertex head, double weight, struct WtMHProposalstruct*, WtNetwork*);
void (*u_func)(Vertex, Vertex, double, struct WtMHProposalstruct*, WtNetwork*, double);
void (*f_func)(struct WtMHProposalstruct*, WtNetwork*);
void (*x_func)(unsigned int type, void *data, struct WtMHProposalstruct*, WtNetwork*);
void (*x_func)(unsigned int, void *, struct WtMHProposalstruct*, WtNetwork*);
Edge ntoggles;
Vertex *toggletail;
Vertex *togglehead;
Expand Down Expand Up @@ -88,7 +88,7 @@ void WtMHProposalDestroy(WtMHProposal *MH, WtNetwork *nwp);
#define Mweight (MHp->toggleweight)

#define WtMH_I_FN(a) void (a) (WtMHProposal *MHp, WtNetwork *nwp)
#define WtMH_U_FN(a) void (a) (Vertex tail, Vertex head, double weight, WtMHProposal *MHp, WtNetwork *nwp)
#define WtMH_U_FN(a) void (a) (Vertex tail, Vertex head, double weight, WtMHProposal *MHp, WtNetwork *nwp, double edgestate)
#define WtMH_P_FN(a) void (a) (WtMHProposal *MHp, WtNetwork *nwp)
#define WtMH_F_FN(a) void (a) (WtMHProposal *MHp, WtNetwork *nwp)
#define WtMH_X_FN(a) void (a) (unsigned int type, void *data, WtMHProposal* MHp, WtNetwork* nwp)
Expand Down
2 changes: 1 addition & 1 deletion inst/include/ergm_wtchangestat.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef struct WtModelTermstruct {
void (*f_func)(struct WtModelTermstruct*, WtNetwork*);
void (*s_func)(struct WtModelTermstruct*, WtNetwork*);
SEXP (*w_func)(struct WtModelTermstruct*, WtNetwork*);
void (*x_func)(unsigned int type, void *data, struct WtModelTermstruct*, WtNetwork*);
void (*x_func)(unsigned int, void *, struct WtModelTermstruct*, WtNetwork*);
void (*z_func)(struct WtModelTermstruct*, WtNetwork*, Rboolean);
double *attrib; /* Ptr to vector of covariates (if necessary; generally unused) */
int *iattrib; /* Ptr to vector of integer covariates (if necessary; generally unused) */
Expand Down
4 changes: 2 additions & 2 deletions src/MHproposal.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ MHProposal *MHProposalInitialize(SEXP pR, Network *nwp, void **aux_storage){
fn[1] = 'i';
MHp->i_func=(void (*)(MHProposal*, Network*)) R_FindSymbol(fn,sn,NULL);
fn[1] = 'u';
MHp->u_func=(void (*)(Vertex tail, Vertex head, MHProposal*, Network*, Rboolean)) R_FindSymbol(fn,sn,NULL);
MHp->u_func=(void (*)(Vertex, Vertex, MHProposal*, Network*, Rboolean)) R_FindSymbol(fn,sn,NULL);
fn[1] = 'f';
MHp->f_func=(void (*)(MHProposal*, Network*)) R_FindSymbol(fn,sn,NULL);
fn[1] = 'x';
MHp->x_func=(void (*)(unsigned int type, void *data, MHProposal*, Network*)) R_FindSymbol(fn,sn,NULL);
MHp->x_func=(void (*)(unsigned int, void *, MHProposal*, Network*)) R_FindSymbol(fn,sn,NULL);

SEXP tmp = getListElement(pR, "inputs");
MHp->inputs=length(tmp) ? REAL(tmp) : NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/wtMHproposal.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ WtMHProposal *WtMHProposalInitialize(SEXP pR, WtNetwork *nwp, void **aux_storage
fn[1] = 'i';
MHp->i_func=(void (*)(WtMHProposal*, WtNetwork*)) R_FindSymbol(fn,sn,NULL);
fn[1] = 'u';
MHp->u_func=(void (*)(Vertex tail, Vertex head, double weight, WtMHProposal*, WtNetwork*)) R_FindSymbol(fn,sn,NULL);
MHp->u_func=(void (*)(Vertex, Vertex, double, WtMHProposal*, WtNetwork*, double)) R_FindSymbol(fn,sn,NULL);
fn[1] = 'f';
MHp->f_func=(void (*)(WtMHProposal*, WtNetwork*)) R_FindSymbol(fn,sn,NULL);
fn[1] = 'x';
MHp->x_func=(void (*)(unsigned int type, void *data, WtMHProposal*, WtNetwork*)) R_FindSymbol(fn,sn,NULL);
MHp->x_func=(void (*)(unsigned int, void *, WtMHProposal*, WtNetwork*)) R_FindSymbol(fn,sn,NULL);

SEXP tmp = getListElement(pR, "inputs");
MHp->inputs=length(tmp) ? REAL(tmp) : NULL;
Expand Down

0 comments on commit 450a1bf

Please sign in to comment.