15 #include "../config/config.hpp"
22 #ifdef MFEM_USE_SUITESPARSE
100 void SLI(
const Operator &A,
const Vector &b, Vector &x,
101 int print_iter = 0,
int max_num_iter = 1000,
102 double RTOLERANCE = 1e-12,
double ATOLERANCE = 1e-24);
105 void SLI(
const Operator &A, Solver &B,
const Vector &b, Vector &x,
106 int print_iter = 0,
int max_num_iter = 1000,
107 double RTOLERANCE = 1e-12,
double ATOLERANCE = 1e-24);
132 void CG(
const Operator &A,
const Vector &b, Vector &x,
133 int print_iter = 0,
int max_num_iter = 1000,
134 double RTOLERANCE = 1e-12,
double ATOLERANCE = 1e-24);
137 void PCG(
const Operator &A, Solver &B,
const Vector &b, Vector &x,
138 int print_iter = 0,
int max_num_iter = 1000,
139 double RTOLERANCE = 1e-12,
double ATOLERANCE = 1e-24);
180 int GMRES(
const Operator &A, Vector &x,
const Vector &b, Solver &M,
181 int &max_iter,
int m,
double &tol,
double atol,
int printit);
184 void GMRES(
const Operator &A, Solver &B,
const Vector &b, Vector &x,
185 int print_iter = 0,
int max_num_iter = 1000,
int m = 50,
186 double rtol = 1e-12,
double atol = 1e-24);
211 int BiCGSTAB(
const Operator &A, Vector &x,
const Vector &b, Solver &M,
212 int &max_iter,
double &tol,
double atol,
int printit);
215 void BiCGSTAB(
const Operator &A, Solver &B,
const Vector &b, Vector &x,
216 int print_iter = 0,
int max_num_iter = 1000,
217 double rtol = 1e-12,
double atol = 1e-24);
246 void MINRES(
const Operator &A,
const Vector &b, Vector &x,
int print_it = 0,
247 int max_it = 1000,
double rtol = 1e-12,
double atol = 1e-24);
250 void MINRES(
const Operator &A, Solver &B,
const Vector &b, Vector &x,
251 int print_it = 0,
int max_it = 1000,
252 double rtol = 1e-12,
double atol = 1e-24);
292 int aGMRES(
const Operator &A, Vector &x,
const Vector &b,
293 const Operator &M,
int &max_iter,
294 int m_max,
int m_min,
int m_step,
double cf,
295 double &tol,
double &atol,
int printit);
341 #ifdef MFEM_USE_SUITESPARSE
356 mutable double Info[UMFPACK_INFO];
413 #endif // MFEM_USE_SUITESPARSE
417 #endif // MFEM_SOLVERS
Conjugate gradient method.
virtual void MultTranspose(const Vector &b, Vector &x) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
double Info[UMFPACK_INFO]
int GetNumIterations() const
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
void SetSize(int s)
Resize the vector to size s.
NewtonSolver(MPI_Comm _comm)
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
Direct sparse solver using KLU.
virtual void SetSolver(Solver &solver)
Set the linear solver for inverting the Jacobian.
virtual void MultTranspose(const Vector &b, Vector &x) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
UMFPackSolver(SparseMatrix &A, bool _use_long_ints=false)
Factorize the given SparseMatrix using the defaults. For larger matrices, if the solver fails...
void add(const Vector &v1, const Vector &v2, Vector &v)
double Norm(const Vector &x) const
double GetFinalNorm() const
int BiCGSTAB(const Operator &A, Vector &x, const Vector &b, Solver &M, int &max_iter, double &tol, double atol, int printit)
BiCGSTAB method. (tolerances are squared)
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
FGMRESSolver(MPI_Comm _comm)
Direct sparse solver using UMFPACK.
UMFPackSolver(bool _use_long_ints=false)
For larger matrices, if the solver fails, set the parameter _use_long_ints = true.
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
void SetLinearConstraint(const Vector &_w, double _a)
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
void SetPrintLevel(int print_lvl)
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
double solve(double l, const Vector &xt, Vector &x, int &nclip) const
Solve QP at fixed lambda.
void MINRES(const Operator &A, const Vector &b, Vector &x, int print_it, int max_it, double rtol, double atol)
MINRES method without preconditioner. (tolerances are squared)
void SetMaxIter(int max_it)
void median(const Vector &lo, const Vector &hi)
v = median(v,lo,hi) entrywise. Implementation assumes lo <= hi.
void SetKDim(int dim)
Set the number of iteration to perform between restarts, default is 50.
Newton's method for solving F(x)=b for a given operator F.
void CG(const Operator &A, const Vector &b, Vector &x, int print_iter, int max_num_iter, double RTOLERANCE, double ATOLERANCE)
Conjugate gradient method. (tolerances are squared)
void print_iteration(int it, double r, double l) const
void PCG(const Operator &A, Solver &B, const Vector &b, Vector &x, int print_iter, int max_num_iter, double RTOLERANCE, double ATOLERANCE)
Preconditioned conjugate gradient method. (tolerances are squared)
virtual void SetOperator(const Operator &op)
Set/update the solver for the given operator.
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
double Dot(const Vector &x, const Vector &y) const
BiCGSTABSolver(MPI_Comm _comm)
SLBQPOptimizer(MPI_Comm _comm)
virtual void Mult(const Vector &b, Vector &x) const
Solve the nonlinear system with right-hand side b.
void SetPrintLevel(int print_lvl)
Set the print level field in the Control data member.
Stationary linear iteration: x <- x + B (b - A x)
void SetAbsTol(double atol)
void SetRelTol(double rtol)
double Control[UMFPACK_CONTROL]
Abstract base class for iterative solver.
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
SLISolver(MPI_Comm _comm)
GMRESSolver(MPI_Comm _comm)
void SetBounds(const Vector &_lo, const Vector &_hi)
virtual double ComputeScalingFactor(const Vector &x, const Vector &b) const
This method can be overloaded in derived classes to implement line search algorithms.
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
virtual void Mult(const Vector &xt, Vector &x) const
Operator application: y=A(x).
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
MINRESSolver(MPI_Comm _comm)
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
KLUSolver(SparseMatrix &A)
int aGMRES(const Operator &A, Vector &x, const Vector &b, const Operator &M, int &max_iter, int m_max, int m_min, int m_step, double cf, double &tol, double &atol, int printit)
virtual void SetPreconditioner(Solver &pr)
These are not currently meaningful for this solver and will error out.
int width
Dimension of the input / number of columns in the matrix.
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
void SLI(const Operator &A, const Vector &b, Vector &x, int print_iter, int max_num_iter, double RTOLERANCE, double ATOLERANCE)
Stationary linear iteration. (tolerances are squared)
int GMRES(const Operator &A, Vector &x, const Vector &b, Solver &M, int &max_iter, int m, double &tol, double atol, int printit)
GMRES method. (tolerances are squared)
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
virtual void SetOperator(const Operator &op)
Factorize the given Operator op which must be a SparseMatrix.