Re: [eigen] Why no LU::solveInPlace()? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Why no LU::solveInPlace()?
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Fri, 3 Sep 2010 15:38:48 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=HGr6fV+MiJDJkPUzMCLbxmvmGvVXccDbjqh1BY3GKnA=; b=txCJEMNrlnMnNzfurNlpWVQ7eqijpJJp2iBsdPirCT7ggP1WSXt6lbdJJSLxvLhjiZ sa59ENxGhZKKpabf29myLO4GGsJgOGYcQkc1Sm+Ys+Hs/STHs+oCin94LF2q8vF5VTeP 4/znTxX1NymyCp06aN/1SDy3y64fTj03ZZr+w=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Ckdie14wwzFKlKuZ/g2TmfhLwzn5n9iugKh7m4b8cCvNaxB/dyKdQAS2sSyP3V8Zpi 5qtY3HUn/UHWdz8W0YOLMy60+zcW7YQqcfytPL+SOUKgcVqSi8YE7ya0pA0YqZt5uc1H 0lvYEcqu1zWMS57nnTaAw0LdJjcUfDcWZI4pY=
ok, good,
then I think the best solution is to introduce a DenseExpressionBase
class just like we have a DenseStorageBase class to be able to select
lightweight expressions and pass them by value to a solveInPlace()
overload.
gael.
On Fri, Sep 3, 2010 at 1:32 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> For MatrixXf we don't. For Matrix2f we might (as the branching's cost
> can be non-negligible)... I really can't make up my mind. On the one
> hand it is unusual for us in Eigen to do this kind of if(), and it is
> unusual for us to tolerate even small / potential overheads when the
> matrices at hand may be fixed-size. On the other hand, since we don't
> currently have fixed-size specializations for these decompositions, we
> do currently have overhead in these decompositions. Yet again, this
> new if() would be a kind of overhead inherent to the API. Also, what
> if the B is an expression that takes longer to write. Then having to
> write it twice will be annoying. For example:
>
> B.foo().bar().long().expression() = A.solve(B.foo().bar().long().expression());
>
> Finally, a solveInPlace() method is easy to look up and understand for
> people who just want to write code quickly and be sure that stuff is
> optimized. It's explicit.
>
> Maybe a good compromise is to keep solveInPlace() and also do the if()
> in solve(). Should make everyone happy: people who care about the cost
> of the if() will typically be able to use in-place solving anyway.