mirror of https://github.com/CGAL/cgal
74 lines
3.3 KiB
TeX
74 lines
3.3 KiB
TeX
\section{Sparse Linear Algebra \label{sec:Sparse-Linear-Algebra}}
|
|
|
|
Parameterizing triangle meshes requires both efficient representation
|
|
of sparse matrices and efficient iterative or direct linear
|
|
solvers. We provide links to \eigen\ library
|
|
and include a separate package devoted to OpenNL sparse linear solver.
|
|
|
|
\subsection{List of Solvers}
|
|
|
|
We provide an interface to several sparse linear solvers, as models
|
|
of the \ccc{SparseLinearAlgebraTraits_d} concept:
|
|
|
|
\begin{itemize}
|
|
\item
|
|
An interface to sparse solvers from the \opennl\ library \cite{cgal:l-nmdgp-05} is provided through classes
|
|
\ccc{OpenNL::DefaultLinearSolverTraits<COEFFTYPE, MATRIX, VECTOR, SOLVER>} and
|
|
\ccc{OpenNL::SymmetricLinearSolverTraits<COEFFTYPE, MATRIX, VECTOR, SOLVER>}. The OpenNL library version shipped with \cgal\
|
|
is a lightweight default sparse linear solver. It does not support large systems, but it is portable and
|
|
supports exact number types.
|
|
|
|
\item
|
|
An interface to all sparse solvers from the \ccThirdPartyEigen\ library is provided through the class
|
|
\ccc{CGAL::Eigen_solver_traits<T>}. This solver traits class can be used for an iterative or a direct,
|
|
symmetric or general sparse solvers. The \eigen\ solver to be used must be given as template parameter.
|
|
|
|
% \item
|
|
% An interface to sparse solvers from the\ccThirdPartyTaucs\ library is provided through the classes
|
|
% \ccc{CGAL::Taucs_solver_traits<T>} (out-of-core general sparse solver) and
|
|
% \ccc{CGAL::Taucs_symmetric_solver_traits<T>} (direct symmetric sparse solver).
|
|
% \ccThirdPartyTaucs\ is no longer maintained and we recommend to use \ccThirdPartyEigen\ instead.\\
|
|
\end{itemize}
|
|
|
|
|
|
\subsection{\eigen\ Solver Example}
|
|
|
|
The example \ccc{examples/Surface_mesh_parameterization/Eigen_parameterization.cpp} computes the
|
|
default parameterization method (Floater mean value coordinates with a circular border),
|
|
but specifically instantiates an \eigen\ solver. Specifying a specific solver
|
|
instead of the default one (OpenNL) means using the third parameter of
|
|
\ccc{CGAL::Mean_value_coordinates_parameterizer_3<ParameterizationMesh_3,
|
|
BorderParameterizer_3, SparseLinearAlgebraTraits_d>}. The differences with the first
|
|
example \ccc{examples/Surface_mesh_parameterization/Simple_parameterization.cpp} are:
|
|
|
|
\begin{ccExampleCode}
|
|
|
|
#include <CGAL/Eigen_solver_traits.h>
|
|
|
|
...
|
|
|
|
//***************************************
|
|
// Floater Mean Value Coordinates parameterization
|
|
// (circular border) with Eigen solver
|
|
//***************************************
|
|
|
|
// Circular border parameterizer (the default)
|
|
typedef CGAL::Circular_border_arc_length_parameterizer_3<Parameterization_polyhedron_adaptor>
|
|
Border_parameterizer;
|
|
// Eigen solver
|
|
typedef CGAL::Eigen_solver_traits<> Solver;
|
|
|
|
// Floater Mean Value Coordinates parameterization
|
|
// (circular border) with Eigen solver
|
|
typedef CGAL::Mean_value_coordinates_parameterizer_3<Parameterization_polyhedron_adaptor,
|
|
Border_parameterizer,
|
|
Solver>
|
|
Parameterizer;
|
|
|
|
Parameterizer::Error_code err = CGAL::parameterize(mesh_adaptor, Parameterizer());
|
|
|
|
...
|
|
|
|
\end{ccExampleCode}
|
|
|