-
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.
- Loading branch information
1 parent
e19ca1f
commit 5c958dc
Showing
6 changed files
with
23 additions
and
65 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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_ |