inlineLologPlugin: An lolog plug-in for easy C++ prototyping and access

Description Usage Arguments Details See Also Examples

Description

An lolog plug-in for easy C++ prototyping and access

The inline plug-in for lolog

Usage

1
2
3

Arguments

...

plug-in arguments

Details

The lolog Rcpp plugin allows for the rapid prototyping of compiled code. new functions can be registered and exposed using cppFunction and new statistics can be compiled and registered using sourceCpp.

See Also

cppFunction, sourceCpp, cppFunction

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# This creates a function in C++ to create an empty network of size n
# and expose it to R.
src <- "
lolog::BinaryNet<lolog::Directed> makeEmptyNetwork(const int n){
Rcpp::IntegerMatrix tmp(0,2);
lolog::BinaryNet<lolog::Directed> net(tmp, n);
return net;
}
"
Rcpp::registerPlugin("lolog",inlineLologPlugin)
emptyNetwork <- cppFunction(src,plugin="lolog")
net <- emptyNetwork(10L)
net[1:10,1:10]


## End(Not run)

lolog documentation built on July 1, 2021, 9:09 a.m.