Re: [eigen] Blas performance on mapped matrices |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Blas performance on mapped matrices
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 9 Jan 2012 21:45:46 +0100
- Cc: Keir Mierle <keir@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Wmp2uMdiCqtPqvppbRpvkw6o4YWlAcZs7G/RNUdQ8iI=; b=hWftXWT6ga+2fQF4WGV/L/vkavCKomzu6iAdDB/mu5zBal262/nvLJvq+O1OIgVYW+ iEU3by9oLOVpf18WVaEcg0CCGyOL+a+O7pOhWyNcrtE9X/TKClCEEhlVd0Et/OgIqDLC rwYa7zouQ7eDAkKrGZdauN6q/PtQc6cDTHypo=
On Mon, Jan 9, 2012 at 9:35 PM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
>> Along the same lines if I have a symmetric matrix A and matrices B and
>> C whose product I know will be symmetric.
>
> A.block(r,c, rsize, csize).triangularView<Eigen::Upper>() += B * C;
>
> will do the job, but as you noticed for small matrices this is not
> necessarily faster than doing the whole product because of the higher
> logic complexity and lack of vectorization nearby the diagonal.
Block<Mat,9,9>(A,i,j).triangularView<Upper>() -= (Map<
Matrix<Scalar,9,3,RowMajor> >(dat1) .lazyProduct( Map<
Matrix<Scalar,3,9,RowMajor> >(dat2)) );
works pretty well here, slightly faster than doing the whole product.
gael