You might be looking for RInside.
> Le 12 juin 2017 à 10:11, Wolf Vollprecht a écrit :
>
> I am trying to run C++ tests from C++ directly.
> It looks like I need to start the R interpreter for memory management etc.
>
> So far I have achieved moderate success through:
>
> int Rf_initEmbedded
Hi,
Instead of doing that:
const int vtype = traits::r_sexptype_traits::rtype;
SEXP shape_sxp = Rf_allocVector(vtype, shape.size());
Perhaps your rxarray object could hold an IntegerVector. Also not quite sure
why you use the first line at all, which does not depend on T, so vtype is
always
Can you prepare a reprex ?
> Le 2 juin 2017 à 15:40, "f.k...@mailbox.org" a écrit :
>
> Hi all,
>
> I wrote a function foo using RcppParallel and I am observing a bug, which I
> can’t figure out.
> I first wrote the function in R, then in Rcpp, then RcppParallel.
>
> foo is doing exactly what
of undeclared identifier 'output'
> output.begin() + begin,
> ^
> 2 errors generated.
> make: *** [par_example.o] Error 1
>
>
> Hope this is as easily solved as the before error.
>
> Cheers, Franz
>
>
>
>
>> On 31 May 2017, at 12:2
You can add this somewhere on top of your cpp file
// [[Rcpp::depends(RcppParallel)]]
Romain
> Le 31 mai 2017 à 12:22, f.k...@mailbox.org a écrit :
>
> Hi all,
>
> I am very new to Rcpp and I wrote a function which I now want to parallelize.
> The function is working fine, and is much faster
Hello,
Functions in sugar only apply to vectors.
For a single value, you’d have to use the dnorm function in the R:: namespace:
// [[Rcpp::export]]
double test6(double x){
double y = R::dnorm(x,5.0,2.0,true);
return y;
}
> test6(3)
[1] -2.112086
> dnorm(3, mean = 5, sd = 2, log = TRUE)
> | It is indeed cumulative. Previously (presumably when that gallery page was
> | written) it was not cumulative, but Romain Francois changed the behavior of
> the
> | step() function several years ago, in this commit:
> https://github.com/RcppCore/
> | Rcpp/commit/e295b2b178de552
I’d be interesting to see what this more C++idomatic version would perform
nanCount = std::count_if( x.begin(), x.end(), ISNAN ) ;
Because despite all the inlining efforts that has been put in the
implementation of NumericVector, its operator[] might not perform as well as
using [] on a double
You can use T::get_na()
Romain
> Le 9 sept. 2015 à 08:24, Rguy a écrit :
>
> What is correct way to represent NA in a template? I have been successfully
> using NA_REAL (see example below) but I am not sure if this is the proper
> method.
> Thanks.
>
> /* template_NA.cpp:
> Experiment with
You need LinkingTo: Rcpp
And the information goes into the CLINK_CPPFLAGS variable if you really need to
make a custom rule for .cpp files
Romain
> Le 29 juil. 2015 à 17:19, "jsmith5...@yahoo.com" a
> écrit :
>
> Hi,
>
> Is there a way to automatically specify the location of the Rcpp inclu
You need
LinkingTo: Rcpp
As per the current documentation.
Romain
Envoyé de mon iPhone
> Le 29 juil. 2015 à 17:19, "jsmith5...@yahoo.com" a
> écrit :
>
> Hi,
>
> Is there a way to automatically specify the location of the Rcpp include
> directory (for Rcpp.h) in Makevars?
>
> In my Make
Or just use a std::vector for sg. That should do it.
Romain
Envoyé de mon iPhone
> Le 14 juil. 2015 à 13:21, JJ Allaire a écrit :
>
> The examples in the RcppParallel documentation assume that access to
> vectors and matrixes are *aligned* (i.e. fall into neat buckets
> whereby reading and wr
I would definitely second that. This eliminates a whole class of hard to deal
with issues.
Even Rcpp IMO should really just be header only.
Romain
Envoyé de mon iPhone
> Le 7 avr. 2015 à 20:51, JJ Allaire a écrit :
>
> I think that header-only packages (where possible) are definitely
> pre
Would be useful to have a solaris machine on aws or whatever with R all these
toils installed.
I once had a virtual machine set up thanks to martyn but the user experience of
virtualbox + keyboard conflicts with my french mac book keyboard was not that
good.
Does someone have the skills to s
Envoyé de mon iPhone
> Le 18 févr. 2015 à 17:31, JJ Allaire a écrit :
>
> We *can* call Rf_error from C++ code, but when we do it bypasses all
> C++ destructors on the stack, so we don't do it so as not leak memory
> and otherwise have deterministic behavior around
> construction/destruction.
Uncaught exception gives you UB. It is however difficult not to catch
exceptions if you use Rcpp::export attributes which includes a "catch all and
deal with it" part.
Romain
Envoyé de mon iPhone
> Le 29 déc. 2014 à 18:28, Wush Wu a écrit :
>
> Dear all,
>
> I have a question which is desc
That is similar to a path i've followed in Rcpp11/Rcpp14.
What's really missing in R is api access to strings, e.g testing for equality
of two CHARSXP, comparing them, ...
This causes all sorts of problems with dplyr.
Romain
> Le 16 déc. 2014 à 06:00, Jeroen Ooms a écrit :
>
>> On Thu, Dec
Envoyé de mon iPhone
> Le 3 déc. 2014 à 17:59, Gabor Grothendieck a écrit :
>
> 1. This returns a matrix rather than a vector:
>
> -- start of file teste.cpp ---
> #include
> // [[Rcpp::depends(RcppArmadillo)]]
>
> using namespace arma;
> using namespace Rcpp;
>
> // [[Rcpp::export]]
> Nume
> Le 27 nov. 2014 à 13:22, Søren Højsgaard a écrit :
>
> Dear all,
> By "accident" I noticed that indexing with x(i) and x[i] gives remarkable
> difference in computing time. For example:
>
> library(Rcpp)
> cppFunction('
> IntegerVector insert1 (int n){
> IntegerVector z(n);
> for (int i=0;
This is probably related to this:
template
struct r_vector_const_iterator {
typedef typename storage_type::type* type ;
};
There should be a const there somewhere.
FWIW, more modern implementations of R/C++ are more safe on that issue:
$ Rcpp11Script
You get UB if the first is bigger than the second.
Envoyé de mon iPhone
> Le 22 nov. 2014 à 14:30, Søren Højsgaard a écrit :
>
> OK; thanks! Shall I read this such as "the behaviour is undefined"?
> Søren
>
> |-Original Message-----
> |From: R
This has nothing to do with NA. It's just about the size difference. sugar does
not make attempt at recycling. Your responsibility.
Romain
> Le 22 nov. 2014 à 11:48, Søren Højsgaard a écrit :
>
> Dear all,
> Came across this:
>
> #include
> using namespace Rcpp;
>
> //[[Rcpp::export]]
> Li
g Xu a écrit :
>
> Thanks a lot!
>
> Does that mean we should never modify an argument passed from R to cpp?
>
> On Wed, Oct 22, 2014 at 8:24 AM, Romain Francois <mailto:rom...@r-enthusiasts.com>> wrote:
> a and b are the same object:
>
> > a <- s
a and b are the same object:
> a <- seq(1, 0.1, -0.1)
> b <- a
> pryr::address( a )
[1] "0x7f9504534948"
> pryr::address( b )
[1] "0x7f9504534948"
So clone is what you need here.
Implementing copy on write for that kind of example is possible, but would
require a lot of additional code, i.e.
Hi,
that's not going to fly.
A CharacterVector holds strings of arbitrary lengths, well technically it holds
other R objects (SEXP) that hold pointers to strings.
A RawVector holds unsigned char.
Can you add some meat to your example, e.g. what you'd expect to go in, etc ...
Romain
> Le
> Le 20 oct. 2014 à 21:54, Dirk Eddelbuettel a écrit :
>
>
> Hi Gustaf,
>
> On 20 October 2014 at 15:17, Gustaf Granath wrote:
> | Im trying to use some C++ functions in R. However, these functions are
> | build around unsigned char* variables (1D array). I have for example a
> | large matri
Envoyé de mon iPhone
> Le 5 oct. 2014 à 07:51, Jeffrey Wong a écrit :
>
> I am trying to use RcppParallel to do a fast grid search. The idea is to
> construct a matrix using R's expand.grid, then for each row of that matrix,
> x, call f(x). For simplicity the function f will always return a
If you want to have a private conversation with Dirk, just email him directly:
e...@debian.org
Now since this is all in the open, let me participate to this.
Le 29 sept. 2014 à 22:42, Jonathon Love a écrit :
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> hey dirk,
>
> i was wonderi
Le 10 sept. 2014 à 14:22, Gregory Jefferis a écrit
:
>
>
> Gregory Jefferis
>
> On 10 Sep 2014, at 10:39, Romain Francois wrote:
>
>> RCPP_EXPOSED_CLASS(A)
>>
>> before you declare class A and simply use this signature for the method.
>>
This is once again something with which the RCPP_EXPOSED_CLASS macro can help
with. Try adding
RCPP_EXPOSED_CLASS(A)
before you declare class A and simply use this signature for the method.
void DoSomethingWithInstanceOfA(const A& )
Also, you can have both of these classes in the same modul
Le 1 sept. 2014 à 11:48, Dr Gregory Jefferis a
écrit :
> Hello,
>
> I have a more or less complete Rcpp(Eigen) dependent package that exposes a
> pair of C++ classes to R using RcppModules;the C++ classes (which implement k
> nearest neighbour search trees) differ only in their scalar storag
g attributes then this isn't a concern, if you are not
> then you need the return value SEXP on the stack prior to RNGScope.
>
> On Thursday, August 21, 2014, Romain Francois
> wrote:
> Ah interesting. PutRNGstate does indeed allocate so might trigger GC.
> h
in and Gregor,
>
> maybe I am misunderstanding everything, but hasn't this problem been
> explained and solved here:
>
> http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-May/005838.html
>
> Best,
>
> Matteo
>
>
>
>
> On Thu, Aug 21,
Le 21 août 2014 à 11:47, Gregor Kastner a écrit :
> On Thu, 21 Aug 2014 11:34:23 +0200
> Romain Francois wrote:
>
> GK> Yep, sorry for the misuse of language. And I do understand going back to
> GK> GetRNGstate() and PutRNGstate() is a bit old school; but I can definite
Le 20 août 2014 à 20:57, Gregor Kastner a écrit :
> JJ> Yes, RNGScope isn't safe by itself. You can use it via attributes (and we
> JJ> make sure to use it correctly) or you could use this pattern e.g. if you
> JJ> are planning to return a NumericVector:
> JJ>
> JJ> NumericVector vec(20); //
Not sure what you mean by hide the R function. You can extract a function by
its name on the C++ side :
Function bazinga("mean") ;
or extract it from a particular environment, e.g.
Environment("package:base")["mean"]
or
Environment base("package:base") ;
Function foo = base["mean"]
Romain
EST PROTOCOL -- Tue Jul 29 13:20:29 2014
> ***
> Number of test functions: 439
> Number of errors: 0
> Number of failures: 0
>
>
> Sorry, due to a restrictive firewall on my dev computer, I cannot access
> github from it. A mail will have to suffice for now.
>
>
This is likely to be a bug in Rcpp, don't go bother clang about it:)
Perhaps you can try to remove the bool cast and run the test suite. If
everything works, then it either means that there are no tests for the
particular case or that the overload is useless.
You probably have to consider what
Lookup in Rcpp::List is linear on something that is quite cheap (comparing
pointers, because strings in R are cached).
Lookup in std::map is logarithmic on whatever it means to compare the keys (so
in your case comparing strings).
on top of that, copying the data across is linear in the best c
Hi,
Please find an answer here.
http://stackoverflow.com/questions/24317910/rcpp-module-for-inheritance-class/24320207#24320207
Romain
Le 20 juin 2014 à 01:13, Jianyang Zhao a écrit :
> Hello All,
>
> I got a problem when I try module with inheritance class. Basiclly, I can't
> compile thi
Le 19 juin 2014 à 03:05, Dirk Eddelbuettel a écrit :
>
> On 18 June 2014 at 19:40, Tim Keitt wrote:
> |
> |
> |
> | On Wed, Jun 18, 2014 at 6:26 PM, Dirk Eddelbuettel wrote:
> |
> |
> | Tim,
> |
> | Step back for a second and recognise that everything happens via
> |
> |
Le 19 juin 2014 à 01:02, Tim Keitt a écrit :
>
>
>
> On Wed, Jun 18, 2014 at 5:37 PM, Romain Francois
> wrote:
> Le 19 juin 2014 à 00:30, Tim Keitt a écrit :
>
>> On Wed, Jun 18, 2014 at 5:22 PM, Romain Francois
>> wrote:
>> Le 1
Le 19 juin 2014 à 00:30, Tim Keitt a écrit :
> On Wed, Jun 18, 2014 at 5:22 PM, Romain Francois
> wrote:
> Le 19 juin 2014 à 00:15, Tim Keitt a écrit :
>
>
>>
>> On Wed, Jun 18, 2014 at 5:07 PM, Romain Francois
>> wrote:
>> Le 18 juin 2014 à 23:5
Le 19 juin 2014 à 00:15, Tim Keitt a écrit :
>
> On Wed, Jun 18, 2014 at 5:07 PM, Romain Francois
> wrote:
> Le 18 juin 2014 à 23:54, Tim Keitt a écrit :
>
>
>> I'd like to raise a condition other than error or warning. Is that possible
>> using the Rcpp
Le 18 juin 2014 à 23:54, Tim Keitt a écrit :
> I'd like to raise a condition other than error or warning. Is that possible
> using the Rcpp api? I assume this can be done via R internals, but I'd prefer
> not to call error() directly (or is that the recommendation?).
>
> THK
Definitely not. R
is the problem.
Romain
>
> On Wed, May 28, 2014 at 3:44 PM, Romain Francois
> wrote:
> (now with some links):
>
> Le 28 mai 2014 à 16:31, John Mous a écrit :
>
>> The object really is just built as part of the return statement. i.e. the
>> lines from my prio
(now with some links):
Le 28 mai 2014 à 16:31, John Mous a écrit :
> The object really is just built as part of the return statement. i.e. the
> lines from my prior e-mail exist as-is in the full code,
Sure. What happens is that Rcpp::export generates something that calls wrap(
std::map ).
This looks like a protection issue.
For whomever this makes sense to: From the code that wraps such object, i would
investigate the call to setAttrib.
Perhaps we are supposed to get the result of it and protect it.
So i would tend to use an Armor instead of a Shield.
Romain
Le 28 mai 2014
Le 6 mai 2014 à 09:35, Florian Burkart a écrit :
> Hi,
>
> I have been creating lists of lists with
>
> return Rcpp::List::create(Rcpp::Named("vec") = someVector,
> Rcpp::Named("lst") = someList,
> Rcpp::Named("vec2") = someOtherVector);
>
Le 6 mai 2014 à 08:45, Florian Burkart a écrit :
> Hi everyone (and Dirk),
>
> Second attempt on corrected email list.
>
> I have been trying to extend Rcpp with my own wrap and as templates.
>
> Two issues:
>
> 1) I need to explicitly call wrap. Is that expected?
>
> So for example I wrote
gt;
> I've tested and it seems to work as intended. Is this fix you were conceiving
> of or is there something more we should be doing?
>
> J.J.
>
>
> On Wed, Apr 30, 2014 at 9:19 AM, Romain Francois
> wrote:
>> The plugin as implemented now is not portable
The plugin as implemented now is not portable. The easiest way to make it
portable would be to define the USE_CXX1X environment variable, which R knows
how to interpret.
This way R would do what makes sense, i.e. use -std=c++0x on windows (for which
rtools is limited to gcc 4.6.3 now) and -std
Hi,
If you can assume c++11, you might bot need openmp, as you can just use
standard support for threads, etc ...
Although the compiler suite used on windows (if you care about that) does not
support c++11 threads. This might be available later.
Romain
Le 28 avr. 2014 à 12:51, Matteo Fasi
Hello,
I’ll keep it short here. Rcpp11 3.1.0 was released on CRAN today. An
announcement email has been sent to both r-packages and the new R and C++
mailing list. https://groups.google.com/forum/#!forum/r-and-cpp
Best Regards,
Romain
___
Rcpp-deve
Le 8 avr. 2014 à 13:28, stat quant a écrit :
> Hi,
> Will that be ok to ask Rcpp questions to on this list too?
>
Definitely. Anything R and C++ related.
> On 8 Apr 2014 09:56, "Romain François" wrote:
> Hello,
>
> I have created a new mailing list (as a google group) for general discussio
Le 28 févr. 2014 à 11:52, Gregor Kastner a écrit :
> Hi Hideyoshi,
>
>> Is there a way I can just call that function in Rcpp rather than having to
>> install new libraries or create my own? (I presume that there is probably a
>> “C_do_fmin.c” file somewhere that I can use?)
>
> This questions
Le 17 févr. 2014 à 12:17, Alessandro Mammana a écrit :
> Dear all,
> I am trying to write an Rcpp function that accepts optionally a
> vector, but I cannot figure out what default value I should give to
> it.
>
> First I tried the following:
>
> // [[Rcpp::export]]
> int nilVec(NumericVector v
FYI, there is a Array template in Rcpp11.
https://github.com/romainfrancois/Rcpp11/blob/master/inst/include/Rcpp/Array.h
With which you could use code like this:
#include
using namespace Rcpp ;
// [[Rcpp::export]]
double NewFunc( NumericArray<3> x){
return x(1,2,3) + x(2,3,4) ;
}
Romain
L
Le 12 févr. 2014 à 13:36, Alessandro Mammana a écrit :
> Ah wait, my bad (as always T.T), I found a much simpler explanation:
>
> colset <- sample(3e7-nr, 1e7)
> storage.mode(colset)
> [1] "integer"
> storage.mode(colset-1)
> [1] "double"
>
> So when I was unwrapping colset I allocated new mem
Hi Antonio,
This is about how R evaluation works. Might not just be what you think it is.
When you use Rcpp and therefore .Call things are evaluated fairly early, at
least earlier than what would happen with R, etc … you can reproduce what R
does by using promises. For example this work in Rc
com |
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
> ------
>
>
>
> On Mon, Feb 3, 2014 at 9:12 PM, Romain Francois
> wrote:
>> The problem is likely t
The problem is likely to be that it was assumed that List derives from RObject.
It used to, it does not anymore.
Classes from the api now use a policy based design. See andrei alexandrescu's
modern c++ book for the why and the how of policy based design.
.
Envoyé de mon iPhone
Le 3 févr.
Hello,
Do you have a budget fo that work ?
Romain
Le 20 janv. 2014 à 11:12, Damian Lyons a écrit :
> Dear Rcpp developers,
>
> Firstly, many thanks for your work on Rcpp. It has saved me countless hours
> (or is that months?) of simulation time.
>
> I'm a big fan of RcppArmadillo and Arma
Hello,
This stands out
double U;
for(int i=0; i(X);
NumericVector y = as(Y);
…
}
by things like this:
//[[Rcpp::export]]
double mydcov(NumericVector x, NumericVector y){
…
}
Romain
Le 19 janv. 2014 à 14:09, 晔张 a écrit :
> Hello, everyone.
> I guess the probrem maybe occur be
Le 18 janv. 2014 à 06:10, Davor Cubranic a écrit :
> Running compileAttributes with “verbose = TRUE” was very informative:
>
> $ Rscript -e 'Rcpp::compileAttributes(".", TRUE)'
> Exports from /Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp:
>List rcpp_hello_world(NumericVecto
Hi,
If you wrap your std::vector you get a list of raw vectors, and this
does not do deep copies of the RawVector.
If you want a RawMatrix, you have to make copies as all the matrix data is
contiguous in memory.
Perhaps you can change things around, first create the matrix and then fill it
; On Thu, Jan 9, 2014 at 11:31 AM, Romain Francois
> wrote:
> Hi,
>
> The module docs is probably the one in the worst shape. I think the current
> recommendation is to have this in one of your .R files:
>
> loadModule( "yourmodule", TRUE )
>
> which trigge
the factory function pointer.)
>
> However I am not seeing any of my functions exported to the package. How
> would the factory be called from R? I sort of understood that exporting in
> packages was automatic. Do I have to manually create the module in R?
>
> THK
>
>
Hello,
You can use .factory instead of .constructor in that case.
Romain
Le 9 janv. 2014 à 03:16, Tim Keitt a écrit :
> I did a little experiment with RCPP_MODULE trying to wrap a class from
> another library. The class in question has a protected default constructor
> and uses a non-membe
Hello,
wrap is for converting an object of arbitrary class to an R object. It deduces
what to do based on the class of what you pass it. So you usually don’t specify
the template parameter. So you’d usually just write :
return wrap(a);
If you wanted to be explicit, then you would use:
re
Thanks.
In any case, for things like this the best thing to do is to not trust what
anyone says and actually benchmark with realistic data.
Romain
Le 31 déc. 2013 à 16:29, Hadley Wickham a écrit :
>> I believe you are mistaken. sorting is an expensive O( N log(N) ) operation.
>>
>> I’d use
Hello,
This is fixed in Rcpp implementations I maintain: Rcpp11 and Rcpp98 and tested
for in Rcpp-test.
https://github.com/romainfrancois/Rcpp11/blob/master/src/attributes.cpp#L1195
https://github.com/romainfrancois/Rcpp98/blob/master/src/attributes.cpp#L1228
Trivial to port the fix to Rcpp.
Hello,
This is a perfect example for using hash sets (std::unordered_set in C++11)
with custom implementations of hashing and comparison operators.
See this gist: https://gist.github.com/romainfrancois/8187193
I have only tested it with Rcpp11 (and therefore using C++11), but I get down
to 2
Hi,
If both these functions will end up in the same package, then I’d suggest to
put both files in the src directory and use devtools::load_all on your package
root directory.
Dirk’s recommendation is relevant bar is in its own package and calls foo from
another package. Might not be what yo
Le 29 déc. 2013 à 12:50, Asis Hallab a écrit :
> Dear Rcpp experst,
>
> I hope everyone has had a pleasant Xmas.
>
> I am just wondering what would be the recommended and most efficient way to
> check, if a Rcpp Vector contains a given element?
>
> If I am not mistaken the C++ standard appro
in a
| JSS paper?
We could add a 'Suggests: RcppEigenFastLm' (or whichever name we end up with).
It would help with a thing or too -- didn't you even discover a slight
NAMESPACE issue on the R side recently?
On 3 December 2013 at 08:47, Romain Francois wrote:
| without them, w
utside of the package,
kind of like "look how I can do fastLm with this one". This has been
useful in training sessions for example.
But now presumably, I'll get replies in the "this has been there for
years" department.
Romain
--
R
.R. C==filt says the
I'm currently on OS X 10.9 with R 3.0.2 and Rcpp 0.10.6.
Does anyone know how to fix this?
Best,
--
Hao Ye
h...@ucsd.edu
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
___
Rcpp-devel mailing list
Rcpp
es/R/x86_64-unknown-linux-gnu-library/3.1/Rcpp/include/Rcpp/exceptions.h:172:17:
note: 'Rcpp::forward_exception_to_r' declared here
inline void forward_exception_to_r( const std::exception& ex){
^
Do these all look like issues that I should address in RcppEigen?
--
R
are usually
called through the BEGIN_RCPP / END_RCPP or nowadays by compileAttributes.
Do these all look like issues that I should address in RcppEigen?
This seems more like Rcpp issues. However I'll propose a few changes to
RcppEigen so that it uses at
removing 'C:/Program Files/R/R-2.15.1/library/RcppArmadillo'
Any advice would be much appreciated.
Thanks
Greg
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
This very much depends on the code but there is a good chance that
RcppArmadillo will generate code making less data copies, etc ...
Hard to say without seeing the code.
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
___
Rcp
ne
_______
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
when I call
> compileAttributes. Is there anywhere a linking involved with Rcpp.so or
> Rcpp.dylib?
>
>
> Best
>
> Simon
>
>
> On 02 Nov 2013, at 09:57, Romain Francois wrote:
>
>> Le 02/11/2013 09:35, Simon Zehnder a écrit :
>>> First,
th
--
Chief Scientist, RStudio
http://had.co.nz/
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
__
Le 31/10/2013 17:36, Dirk Eddelbuettel a écrit :
On 31 October 2013 at 17:15, Romain Francois wrote:
| Le 31/10/2013 15:59, baptiste auguie a écrit :
| > "OS X 10.9 (aka Mavericks) has a new C++ compiler, clang++ with libcxx
| > headers/runtime. Your package fails to compile with th
ch trivial uses of modules (i.e. no classes), maybe it is
worth considering using // [[Rcpp::export]] and code generation given by
compileAttributes instead of modules.
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
___
I'll have a look. It is likely to be a bug in some part of Rcpp's code
bloat.
I will try to find a solution that does not involve releasing a new Rcpp
as 0.10.6 was just released.
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
_
re details if needed... I am doing some long-running MCMC
calculations. And, I would like the C++ code to store the
results every, say, 1 iterations. Of course, I could do
this in a loop from R. But, I want to be sure that is really
necessary before I re-write my R code ;o)
--
Romain Fra
lapply(x, add_1);
Thanks!
-Kevin
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Just a warning that this code creates a NumericVector of length 1 initialised
with 0.
1 is not a NumericVector so the compiler looks for a conversion, the one that
is found is the ctor for NumericVector that takes an int.
Romain
Le 28 oct. 2013 à 17:05, Hadley Wickham a écrit :
> FYI, that
ey a écrit :
Hi Romain, Dirk,
I'd be willing to contribute an Rcpp Gallery post and some tests if
this were added to Rcpp; I think it would be quite useful.
-Kevin
On Wed, Oct 23, 2013 at 6:31 AM, Dirk Eddelbuettel wrote:
On 23 October 2013 at 14:31, Romain Francois wrote:
| Le 23/10/2
ter to a function that is Rcpp::export'ed,
what happens is that the data gets copied.
Could you instead pass down an NumericVector ? The reason is that given
Rcpp's design, copy semantics of NumericVector are cheap (no data copy).
Which leads back
Le 23/10/2013 13:47, Dirk Eddelbuettel a écrit :
On 21 October 2013 at 14:32, Romain Francois wrote:
| Hello,
|
| Another thing I have developped in dplyr but might be generally useful
| is the ListOf class. See
| https://github.com/hadley/dplyr/blob/master/inst/include/tools/ListOf.h
|
| The
nserter["x29"] = 32 ;
You can probably encapsulate more so that you don't have to create the 3
objects (out, names and inserter), but I leave this as an exercize.
This is not as nice as using create, but it gets the job done in a way
that does not compro
(){
Sinker bar ;
// call whatever that uses cout
}
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp
list and SO, but could
be generally useufl for Rcpp users.
Do people want to see this in Rcpp.
This is orthogonal to everything else, so the risk is minimum. This is a
template class, so the cost is null if the class is not used.
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6
Dirk Eddelbuettel | e...@debian.org <mailto:e...@debian.org> |
http://dirk.eddelbuettel.com
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
enough, so maybe the next someone struggles with this they
may find. If someone is itching to fix this, we will gladly take patches.
Dirk
--
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
--
Romain Francois
Professional R Enthusiast
Le 19/10/13 20:09, Dirk Eddelbuettel a écrit :
On 19 October 2013 at 17:55, Romain Francois wrote:
| Try putting your declarations into a RItools.h file in inst/include/ or
| src/ in your package, i.e. have this in RItools.h
|
| typedef double (*testStat)(NumericVector, NumericVector);
|
| and
1 - 100 of 793 matches
Mail list logo