[Rcpp-devel] armadillo mailing list?
Romain Francois
romain at r-enthusiasts.com
Thu Jul 29 15:17:31 CEST 2010
Le 29/07/10 15:00, baptiste Auguié a écrit :
>
> On Jul 29, 2010, at 1:23 PM, Romain Francois wrote:
>
>> Le 29/07/10 09:30, baptiste auguie a écrit :
>>> Dear all,
>>>
>>> I'm porting some R code to C++ using the armadillo framework (I'm
>>> using operations on complex matrices, etc.). The final goal is of
>>> course to wrap the code using RcppArmadillo. Currently, I'm still
>>> struggling with my little C++ knowledge. Does anyone know of an
>>> Armadillo mailing list where I could ask C++ questions?
>>
>> From armadillo's faq http://arma.sourceforge.net/faq.html
>> you can find a link to a forum:
>> http://sourceforge.net/apps/phpbb/arma/
>
> I don't know how I'd missed it, thanks!
No trouble. It was useful for me anyway as I did not know about creating
matrices from strings, so I learned something too. pretty nice.
> It turns out that my example would work, one only needs to make sure that the replacement has the correct type (matrix) and dimensions:
>
> this works
>
> mat A = "0 0 0; 0 0 0; 0 0 0;";
> A.submat(1,1,1,1) = ones(1);
>
> Thanks,
>
> baptiste
>
>>
>>> Just in case, I'll ask here too. I have a small 3x3 matrix that I
>>> generate in a nested for loop, and I want to insert this matrix as a
>>> block inside a larger matrix. In R language, I'd want to use a
>>> construct like,
>>>
>>> A[ seq(ii, ii+2), seq(jj, jj+2)]<- matrix(rnorm(9), 3, 3)
>>>
>>> I tried the following as a test,
>>>
>>> mat A = "0 0 0; 0 0 0; 0 0 0;";
>>> A.submat(1,1,1,1) = 1;
>>>
>>> but it seems that .submat is only to view elements, not assign them
>>> (the `[<-` method in R). Any tip?
>>>
>>> Sincerely,
>>>
>>> baptiste
>>
>> That is the kind of thing we should add in Rcpp sugar at some point, but currently I don't know how to.
>>
>> Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/aryfrk : useR! 2010
|- http://bit.ly/bc8jNi : Rcpp 0.8.4
`- http://bit.ly/dz0RlX : bibtex 0.2-1
More information about the Rcpp-devel
mailing list