Re: [Rcpp-devel] Best way to compute M'M if M is triangular using RcppArmadillo

2013-04-17 Thread Ahmadou Dicko
-wien.ac.at [mailto: > [email protected]] On Behalf Of Dirk Eddelbuettel > > Sent: Wednesday, April 17, 2013 9:17 AM > > To: [email protected] > > Cc: [email protected] > > Subject: Re: [Rcpp-devel] Best way to compute M'M if M i

Re: [Rcpp-devel] Best way to compute M'M if M is triangular using RcppArmadillo

2013-04-17 Thread F.Tusell
April 17, 2013 9:17 AM > To: [email protected] > Cc: [email protected] > Subject: Re: [Rcpp-devel] Best way to compute M'M if M is triangular using > RcppArmadillo > > > On 17 April 2013 at 14:24, F.Tusell wrote: > | Not a question strictly abou

Re: [Rcpp-devel] Best way to compute M'M if M is triangular using RcppArmadillo

2013-04-17 Thread Conrad S
On Wed, Apr 17, 2013 at 10:24 PM, F.Tusell wrote: > SEXP Prod1(SEXP M_) { > const mat M = as(M_) ; > mat prodM = M ; > prodM = trans(M) * M ; > return(wrap(prodM)) ; > } Why are you making a copy of M (as prodM) before doing the multiplication ? Why not just directly do "mat prodM = M.t(

Re: [Rcpp-devel] Best way to compute M'M if M is triangular using RcppArmadillo

2013-04-17 Thread Smith, Dale (Norcross)
l Message- From: [email protected] [mailto:[email protected]] On Behalf Of Dirk Eddelbuettel Sent: Wednesday, April 17, 2013 9:17 AM To: [email protected] Cc: [email protected] Subject: Re: [Rcpp-devel] Best way to compute M&

Re: [Rcpp-devel] Best way to compute M'M if M is triangular using RcppArmadillo

2013-04-17 Thread Dirk Eddelbuettel
On 17 April 2013 at 14:24, F.Tusell wrote: | Not a question strictly about Rcpp but hope this is a right | place to ask. | | I am trying to find out what is the fastest possible way to compute | M'M for M upper triangular. I have coded, | | // [[Rcpp::export]] | SEXP Prod1(SEXP M_) { | const