Re: [eigen] Re: recent improvements in the products |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Re: recent improvements in the products
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Thu, 30 Jul 2009 16:08:35 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=D/flgHs6yOjX29m5yJwhzcaER7PbIGpMDNQOITyA/zM=; b=dwU6kYMwcGTeNRqle2iGQPxUffudLH6glAxvMHWPEtfiGxkQSwLiCoqwIA0t9dpIpj NEHcgQFEsbxRQBedlaNcTVBmpQM6kasnrbOzHpMFs2X2nmmISU8FyckfJ1+ScJ3gcITi mqOXrrgfDkiNf+aJFUQ0ss/Pq+ApDufhZOMuE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=qEi++k1sAnYmkh+wCpibJuIs5m6cWSylo3o/wlWUYaQnxdQXv6P0ZsHDej1d3v4spf xJ5wvwx9SnMY9/m0XnPPP8bFCwbHYoD6ZHwxSpX3ntZd16wgPjXtK7wCY2WEHuQiNg/Y kkCBuDUq1TjGQ4w8YH7TOZSPrrqm5RnQ36hts=
ok committed with version 1.
here is an overview of my next commit: a very efficient (8/9 GFLops on
2GHz CPU) block LLT implementation making use of it:
template<typename MatrixType>
void block_llt_lo(MatrixType& m)
{
int BlockSize = 128;
for (int k=0; k<m.rows(); k+=BlockSize)
{
int bs = std::min(BlockSize, m.rows()-k);
int rs = size - k - bs;
Block<MatrixType,Dynamic,Dynamic> A00(m,0,0,k,k);
Block<MatrixType,Dynamic,Dynamic> A10(m,k,0,bs,k);
Block<MatrixType,Dynamic,Dynamic> A11(m,k,k,bs,bs);
A00.template triangularView<LowerTriangular>().template
solveInPlace<OnTheRight>(A10); // bottleneck
A11.template selfadjointView<LowerTriangular>().rankUpdate(A10,-1);
ei_inplace_llt_lo(A11);
}
}
cheers,
Gael
On Thu, Jul 30, 2009 at 3:53 PM, Benoit Jacob<jacob.benoit.1@xxxxxxxxx> wrote:
> 2009/7/30 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>> On Tue, Jul 28, 2009 at 8:24 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>>> > * currently we can only solve for X = M^1 * Y, but we also need X = Y *
>>> > M^-1. Implementation wise we just have to transpose everything, so actually,
>>> > the user can probably already do:
>>> > m1.transpose().triangularView<UpperTriangular>(m2.transpose());
>>> > but that's not very nice API wise. The only solution I see is to add an
>>> > option to TriangularView::solveInPlace(), e.g., solveInPlace(m2, Right);
>>>
>>> Yes and then i'd call that OnTheRight.
>>
>> ok, finally it turns out that this "side" parameter should be a
>> compile time parameter, otherwise we would have:
>>
>> if(side==OnTheRight)
>> call version_1
>> else
>> call version_2
>>
>> that means for a template library twice the compilation time. So:
>> 1 - it could be a template parameter of the solve function with
>> overloads for mimic a default parameter:
>>
>> m.triangularView<UnitUpperTriangular>().solveInPlace<OnTheRight>(x);
>>
>> 2 - or we can add new solve functions:
>>
>> m.triangularView<UnitUpperTriangular>().solveInPlaceOnTheRight(x);
>>
>> 3 - or we can define OnTheRight/OnTheLeft as instances of different
>> types allowing:
>>
>> m.triangularView<UnitUpperTriangular>().solveInPlace(x, OnTheRight);
>>
>>
>> any preference ?
>
> I think I prefer 1 or 2, but not 3. I would reserve 3 for cases where
> the special value replaces what can otherwise be a normal parameter:
> see resize(int,int) and NoChange.
>
> Benoit
>
>
>