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

baptiste auguie baptiste.auguie at googlemail.com
Tue May 31 21:58:59 CEST 2011


Thanks so much, Conrad!

Best regards,

Baptiste

On 31 May 2011 23:37, Conrad Sand <conradsand.rcpp at gmail.com> wrote:
> I've found the cause of the issue (involves handling of small matrices).
>
> The fix is easy (and already done in the SVN repo), but I currently
> don't have the time to roll out another release.  I'll aim to release
> a fix on the weekend, which will also give me time to double-check if
> there is a problem in inv().
>
> In the meantime I recommend sticking to the previous version of
> Armadillo and RcppArmadillo.
>
> btw, for dot products I recommend using the dot() and cdot() functions
> -- they're generally faster than going through the multiplication
> operator.
>
>
> On 31 May 2011 11:39, Conrad Sand <conradsand.rcpp at gmail.com> wrote:
>> 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