Re: [eigen] Getting to a solution from sparse matrices, Eigen3 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Getting to a solution from sparse matrices, Eigen3
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 18 Aug 2010 15:30:54 +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=RmjYxAD586SIVfcsNGhuvSyao4gwgOQ4Buvcer0gEEY=; b=gI+MUmAJzZuSl984OJE1nCzrHbZaQ5SNa/DGLZ/o+EHkFjsmCdj7fHu8O6VKSOsNx7 lNmPmbnOciwxn+tq7RDc1dq5H1+VSVjkQYVqCRQAPNv2X+o8/4Zuc3XDgGw7SLw0Xa5c TnmNqATWKBHt+C0NaG8G/Vxti5uJrbNXWMiCc=
- 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=sOjQy5d6aHtJJdwFTV9HJZ2LVD5d5Nq6VKf7OngAqA0stT0naaX2/EtMMjMLutHxsU j0yfy86G45b4UU+umJ0gwQdU3kw26PVr0/oBLuBlosCKQSBbMPVsfiw6qpIkc8rD3k3D 184OgpRzdvFgVriDGYgcUmRf/W9Grty2yp9qg=
Hi,
I've quickly updated the documentation page to mention the current
sparse solving possibilities. It should be available within a few
hours there:
http://eigen.tuxfamily.org/dox-devel/TutorialSparse.html#TutorialSparseDirectSolvers
in the meantime here it is (without formatting):
******************
Using the direct solvers
To solve a sparse problem you currently have to use one or multiple of
the following "unsupported" module:
SparseExtra module
solvers: SparseLLT<SparseMatrixType>, SparseLDLT<SparseMatrixType>
(include <Eigen/SparseExtra>)
notes: built-in basic LLT and LDLT solvers
Cholmod Support module
solver: SparseLLT<SparseMatrixType, Cholmod> (include <Eigen/CholmodSupport>)
notes: LLT solving using Cholmod, requires a SparseMatrix object.
(recommended for symmetric/selfadjoint problems)
UmfPack support module
solver: SparseLU<SparseMatrixType, UmfPack> (include <Eigen/UmfPackSupport>)
notes: LU solving using UmfPack, requires a SparseMatrix object
(recommended for squared matrices)
Super LU support
solver: SparseLU<SparseMatrixType, SuperLU> (include <Eigen/SuperLUSupport>)
notes: (LU solving using SuperLU, requires a SparseMatrix object,
recommended for squared matrices)
Taucs support module
solver: SparseLLT<SparseMatrixType, Taucs> (include <Eigen/TaucsSupport>)
notes: LLT solving using Taucs, requires a SparseMatrix object (not recommended)
Warning:
Those modules are currently considered to be "unsupported" because 1)
they are not documented, and 2) their API is likely to change in the
future.
Here is a typical example:
#include <Eigen/UmfPackSupport>
// ...
SparseMatrix<double> A;
// fill A
VectorXd b, x;
// fill b
// solve Ax = b using UmfPack:
SparseLU<SparseMatrix<double>,UmfPack> lu_of_A(A);
if(!lu_of_A.succeeded()) {
// decomposiiton failed
return;
}
if(!lu_of_A.solve(b,&x)) {
// solving failed
return;
}
See also the class SparseLLT, class SparseLU, and class SparseLDLT.
cheers,
gael
On Tue, Aug 17, 2010 at 8:27 PM, FMDSPAM <fmdspam@xxxxxxxxx> wrote:
> Am 17.08.2010 15:59, schrieb Will S:
>
> ... So far the
> only way through the API I've seen to solve is to first call
> sparse.toDense() then solve, but I'm wondering if there is a way to
> solve a sparse matrix without calling .toDense() first in Eigen 3
>
>
> To quote the docs "To summarize, it is recommanded to use a SparseMatrix
> whenever this is possible, and reserve the use of DynamicSparseMatrix for
> matrix assembly purpose when a SparseMatrix is not flexible enough."
>
> and
>
> "Then the DynamicSparseMatrix object can be converted to a compact
> SparseMatrix to be used"
>
> I presume your sneaking suspision: Converting a (dynamic)sparsematrix into a
> densematrix is really pointless.
>
> cheers
> Frank
>