CNDSM  1.00
Deflection Class Referenceabstract

The class Deflection provides an interface for the deflection rule (DR), to be used in the SubGrad solver [see SubGrad.h]. More...

#include <Deflection.h>

Inheritance diagram for Deflection:
PrimalDual Volume

Public Member Functions

Constructor
 Deflection (SubGrad *slvr)
 Constructor of the class. More...
 
Other initializations
virtual void SetVOLLog (ostream *outs=0, const char lvl=0)
 The class outputs "log" information onto the ostream pointed by outs. More...
 
virtual void Format (void)
 The method initializes the DR. More...
 
Reading the solution
virtual void NewDEF (void)=0
 This method must be called before GetDFLCoeff() [see below]. More...
 
virtual cHpNum GetDFLCoeff (void)=0
 Returns the deflection coefficient. More...
 
virtual const bool DoSS (void)
 Returns true if a Serious Step (SS) takes place. More...
 
virtual cHpNum Delta (void)
 Returns the expected improvement in the objective function [see DoSS()]. More...
 
Destructor
virtual ~Deflection ()
 

Protected Member Functions

Protected methods to read from Subgrad

These methods are used to provide access to the information stored into the SubGrad object.

Deflection is a "friend" of SubGrad and therefore it can read its protected data structures, but classes derived from Deflection are not friend of SubGrad and cannot. This is why these methods are defined in the base class (and implemented in SubGrad.C).

FiOracleGetOracle (void)
 Returns the pointer to FiOracle. More...
 
HpNum GetStepsize (void)
 Returns the stepsize $\nu_i$. More...
 
cHpNum GetGiNorm (void)
 Returns the norm of the subgradient $ g_i $. More...
 
cHpNum GetDNorm (void)
 Returns the norm of the direction $ d_i $. More...
 
cHpNum GetdGk (void)
 Returns the scalar product $ g_i^{\top} d_i $. More...
 
cHpNum GetSigma (void)
 Returns the linearization error $ \sigma_i $. More...
 
cHpNum GetEpsilon (void)
 Returns the linearization error $ \epsilon_i $. More...
 
cHpNum ReadFVal (void)
 Returns the full function $ f(\lambda_i) $. More...
 

Protected Attributes

SubGradSolver
 (pointer to) the SubGrad solver
 
ostream * VOLLog
 the output stream object
 
char VOLLLvl
 the "level of verbosity"
 

Detailed Description

The class Deflection provides an interface for the deflection rule (DR), to be used in the SubGrad solver [see SubGrad.h].

The aim of this class is to compute the deflection coefficient $ \alpha_i $, which is employed in the search direction formula as follows:

\[ d_i = \alpha_i g_i + (1-\alpha_i)d_{i-1}\;. \]

The user must extend the class to one or more deflection rules following this interface.

Constructor & Destructor Documentation

Deflection ( SubGrad slvr)
inline

Constructor of the class.

It has no parameters apart the SubGrad object using it because there is no "standard" deflection rule (except "no deflection", i.e., $ \alpha_i = 1 $, which however in SubGrad is treated by just setting the null Deflection object).

Member Function Documentation

virtual void SetVOLLog ( ostream *  outs = 0,
const char  lvl = 0 
)
inlinevirtual

The class outputs "log" information onto the ostream pointed by outs.

lvl controls the "level of verbosity" of the code: lvl == 0 means that nothing at all is printed, and values larger than 0 mean increasing amounts of information, the specific effect of each value being derived- class-dependent. outs == 0 implies lvl == 0.

Referenced by PrimalDual::PrimalDual(), and Volume::Volume().

virtual void Format ( void  )
inlinevirtual

The method initializes the DR.

It does nothing for the base class.

Referenced by PrimalDual::PrimalDual(), and Volume::Volume().

virtual void NewDEF ( void  )
pure virtual

This method must be called before GetDFLCoeff() [see below].

This is indeed the core of every derived class, producing a new deflection coefficient.

Typically, the previous coefficient will be unavailable after the call to NewDEF() [GetDFLCoeff()].

Implemented in PrimalDual.

virtual cHpNum GetDFLCoeff ( void  )
pure virtual

Returns the deflection coefficient.

This function must be called after NewDEF() [see above].

virtual const bool DoSS ( void  )
inlinevirtual

Returns true if a Serious Step (SS) takes place.

Otherwise a Null Step (NS) occurs. By default, true is returned.

Typically, a SS occurs when a " good " improvement of the function $ f $ is obtained, usually it should be as good as the expected improvement [see Delta()].

virtual cHpNum Delta ( void  )
inlinevirtual

Returns the expected improvement in the objective function [see DoSS()].

This value is not useful for all DR. By default Inf<HpNum>() is returned.

FiOracle* GetOracle ( void  )
protected

Returns the pointer to FiOracle.

Thus, Deflection can ask directly the FiOracle object for the function information.

Referenced by PrimalDual::PrimalDual().

HpNum GetStepsize ( void  )
protected

Returns the stepsize $\nu_i$.

Referenced by PrimalDual::PrimalDual().

cHpNum GetGiNorm ( void  )
protected

Returns the norm of the subgradient $ g_i $.

Referenced by PrimalDual::NewDEF().

cHpNum GetDNorm ( void  )
protected

Returns the norm of the direction $ d_i $.

cHpNum GetdGk ( void  )
protected

Returns the scalar product $ g_i^{\top} d_i $.

cHpNum GetSigma ( void  )
protected

Returns the linearization error $ \sigma_i $.

cHpNum GetEpsilon ( void  )
protected

Returns the linearization error $ \epsilon_i $.

cHpNum ReadFVal ( void  )
protected

Returns the full function $ f(\lambda_i) $.