Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-16 Thread Nicolas Heslot
Hi dear List, Another question related to the first one is about the compilation of that code. If the source of error is removed, the code compile correctly using cxxfunction. However, I get a warning message when I try to produce a package out of it using package.skeleton( "fun2", fun ): In dump

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-16 Thread Nicolas Heslot
I ran into the same kind of problem again, but this time I just can't find what the correct syntax is: I need to update a matrix stored in a list, by summing with an arma:: mat object the syntax MyList[j] += ArmaObject does not work. On the other hand I can access the matrix object stored in those

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Nicolas Heslot
I finally figured out, it was a syntax error, as the new assigned object was not an arma:: mat but an element from a list I took care of the problem by using ui = Rcpp::as(all_ui[i]) in the reaffectation Thank you again all for your help On Wed, Jun 15, 2011 at 11:00 PM, Dirk Eddelbuettel wrote:

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Dirk Eddelbuettel
On 15 June 2011 at 20:17, Nicolas Heslot wrote: | Any idea about this variable reaffectation thing? Well ... that still make little sense. Variables are not protected; there is nothing stopping you from re-assigning values, be it element-wise, row or column-wise, or as a whole matrix. So I suspec

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread MISRA, SANJOG
I've also written MCMC code using arma and have no trouble overwriting (assuming that's what reaffectation is) matrices. On Jun 15, 2011, at 8:17 PM, "Nicolas Heslot" wrote: Well, That's sound good, The distribution I need are multivariate normal, inverse gaussian. Though, the biggest issu

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Nicolas Heslot
Well, That's sound good, The distribution I need are multivariate normal, inverse gaussian. Though, the biggest issue is that for one of the parameter there is no closed form so I am using Metropolis Hastings for it. Any idea about this variable reaffectation thing? It seems to be specific to arma

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Whit Armstrong
I'm not giving up yet. I'll implement the distribution that is missing, and send you the example if you lay out your model w/ pseudocode. -Whit On Wed, Jun 15, 2011 at 7:59 PM, Nicolas Heslot wrote: > Hi, > > Thank you for your quick answer. > Sorry that I did not explain well enought my issue

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Nicolas Heslot
Hi, Thank you for your quick answer. Sorry that I did not explain well enought my issue. I did not know about cppbugs but I just checked and it does not seem that I can use it for my model because it lacks some of the distribution I need. The fraction of code could seems obscure but it is just the

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Dirk Eddelbuettel
Salut Nicolas, On 15 June 2011 at 17:03, Nicolas Heslot wrote: | Hi rcpp-devel! | First of all thank you for this awesome tool! Pleasure, and welcome. | I started a few days ago coding with Rcpp to try to reduce the computing time | of a MCMC model. | However, I don't have experience with C/C+

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Whit Armstrong
You're not the only person working on MCMC w/ Rcpp. I'm not sure about your exact question, but if you provide a .bug file or write your model in pseudo code (i.e. alpha ~ dnorm(0, tau)), then I'll write up a cppbugs example for you. -Whit On Wed, Jun 15, 2011 at 5:03 PM, Nicolas Heslot wrote

[Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Nicolas Heslot
Hi rcpp-devel! First of all thank you for this awesome tool! I started a few days ago coding with Rcpp to try to reduce the computing time of a MCMC model. However, I don't have experience with C/C++ and I can't figure out how to reaffect a new content to a variable. This seems probably very simpl