-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Dealing with terms should be more general. In the current design, terms in C++ receive a vector. This should change to a list, and more over, using C++ classes:
typedef std::vector< int > v_int;
class term_args;
class ergmito_term {
public:
...
// Calculation
std::function<void(v_int&, term_args*) fun;
// Checker
std::function<void(v_int&, term_args*) check_args;
}This way terms can be generated with a set of arbitrary arguments. Moreover, this could be ported to a C++ header-only library for computing sufficient statistics on networks (represented as list of source/target).
On the R side, functions with the same name of the term should be defined such that those can be called within R and set up all the requirements.
Formulas need to be more regeneral. Here is a proposed set of steps:
- Extract the RHS of the formula
- Match terms by using something like
"(edge|ctriad|triad|...)(\(.*\))?" - If only the first part matched, then add () and make a call, otherwise make the call.
Metadata
Metadata
Assignees
Labels
No labels