From 04d2b7051f7abc87cea4f2d96e0989dbacc0a6e0 Mon Sep 17 00:00:00 2001
From: "Pavel N. Krivitsky"
Date: Sun, 13 Oct 2024 12:11:53 +1100
Subject: [PATCH] mm() term implementation now uses the integer inputs API.
---
R/InitErgmTerm.R | 2 +-
src/changestats.c | 10 +++++-----
src/wtchangestats.c | 20 ++++++++++----------
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/R/InitErgmTerm.R b/R/InitErgmTerm.R
index 273ac2a41..32ca87dea 100644
--- a/R/InitErgmTerm.R
+++ b/R/InitErgmTerm.R
@@ -3592,7 +3592,7 @@ InitErgmTerm.mm<-function (nw, arglist, ..., version=packageVersion("ergm")) {
list(name = "mixmat",
coef.names = coef.names,
- inputs = c(symm+marg*2, attrval$row$valcodes, attrval$col$valcodes, unlist(levels2codes)),
+ iinputs = c(symm+marg*2, attrval$row$valcodes, attrval$col$valcodes, unlist(levels2codes)),
dependence = FALSE,
minval = 0)
}
diff --git a/src/changestats.c b/src/changestats.c
index 7114fa8bc..3af49d849 100644
--- a/src/changestats.c
+++ b/src/changestats.c
@@ -2603,11 +2603,11 @@ C_CHANGESTAT_FN(c_meandeg) {
General mixing matrix (mm) implementation.
*****************/
C_CHANGESTAT_FN(c_mixmat){
- unsigned int symm = ((int)INPUT_PARAM[0]) & 1;
- unsigned int marg = ((int)INPUT_PARAM[0]) & 2;
- double *tx = INPUT_PARAM;
- double *hx = BIPARTITE? INPUT_PARAM : INPUT_PARAM + N_NODES;
- double *cells = BIPARTITE? INPUT_PARAM + N_NODES + 1: INPUT_PARAM + N_NODES*2 + 1;
+ unsigned int symm = IINPUT_PARAM[0] & 1;
+ unsigned int marg = IINPUT_PARAM[0] & 2;
+ int *tx = IINPUT_PARAM;
+ int *hx = BIPARTITE? IINPUT_PARAM : IINPUT_PARAM + N_NODES;
+ int *cells = BIPARTITE? IINPUT_PARAM + N_NODES + 1: IINPUT_PARAM + N_NODES*2 + 1;
unsigned int diag = tx[tail]==tx[head] && hx[tail]==hx[head];
for(unsigned int j=0; j