[Rcpp-devel] trans() changed in latest RcppArmadillo

Conrad Sand conradsand.rcpp at gmail.com
Tue May 31 03:39:44 CEST 2011


Hi Baptiste,

Thanks for the bug report.  I'll take a look at the underlying issues.


On 31 May 2011 09:48, baptiste auguie <baptiste.auguie at googlemail.com> wrote:
> Sorry, I had too many spaces in the vectors. The conclusion is the same though.
>
> library(inline)
> require( RcppArmadillo )
>
> ## let's calculate this product
> c(-1-1i, 1-1i) %*% c(1i, -1i)
>  ## 0-2i
>
> ## trans() with v0.2.19
> fx <- cxxfunction( signature() , '
>  arma::cx_colvec A = "(-1,-1) (+1,-1);", B = "(+0,1) (+0,-1);" ;
>                arma::cx_colvec res = trans(A) * B;
>
>                return wrap( res ) ;
>        ', plugin = "RcppArmadillo" )
>
> fx()
> ## 0-2i
>
> ## strans() with v0.2.21
> fx <- cxxfunction( signature() , '
>  arma::cx_colvec A = "(-1,-1) (+1,-1);", B = "(+0,1) (+0,-1);" ;
>                arma::cx_colvec res = strans(A) * B;
>                return wrap( res ) ;
>        ', plugin = "RcppArmadillo" )
>
> fx()
> ## 1-1i


More information about the Rcpp-devel mailing list