Limbo 3.5.4
Loading...
Searching...
No Matches
limbo::solvers::SubGradientDescent< T > Class Template Reference

Update lagrangian multiplier with subgradient descent. More...

#include <MultiKnapsackLagRelax.h>

Inheritance diagram for limbo::solvers::SubGradientDescent< T >:
limbo::solvers::LagMultiplierUpdater< T >

Public Types

typedef LagMultiplierUpdater< T > base_type
 base type
typedef base_type::value_type value_type
 value type
Public Types inherited from limbo::solvers::LagMultiplierUpdater< T >
typedef T value_type
 value type

Public Member Functions

 SubGradientDescent (value_type alpha=1, value_type beta=1)
 constructor
 SubGradientDescent (SubGradientDescent const &rhs)
 copy constructor
SubGradientDescentoperator= (SubGradientDescent const &rhs)
 assignment
 ~SubGradientDescent ()
 destructor
value_type operator() (unsigned int iter, value_type multiplier, value_type slackness)
 API to update lagrangian multiplier using subgradient descent.
void operator() (unsigned int iter, unsigned int n, value_type const *vSlackness, value_type const *vLagMultiplier, value_type *vNewLagMultiplier)
 API to update lagrangian multiplier using subgradient descent.
Public Member Functions inherited from limbo::solvers::LagMultiplierUpdater< T >
 LagMultiplierUpdater ()
 constructor
virtual ~LagMultiplierUpdater ()
 destructor

Protected Member Functions

void copy (SubGradientDescent const &rhs)
 copy object
void computeScalingFactor (unsigned int iter)
 compute scaling factor

Protected Attributes

value_type m_alpha
 power
value_type m_beta
 constant
unsigned int m_iter
 current iteration
value_type m_scalingFactor
 scaling factor \( t_k = \beta \cdot k^{-\alpha} \)

Detailed Description

template<typename T>
class limbo::solvers::SubGradientDescent< T >

Update lagrangian multiplier with subgradient descent.

Template Parameters
Tcoefficient value type

Definition at line 962 of file MultiKnapsackLagRelax.h.

Member Typedef Documentation

◆ base_type

template<typename T>
typedef LagMultiplierUpdater<T> limbo::solvers::SubGradientDescent< T >::base_type

base type

Definition at line 966 of file MultiKnapsackLagRelax.h.

◆ value_type

template<typename T>
typedef base_type::value_type limbo::solvers::SubGradientDescent< T >::value_type

value type

Definition at line 968 of file MultiKnapsackLagRelax.h.

Constructor & Destructor Documentation

◆ SubGradientDescent() [1/2]

template<typename T>
limbo::solvers::SubGradientDescent< T >::SubGradientDescent ( value_type alpha = 1,
value_type beta = 1 )
inline

constructor

Parameters
alphathe power term for scaling factor \( t_k = \beta \cdot k^{-\alpha} \)
betathe constant

Definition at line 973 of file MultiKnapsackLagRelax.h.

◆ SubGradientDescent() [2/2]

template<typename T>
limbo::solvers::SubGradientDescent< T >::SubGradientDescent ( SubGradientDescent< T > const & rhs)
inline

copy constructor

right hand side

Definition at line 983 of file MultiKnapsackLagRelax.h.

◆ ~SubGradientDescent()

template<typename T>
limbo::solvers::SubGradientDescent< T >::~SubGradientDescent ( )
inline

destructor

Definition at line 999 of file MultiKnapsackLagRelax.h.

Member Function Documentation

◆ computeScalingFactor()

template<typename T>
void limbo::solvers::SubGradientDescent< T >::computeScalingFactor ( unsigned int iter)
inlineprotected

compute scaling factor

Parameters
itercurrent iteration

Definition at line 1048 of file MultiKnapsackLagRelax.h.

◆ copy()

template<typename T>
void limbo::solvers::SubGradientDescent< T >::copy ( SubGradientDescent< T > const & rhs)
inlineprotected

copy object

right hand side

Definition at line 1039 of file MultiKnapsackLagRelax.h.

◆ operator()() [1/2]

template<typename T>
void limbo::solvers::SubGradientDescent< T >::operator() ( unsigned int iter,
unsigned int n,
value_type const * vSlackness,
value_type const * vLagMultiplier,
value_type * vNewLagMultiplier )
inlinevirtual

API to update lagrangian multiplier using subgradient descent.

Parameters
itercurrent iteration
ndimension
vSlacknessarray of slackness
vLagMultiplierarray of lagrangian multipliers
vNewLagMultiplierarray of new lagrangian multipliers

Implements limbo::solvers::LagMultiplierUpdater< T >.

Definition at line 1021 of file MultiKnapsackLagRelax.h.

◆ operator()() [2/2]

template<typename T>
value_type limbo::solvers::SubGradientDescent< T >::operator() ( unsigned int iter,
value_type multiplier,
value_type slackness )
inlinevirtual

API to update lagrangian multiplier using subgradient descent.

Parameters
itercurrent iteration
multipliercurrent multiplier value
slacknesscurrent slackness value assuming the constraint is in \( Ax \le b \) and compute \( b-Ax \)
Returns
updated multiplier value

Implements limbo::solvers::LagMultiplierUpdater< T >.

Definition at line 1008 of file MultiKnapsackLagRelax.h.

◆ operator=()

template<typename T>
SubGradientDescent & limbo::solvers::SubGradientDescent< T >::operator= ( SubGradientDescent< T > const & rhs)
inline

assignment

right hand side

Definition at line 989 of file MultiKnapsackLagRelax.h.

Member Data Documentation

◆ m_alpha

template<typename T>
value_type limbo::solvers::SubGradientDescent< T >::m_alpha
protected

power

Definition at line 1058 of file MultiKnapsackLagRelax.h.

◆ m_beta

template<typename T>
value_type limbo::solvers::SubGradientDescent< T >::m_beta
protected

constant

Definition at line 1059 of file MultiKnapsackLagRelax.h.

◆ m_iter

template<typename T>
unsigned int limbo::solvers::SubGradientDescent< T >::m_iter
protected

current iteration

Definition at line 1060 of file MultiKnapsackLagRelax.h.

◆ m_scalingFactor

template<typename T>
value_type limbo::solvers::SubGradientDescent< T >::m_scalingFactor
protected

scaling factor \( t_k = \beta \cdot k^{-\alpha} \)

Definition at line 1061 of file MultiKnapsackLagRelax.h.


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