Re: [eigen] Using LU with matrix-views and blocks |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Using LU with matrix-views and blocks
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 12 Apr 2010 08:43:36 -0400
- 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:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uXlviwoCkBDQgak9DEI6yqHkD/2FrmvM2DTcoslvSm4=; b=aAlw8M+ZHAS9JwahhC+KJo2Jl/iF0kxX/T+AloK0PwVQl3AdbS/PH1qloVV4mdg22H zi7pBIzMCqNe5IHCBNHYoPyvEaOeVPGXD7TMqTMalMKXmluVRXdHikG8p4y8Y52CYlrJ BHkuvagB9/8KWJLUwDjRL4QFRekr87UbwaO0s=
- 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=U1jpq4JqGVZlieHiuTjM2rYfUixo0clmXIbs395ryypeFIj4eYhtP6YpuFlO3q1NYm lfIgXT1inqAp+W5QHRjm+QI3czGruNIjDTM00xXa8oPXNYZ+2OoeiXn9919ULEKFof+D tUg0i9y/vr4Buf49Z47ExNVHV6SM8E++qptqU=
2010/4/11 Manoj Rajagopalan <rmanoj@xxxxxxxxx>:
> Hi eigen-users,
>
> I have a requirement for performing A \ b where A is a submatrix of a
> larger matrix, created using MatrixXd::block(...). I can use A.lu().solve()
> but can't seem to be able to use FullPivLu<Block<MatrixXd> > to store the LU
> factorization of A and then use it repeatedly. Is this be design?
Why don't you just do:
FullPivLU<MatrixXd> lu(matrix.block(....));
That does what I understand you describe above. Or are you looking for
an in-place decomposition (i.e. you want to avoid the cost of a matrix
copy)? It's true that we don't do in-place LU at the moment. It is
planned.
> I also don't seem to be able to store the LU factorization when I create a
> matrix view using Map<MatrixXd>.
Same: FullPivLU<MatrixXd> lu(some_map_object);
> I am writing code that needs to be high-performance so I conservatively
> pre-allocate my matrices in a constructor and later use submatrix portions
> later (whose dimensions show bounded change with each iteration).
> Alternatively, I conservatively pre-allocate a large std::vector<double> in
> my CTOR and try to use Map<MatrixXd> with the correct dynamic size. In either
> case, I need to use the LU.
OK, so you really want in-place LU and/or preallocation, sorry we
don't support that at the moment though it is not hard to adapt Eigen
for that. There have been threads recently on this list on these
matters.
>
> Problems mostly seem to be venial compilation issues:
>
> 1. missing enums
> 2. missing default CTORs for Block and Map (probably by design)
> 3. DenseStorageBase::_check_template_params() failure because correcting
> issue #1 above with missing enum defs fails static assert (probably
> because I don't understand Eigen well enough yet to assign correct
> values).
>
> Any ideas/tips?
Sorry, it's a bit complicated to explain here by e-mail exactly how to
code this feature. If you have precise questions though, i'll be happy
to help.
Benoit