Discussion:
[Rcpp-devel] help needed on RcppEigen
akshay kulkarni
2018-03-19 16:21:59 UTC
Permalink
dear sir,

I am using R to model stock prices but a slow "for" loop has stifled my research.


I am using Rcpp to speed up my "for" loop. I am also using RcppEigen to implement block operations on xts objects.....
require(RcppEigen)
it is not recognising the .block method in C++.
cppFunction(' include <RcppEigen.h> .....body')
error: "include doesn't name a type"
My question is : how do I manipulate the installed RcppEigen package for the cppFunction to recognize block operations that are part of the Eigen library in C++? If I have to use the "include" key word (something like this: include <RcppEigen.h> ), where exactly should i position it in order to work with cppFunction ( I want to use Eigen block operation methods or functions inside the body of the cppFunction)?


very many thanks for your time and effort.....


yours sincerely,

AKSHAY M KULKARNI
Serguei Sokol
2018-03-19 17:42:29 UTC
Permalink
Post by akshay kulkarni
dear sir,
               I am using R to model stock prices but a slow "for" loop has stifled my research.
I am using Rcpp to speed up my "for" loop. I am also using RcppEigen to implement block operations on xts objects.....
require(RcppEigen)
it is not recognising the .block method in C++.
 cppFunction(' include  <RcppEigen.h>  .....body')
error: "include doesn't name a type"
My question is : how do I manipulate the installed RcppEigen package for the cppFunction to recognize block operations that are part of the Eigen library in
C++? If I have to use the "include" key word (something like this: include <RcppEigen.h> ), where exactly should i position it in order to work with cppFunction
( I want to use Eigen block operation methods or functions inside the body of the cppFunction)?
It looks like you have missed some starter texts.
Take a look at
https://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-introduction.pdf
and http://gallery.rcpp.org/articles/eigen-eigenvalues/
Note that in all examples there is "#" before "include", it's not optional.
May be some introduction texts to C++ would be useful too.

Best,
Serguei.
Post by akshay kulkarni
very many thanks for your time and effort.....
yours sincerely,
AKSHAY M KULKARNI
_______________________________________________
Rcpp-devel mailing list
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Loading...