Re: [Rcpp-devel] Working with indicators in Armadillo

2013-02-25 Thread Conrad S
On Sun, Feb 24, 2013 at 6:33 AM, Simon Zehnder wrote: > 1 arma::mat repS = arma::repmat(S, 1, K); > 2 arma::mat compM = arma::ones(S.n_rows, K); > 3 arma::rowvec par_post(K); > 4 > 5 for(unsigned int k = 0; k < K; ++k) { > 6 compM.col(k) = compM.col(k) * (k + 1); > 7 }

Re: [Rcpp-devel] Working with indicators in Armadillo

2013-02-23 Thread Dirk Eddelbuettel
On 23 February 2013 at 21:33, Simon Zehnder wrote: | Dear Rcpp-Devels, | | I try to write some code in C++, where S is a classification vector (arma::uvec) with entries in between 1 and K: Well, that was an incomplete and unreproducible example. At a minimum, try to make them complete and prov