mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add matrix-free solver example
This commit is contained in:
20
doc/MatrixfreeSolverExample.dox
Normal file
20
doc/MatrixfreeSolverExample.dox
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
/**
|
||||
|
||||
\eigenManualPage MatrixfreeSolverExample Matrix-free solvers
|
||||
|
||||
Iterative solvers such as ConjugateGradient and BiCGSTAB can be used in a matrix free context. To this end, user must provide a wrapper class inheriting EigenBase<> and implementing the following methods:
|
||||
- Index rows() and Index cols(): returns number of rows and columns respectively
|
||||
- operator* with and %Eigen dense column vector (its actual implementation goes in a specialization of the internal::generic_product_impl class)
|
||||
|
||||
Eigen::internal::traits<> must also be specialized for the wrapper type.
|
||||
|
||||
Here is a complete example wrapping a Eigen::SparseMatrix:
|
||||
\include matrixfree_cg.cpp
|
||||
Output: \verbinclude matrixfree_cg.out
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user