Skip to content

Commit cd02803

Browse files
committed
Updated the C++ shim vignette.
1 parent 83a0985 commit cd02803

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

vignettes/cpp-api.Rmd

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ vignette: >
99

1010
This vignette documents the C++ convenience wrappers for developing ERGM terms and proposals using modern C++ while interfacing with ergm's core C data structures.
1111

12-
The API focuses on lightweight wrappers (no ownership) around existing C structs to provide: range-based iteration, safer array handling, and access to `->R` list elements/attributes.
12+
The API partially wraps the Terms and Proposals APIs and focuses on lightweight wrappers (no ownership) around existing C structs to provide: range-based iteration, safer array handling, and access to `->R` list elements/attributes.
1313

1414
**WARNING:** This API is *experimental* and is subject to change in response to evolving needs and user feedback, but some effort will be made to maintain backwards compatibility. In particular, see the item about namespace versioning below.
1515

@@ -101,21 +101,23 @@ Headers: `#include "cpp/ergm_proposal.h"`, `#include "cpp/ergm_wtproposal.h"`
101101

102102
The following macros define the C entry point and construct network and model term handles named `nw` and `mt` for use in `impl`:
103103

104-
- `C_CHANGESTAT_CPP(name, impl, StorageType)`
105-
- `S_CHANGESTAT_CPP(name, impl, StorageType)`
106-
- `D_CHANGESTAT_CPP(name, impl, StorageType)`
107-
- `I_CHANGESTAT_CPP(name, impl, StorageType)`
108-
- `U_CHANGESTAT_CPP(name, impl, StorageType)`
109-
- `F_CHANGESTAT_CPP(name, impl, StorageType)`
110-
- `W_CHANGESTAT_CPP(name, impl, StorageType)` (returns `SEXP`)
111-
- `X_CHANGESTAT_CPP(name, impl, StorageType)`
112-
- `Z_CHANGESTAT_CPP(name, impl, StorageType)`
104+
- `C_CHANGESTAT_CPP(name, StorageType, impl)`
105+
- `S_CHANGESTAT_CPP(name, StorageType, impl)`
106+
- `D_CHANGESTAT_CPP(name, StorageType, impl)`
107+
- `I_CHANGESTAT_CPP(name, StorageType, impl)`
108+
- `U_CHANGESTAT_CPP(name, StorageType, impl)`
109+
- `F_CHANGESTAT_CPP(name, StorageType, impl)`
110+
- `W_CHANGESTAT_CPP(name, StorageType, impl)` (returns `SEXP`)
111+
- `X_CHANGESTAT_CPP(name, StorageType, impl)`
112+
- `Z_CHANGESTAT_CPP(name, StorageType, impl)`
113+
114+
`StorageType` can be omitted (i.e., passing only 2 arguments) if no private storage is used.
113115

114116
Weighted counterparts in `ergm_wtchangestat.h` are prefixed with `Wt` (e.g., `WtC_CHANGESTAT_CPP`).
115117

116118
## Examples
117119

118-
Binary terms: triangle count in `src/cpp_changestats.cpp`.
120+
Binary terms: triangle and cycle counts in `src/cpp_changestats.cpp`.
119121

120122
Valued terms: transitive weights in `src/cpp_wtchangestats.cpp`.
121123

0 commit comments

Comments
 (0)