cgal/Solver_interface/doc/Solver_interface/Solver_interface.txt

96 lines
2.9 KiB
Plaintext

namespace CGAL {
/*!
\mainpage User Manual
\anchor Chapter_CGAL_and_Solvers
\anchor chapterSolvers
\cgalAutoToc
\authors %CGAL Editorial Board
Several \cgal packages have to solve linear systems with dense or sparse matrices.
This package provides concepts and models for that purpose. Most of the models we provide
use the \ref thirdpartyEigen library. It is straightforward to develop
equivalent models for other solvers, for example those found in the
<a href="https://software.intel.com/en-us/intel-mkl">Intel Math Kernel Library (MKL)</a>.
\section SectionSolverVCM Matrix Diagonalization
The concept `VCMTraits<T,dim>` defines an interface for the
diagonalization and computation of eigenvectors and eigenvalues of a
symmetric matrix. `T` is the number type and `dim` is the dimension of
the matrices and vector (set to 3 by default). We provide two models
for this concept:
- `Eigen_vcm_traits<T,dim>` uses the \ref thirdpartyEigen library.
- `Internal_vcm_traits<T,dim>` is an internal implementation that does not
depend on another library.
Although both models achieve the same computation,
`Eigen_vcm_traits<T,dim>` is faster and should thus be used if the \ref
thirdpartyEigen library is available.
This is an example of an eigendecomposition of a matrix using this
class:
\cgalExample{Solver_interface/diagonalize_matrix.cpp}
\section SectionSolverSVD Singular Value Decomposition
The concept `SvdTraits` defines an interface for solving in the least
square sense a linear system with a singular value decomposition. The
field type is `double`. We provide two models for this concept:
- `Eigen_svd` uses the \ref thirdpartyEigen library.
- `Lapack_svd` uses the \ref thirdpartyLapack library.
Here is a simple example that shows how to handle matrices, vectors
and this solver:
\cgalExample{Solver_interface/singular_value_decomposition.cpp}
\section SectionSolverSparse Sparse Solvers
An interface to all sparse solvers from the \ref thirdpartyEigen
library is provided through the class
`Eigen_solver_traits<T>`. This solver traits class can be used for an
iterative or a direct, symmetric or general sparse solvers. The
specific solver to be used must be given as template
parameter.
Each \cgal package using a sparse solver specifies which type of matrix
and solver is required:
\code{.cpp}
typedef CGAL::Eigen_sparse_matrix<double>::EigenType EigenMatrix;
//iterative general solver
typedef CGAL::Eigen_solver_traits< Eigen::BiCGSTAB<EigenMatrix> > Iterative_general_solver;
//iterative symmetric solver
typedef CGAL::Eigen_solver_traits< Eigen::ConjugateGradient<EigenMatrix> > Iterative_symmetric_solver;
//direct symmetric solver
typedef CGAL::Eigen_solver_traits< Eigen::SimplicialCholesky<EigenMatrix> > Direct_symmetric_solver;
\endcode
Here is an example that shows how to fill the sparse matrix and call
the solver:
\cgalExample{Solver_interface/eigen_sparse_solvers.cpp}
*/
} /* namespace CGAL */