diff --git a/DESCRIPTION b/DESCRIPTION index 3767c9e7..aea9d0ce 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: ergm -Version: 4.8.0-7022 +Version: 4.8.0-7504 Date: 2024-12-22 Title: Fit, Simulate and Diagnose Exponential-Family Models for Networks Authors@R: c( diff --git a/R/InitErgmTerm.operator.R b/R/InitErgmTerm.operator.R index aab9d949..12666823 100644 --- a/R/InitErgmTerm.operator.R +++ b/R/InitErgmTerm.operator.R @@ -715,8 +715,6 @@ InitErgmTerm.Sum <- function(nw, arglist,...){ nparam <- nparams[1] inputs <- unlist(wl%>%map(t)) - inputs <- c(nf, length(inputs), inputs) - if(is.function(a$label)){ cns <- lapply(ms, param_names, canonical=TRUE) @@ -770,7 +768,7 @@ InitErgmTerm.Sum <- function(nw, arglist,...){ } }else offset <- FALSE - c(list(name="Sum", coef.names = coef.names, inputs=inputs, submodels=ms, emptynwstats=gs, + c(list(name="Sum", coef.names = coef.names, inputs=inputs, iinputs=nf, submodels=ms, emptynwstats=gs, dependence=dependence, offset=offset, ext.encode = if(ms %>% map("terms") %>% unlist(FALSE) %>% map("ext.encode") %>% compact %>% length) function(el, nw0) diff --git a/src/changestats_operator.c b/src/changestats_operator.c index 36503f4d..bb02a7a4 100644 --- a/src/changestats_operator.c +++ b/src/changestats_operator.c @@ -177,18 +177,7 @@ F_CHANGESTAT_FN(f__submodel_and_summary_term){ // Sum: Take a weighted sum of the models' statistics. I_CHANGESTAT_FN(i_Sum){ - /* - inputs expected: - 1: number of models (nms) - 1: total length of all weight matrices (tml) - tml: a list of mapping matrices in row-major order - */ - - double *inputs = INPUT_PARAM; - unsigned int nms = *(inputs++); - unsigned int tml = *(inputs++); - inputs+=tml; // Jump to start of model specifications. - + unsigned int nms = *IINPUT_PARAM; ALLOC_STORAGE(nms, Model*, ms); SEXP submodels = getListElement(mtp->R, "submodels"); @@ -200,11 +189,9 @@ I_CHANGESTAT_FN(i_Sum){ } C_CHANGESTAT_FN(c_Sum){ - double *inputs = INPUT_PARAM; GET_STORAGE(Model*, ms); - unsigned int nms = *(inputs++); - inputs++; // Skip total length of weight matrices. - double *wts = inputs; + unsigned int nms = *IINPUT_PARAM; + double *wts = INPUT_PARAM; for(unsigned int i=0; i