#include <shark/Algorithms/QP/BoxConstrainedProblems.h>
Public Types | |
typedef base_type::QpFloatType | QpFloatType |
typedef base_type::MatrixType | MatrixType |
typedef base_type::PreferedSelectionStrategy | PreferedSelectionStrategy |
![]() | |
typedef Problem ::QpFloatType | QpFloatType |
typedef Problem ::MatrixType | MatrixType |
typedef MaximumGainCriterion | PreferedSelectionStrategy |
Public Member Functions | |
BoxConstrainedShrinkingProblem (Problem &problem, bool shrink=true) | |
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... | |
bool | shrink (double epsilon) |
void | unshrink () |
Unshrink the problem. More... | |
void | setShrinking (bool shrinking) |
void | scaleBoxConstraints (double factor, double variableScalingFactor) |
Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor. More... | |
virtual void | deactivateVariable (std::size_t i) |
Remove the i-th example from the problem. 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... | |
void | flipCoordinates (std::size_t i, std::size_t j) |
swap indizes (i,j) More... | |
![]() | |
BoxConstrainedProblem (Problem &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 |
MatrixType & | quadratic () |
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 |
double | functionValue () const |
Returns the current function value of the problem. More... | |
bool | shrink (double) |
void | reshrink () |
void | unshrink () |
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... | |
double | checkKKT () const |
Protected Member Functions | |
void | updateGradientEdge (std::size_t i, double oldAlpha, double newAlpha) |
Updates the edge-part of the gradient when an alpha valu was changed. More... | |
![]() | |
void | updateAlphaStatus (std::size_t i) |
Additional Inherited Members | |
![]() | |
Problem & | 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 |
Definition at line 349 of file BoxConstrainedProblems.h.
typedef base_type::MatrixType shark::BoxConstrainedShrinkingProblem< Problem >::MatrixType |
Definition at line 354 of file BoxConstrainedProblems.h.
typedef base_type::PreferedSelectionStrategy shark::BoxConstrainedShrinkingProblem< Problem >::PreferedSelectionStrategy |
Definition at line 355 of file BoxConstrainedProblems.h.
typedef base_type::QpFloatType shark::BoxConstrainedShrinkingProblem< Problem >::QpFloatType |
Definition at line 353 of file BoxConstrainedProblems.h.
|
inline |
Definition at line 357 of file BoxConstrainedProblems.h.
|
inlinevirtual |
Remove the i-th example from the problem.
Reimplemented from shark::BoxConstrainedProblem< Problem >.
Definition at line 464 of file BoxConstrainedProblems.h.
References SIZE_CHECK.
|
inline |
swap indizes (i,j)
Definition at line 479 of file BoxConstrainedProblems.h.
References shark::swap().
|
inline |
Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor.
Definition at line 448 of file BoxConstrainedProblems.h.
|
inlinevirtual |
adapts the linear part of the problem and updates the internal data structures accordingly.
Reimplemented from shark::BoxConstrainedProblem< Problem >.
Definition at line 472 of file BoxConstrainedProblems.h.
|
inline |
Definition at line 441 of file BoxConstrainedProblems.h.
|
inline |
Definition at line 387 of file BoxConstrainedProblems.h.
References shark::blas::max(), and shark::blas::min().
|
inline |
Unshrink the problem.
Definition at line 414 of file BoxConstrainedProblems.h.
|
inlineprotected |
Updates the edge-part of the gradient when an alpha valu was changed.
This function overwite the base class method and is called, whenever the base class changes an alpha value.
Definition at line 488 of file BoxConstrainedProblems.h.
References shark::blas::max(), shark::blas::min(), and SIZE_CHECK.
|
inlinevirtual |
Does an update of SMO given a working set with indices i and j.
Reimplemented from shark::BoxConstrainedProblem< Problem >.
Definition at line 374 of file BoxConstrainedProblems.h.