Re: [eigen] Feature idea: coeffRef() ---> setCoeff() |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Feature idea: coeffRef() ---> setCoeff()
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Sat, 14 Aug 2010 10:36:40 +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 :content-transfer-encoding; bh=WDOZdODqptiIrTOAcnVPBYMTjE6IlwBa4qa1hJFdCTI=; b=UcW1Gv9sRsfTeGVR1cLIAfE9LdtoQ1yZj14LbtBgR+rojyHW+bpIaTuRqdEuEgIsmy N23bDwrH5rBbkwPqrPnQSbJ4XbZvajO7hmJ/GdQ11+jMZnXpsk+9nIzMB5xI/9njCVKj TBo1/TnKyPTaqcvmrcYoHLppnvxjaLu+JVES0=
- 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:content-transfer-encoding; b=F2xSr25ICK/sgC6JpsIkqfYE99Mz15JCCFAYt7AuYodMQgeaytqMTPv/663zBm5fUy 2Nb9FP+Bf4Jwue9DAtvdgVLvkoAUQsH3m4tVzBOoKPk2+xAxTmBk5ieotFLjTx/URLhe uZ4xl2qqsszBComULBAu4fsbfuZ86eHFYCtd0=
On Fri, Jul 30, 2010 at 6:56 PM, Manoj Rajagopalan <rmanoj@xxxxxxxxx> wrote:
>
>
>
> On Friday 30 July 2010 10:30:19 am Benoit Jacob wrote:
>> 2010/7/30 Manoj Rajagopalan <rmanoj@xxxxxxxxx>:
>> > On Friday 30 July 2010 12:08:42 am Benoit Jacob wrote:
>> >> oh... i see. I guess that you omitted setCoeff in the above line, by
>> >> the way, so you meant:
>> >>
>> >> A.selfadjointView<Lower>().setCoeff(j, j+1, value); // note: write to
>> >> upper triangle
>> >>
>> >> so this would write 2 coeffs at once in A ? Why not. Indeed that cant
>> >> be done with coeffRef. But I don't adhere to your rather complex plan
>> >> of generally allowing to write to Conjugate expressions, this is not a
>> >> prerequisite for that, we could just implement setCoeff in
>> >> selfadjointView, where it is useful, without implementing it in stuff
>> >> like conjugate() which IMO just don't want to be writable expressions..
>> >>
>> >> This would be much simpler --- the patch could be just a few kB's.
>> >>
>> >> But again, coeffRef() is definitely not going away.
>> >>
>> >> Benoit
>> >
>> > In my implementation of LLT on self-adjoint matrices with compact
>> > triangular storage, which involves partitioning the matrix into 2x2 block
>> > form, one step leads to an Eigen expression of the form,
>> >
>> > L11.solveInPlace(L21.adjoint()); // L11 is triangular-view
>>
>> Oh, if that's what you wanted to do, why don't you just apply complex
>> conjugation here, so this is equivalent to doing:
>>
>> L11.conjugate().solveInPlace(L21.transpose());
>>
>> Now you're good to go, because transpose() returns a writable
>> expression which can perfectly be used in solve-in-place.
>>
>> Benoit
>>
>
> That's exactly what I settled into :-) The wish for a neater, more direct
> expression closer to the math sparked off this entire line of thought :-)
your initial mathematical expression was:
L21 L11^H = A21;
=>
L21 = A21 L11^-H
so the most direct Eigen version is:
L11.adjoint().solveInPlace<OnTheRight>(L21);
which is far less ambiguous than any other solution.
gael
>
> -- Manoj
>
>
>