My RcppArmadillo code is structured with a .cpp function that calls a
group of enabling .cpp functions. The .cpp function returns SEXP
arguments and is wrapped in the macros BEGIN_RCPP, END_RCPP to promote
C++ errors to R. The group of other functions called are structured as
void return (passing
On 22 December 2010 at 18:08, Cedric Ginestet wrote:
| Dear Rcpp Experts,
|
| I have encountered two issues when modifying an object within C++ function.
See
| the code below:
|
| ##
| library(inline); library(Rcpp)
| D <- matrix(rnorm(4),2,2)
| src3 <- '
On Wed, Dec 22, 2010 at 12:08 PM, Cedric Ginestet
wrote:
> Dear Rcpp Experts,
>
> I have encountered two issues when modifying an object within C++ function.
> See the code below:
>
> ##
> library(inline); library(Rcpp)
> D <- matrix(rnorm(4),2,2)
> src3 <-
On 22 December 2010 at 10:40, Andrew Redd wrote:
| To chime in about Romain's comment about recognizing more types. I would love
| a more robust exception handling. I think I already mentioned that but
| sometimes throwing a std::exception can be very expensive. something a little
| bit more ro
Dear Rcpp Experts,
I have encountered two issues when modifying an object within C++
function. See the code below:
##
library(inline); library(Rcpp)
D <- matrix(rnorm(4),2,2)
src3 <- '
NumericMatrix xD(D);
xD[1,1] = 100.0;
return xD;
'
passRef <- cxx
To chime in about Romain's comment about recognizing more types. I would
love a more robust exception handling. I think I already mentioned that but
sometimes throwing a std::exception can be very expensive. something a
little bit more robust would be very helpful. For example, with the
discus
On 22 December 2010 at 09:18, Christian Gunning wrote:
| > test1 = cxxfunction(signature(vec='complex'), '
| > ComplexVector x(vec) ;
| > int nn = x.size();
| > for( int i=0; i x[i].r = x[i].r*2 ;
| > x[i].i = x[i]
> test1 = cxxfunction(signature(vec='complex'), '
> ComplexVector x(vec) ;
> int nn = x.size();
> for( int i=0; i x[i].r = x[i].r*2 ;
> x[i].i = x[i].i*2 ;
> }
> return x ;
> ', plugi
On Wed, Dec 22, 2010 at 5:33 AM, wrote:
> Hello,
>
> Following Gabor's thread yesterday, I looked into R source code and figure
> that we don't need to test for NA when using numeric vector. See this:
>
> require(inline)
> require(Rcpp)
>
> pl <- cxxfunction( , '
> return List::create(
>
On 21 December 2010 at 22:23, Christian Gunning wrote:
| A few unit tests of instantiating a ComplexVector are attached.
Thank you! Now applied as rev 2811.
Dirk
--
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel ma
On 22 December 2010 at 11:56, Cedric Ginestet wrote:
[...]
| throw("Matrix Index is lower than 0.");
[...]
| How can I modify my code in order to get the reason for the exception
| printed within R.
By passing a exception class that inherits from std::exception, see a C++
reference an
Hello,
That is because you are not throwing an exception, but a "const char*" and
END_RCPP does not recognize this type. Maybe it should.
You can either create your own exception class or use one from the standard
set: http://cplusplus.com/reference/std/exception/exception/
Romain
Le mer
Le mer 22/12/10 13:02, "Gabor Grothendieck" ggrothendi...@gmail.com a écrit:
> On Wed, Dec 22, 2010 at 6:33 AM, i...@r-enthusiasts.com> wrote:
> Also, I'm trying to write the looping internally in
> order to get a better comparison. With the attached file, I
> get:
> The attachment does not see
On Wed, Dec 22, 2010 at 6:33 AM, wrote:
> Also, I'm trying to write the looping internally in order to get a better
> comparison. With the attached file, I get:
The attachment does not seem to have made it through.
--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-
Dear Rcpp experts,
I have got another problem with the throw of exception in C++
channelled into R. Apologies but these codes are not reproducible: I
didn't succeed to use the BEGIN_RCPP ... END_RCPP commands with the
inline-package. Help regarding this would be also welcomed.
#
Hello,
Following Gabor's thread yesterday, I looked into R source code and figure that
we don't need to test for NA when using numeric vector. See this:
require(inline)
require(Rcpp)
pl <- cxxfunction( , '
return List::create(
NA_REAL + NA_REAL,
NA_REAL + 1.0,
1
Perfect. You were correct. It was just to do with my compiler. It worked.
For future reference, my compiler's version is:
gcc 4.4.3
Cheers,
Cedric
On 22/12/10 10:49, rom...@r-enthusiasts.com wrote:
Hmm. It works for me :
romain@ /tmp $ Rscript scalar.R
Le chargement a nécessité le package : Rc
Hmm. It works for me :
romain@ /tmp $ Rscript scalar.R
Le chargement a nécessité le package : Rcpp
Le chargement a nécessité le package : methods
Le chargement a nécessité le package : inline
[1] 0.118499288 -1.817607621 -0.222048483 -1.237370127 -0.311005542
[6] -1.171129611 -1.762177277
Dear Rcpp experts,
I've got another problem related to Rcpp Sugar. Basically, I would
like to have the same functionality that you get from R's vectors,
where binary operations with scalars are automatically interpreted as
elementwise operations. See the following code and error message:
###
19 matches
Mail list logo