namespace Eigen { /** \page TutorialSparse Tutorial page 9 - Sparse Matrix \ingroup Tutorial \li \b Previous: \ref TutorialGeometry \li \b Next: \ref TutorialMapClass \b Table \b of \b contents \n - \ref TutorialSparseIntro - \ref TutorialSparseExample "Example" - \ref TutorialSparseSparseMatrix - \ref TutorialSparseFilling - \ref TutorialSparseDirectSolvers - \ref TutorialSparseFeatureSet - \ref TutorialSparse_BasicOps - \ref TutorialSparse_Products - \ref TutorialSparse_TriangularSelfadjoint - \ref TutorialSparse_Submat
Module | Header file | Contents |
---|---|---|
\link Sparse_Module SparseCore \endlink | \code#include | SparseMatrix and SparseVector classes, matrix assembly, basic sparse linear algebra (including sparse triangular solvers) |
\link SparseCholesky_Module SparseCholesky \endlink | \code#include | Direct sparse LLT and LDLT Cholesky factorization to solve sparse self-adjoint positive definite problems |
\link IterativeLinearSolvers_Module IterativeLinearSolvers \endlink | \code#include | Iterative solvers to solve large general linear square problems (including self-adjoint positive definite problems) |
\code#include | Includes all the above modules |
0 | 3 | 0 | 0 | 0 |
22 | 0 | 0 | 0 | 17 |
7 | 5 | 0 | 1 | 0 |
0 | 0 | 0 | 0 | 0 |
0 | 0 | 14 | 0 | 8 |
Values: | 22 | 7 | _ | 3 | 5 | 14 | _ | _ | 1 | _ | 17 | 8 |
InnerIndices: | 1 | 2 | _ | 0 | 2 | 4 | _ | _ | 2 | _ | 1 | 4 |
OuterStarts: | 0 | 3 | 5 | 8 | 10 | \em 12 |
InnerNNZs: | 2 | 2 | 1 | 1 | 2 |
Values: | 22 | 7 | 3 | 5 | 14 | 1 | 17 | 8 |
InnerIndices: | 1 | 2 | 0 | 2 | 4 | 2 | 1 | 4 |
OuterStarts: | 0 | 2 | 4 | 5 | 6 | \em 8 |
\include Tutorial_sparse_example.cpp | \image html Tutorial_sparse_example.jpeg |
Standard \n dimensions | \code mat.rows() mat.cols()\endcode | \code vec.size() \endcode |
Sizes along the \n inner/outer dimensions | \code mat.innerSize() mat.outerSize()\endcode | |
Number of non \n zero coefficients | \code mat.nonZeros() \endcode | \code vec.nonZeros() \endcode |
\code
SparseMatrix |
\code
SparseVector |
Class | Module | Solver kind | Matrix kind | Features related to performance | Dependencies,License | Notes |
---|---|---|---|---|---|---|
SimplicialLLT | \link SparseCholesky_Module SparseCholesky \endlink | Direct LLt factorization | SPD | Fill-in reducing | built-in, LGPL | SimplicialLDLT is often preferable |
SimplicialLDLT | \link SparseCholesky_Module SparseCholesky \endlink | Direct LDLt factorization | SPD | Fill-in reducing | built-in, LGPL | Recommended for very sparse and not too large problems (e.g., 2D Poisson eq.) |
ConjugateGradient | \link IterativeLinearSolvers_Module IterativeLinearSolvers \endlink | Classic iterative CG | SPD | Preconditionning | built-in, LGPL | Recommended for large symmetric problems (e.g., 3D Poisson eq.) |
BiCGSTAB | \link IterativeLinearSolvers_Module IterativeLinearSolvers \endlink | Iterative stabilized bi-conjugate gradient | Square | Preconditionning | built-in, LGPL | Might not always converge |
CholmodSupernodalLLT | \link CholmodSupport_Module CholmodSupport \endlink | Direct LLT factorization | SPD | Fill-in reducing, Leverage fast dense algebra | Requires the SuiteSparse package, \b GPL | |
UmfPackLU | \link UmfPackSupport_Module UmfPackSupport \endlink | Direct LU factorization | Square | Fill-in reducing, Leverage fast dense algebra | Requires the SuiteSparse package, \b GPL | |
SuperLU | \link SuperLUSupport_Module SuperLUSupport \endlink | Direct LU factorization | Square | Fill-in reducing, Leverage fast dense algebra | Requires the SuperLU library, (BSD-like) |