[Rcpp-devel] Is there an Rcpp class for arrays with > 2 dimensions?

Dominick Samperi djsamperi at gmail.com
Tue Jun 15 20:45:42 CEST 2010


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
<romain at r-enthusiasts.com>wrote:

> 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 create such an
>> object by installing a dim attribute on a Vector type but I didn't
>> want to reinvent the wheel.
>>
>> Is there such a class or am I misremembering?
>>
>
> We do not have invented that wheel. It should not be too hard to generalize
> what we do with Rcpp::Matrix
>
> You can ignore the member functions that have diag in their names.
>
> although, we would probably also have to extend the Vector::operator() for
> more dimensions, and probably also Vector::offset.
>
> I feel somewhat lazy here, but if you or someone else decides to pick it
> up, I will have a look.
>
> Romain
>
> --
> Romain Francois
> Professional R Enthusiast
> +33(0) 6 28 91 30 30
> http://romainfrancois.blog.free.fr
> |- http://bit.ly/98Uf7u : Rcpp 0.8.1
> |- http://bit.ly/c6YnCi : graph gallery collage
> `- http://bit.ly/bZ7ltC : inline 0.3.5
>
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20100615/fc1c0ddd/attachment.htm>


More information about the Rcpp-devel mailing list