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: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 30 Jul 2009 15:53:08 +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=Pci/fNX8JxAmFqWDj1GK9/DM5KVvdEKpuYXYa9xRLaE=; b=DXQx4JlnO3rphUMR/SKBFosGCPOukP5VI/1fQOXUViUtQUM1D7bAT4jnqauey1C52L me9dwVJ9cNgbtlswL3GffsYafiLRtK1FCBAjoc/vrh7T3xP/doBmHSAP1FK+C16ng4rW izyyVvQWEN74GTYSj3w7FWebfQGA+lT1qdbzs=
- 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=j9IPIeDgaTU9Hd2OJUdZsBHz7IFzclyBm3k/6oa1wnWbp50HBqtdfy7s305Wp4BvH5 IoJyGGkDvgoeMcuu08YvTlPj3scA9oOivCuCrAGbDC7VuE+cUh9Y2gWODOPkjYSdGbM9 BST2dIBoORzmHBkXppGBnSwqbh5BrNjSMxBMU=
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