Re: [Rcpp-devel] matrix indexing

2010-01-26 Thread Romain Francois
Hi, We now (in svn) have matrix-like indexing through operator() for all vectors : (character, integer, numeric, raw, logical, generic and expression). Here is an example from the unit tests of NumericVector : > funx <- cfunction(signature(x = "numeric" ), ' + NumericVector m(x) ; + double tr

Re: [Rcpp-devel] matrix indexing

2010-01-24 Thread Dirk Eddelbuettel
On 24 January 2010 at 13:37, Whit Armstrong wrote: | Oh, boy. I _do_ want a pony! | | > Don;t forget we all want a pony too.  Now, seriously, what is R++? | > If I knew what you were talking about I might have a chance of answering this :) | | I was talking about this one: | http://www.cs.kent.

Re: [Rcpp-devel] matrix indexing

2010-01-24 Thread Whit Armstrong
Oh, boy. I _do_ want a pony! > Don;t forget we all want a pony too.  Now, seriously, what is R++? > If I knew what you were talking about I might have a chance of answering this > :) I was talking about this one: http://www.cs.kent.ac.uk/projects/cxxr which Romain has pointed out in the next po

Re: [Rcpp-devel] matrix indexing

2010-01-24 Thread Romain Francois
On 01/24/2010 12:33 AM, Whit Armstrong wrote: >> indexing, but apparently one cannot pass more than one parameter to [] >> so ... I guess I'll have to sacrifice look and feel for a minute. > > yes, same issue for me in tslib. but (i,j) is not so bad esp for > matlab users. tslib users have it eve

Re: [Rcpp-devel] matrix indexing

2010-01-24 Thread Romain Francois
On 01/24/2010 12:42 AM, Whit Armstrong wrote: > I think the Armadillo stuff is great. MTL4 is also great, but lacking > some of the features of Armadillo. > > http://www.osl.iu.edu/research/mtl/mtl4/ > > All the good libraries that I've seen allow you to construct objects > from a pointer to raw m

Re: [Rcpp-devel] matrix indexing

2010-01-23 Thread Dirk Eddelbuettel
On 23 January 2010 at 18:42, Whit Armstrong wrote: | You all are also touching indirectly on another topic. We are all | doing interesting things in with R/c++ wrappers to make our lives | easier and make our code faster. What we really want is R++? Don;t forget we all want a pony too. Now, s

Re: [Rcpp-devel] matrix indexing

2010-01-23 Thread Whit Armstrong
I think the Armadillo stuff is great. MTL4 is also great, but lacking some of the features of Armadillo. http://www.osl.iu.edu/research/mtl/mtl4/ All the good libraries that I've seen allow you to construct objects from a pointer to raw memory and dimensions which should be very easy to write fo

Re: [Rcpp-devel] matrix indexing

2010-01-23 Thread Whit Armstrong
> indexing, but apparently one cannot pass more than one parameter to [] > so ... I guess I'll have to sacrifice look and feel for a minute. yes, same issue for me in tslib. but (i,j) is not so bad esp for matlab users. tslib users have it even harder since x() is used as lag/lead. x[] is used a

Re: [Rcpp-devel] matrix indexing

2010-01-23 Thread Romain Francois
On 01/23/2010 09:23 PM, Dirk Eddelbuettel wrote: > > On 23 January 2010 at 21:05, Romain Francois wrote: > | Hello, > | > | Motivated by Christophe's question on R-help (cc'ed), I'd like to add > | facilities for matrix (and maybe arrays) indexing into the new Rcpp api. > | > | The classic api alre

Re: [Rcpp-devel] matrix indexing

2010-01-23 Thread Dirk Eddelbuettel
On 23 January 2010 at 21:05, Romain Francois wrote: | Hello, | | Motivated by Christophe's question on R-help (cc'ed), I'd like to add | facilities for matrix (and maybe arrays) indexing into the new Rcpp api. | | The classic api already ships matrix indexing through RcppMatrix and | RcppMatri

[Rcpp-devel] matrix indexing

2010-01-23 Thread Romain Francois
Hello, Motivated by Christophe's question on R-help (cc'ed), I'd like to add facilities for matrix (and maybe arrays) indexing into the new Rcpp api. The classic api already ships matrix indexing through RcppMatrix and RcppMatrixView classes. I'm not a big fan of using round brackets for index