Thanks for your advice! I'll plan to read the documents carefully. Now I am
anxious to make the program running. If possible, could you please give me an
example to achieve that?
Best regards,
Gao Xia
xiagao1982
2010-06-16
发件人: Dirk Eddelbuettel
发送时间: 2010-06-16 09:14:07
收件人: xiagao1982
On 16 June 2010 at 08:13, xiagao1982 wrote:
| Dear friends,
|
| I am a newcomer of Rcpp and RInside. I installed them in my system and
| successfully build the following example:
|
| #include //
| for the embedded R via RInside
|
| Rcpp::NumericMatrix createMatri
Dear friends,
I am a newcomer of Rcpp and RInside. I installed them in my system and
successfully build the following example:
#include // for the embedded R via
RInside
Rcpp::NumericMatrix createMatrix(const int n) {
Rcpp::NumericMatrix M(n,n);
for (int i=0
[should have used reply all]
On Tue, Jun 15, 2010 at 3:11 PM, Romain Francois
wrote:
>
> But there seems to be a problem due to non-public fields.
>>
>
> What do you mean ?
I made the mistake of using NumericMatrix(Dimension(2,3,4)) instead of
NumericVector(Dimension(2,3,4)). That is why I had c
Le 15/06/10 23:06, Douglas Bates a écrit :
Suppose I want to iterate over the values of a NumericVector x. If
one wants to "future-proof" one's code a bit, I presume the preferred
idiom is
for(R_len_t i = 0; i< x.size(); ++i) x[i] = ...
as opposed to declaring i to be an int or a size_t. I
Suppose I want to iterate over the values of a NumericVector x. If
one wants to "future-proof" one's code a bit, I presume the preferred
idiom is
for(R_len_t i = 0; i < x.size(); ++i) x[i] = ...
as opposed to declaring i to be an int or a size_t. Is that correct?
___
On Tue, Jun 15, 2010 at 2:11 PM, Romain Francois
wrote:
>
> Le 15/06/10 20:45, Dominick Samperi a écrit :
>>
>> I have tried something like
>>
>> Rcpp::NumericVector nm(Rcpp::Dimension(2,3,4));
>
> I get this:
>
>> require( Rcpp )
> Le chargement a nécessité le package : Rcpp
>> require( inline )
(cc'ing the list since apparently you did not)
Le 15/06/10 21:50, Dominick Samperi a écrit :
On Tue, Jun 15, 2010 at 3:11 PM, Romain Francois
mailto:[email protected]>> wrote:
which looks about right. although not much useful without some more
support such as extract or set the v
Le 15/06/10 20:45, Dominick Samperi a écrit :
I have tried something like
Rcpp::NumericVector nm(Rcpp::Dimension(2,3,4));
I get this:
> require( Rcpp )
Le chargement a nécessité le package : Rcpp
> require( inline )
Le chargement a nécessité le package : inline
> fx <- cxxfunction( signature
I have tried something like
Rcpp::NumericVector nm(Rcpp::Dimension(2,3,4));
But there seems to be a problem due to non-public fields.
Am I misunderstanding the purpose of Dimension() here?
On Tue, Jun 15, 2010 at 2:19 PM, Romain Francois
wrote:
> Le 15/06/10 20:08, Douglas Bates a écrit :
>
>
I've seen 2-10 times figure mentioned as a reasonable expectation for this. (I
hit around 5-6x on my last few projects.)
Avoid calling back into R (i.e., Rcpp::Function) too frequently, because
crossing that interpreter boundary carries a real price.
Also, if your R code is mostly staying insid
Hi Chuck,
On 15 June 2010 at 12:24, Chuck Anderson wrote:
| I translated some R code I have for training neural networks into C++
| using Armadillo and call it using RcppArmadillo. It was great fun to
| see how Armadillo allows a pretty direct translation from R to C++.
Cool. That's pretty
I translated some R code I have for training neural networks into C++
using Armadillo and call it using RcppArmadillo. It was great fun to
see how Armadillo allows a pretty direct translation from R to C++.
However, I only see a speed up of 2 over the R execution time. I
expected much more.
Le 15/06/10 20:08, Douglas Bates a écrit :
I may be confusing Armadillo classes and Rcpp classes but I seem to
recall that there is an Rcpp class for arrays with more than 2
dimensions. However, I can't find anything that looks like that in
the declarations or in the unit tests. I can easily c
I may be confusing Armadillo classes and Rcpp classes but I seem to
recall that there is an Rcpp class for arrays with more than 2
dimensions. However, I can't find anything that looks like that in
the declarations or in the unit tests. I can easily create such an
object by installing a dim attri
Le 15/06/10 17:27, Dominick Samperi a écrit :
This code seems simple enough (from cxxPack)...
RcppExport SEXP testBankOpen(SEXP name, SEXP id, SEXP balance) {
BEGIN_RCPP
BankAccount *p = new BankAccount(Rcpp::as(name),
Rcpp::as(id),
Rcpp::as(
This code seems simple enough (from cxxPack)...
RcppExport SEXP testBankOpen(SEXP name, SEXP id, SEXP balance) {
BEGIN_RCPP
BankAccount *p = new BankAccount(Rcpp::as(name),
Rcpp::as(id),
Rcpp::as(balance));
Rcpp::XPtr xp(p, true);
return xp
17 matches
Mail list logo