shark::BoxConstrainedProblem< SVMProblem > Class Template Reference

Quadratic program with box constraints. More...

#include <shark/Algorithms/QP/BoxConstrainedProblems.h>

Public Types

typedef SVMProblem::QpFloatType QpFloatType
 
typedef SVMProblem::MatrixType MatrixType
 
typedef MaximumGainCriterion PreferedSelectionStrategy
 

Public Member Functions

 BoxConstrainedProblem (SVMProblem &problem)
 
std::size_t dimensions () const
 
std::size_t active () const
 
double boxMin (std::size_t i) const
 
double boxMax (std::size_t i) const
 
bool isLowerBound (std::size_t i) const
 
bool isUpperBound (std::size_t i) const
 
bool isDeactivated (std::size_t i) const
 
MatrixTypequadratic ()
 representation of the quadratic part of the objective function More...
 
double linear (std::size_t i) const
 
double alpha (std::size_t i) const
 
double diagonal (std::size_t i) const
 
double gradient (std::size_t i) const
 
std::size_t permutation (std::size_t i) const
 
RealVector getUnpermutedAlpha () const
 
virtual void updateSMO (std::size_t i, std::size_t j)
 Does an update of SMO given a working set with indices i and j. More...
 
double functionValue () const
 Returns the current function value of the problem. More...
 
bool shrink (double)
 
void reshrink ()
 
void unshrink ()
 
virtual void deactivateVariable (std::size_t i)
 Remove the i-th example from the problem. More...
 
void activateVariable (std::size_t i)
 Reactivate an previously deactivated variable. More...
 
void flipCoordinates (std::size_t i, std::size_t j)
 exchange two variables via the permutation More...
 
virtual void setLinear (std::size_t i, double newValue)
 adapts the linear part of the problem and updates the internal data structures accordingly. More...
 
double checkKKT () const
 

Protected Member Functions

void updateAlphaStatus (std::size_t i)
 

Protected Attributes

SVMProblem & m_problem
 
RealVector m_gradient
 gradient of the objective function at the current alpha More...
 
std::size_t m_active
 
std::vector< char > m_alphaStatus
 

Detailed Description

template<class SVMProblem>
class shark::BoxConstrainedProblem< SVMProblem >

Quadratic program with box constraints.

An instance of this class represents a quadratic program of the type TODO: write documentation!

Definition at line 137 of file BoxConstrainedProblems.h.

Member Typedef Documentation

§ MatrixType

template<class SVMProblem>
typedef SVMProblem::MatrixType shark::BoxConstrainedProblem< SVMProblem >::MatrixType

Definition at line 140 of file BoxConstrainedProblems.h.

§ PreferedSelectionStrategy

template<class SVMProblem>
typedef MaximumGainCriterion shark::BoxConstrainedProblem< SVMProblem >::PreferedSelectionStrategy

Definition at line 141 of file BoxConstrainedProblems.h.

§ QpFloatType

template<class SVMProblem>
typedef SVMProblem::QpFloatType shark::BoxConstrainedProblem< SVMProblem >::QpFloatType

Definition at line 139 of file BoxConstrainedProblems.h.

Constructor & Destructor Documentation

§ BoxConstrainedProblem()

template<class SVMProblem>
shark::BoxConstrainedProblem< SVMProblem >::BoxConstrainedProblem ( SVMProblem &  problem)
inline

Definition at line 144 of file BoxConstrainedProblems.h.

Member Function Documentation

§ activateVariable()

template<class SVMProblem>
void shark::BoxConstrainedProblem< SVMProblem >::activateVariable ( std::size_t  i)
inline

Reactivate an previously deactivated variable.

Definition at line 288 of file BoxConstrainedProblems.h.

§ active()

template<class SVMProblem>
std::size_t shark::BoxConstrainedProblem< SVMProblem >::active ( ) const
inline

Definition at line 164 of file BoxConstrainedProblems.h.

§ alpha()

template<class SVMProblem>
double shark::BoxConstrainedProblem< SVMProblem >::alpha ( std::size_t  i) const
inline

Definition at line 193 of file BoxConstrainedProblems.h.

§ boxMax()

template<class SVMProblem>
double shark::BoxConstrainedProblem< SVMProblem >::boxMax ( std::size_t  i) const
inline

Definition at line 171 of file BoxConstrainedProblems.h.

§ boxMin()

template<class SVMProblem>
double shark::BoxConstrainedProblem< SVMProblem >::boxMin ( std::size_t  i) const
inline

Definition at line 168 of file BoxConstrainedProblems.h.

§ checkKKT()

template<class SVMProblem>
double shark::BoxConstrainedProblem< SVMProblem >::checkKKT ( ) const
inline

Definition at line 312 of file BoxConstrainedProblems.h.

§ deactivateVariable()

template<class SVMProblem>
virtual void shark::BoxConstrainedProblem< SVMProblem >::deactivateVariable ( std::size_t  i)
inlinevirtual

Remove the i-th example from the problem.

Reimplemented in shark::BoxConstrainedShrinkingProblem< Problem >.

Definition at line 277 of file BoxConstrainedProblems.h.

§ diagonal()

template<class SVMProblem>
double shark::BoxConstrainedProblem< SVMProblem >::diagonal ( std::size_t  i) const
inline

Definition at line 197 of file BoxConstrainedProblems.h.

§ dimensions()

template<class SVMProblem>
std::size_t shark::BoxConstrainedProblem< SVMProblem >::dimensions ( ) const
inline

Definition at line 160 of file BoxConstrainedProblems.h.

§ flipCoordinates()

template<class SVMProblem>
void shark::BoxConstrainedProblem< SVMProblem >::flipCoordinates ( std::size_t  i,
std::size_t  j 
)
inline

exchange two variables via the permutation

Definition at line 294 of file BoxConstrainedProblems.h.

§ functionValue()

template<class SVMProblem>
double shark::BoxConstrainedProblem< SVMProblem >::functionValue ( ) const
inline

Returns the current function value of the problem.

Definition at line 268 of file BoxConstrainedProblems.h.

§ getUnpermutedAlpha()

template<class SVMProblem>
RealVector shark::BoxConstrainedProblem< SVMProblem >::getUnpermutedAlpha ( ) const
inline

Definition at line 209 of file BoxConstrainedProblems.h.

§ gradient()

template<class SVMProblem>
double shark::BoxConstrainedProblem< SVMProblem >::gradient ( std::size_t  i) const
inline

Definition at line 201 of file BoxConstrainedProblems.h.

§ isDeactivated()

template<class SVMProblem>
bool shark::BoxConstrainedProblem< SVMProblem >::isDeactivated ( std::size_t  i) const
inline

Definition at line 180 of file BoxConstrainedProblems.h.

§ isLowerBound()

template<class SVMProblem>
bool shark::BoxConstrainedProblem< SVMProblem >::isLowerBound ( std::size_t  i) const
inline

Definition at line 174 of file BoxConstrainedProblems.h.

§ isUpperBound()

template<class SVMProblem>
bool shark::BoxConstrainedProblem< SVMProblem >::isUpperBound ( std::size_t  i) const
inline

Definition at line 177 of file BoxConstrainedProblems.h.

§ linear()

template<class SVMProblem>
double shark::BoxConstrainedProblem< SVMProblem >::linear ( std::size_t  i) const
inline

Definition at line 189 of file BoxConstrainedProblems.h.

§ permutation()

template<class SVMProblem>
std::size_t shark::BoxConstrainedProblem< SVMProblem >::permutation ( std::size_t  i) const
inline

Definition at line 205 of file BoxConstrainedProblems.h.

§ quadratic()

template<class SVMProblem>
MatrixType& shark::BoxConstrainedProblem< SVMProblem >::quadratic ( )
inline

representation of the quadratic part of the objective function

Definition at line 185 of file BoxConstrainedProblems.h.

§ reshrink()

template<class SVMProblem>
void shark::BoxConstrainedProblem< SVMProblem >::reshrink ( )
inline

Definition at line 273 of file BoxConstrainedProblems.h.

§ setLinear()

template<class SVMProblem>
virtual void shark::BoxConstrainedProblem< SVMProblem >::setLinear ( std::size_t  i,
double  newValue 
)
inlinevirtual

adapts the linear part of the problem and updates the internal data structures accordingly.

Reimplemented in shark::BoxConstrainedShrinkingProblem< Problem >.

Definition at line 306 of file BoxConstrainedProblems.h.

§ shrink()

template<class SVMProblem>
bool shark::BoxConstrainedProblem< SVMProblem >::shrink ( double  )
inline

Definition at line 272 of file BoxConstrainedProblems.h.

§ unshrink()

template<class SVMProblem>
void shark::BoxConstrainedProblem< SVMProblem >::unshrink ( )
inline

Definition at line 274 of file BoxConstrainedProblems.h.

§ updateAlphaStatus()

template<class SVMProblem>
void shark::BoxConstrainedProblem< SVMProblem >::updateAlphaStatus ( std::size_t  i)
inlineprotected

Definition at line 336 of file BoxConstrainedProblems.h.

§ updateSMO()

template<class SVMProblem>
virtual void shark::BoxConstrainedProblem< SVMProblem >::updateSMO ( std::size_t  i,
std::size_t  j 
)
inlinevirtual

Does an update of SMO given a working set with indices i and j.

Reimplemented in shark::BoxConstrainedShrinkingProblem< Problem >.

Definition at line 217 of file BoxConstrainedProblems.h.

Member Data Documentation

§ m_active

template<class SVMProblem>
std::size_t shark::BoxConstrainedProblem< SVMProblem >::m_active
protected

Definition at line 332 of file BoxConstrainedProblems.h.

§ m_alphaStatus

template<class SVMProblem>
std::vector<char> shark::BoxConstrainedProblem< SVMProblem >::m_alphaStatus
protected

Definition at line 334 of file BoxConstrainedProblems.h.

§ m_gradient

template<class SVMProblem>
RealVector shark::BoxConstrainedProblem< SVMProblem >::m_gradient
protected

gradient of the objective function at the current alpha

Definition at line 330 of file BoxConstrainedProblems.h.

§ m_problem

template<class SVMProblem>
SVMProblem& shark::BoxConstrainedProblem< SVMProblem >::m_problem
protected

Definition at line 327 of file BoxConstrainedProblems.h.


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