4 #include <Eigen/IterativeLinearSolvers> 5 #include <unsupported/Eigen/IterativeSolvers> 36 template<
typename Rhs>
58 template<
typename Rhs>
64 template<
typename Dest>
69 assert(alpha==
Scalar(1) &&
"scaling is not implemented");
91 Eigen::VectorXd
b(n),
x;
99 std::cout <<
"CG: #iterations: " << cg.
iterations() <<
", estimated error: " << cg.
error() << std::endl;
106 std::cout <<
"BiCGSTAB: #iterations: " << bicg.
iterations() <<
", estimated error: " << bicg.
error() << std::endl;
113 std::cout <<
"GMRES: #iterations: " << gmres.
iterations() <<
", estimated error: " << gmres.
error() << std::endl;
120 std::cout <<
"DGMRES: #iterations: " << gmres.
iterations() <<
", estimated error: " << gmres.
error() << std::endl;
127 std::cout <<
"MINRES: #iterations: " << minres.
iterations() <<
", estimated error: " << minres.
error() << std::endl;
Expression of the product of two arbitrary matrices or vectors.
A Restarted GMRES with deflation. This class implements a modification of the GMRES solver for sparse...
A versatible sparse matrix representation.
const Solve< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >, Rhs > solve(const MatrixBase< Rhs > &b) const
Namespace containing all symbols from the Eigen library.
A conjugate gradient solver for sparse (or dense) self-adjoint problems.
void attachMyMatrix(const SparseMatrix< double > &mat)
const SparseMatrix< double > my_matrix() const
Eigen::Index Index
The interface type of indices.
Product< MatrixReplacement, Rhs >::Scalar Scalar
ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > & compute(const EigenBase< MatrixDerived > &A)
TransposeReturnType transpose()
A minimal residual solver for sparse symmetric problems.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC ColXpr col(Index i)
A GMRES solver for sparse square problems.
A bi conjugate gradient stabilized solver for sparse square problems.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Eigen::Product< MatrixReplacement, Rhs, Eigen::AliasFreeProduct > operator*(const Eigen::MatrixBase< Rhs > &x) const
Base class for all dense matrices, vectors, and expressions.
static void scaleAndAddTo(Dest &dst, const MatrixReplacement &lhs, const Rhs &rhs, const Scalar &alpha)
const SparseMatrix< double > * mp_mat
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
EIGEN_DONT_INLINE void minres(const MatrixType &mat, const Rhs &rhs, Dest &x, const Preconditioner &precond, Index &iters, typename Dest::RealScalar &tol_error)
bool gmres(const MatrixType &mat, const Rhs &rhs, Dest &x, const Preconditioner &precond, Index &iters, const Index &restart, typename Dest::RealScalar &tol_error)