So-Bogus
A c++ sparse block matrix library aimed at Second Order cone problems
|
Dual AMA iterative solver (Alternating Minimization Algorithm on dual formuation of quadratic optimization problem). More...
#include <ADMM.hpp>
Public Types | |
typedef ConstrainedSolverBase < DualAMA, BlockMatrixType > | Base |
typedef Base::GlobalProblemTraits | GlobalProblemTraits |
typedef GlobalProblemTraits::Scalar | Scalar |
typedef LocalProblemTraits < Base::BlockTraits::RowsPerBlock, Scalar > | BlockProblemTraits |
typedef BlockMatrixTraits < BlockMatrixType > | BlockTraits |
typedef Signal< unsigned, Scalar > | CallBackType |
Public Member Functions | |
DualAMA () | |
Default constructor – you will have to call setMatrix() before using the solve() function. | |
DualAMA (const BlockObjectBase< BlockMatrixType > &matrix) | |
Constructor with the system matrix. | |
template<typename NSLaw , typename MatrixT , typename RhsT , typename ResT > | |
Scalar | solve (const NSLaw &law, const BlockObjectBase< MatrixT > &A, const RhsT &f, const RhsT &w, ResT &v, ResT &r) const |
Solve function using default variant. | |
template<admm::Variant variant, typename NSLaw , typename MatrixT , typename RhsT , typename ResT > | |
Scalar | solve (const NSLaw &law, const BlockObjectBase< MatrixT > &A, const RhsT &f, const RhsT &w, ResT &v, ResT &r) const |
Solve function with variant as template argument. | |
template<admm::Variant variant, typename NSLaw , typename AType , typename BType , typename HType , typename PrecondT , typename RhsT , typename ORhsT , typename ResT , typename OResT > | |
Scalar | solveWithLinearConstraints (const NSLaw &law, const BlockObjectBase< AType > &A, const BlockObjectBase< BType > &B, const BlockObjectBase< HType > &H, const PrecondT &preconditioner, const RhsT &f, const ORhsT &k, const RhsT &w, ResT &v, OResT &p, ResT &r, Scalar stepRatio=1) const |
Idem with constraint ( B v + k = 0 ) | |
DualAMA & | setMatrix (const BlockObjectBase< BlockMatrixType > &matrix) |
Sets the problem matrix – the one defining the constraints. | |
void | setFpStepSize (const Scalar size) |
Sets the step size for updating the dual variable (forces). | |
void | setProjStepSize (const Scalar size) |
void | setDefaultVariant (admm::Variant variant) |
Sets the variant that will be used when calling solve() without template arguments. | |
Scalar | fpStepSize () const |
Scalar | projStepSize () const |
void | setLineSearchIterations (const unsigned lsIterations) |
Sets the maximum number of line-search iterations. | |
void | setLineSearchOptimisticFactor (const Scalar lsOptimisticFactor) |
void | setLineSearchPessimisticFactor (const Scalar lsPessimisticFactor) |
unsigned | lineSearchIterations () const |
Scalar | lineSearchOptimisticFactor () const |
Scalar | lineSearchPessimisticFactor () const |
void | useInfinityNorm (bool useInfNorm) |
Sets whether the solver will use the infinity norm instead of the l1 one to compute the global residual from the local ones. | |
bool | usesInfinityNorm () const |
Scalar | eval (const NSLaw &law, const ResT &y, const RhsT &x) const |
Eval the current global residual as a function of the local ones. More... | |
void | projectOnConstraints (const NSLaw &projector, VectorT &x) const |
Projects the variable x on the constraints defined by projector . | |
void | dualityCOV (const NSLaw &law, const RhsT &b, ResT &x) const |
Compute associated change of variable (see NSLaw) | |
Scalar | solve (const NSLaw &law, const RhsT &b, ResT &x) const |
void | setMaxIters (unsigned maxIters) |
For iterative solvers: sets the maximum number of iterations. | |
unsigned | maxIters () const |
void | setTol (Scalar tol) |
For iterative solvers: sets the solver tolerance. | |
Scalar | tol () const |
CallBackType & | callback () |
Callback hook; will be triggered every N iterations, depending on the solver. More... | |
const CallBackType & | callback () const |
const BlockObjectBase < BlockMatrixType > & | matrix () const |
Protected Types | |
typedef Base::Index | Index |
Protected Member Functions | |
void | init () |
Sets up the default values for all parameters. | |
void | updateScalings () |
Protected Attributes | |
Scalar | m_fpStepSize |
Scalar | m_projStepSize |
admm::Variant | m_defaultVariant |
unsigned | m_lsIters |
Scalar | m_lsOptimisticFactor |
Scalar | m_lsPessimisticFactor |
GlobalProblemTraits::DynVector | m_scaling |
bool | m_useInfinityNorm |
See useInfinityNorm(). Defaults to false. | |
const BlockObjectBase < BlockMatrixType > * | m_matrix |
Pointer to the matrix of the system. | |
unsigned | m_maxIters |
See setMaxIters() | |
Scalar | m_tol |
See setTol() | |
CallBackType | m_callback |
Dual AMA iterative solver (Alternating Minimization Algorithm on dual formuation of quadratic optimization problem).
Minimizes .5 r' M A^-1 M' r + r' ( w - M A^-1 f ) for r in C as min H(x) + G(r) , x = M' r with H(x) = .5 x' A^-1 x - x' A^-1 f G(r) = I_C(r) + r'w thanks to the identities prox_{l,G} (y) = prox_{l,Ic}( y - lw ) = Pi_C ( y - lw ) and inf_x H(x) - < v, x > = A v + f
Main advantage of this solver is that it does not require inverting or solving linear system with the stiffness matrix A.
|
inherited |
Callback hook; will be triggered every N iterations, depending on the solver.
Useful to monitor the convergence of the solver. Can be connected to a function that takes an unsigned
and a Scalar
as parameters. The first argument will be the current iteration number, and the second the current residual.
|
inherited |
Eval the current global residual as a function of the local ones.
y
should be such that y
= m_matrix * x
+ rhs
err
defined as follow :err
err
:= void bogus::DualAMA< BlockMatrixType >::setLineSearchOptimisticFactor | ( | const Scalar | lsOptimisticFactor | ) |
Sets the amount by which the step size will be multiplied at the beginninf of each PG iteration. Should be greater than 1
void bogus::DualAMA< BlockMatrixType >::setLineSearchPessimisticFactor | ( | const Scalar | lsPessimisticFactor | ) |
Sets the amount by which the step size will be multiplied at the end of each line-search iterations. Should be in ]0,1[