Displaying 8 results from an estimated 8 matches for "rcpp_modul".
Did you mean:
rcpp_module
2011 Feb 17
2
Newbie Rccp module question. "Failed to initialize module pointer"???
...out
fully understanding how all the pieces fit together.
Basically, i took the first example from Rcpp modules vignette:
fun.cpp
========================
#include <Rcpp.h>
#include <math.h>
using namespace Rcpp;
double norm(double x, double y){
return sqrt(x*x+y*y);
}
RCPP_MODULE(mod){
function("norm", &norm);
}
==========================
I then run Rcpp.package.skeleton("mypackage"), put fun.cpp in mypackage/src and
did
R CMD INSTALL mypackage, which seemed to compile mypackage.so OK. However, when
i am trying to use module, i get error...
2011 Jan 26
1
Problem with "setMethod" in R package
...uot; from graphics shows up
x="ANY", y="ANY" # why was it missing before?
x="Rcpp_rothC", y="missing"
######### FILE rcpp_rothC_module.h #########
class rothC { ... }
######### FILE rcpp_rothC_module.cpp #########
using namespace Rcpp ;
RCPP_MODULE(rothC) {
class_<rothC>("rothC")
.constructor()
...
}
######### FILE rcpp_rothC.R #########
Rcpp_rothC.plot <- function(x,y,...) { ... }
########## FILE zzz.R ##########
.NAMESPACE <- environment()
rothC <- new( "Module" )
.onLoad <- function(...
2011 Jan 23
0
setMethod call in package code using Rcpp
...uot; from graphics shows up
x="ANY", y="ANY" # why was it missing before?
x="Rcpp_rothC", y="missing"
######### FILE rcpp_rothC_module.h #########
class rothC { ... }
######### FILE rcpp_rothC_module.cpp #########
using namespace Rcpp ;
RCPP_MODULE(rothC) {
class_<rothC>("rothC")
.constructor()
...
}
######### FILE rcpp_rothC.R #########
Rcpp_rothC.plot <- function(x,y,...) { ... }
########## FILE zzz.R ##########
.NAMESPACE <- environment()
rothC <- new( "Module" )
.onLoad <- function(...
2011 May 06
1
Create and access several instances of a C++ class from R
Hello
We have a C++ class with several methods that manipulate an object. How is it possible to create several instances of that class *from R* in the C++ realm, which can then be accessed via a given name character? Symbolic example (we hope this illustrates our problem):
// C++ side:
class Foo{
...
}
// perhaps:
void my_new_instance_wrapper("the_character") // plain to see that I am
2010 Dec 22
0
Rcpp 0.9.0 and RcppClassic 0.9.0
...and make exposing C++ functions or
classes to R even easier. A first illustration is provided by this simple
C++ code snippet
const char* hello( const std::string& who ){
std::string result( "hello " ) ;
result += who ;
return result.c_str() ;
}
RCPP_MODULE(yada){
using namespace Rcpp ;
function( "hello", &hello ) ;
}
which (after compiling and loading) we can access in R as
yada <- Module( "yada" )
yada$hello( "world" )
In a similar way, C++ classes can be exposed very easily.
Rcpp...
2010 Dec 22
0
Rcpp 0.9.0 and RcppClassic 0.9.0
...and make exposing C++ functions or
classes to R even easier. A first illustration is provided by this simple
C++ code snippet
const char* hello( const std::string& who ){
std::string result( "hello " ) ;
result += who ;
return result.c_str() ;
}
RCPP_MODULE(yada){
using namespace Rcpp ;
function( "hello", &hello ) ;
}
which (after compiling and loading) we can access in R as
yada <- Module( "yada" )
yada$hello( "world" )
In a similar way, C++ classes can be exposed very easily.
Rcpp...
2013 Jun 19
3
Calling an array in a struct in C to R
Hi there,
Although I'm a quite experienced R user and know my ways in C, I stumbled
upon a problem I don't know how to solve. Therefore, I hope someone can
provide me with the information or pointers I need in order to understand
the way in which the communication between R and C occurs. I have the
following C code which basicallly reflects what I want:
typedef struct
{
float
2011 Jun 04
2
Interfacing a C++ class
Hello
Apologies for cross-posting, the discussion should (if) go to R-devel, but I also want to reach the rcpp-devel people.
My C++ class FOO is a module available through Rcpp, and it works fine and is -- so far -- bug free. With trying to further develop my R package, I thought it was a good idea to interface my C++ workhorse FOO with an S4 class Foo. After some long and not always insightful