So-Bogus
A c++ sparse block matrix library aimed at Second Order cone problems
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
bogus::ADMM< BlockMatrixType > Class Template Reference

ADMM (Alternating Direction Method of Multipliers ) iterative solver. More...

#include <ADMM.hpp>

Inheritance diagram for bogus::ADMM< BlockMatrixType >:
bogus::ConstrainedSolverBase< ADMM< BlockMatrixType >, BlockMatrixType > bogus::BlockSolverBase< BlockMatrixType >

Public Types

typedef ConstrainedSolverBase
< ADMM, 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

 ADMM ()
 Default constructor – you will have to call setMatrix() before using the solve() function.
 
 ADMM (const BlockObjectBase< BlockMatrixType > &matrix)
 Constructor with the system matrix.
 
template<admm::Variant variant, typename NSLaw , typename ProxOp , typename RhsT , typename ResT >
Scalar solve (const NSLaw &law, const ProxOp &op, const RhsT &w, ResT &v, ResT &r) const
 
template<typename NSLaw , typename ProxOp , typename RhsT , typename ResT >
Scalar solve (const NSLaw &law, const ProxOp &op, const RhsT &w, ResT &v, ResT &r) const
 Solve function using default variant.
 
ADMMsetMatrix (const BlockObjectBase< BlockMatrixType > &matrix)
 Sets the problem matrix – the one defining the constraints.
 
void setStepSize (const Scalar size)
 Sets the step size for updating the dual variable (forces).
 
void setDefaultVariant (admm::Variant variant)
 Sets the variant that will be used when calling solve() without template arguments.
 
Scalar stepSize () 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
 
CallBackTypecallback ()
 Callback hook; will be triggered every N iterations, depending on the solver. More...
 
const CallBackTypecallback () 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_stepSize
 
admm::Variant m_defaultVariant
 
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
 

Detailed Description

template<typename BlockMatrixType>
class bogus::ADMM< BlockMatrixType >

ADMM (Alternating Direction Method of Multipliers ) iterative solver.

Minimizes J(v) with ( M v + w ) in C, C defined by the NSLaw in the solve() function.

Requires ability to evaluate $ prox_{\lambda} J( x ) := \min_y J(y) + \frac 1 {2 \lambda} \Vert x - y \Vert^2 $

See Also
QuadraticProxOp
Warning
Experimental

Member Function Documentation

template<typename BlockMatrixType >
CallBackType& bogus::BlockSolverBase< BlockMatrixType >::callback ( )
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.

See Also
Signal< unsigned, Scalar >
Scalar bogus::ConstrainedSolverBase< ADMM< BlockMatrixType > , BlockMatrixType >::eval ( const NSLaw &  law,
const ResT &  y,
const RhsT &  x 
) const
inherited

Eval the current global residual as a function of the local ones.

y should be such that y = m_matrix * x + rhs

Returns
the current residual err defined as follow :
template<typename BlockMatrixType >
template<admm::Variant variant, typename NSLaw , typename ProxOp , typename RhsT , typename ResT >
Scalar bogus::ADMM< BlockMatrixType >::solve ( const NSLaw &  law,
const ProxOp &  op,
const RhsT &  w,
ResT &  v,
ResT &  r 
) const

Find the minimizer of J(v), ( Mv + w in C ) with J(v) defined through its proximal operator, op and C defined by law

Parameters
lawshould define projectOnConstraints()
opshould define a eval(Rhs& rhs, Res& res) function computing res as $ prox_{J, 1/\lambda}( rhs/\lambda ) $ and coefficient() returning $\lambda$
See Also
QuadraticProxOp

The documentation for this class was generated from the following file: