On 10 February 2012 at 15:56, Andy Leung wrote:
| Dear Rcpp users and developers,
|
| I understand how to extract a single column or row from an
| RcppArmadillo matrix, but I am still unsure how to extract columns or
I use span() methods a lot too, but thety are continuous...
| rows based on a
On 10 February 2012 at 16:57, Haiying Pang wrote:
|
| I am calling a R function through Rcpp and RInside in my c++ program in Linux.
| There are a lot of warning messages saying "no graphics system to unregister"
| that were outputed to my log file, which leaded to a hug log file that I can
| ha
Dear Rcpp users and developers,
I understand how to extract a single column or row from an
RcppArmadillo matrix, but I am still unsure how to extract columns or
rows based on a vector of indices. I wrote a rather awkward (and dumb)
way to extract, and here are some reproducible codes:
###
I am calling a R function through Rcpp and RInside in my c++ program in
Linux. There are a lot of warning messages saying "no graphics system to
unregister" that were outputed to my log file, which leaded to a hug log
file that I can hardly open after letting the code run for a few hours. Is
there
Thank you, this makes more sense now. I do like the succinct, "show-off"
style; it seems to convey the meaning better.
On Fri, Feb 10, 2012 at 4:47 PM, Douglas Bates wrote:
> On Fri, Feb 10, 2012 at 3:30 PM, Dirk Eddelbuettel wrote:
> >
> > On 10 February 2012 at 15:05, Douglas Bates wrote:
> >
On Fri, Feb 10, 2012 at 3:30 PM, Dirk Eddelbuettel wrote:
>
> On 10 February 2012 at 15:05, Douglas Bates wrote:
> | Or if you want to show off you could collapse it to
> |
> | > src <- "
> | + NumericMatrix tmpMatrix(as(List(L)[0]));
> | + return wrap(tmpMatrix.ncol());
> | + "
> | > f <- cxx
On 10 February 2012 at 15:05, Douglas Bates wrote:
| Or if you want to show off you could collapse it to
|
| > src <- "
| + NumericMatrix tmpMatrix(as(List(L)[0]));
| + return wrap(tmpMatrix.ncol());
| + "
| > f <- cxxfunction(signature(L="list"), src, plugin = "Rcpp" )
| > f(list(matrix(1:9,
Or if you want to show off you could collapse it to
> src <- "
+ NumericMatrix tmpMatrix(as(List(L)[0]));
+ return wrap(tmpMatrix.ncol());
+ "
> f <- cxxfunction(signature(L="list"), src, plugin = "Rcpp" )
> f(list(matrix(1:9,3,3)))
[1] 3
On Fri, Feb 10, 2012 at 3:01 PM, Douglas Bates wrote:
Another approach is to force the evaluation of the list element with as
> src <- "
+ List inputList(L) ;
+ NumericMatrix tmpMatrix(as(inputList[0])) ;
+
+ return wrap(tmpMatrix.ncol());
+ "
> f <- cxxfunction(signature(L="list"), src, plugin = "Rcpp" )
> f(list(matrix(1:9,3,3)))
[1] 3
In an
I am not exactly sure why that works, but it does! Why doesn't it directly
see the NumericMatrix(SEXP)?
Thank you, Dirk!
On Fri, Feb 10, 2012 at 3:10 PM, Dirk Eddelbuettel wrote:
>
> On 10 February 2012 at 14:49, Sameer Soi wrote:
> | Hello Rcpp'ers,
> |
> | I want to access a List of matrices
On 10 February 2012 at 14:49, Sameer Soi wrote:
| Hello Rcpp'ers,
|
| I want to access a List of matrices in an Rcpp/C++ function that will passed
to
| me via R...
|
| src <- "
| using namespace Rcpp ;
| List inputList(L) ;
| NumericMatrix tmpMatrix ;
|
| tmpMatrix = NumericMatrix(inpu
Hello Rcpp'ers,
I want to access a List of matrices in an Rcpp/C++ function that will
passed to me via R...
src <- "
using namespace Rcpp ;
List inputList(L) ;
NumericMatrix tmpMatrix ;
tmpMatrix = NumericMatrix(inputList[0]) ;
return(wrap(tmpMatrix.ncol())) ;
"
test <- cxxfunction(sig
12 matches
Mail list logo