mirror of https://github.com/CGAL/cgal
cleanup
This commit is contained in:
parent
c50448e918
commit
71aed48848
|
|
@ -24,7 +24,7 @@ the geometric classes and tools required by local
|
|||
computations.
|
||||
|
||||
\tparam SvdTraits features the linear
|
||||
algebra algorithm required by the fitting method.
|
||||
algebra algorithm required by the fitting method. The scalar type, `SvdTraits::FT`, must be the same as that of the `LocalKernel` concept : `LocalKernel::FT`.
|
||||
|
||||
\sa `Eigen_svd`
|
||||
\sa `Monge_form`
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@
|
|||
## Concepts ##
|
||||
- `DataKernel`
|
||||
- `LocalKernel`
|
||||
- `SvdTraits`
|
||||
|
||||
|
||||
## Classes ##
|
||||
- \link CGAL::Monge_via_jet_fitting::Monge_form `CGAL::Monge_via_jet_fitting< DataKernel, LocalKernel, SvdTraits>::Monge_form` \endlink
|
||||
- `CGAL::Monge_via_jet_fitting<DataKernel, LocalKernel, SvdTraits>`
|
||||
- `CGAL::Eigen_svd`
|
||||
|
||||
|
||||
## Global Functions ##
|
||||
The insert operator (operator<< ) is overloaded for the class \link CGAL::Monge_via_jet_fitting::Monge_form `Monge_form` \endlink.
|
||||
|
|
|
|||
|
|
@ -5,3 +5,4 @@ Algebraic_foundations
|
|||
Circulator
|
||||
Stream_support
|
||||
Number_types
|
||||
Solver_interface
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ typedef unspecified_type EigenType;
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceParameterizationAlgebra
|
||||
\ingroup PkgSolver
|
||||
|
||||
The class `Eigen_sparse_symmetric_matrix` is a C++ wrapper around \ref thirdpartyEigen "Eigen" matrix type `Eigen::SparseMatrix`.
|
||||
|
||||
|
|
|
|||
|
|
@ -9,16 +9,13 @@ The version 3.1 (or greater) of \ref thirdpartyEigen "Eigen" must be available o
|
|||
|
||||
\cgalModels `SparseLinearAlgebraTraitsWithFactor_d`
|
||||
|
||||
Parameters
|
||||
--------------
|
||||
|
||||
`T`: a sparse solver of \ref thirdpartyEigen "Eigen". The default solver is the iterative bi-congugate gradient stabilized solver
|
||||
\tparam T a sparse solver of \ref thirdpartyEigen "Eigen". The default solver is the iterative bi-congugate gradient stabilized solver
|
||||
`Eigen::BiCGSTAB` for `double`.
|
||||
|
||||
\sa `CGAL::Eigen_sparse_matrix<T>`
|
||||
\sa `CGAL::Eigen_sparse_symmetric_matrix<T>`
|
||||
\sa `CGAL::Eigen_vector<T>`
|
||||
\sa http://eigen.tuxfamily.org
|
||||
|
||||
Example
|
||||
--------------
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgJet_fitting_3
|
||||
\ingroup PkgSolver
|
||||
|
||||
The class `Eigen_svd` provides an algorithm to solve in the least
|
||||
square sense a linear system with a singular value decomposition using
|
||||
|
|
@ -15,7 +15,7 @@ square sense a linear system with a singular value decomposition using
|
|||
class Eigen_svd {
|
||||
public:
|
||||
|
||||
/// @}
|
||||
|
||||
|
||||
}; /* end Eigen_svd */
|
||||
} /* end namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,183 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgKernelDLinAlgConcepts
|
||||
\cgalConcept
|
||||
|
||||
The data type `LinearAlgebraTraits_d` encapsulates two classes
|
||||
`Matrix`, `Vector` and many functions of basic linear algebra.
|
||||
An instance of data type `Matrix` is a matrix of variables of type
|
||||
`NT`. Accordingly, `Vector` implements vectors of variables of
|
||||
type `NT`. Most functions of linear algebra are <I>checkable</I>,
|
||||
i.e., the programs can be asked for a proof that their output is
|
||||
correct. For example, if the linear system solver declares a linear
|
||||
system \f$ A x = b\f$ unsolvable it also returns a vector \f$ c\f$ such that
|
||||
\f$ c^T A = 0\f$ and \f$ c^T b \neq 0\f$.
|
||||
|
||||
\cgalHasModel `CGAL::Linear_algebraHd<RT>`
|
||||
\cgalHasModel `CGAL::Linear_algebraCd<FT>`
|
||||
|
||||
*/
|
||||
|
||||
class LinearAlgebraTraits_d {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
the number type of the components.
|
||||
*/
|
||||
typedef unspecified_type NT;
|
||||
|
||||
/*!
|
||||
the vector type.
|
||||
*/
|
||||
typedef unspecified_type Vector;
|
||||
|
||||
/*!
|
||||
the matrix type.
|
||||
*/
|
||||
typedef unspecified_type Matrix;
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns \f$ M^T\f$
|
||||
(a `M.column_dimension()` \f$ \times\f$ `M.column_dimension()` -
|
||||
matrix).
|
||||
*/
|
||||
static Matrix transpose(const Matrix& M);
|
||||
|
||||
/*!
|
||||
determines whether `M` has an inverse. It also
|
||||
computes either the inverse as \f$ (1/D) \cdot I\f$ or when no
|
||||
inverse exists, a vector \f$ c\f$ such that \f$ c^T \cdot M = 0 \f$.
|
||||
\pre \f$ M\f$ is square.
|
||||
*/
|
||||
static bool inverse(const Matrix& M, Matrix& I, NT& D,
|
||||
Vector& c);
|
||||
|
||||
/*!
|
||||
returns the
|
||||
inverse matrix of `M`. More precisely, \f$ 1/D\f$ times the matrix
|
||||
returned is the inverse of `M`.
|
||||
\pre `determinant(M) != 0`.
|
||||
|
||||
\pre \f$ M\f$ is square.
|
||||
*/
|
||||
static Matrix inverse(const Matrix& M, NT& D) ;
|
||||
|
||||
/*!
|
||||
returns the determinant \f$ D\f$ of
|
||||
`M` and sufficient information to verify that the value of the
|
||||
determinant is correct. If the determinant is zero then \f$ c\f$ is a
|
||||
vector such that \f$ c^T \cdot M = 0\f$. If the determinant is non-zero
|
||||
then \f$ L\f$ and \f$ U\f$ are lower and upper diagonal matrices respectively
|
||||
and \f$ q\f$ encodes a permutation matrix \f$ Q\f$ with \f$ Q(i,j) = 1\f$ iff \f$ i =
|
||||
q(j)\f$ such that \f$ L \cdot M \cdot Q = U\f$, \f$ L(0,0) = 1\f$, \f$ L(i,i) = U(i
|
||||
- 1,i - 1)\f$ for all \f$ i\f$, \f$ 1 \le i < n\f$, and \f$ D = s \cdot U(n - 1,n -
|
||||
1)\f$ where \f$ s\f$ is the determinant of \f$ Q\f$.
|
||||
|
||||
\pre `M` is square.
|
||||
*/
|
||||
static NT determinant (const Matrix& M, Matrix& L, Matrix&
|
||||
U, std::vector<int>& q, Vector& c);
|
||||
|
||||
/*!
|
||||
verifies the conditions stated above.
|
||||
*/
|
||||
static bool verify_determinant (const Matrix& M, NT D,
|
||||
Matrix& L, Matrix& U, const std::vector<int>& q, Vector&
|
||||
c);
|
||||
|
||||
/*!
|
||||
returns the
|
||||
determinant of `M`.
|
||||
|
||||
\pre `M` is square.
|
||||
*/
|
||||
static NT determinant (const Matrix& M);
|
||||
|
||||
/*!
|
||||
returns
|
||||
the sign of the determinant of `M`.
|
||||
|
||||
\pre `M` is square.
|
||||
*/
|
||||
static int sign_of_determinant (const Matrix& M);
|
||||
|
||||
/*!
|
||||
determines
|
||||
the complete solution space of the linear system \f$ M\cdot x = b\f$. If
|
||||
the system is unsolvable then \f$ c^T \cdot M = 0\f$ and \f$ c^T \cdot b
|
||||
\not= 0\f$. If the system is solvable then \f$ (1/D) x\f$ is a solution,
|
||||
and the columns of `spanning_vectors` are a maximal set of
|
||||
linearly independent solutions to the corresponding homogeneous
|
||||
system.
|
||||
|
||||
\pre `M.row_dimension() = b.dimension()`.
|
||||
*/
|
||||
static bool linear_solver(const Matrix& M, const Vector& b,
|
||||
Vector& x, NT& D, Matrix& spanning_vectors, Vector& c);
|
||||
|
||||
/*!
|
||||
determines whether the linear
|
||||
system \f$ M\cdot x = b\f$ is solvable. If yes, then \f$ (1/D) x\f$ is a
|
||||
solution, if not then \f$ c^T \cdot M = 0\f$ and \f$ c^T \cdot b \not= 0\f$.
|
||||
\pre `M.row_dimension() = b.dimension()`.
|
||||
*/
|
||||
static bool linear_solver(const Matrix& M, const Vector& b,
|
||||
Vector& x, NT& D, Vector& c) ;
|
||||
|
||||
/*!
|
||||
as above, but without the witness \f$ c\f$
|
||||
\pre `M.row_dimension() = b.dimension()`.
|
||||
*/
|
||||
static bool linear_solver(const Matrix& M, const Vector& b,
|
||||
Vector& x, NT& D) ;
|
||||
|
||||
/*!
|
||||
determines whether the system \f$ M \cdot x = b\f$ is solvable
|
||||
|
||||
\pre `M.row_dimension() = b.dimension()`.
|
||||
*/
|
||||
static bool is_solvable(const Matrix& M, const Vector& b)
|
||||
;
|
||||
|
||||
/*!
|
||||
determines whether the homogeneous linear system
|
||||
\f$ M\cdot x = 0\f$ has a non - trivial solution. If yes, then \f$ x\f$ is
|
||||
such a solution.
|
||||
*/
|
||||
static bool homogeneous_linear_solver (const Matrix& M,
|
||||
Vector& x);
|
||||
|
||||
/*!
|
||||
determines the solution space of the
|
||||
homogeneous linear system \f$ M\cdot x = 0\f$. It returns the dimension
|
||||
of the solution space. Moreover the columns of `spanning_vecs`
|
||||
span the solution space.
|
||||
*/
|
||||
static int homogeneous_linear_solver (const Matrix& M,
|
||||
Matrix& spanning_vecs);
|
||||
|
||||
/*!
|
||||
returns the indices of a maximal subset
|
||||
of independent columns of `M`.
|
||||
*/
|
||||
static int independent_columns (const Matrix& M,
|
||||
std::vector<int>& columns);
|
||||
|
||||
/*!
|
||||
returns the rank of
|
||||
matrix `M`
|
||||
*/
|
||||
static int rank (const Matrix & M);
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* end LinearAlgebraTraits_d */
|
||||
|
||||
|
|
@ -0,0 +1,354 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgKernelDLinAlgConcepts
|
||||
\cgalConcept
|
||||
|
||||
An instance of data type `Matrix` is a matrix of
|
||||
variables of number type `NT`. The types `Matrix` and `Vector`
|
||||
together realize many functions of basic linear algebra.
|
||||
|
||||
*/
|
||||
|
||||
class Matrix {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
the ring type of the components.
|
||||
*/
|
||||
typedef unspecified_type NT;
|
||||
|
||||
/*!
|
||||
bidirectional iterator for accessing
|
||||
all components row-wise.
|
||||
*/
|
||||
typedef unspecified_type iterator;
|
||||
|
||||
/*!
|
||||
bidirectional iterator for accessing
|
||||
all components row-wise.
|
||||
*/
|
||||
typedef unspecified_type const_iterator;
|
||||
|
||||
|
||||
/*!
|
||||
random access iterator for accessing row
|
||||
entries.
|
||||
*/
|
||||
typedef unspecified_type row_iterator;
|
||||
|
||||
/*!
|
||||
random access iterator for accessing row
|
||||
entries.
|
||||
*/
|
||||
typedef unspecified_type const_row_iterator;
|
||||
|
||||
/*!
|
||||
random access iterator for accessing
|
||||
column entries.
|
||||
*/
|
||||
typedef unspecified_type column_iterator;
|
||||
|
||||
/*!
|
||||
random access iterator for accessing
|
||||
column entries.
|
||||
*/
|
||||
typedef unspecified_type const_column_iterator;
|
||||
|
||||
/*!
|
||||
a tag class for identity initialization
|
||||
*/
|
||||
typedef unspecified_type Identity;
|
||||
|
||||
/*!
|
||||
the vector type used.
|
||||
*/
|
||||
typedef unspecified_type Vector;
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Creation
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
creates an instance `M` of type
|
||||
`Matrix`.
|
||||
*/
|
||||
Matrix();
|
||||
|
||||
/*!
|
||||
creates an instance `M` of type
|
||||
`Matrix` of dimension \f$ n \times n\f$ initialized to the zero matrix.
|
||||
|
||||
*/
|
||||
Matrix(int n);
|
||||
|
||||
/*!
|
||||
creates an instance `M` of
|
||||
type `Matrix` of dimension \f$ m \times n\f$ initialized to the zero
|
||||
matrix.
|
||||
*/
|
||||
Matrix(int m, int n);
|
||||
|
||||
/*!
|
||||
creates an instance
|
||||
`M` of type `Matrix` of dimension
|
||||
`p.first`\f$ \times\f$`p.second` initialized to the zero matrix.
|
||||
*/
|
||||
Matrix(std::pair<int,int> p);
|
||||
|
||||
/*!
|
||||
creates an
|
||||
instance `M` of type `Matrix` of dimension \f$ n \times n\f$
|
||||
initialized to the identity matrix (times `x`).
|
||||
*/
|
||||
Matrix(int n, Identity, NT x = NT(1));
|
||||
|
||||
/*!
|
||||
creates an instance `M`
|
||||
of type `Matrix` of dimension \f$ m \times n\f$ initialized to the
|
||||
matrix with `x` entries.
|
||||
*/
|
||||
Matrix(int m, int n, NT x);
|
||||
|
||||
/*!
|
||||
creates an
|
||||
instance `M` of type `Matrix`. Let \f$ S\f$ be the ordered set of
|
||||
\f$ n\f$ column-vectors of common dimension \f$ m\f$ as given by the iterator
|
||||
range `[first,last)`. `M` is initialized to an \f$ m \times n\f$
|
||||
matrix with the columns as specified by \f$ S\f$.
|
||||
|
||||
\pre `Forward_iterator` has a value type `V` from which we require to provide a iterator type `V::const_iterator`, to have `V::value_type == NT`.
|
||||
|
||||
Note that `Vector` or `std::vector<NT>` fulfill these requirements.
|
||||
*/
|
||||
template <class Forward_iterator>
|
||||
Matrix(Forward_iterator first, Forward_iterator last);
|
||||
|
||||
/*!
|
||||
creates an instance
|
||||
`M` of type `Matrix`. Let \f$ A\f$ be an array of \f$ n\f$
|
||||
column-vectors of common dimension \f$ m\f$. `M` is initialized to an
|
||||
\f$ m \times n\f$ matrix with the columns as specified by \f$ A\f$.
|
||||
*/
|
||||
Matrix(std::vector< Vector > A);
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns \f$ n\f$, the number of rows of
|
||||
`M`.
|
||||
*/
|
||||
int row_dimension() ;
|
||||
|
||||
/*!
|
||||
returns \f$ m\f$, the number of columns
|
||||
of `M`.
|
||||
*/
|
||||
int column_dimension() ;
|
||||
|
||||
/*!
|
||||
returns \f$ (m,n)\f$, the
|
||||
dimension pair of `M`.
|
||||
*/
|
||||
std::pair<int,int> dimension() ;
|
||||
|
||||
/*!
|
||||
returns the \f$ i\f$-th row of `M` (an
|
||||
\f$ m\f$ - vector).
|
||||
|
||||
\pre \f$ 0 \le i \le m - 1\f$.
|
||||
*/
|
||||
Vector row(int i) ;
|
||||
|
||||
/*!
|
||||
returns the \f$ i\f$-th column of `M`
|
||||
(an \f$ n\f$ - vector).
|
||||
|
||||
\pre \f$ 0 \le i \le n - 1\f$.
|
||||
*/
|
||||
Vector column(int i) ;
|
||||
|
||||
/*!
|
||||
returns \f$ M_{i,j}\f$.
|
||||
\pre \f$ 0\le i\le m-1\f$ and \f$ 0\le j\le n-1\f$.
|
||||
*/
|
||||
NT& operator()(int i, int j) ;
|
||||
|
||||
/*!
|
||||
swaps rows \f$ i\f$ and \f$ j\f$.
|
||||
\pre \f$ 0\le i\le m-1\f$ and \f$ 0\le j\le m-1\f$.
|
||||
|
||||
*/
|
||||
void swap_rows(int i, int j) ;
|
||||
|
||||
/*!
|
||||
swaps columns \f$ i\f$ and
|
||||
\f$ j\f$.
|
||||
|
||||
\pre \f$ 0\le i\le n-1\f$ and \f$ 0\le j\le n-1\f$.
|
||||
*/
|
||||
void swap_columns(int i, int j) ;
|
||||
|
||||
/*!
|
||||
an iterator pointing to the
|
||||
first entry of the \f$ i\f$th row.
|
||||
|
||||
\pre \f$ 0\le i\le m-1\f$.
|
||||
*/
|
||||
row_iterator row_begin(int i) ;
|
||||
|
||||
/*!
|
||||
an iterator pointing beyond
|
||||
the last entry of the \f$ i\f$th row.
|
||||
|
||||
\pre \f$ 0\le i\le m-1\f$.
|
||||
*/
|
||||
row_iterator row_end(int i) ;
|
||||
|
||||
/*!
|
||||
an iterator pointing to the
|
||||
first entry of the \f$ i\f$th row.
|
||||
|
||||
\pre \f$ 0\le i\le m-1\f$.
|
||||
*/
|
||||
const_row_iterator row_begin(int i) const;
|
||||
|
||||
/*!
|
||||
an iterator pointing beyond
|
||||
the last entry of the \f$ i\f$th row.
|
||||
|
||||
\pre \f$ 0\le i\le m-1\f$.
|
||||
*/
|
||||
const_row_iterator row_end(int i) const;
|
||||
|
||||
/*!
|
||||
an iterator pointing
|
||||
to the first entry of the \f$ i\f$th column.
|
||||
|
||||
\pre \f$ 0\le i\le n-1\f$.
|
||||
|
||||
*/
|
||||
column_iterator column_begin(int i) ;
|
||||
|
||||
/*!
|
||||
an iterator pointing
|
||||
beyond the last entry of the \f$ i\f$th column.
|
||||
|
||||
\pre \f$ 0\le i\le n-1\f$.
|
||||
*/
|
||||
column_iterator column_end(int i) ;
|
||||
|
||||
/*!
|
||||
an iterator pointing
|
||||
to the first entry of the \f$ i\f$th column.
|
||||
|
||||
\pre \f$ 0\le i\le n-1\f$.
|
||||
|
||||
*/
|
||||
const_column_iterator column_begin(int i) const;
|
||||
|
||||
/*!
|
||||
an iterator pointing
|
||||
beyond the last entry of the \f$ i\f$th column.
|
||||
|
||||
\pre \f$ 0\le i\le n-1\f$.
|
||||
*/
|
||||
const_column_iterator column_end(int i) const;
|
||||
|
||||
|
||||
/*!
|
||||
an iterator pointing to the first entry
|
||||
of \f$ M\f$.
|
||||
*/
|
||||
iterator begin();
|
||||
|
||||
/*!
|
||||
an iterator pointing beyond the last entry
|
||||
of \f$ M\f$.
|
||||
*/
|
||||
terator end();
|
||||
|
||||
/*!
|
||||
an iterator pointing to the first entry
|
||||
of \f$ M\f$.
|
||||
*/
|
||||
const_iterator begin() const;
|
||||
|
||||
/*!
|
||||
an iterator pointing beyond the last entry
|
||||
of \f$ M\f$.
|
||||
*/
|
||||
const_terator end() const;
|
||||
|
||||
|
||||
/*!
|
||||
Test for equality.
|
||||
*/
|
||||
bool operator==(const Matrix& M1) ;
|
||||
|
||||
/*!
|
||||
Test for inequality.
|
||||
*/
|
||||
bool operator!=(const Matrix& M1) ;
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Arithmetic Operators
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Addition.
|
||||
\pre `M.row_dimension() == M1.row_dimension()`
|
||||
\pre `M.column_dimension() == M1.column_dimension()`
|
||||
*/
|
||||
Matrix operator+ (const Matrix& M1);
|
||||
|
||||
/*!
|
||||
|
||||
Subtraction.
|
||||
\pre `M.row_dimension() == M1.row_dimension()`
|
||||
\pre `M.column_dimension() == M1.column_dimension()`
|
||||
*/
|
||||
Matrix operator- (const Matrix& M1);
|
||||
|
||||
/*!
|
||||
Negation.
|
||||
*/
|
||||
Matrix operator-();
|
||||
|
||||
/*!
|
||||
Multiplication.
|
||||
|
||||
\pre `M.column_dimension() = M1.row_dimension()`
|
||||
*/
|
||||
Matrix operator*(const Matrix& M1)
|
||||
;
|
||||
|
||||
/*!
|
||||
Multiplication with
|
||||
vector.
|
||||
|
||||
\pre `M.column_dimension() = vec.dimension()`
|
||||
*/
|
||||
Vector operator*(const Vector& vec) ;
|
||||
|
||||
/*!
|
||||
Multiplication of every entry with `x`.
|
||||
*/
|
||||
Matrix operator*(const NT& x, const Matrix& M);
|
||||
|
||||
/*!
|
||||
Multiplication of every entry with `x`.
|
||||
*/
|
||||
Matrix operator*(const Matrix& M, const NT& x) ;
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* end Matrix */
|
||||
|
||||
|
|
@ -5,14 +5,11 @@
|
|||
|
||||
The concept `SparseLinearAlgebraTraits_d` is used to solve sparse linear systems <I>A\f$ \times \f$ X = B</I>.
|
||||
|
||||
\cgalRefines `LinearAlgebraTraits_d`
|
||||
|
||||
\cgalHasModel `CGAL::Eigen_solver_traits<T>`
|
||||
\cgalHasModel `OpenNL::DefaultLinearSolverTraits<COEFFTYPE, MATRIX, VECTOR, SOLVER>` in OpenNL package
|
||||
\cgalHasModel `OpenNL::SymmetricLinearSolverTraits<COEFFTYPE, MATRIX, VECTOR, SOLVER>` in OpenNL package
|
||||
|
||||
\sa `SparseLinearAlgebraTraits_d::Matrix`
|
||||
\sa `SparseLinearAlgebraTraits_d::Vector`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -67,7 +64,7 @@ bool linear_solver(const Matrix& A, const Vector& B, Vector& X, NT& D);
|
|||
/// @}
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceParameterizationConcepts
|
||||
\ingroup PkgSolverConcepts
|
||||
\cgalConcept
|
||||
|
||||
`SparseLinearAlgebraTraits_d::Vector` is a concept of a vector that can be multiplied by a sparse matrix.
|
||||
|
|
@ -82,7 +79,10 @@ bool linear_solver(const Matrix& A, const Vector& B, Vector& X, NT& D);
|
|||
|
||||
*/
|
||||
|
||||
class Vector {
|
||||
}; /* end SparseLinearAlgebraTraits_d */
|
||||
|
||||
|
||||
class SparseLinearAlgebraTraits_d::Vector {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
|
|
@ -142,7 +142,7 @@ NT& operator[](int row);
|
|||
}; /* end Vector */
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceParameterizationConcepts
|
||||
\ingroup PkgSolverConcepts
|
||||
\cgalConcept
|
||||
|
||||
`SparseLinearAlgebraTraits_d::Matrix` is a concept of a sparse matrix class.
|
||||
|
|
@ -158,7 +158,7 @@ NT& operator[](int row);
|
|||
|
||||
*/
|
||||
|
||||
class Matrix {
|
||||
class SparseLinearAlgebraTraits_d::Matrix {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
|
|
@ -243,6 +243,3 @@ void set_coef(int row, int column, NT value, bool new_coef = false);
|
|||
|
||||
}; /* end Matrix */
|
||||
|
||||
|
||||
}; /* end SparseLinearAlgebraTraits_d */
|
||||
|
||||
|
|
|
|||
|
|
@ -2,22 +2,12 @@
|
|||
\ingroup PkgSolverConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `SvdTraits` describes the set of requirements to be
|
||||
fulfilled by any class used to instantiate the third template
|
||||
parameter of the class
|
||||
`CGAL::Monge_via_jet_fitting<DataKernel,LocalKernel,SvdTraits>`.
|
||||
|
||||
It describes the linear algebra types and algorithms needed by the
|
||||
class `CGAL::Monge_via_jet_fitting`.
|
||||
|
||||
\cgalHeading{Requirements}
|
||||
|
||||
The scalar type, `SvdTraits::FT`, must be the same as that of
|
||||
the `LocalKernel` concept : `LocalKernel::FT`.
|
||||
The concept `SvdTraits` describes the linear algebra types and algorithms needed
|
||||
to solve in the least square sense a linear system with a singular value decomposition
|
||||
|
||||
\cgalHasModel `CGAL::Eigen_svd`
|
||||
|
||||
\sa `LocalKernel`
|
||||
\sa `CGAL::Monge_via_jet_fitting<DataKernel,LocalKernel,SvdTraits>`
|
||||
|
||||
*/
|
||||
class SvdTraits {
|
||||
|
|
@ -60,7 +50,7 @@ public:
|
|||
}; /* end SvdTraits */
|
||||
|
||||
/*!
|
||||
\ingroup PkgJet_fitting_3Concepts
|
||||
\ingroup PkgSolverConcepts
|
||||
\cgalConcept
|
||||
Concept of vector type used by the concept SvdTraits.
|
||||
*/
|
||||
|
|
@ -93,7 +83,7 @@ public:
|
|||
|
||||
|
||||
/*!
|
||||
\ingroup PkgJet_fitting_3Concepts
|
||||
\ingroup PkgSolverConcepts
|
||||
\cgalConcept
|
||||
Concept of matrix type used by the concept SvdTraits.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,177 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgKernelDLinAlgConcepts
|
||||
\cgalConcept
|
||||
|
||||
An instance of data type `Vector` is a vector of variables of
|
||||
number type `NT`. Together with the type `Matrix` it realizes
|
||||
the basic operations of linear algebra.
|
||||
|
||||
*/
|
||||
|
||||
class Vector {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
the ring type of the components.
|
||||
*/
|
||||
typedef unspecified_type NT;
|
||||
|
||||
/*!
|
||||
the iterator type for accessing components.
|
||||
*/
|
||||
typedef unspecified_type iterator;
|
||||
|
||||
/*!
|
||||
the const iterator type for accessing
|
||||
components.
|
||||
*/
|
||||
typedef unspecified_type const_iterator;
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Creation
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
creates an instance `v` of type
|
||||
`Vector`.
|
||||
*/
|
||||
Vector();
|
||||
|
||||
/*!
|
||||
creates an instance `v` of type
|
||||
`Vector`. `v` is initialized to a vector of dimension \f$ d\f$.
|
||||
|
||||
*/
|
||||
Vector(int d);
|
||||
|
||||
/*!
|
||||
creates an instance `v` of
|
||||
type `Vector`. `v` is initialized to a vector of dimension
|
||||
\f$ d\f$ with entries `x`.
|
||||
*/
|
||||
Vector(int d, NT x);
|
||||
|
||||
/*!
|
||||
creates an
|
||||
instance `v` of type `Vector`; `v` is initialized to the
|
||||
vector with entries `set [first,last)`.
|
||||
\cgalRequires `Forward_iterator` has value type `NT`.
|
||||
*/
|
||||
template <class Forward_iterator>
|
||||
Vector(Forward_iterator first, Forward_iterator last);
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the dimension of `v`.
|
||||
*/
|
||||
int dimension() ;
|
||||
|
||||
/*!
|
||||
returns true iff `v` is the zero
|
||||
vector.
|
||||
*/
|
||||
bool is_zero() ;
|
||||
|
||||
/*!
|
||||
returns the \f$ i\f$-th component of `v`.
|
||||
|
||||
\pre \f$ 0\le i \le v.dimension()-1\f$.
|
||||
*/
|
||||
NT& operator[](int i) ;
|
||||
|
||||
/*!
|
||||
iterator to the first component.
|
||||
*/
|
||||
iterator begin() ;
|
||||
|
||||
/*!
|
||||
iterator beyond the last component.
|
||||
*/
|
||||
iterator end() ;
|
||||
|
||||
/*!
|
||||
iterator to the first component.
|
||||
*/
|
||||
const_iterator begin() const;
|
||||
|
||||
/*!
|
||||
iterator beyond the last component.
|
||||
*/
|
||||
const_iterator end() const;
|
||||
|
||||
|
||||
/*!
|
||||
Addition.
|
||||
|
||||
\pre `v.dimension() == v1.dimension()`.
|
||||
*/
|
||||
Vector operator+(const Vector& v1) ;
|
||||
|
||||
/*!
|
||||
Subtraction.
|
||||
|
||||
\pre `v.dimension() = v1.dimension()`.
|
||||
*/
|
||||
Vector operator-(const Vector& v1) ;
|
||||
|
||||
/*!
|
||||
Inner Product.
|
||||
|
||||
\pre `v.dimension() = v1.dimension()`.
|
||||
*/
|
||||
NT operator*(const Vector& v1) ;
|
||||
|
||||
/*!
|
||||
Negation.
|
||||
*/
|
||||
Vector operator-() ;
|
||||
|
||||
/*!
|
||||
Addition plus assignment.
|
||||
|
||||
\pre `v.dimension() == v1.dimension()`.
|
||||
*/
|
||||
Vector& operator+=(const Vector& v1);
|
||||
|
||||
/*!
|
||||
Subtraction plus assignment.
|
||||
|
||||
\pre `v.dimension() == v1.dimension()`.
|
||||
*/
|
||||
Vector& operator-=(const Vector& v1);
|
||||
|
||||
/*!
|
||||
Scalar multiplication plus
|
||||
assignment.
|
||||
*/
|
||||
Vector& operator*=(const NT& s);
|
||||
|
||||
/*!
|
||||
Scalar division plus assignment.
|
||||
|
||||
*/
|
||||
Vector& operator/=(const NT& s);
|
||||
|
||||
/*!
|
||||
Component-wise multiplication with number \f$ r\f$.
|
||||
*/
|
||||
Vector operator*(const NT& r, const Vector& v);
|
||||
|
||||
/*!
|
||||
Component-wise multiplication with number \f$ r\f$.
|
||||
*/
|
||||
Vector operator*(const Vector& v, const NT& r);
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* end Vector */
|
||||
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS}
|
||||
|
||||
PROJECT_NAME = "CGAL ${CGAL_CREATED_VERSION_NUM} - CGAL and Solvers"
|
||||
INPUT = ${CMAKE_SOURCE_DIR}/Solver_interface/doc/Solver_interface/ \
|
||||
${CMAKE_SOURCE_DIR}/Solver_interface/include/CGAL
|
||||
INPUT = ${CMAKE_SOURCE_DIR}/Solver_interface/doc/Solver_interface/
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,12 @@
|
|||
/// \defgroup PkgSolverConcepts Concepts
|
||||
/// \ingroup PkgSolver
|
||||
///
|
||||
/// We
|
||||
|
||||
|
||||
/*!
|
||||
\addtogroup PkgSolver
|
||||
\cgalPkgDescriptionBegin{CGAL and Solvers,PkgSolverSummary}
|
||||
\cgalPkgPicture{solver-detail.png}
|
||||
\cgalPkgPicture{solver.png}
|
||||
\cgalPkgSummaryBegin
|
||||
\cgalPkgAuthors{CGAL Editorial Board }
|
||||
\cgalPkgDesc{This package provides }
|
||||
|
|
@ -32,10 +31,10 @@
|
|||
|
||||
## Classes ##
|
||||
|
||||
- `Eigen_solver_traits`
|
||||
- `Eigen_svd`
|
||||
- `Eigen_matrix`
|
||||
- `Eigen_vector`
|
||||
- `CGAL::Eigen_solver_traits`
|
||||
- `CGAL::Eigen_svd`
|
||||
- `CGAL::Eigen_matrix`
|
||||
- `CGAL::Eigen_vector`
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -5,30 +5,23 @@ namespace CGAL {
|
|||
\anchor Chapter_CGAL_and_Solvers
|
||||
\anchor chapterBGL
|
||||
\cgalAutoToc
|
||||
\authors NN
|
||||
\authors %CGAL Editorial Board
|
||||
|
||||
|
||||
|
||||
The scope of \cgal is geometry and not solving linear systems. Nevertheless, this package
|
||||
provides the necessary classes and functions that enable using the
|
||||
algorithms of the
|
||||
Several \cgal packages have to solve linear systems with dense or sparse matrices.
|
||||
This package provides concepts and models for that purpose. The models we provide
|
||||
all use the \ref thirdpartyEigen library.
|
||||
|
||||
|
||||
\section SolverConcepts Solver Concepts
|
||||
|
||||
\section SectionSolverConcepts Solver Concepts
|
||||
|
||||
|
||||
See also the Chapter \ref PkgProperty_mapSummary.
|
||||
|
||||
See also Section <A HREF="http://www.boost.org/libs/graph/doc/visitor_concepts.html">Visitor Concepts</A>
|
||||
in the \sc{Bgl} manual.
|
||||
\section SectionSolverEigen Eigen
|
||||
|
||||
|
||||
\subsection SolverExamplel Example:
|
||||
|
||||
The following example program computes
|
||||
|
||||
\cgalExample{Solver_interface/eigen.cpp}
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,3 +3,4 @@ Kernel_23
|
|||
STL_Extension
|
||||
Algebraic_foundations
|
||||
Miscellany
|
||||
Jet_fitting_3
|
||||
|
|
|
|||
|
|
@ -1,16 +1,3 @@
|
|||
/*!
|
||||
\example BGL_arrangement_2/arr_print.h
|
||||
\example BGL_arrangement_2/arr_rational_nt.h
|
||||
\example BGL_arrangement_2/dual.cpp
|
||||
\example BGL_arrangement_2/primal.cpp
|
||||
\example BGL_polyhedron_3/cube.off
|
||||
\example BGL_polyhedron_3/distance.cpp
|
||||
\example BGL_polyhedron_3/kruskal.cpp
|
||||
\example BGL_polyhedron_3/kruskal_with_stored_id.cpp
|
||||
\example BGL_polyhedron_3/normals.cpp
|
||||
\example BGL_polyhedron_3/incident_vertices.cpp
|
||||
\example BGL_triangulation_2/dijkstra.cpp
|
||||
\example BGL_triangulation_2/dijkstra_with_internal_properties.cpp
|
||||
\example BGL_triangulation_2/emst.cpp
|
||||
\example BGL_surface_mesh/prim.cpp
|
||||
|
||||
*/
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 909 B |
Loading…
Reference in New Issue