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 15:43:31 +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=Eecy29ixLAxwj7skq+DMs5rY79wut8W7/tf5uPqaEW8=; b=jCcyU8b2B5VQyK+qdS7pw/WntoZQYZAiBb959cJldrhOAZ6PUo/lIGtAWey/jVlvU3 eYI70Upx6YlqOTWGTdg3Q6Vz6PBZy0jcRK9yS9XNk/x7t/YBTL4knDiAkd3cL525W9M/ 7MSJyi5kpedyX76vBjaNYyaVUV93ZMijiXka0=
- 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=RKp6Q/vPoUyrwAd0rMvqxaeS981dJuLv+1vWeCzdb9WhWQoDUhuwXs0iZlfbroB3hm JR4F9w9ihfnZf45qjDCYIbrjPM68cfHyDvCfB6k9KIsSJ+CUXSOUm7aifGgWwqntaolG GGEC6QUtx6De073ieqUiLjThwXBA58vgMFAbQ=
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 ?
cheers,
Gael.