-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamic allocation of logging toggles (#126)
fixes #123 Co-authored-by: Pavel N. Krivitsky <p.krivitsky@unsw.edu.au>
- Loading branch information
1 parent
f84873b
commit c24e7ac
Showing
4 changed files
with
61 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "kvint.h" | ||
|
||
SEXP kvint_to_SEXP(kvint v) { | ||
int size = kv_size(v); | ||
SEXP out = PROTECT(allocVector(INTSXP, size)); | ||
int *out_ptr = INTEGER(out); | ||
for (int i = 0; i < size; i++) { | ||
out_ptr[i] = kv_A(v, i); | ||
} | ||
UNPROTECT(1); | ||
return out; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef INCLUDE_SRC_KVINT_H_ | ||
#define INCLUDE_SRC_KVINT_H_ | ||
|
||
#include <Rinternals.h> | ||
#include "ergm_kvec.h" | ||
|
||
typedef kvec_t(int) kvint; | ||
SEXP kvint_to_SEXP(kvint v); | ||
|
||
#endif // INCLUDE_SRC_KVINT_H_ |