Takes q boxx constrained QP-type problem and implements shrinking on it. More...
#include <shark/Algorithms/QP/BoxBasedShrinkingStrategy.h>
Public Types | |
typedef Problem::QpFloatType | QpFloatType |
typedef Problem::MatrixType | MatrixType |
typedef Problem::PreferedSelectionStrategy | PreferedSelectionStrategy |
Public Member Functions | |
template<class ProblemT > | |
BoxBasedShrinkingStrategy (ProblemT &problem, bool shrink=true) | |
virtual void | updateSMO (std::size_t i, std::size_t j) |
bool | shrink (double epsilon) |
void | unshrink () |
Unshrink the problem. More... | |
void | setShrinking (bool shrinking) |
void | setInitialSolution (RealVector const &alpha, RealVector const &gradient, RealVector const &gradientEdge) |
Define the initial solution for the iterative solver. More... | |
void | setInitialSolution (RealVector const &alpha) |
Define the initial solution for the iterative solver. More... | |
void | deactivateVariable (std::size_t i) |
Remove the i-th example from the problem. More... | |
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 | 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... | |
Takes q boxx constrained QP-type problem and implements shrinking on it.
Given a QP-type-Problem, implements a strategy which allows to efficiently shrink and unshrink the problem. If a value of the QP has an active box constraint, it is shrinked from the problem when currently there is no possible step using that variable that leads to a gain. This is problem dependent as this might involve consideration of additional constraints. Therefore, every Problem must implement the method testShrinkVariable.
Definition at line 47 of file BoxBasedShrinkingStrategy.h.
typedef Problem::MatrixType shark::BoxBasedShrinkingStrategy< Problem >::MatrixType |
Definition at line 50 of file BoxBasedShrinkingStrategy.h.
typedef Problem::PreferedSelectionStrategy shark::BoxBasedShrinkingStrategy< Problem >::PreferedSelectionStrategy |
Definition at line 51 of file BoxBasedShrinkingStrategy.h.
typedef Problem::QpFloatType shark::BoxBasedShrinkingStrategy< Problem >::QpFloatType |
Definition at line 49 of file BoxBasedShrinkingStrategy.h.
|
inline |
Definition at line 54 of file BoxBasedShrinkingStrategy.h.
|
inline |
Remove the i-th example from the problem.
Definition at line 189 of file BoxBasedShrinkingStrategy.h.
|
inline |
swap indizes (i,j)
Definition at line 222 of file BoxBasedShrinkingStrategy.h.
|
inline |
Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor.
Definition at line 198 of file BoxBasedShrinkingStrategy.h.
|
inline |
Define the initial solution for the iterative solver.
This method can be used to warm-start the solver. It requires a feasible solution (alpha) and the corresponding gradient of the dual objective function.
Definition at line 151 of file BoxBasedShrinkingStrategy.h.
|
inline |
Define the initial solution for the iterative solver.
This method can be used to warm-start the solver. It requires a feasible solution (alpha), for which it computes the gradient of the dual objective function. Note that this is a quadratic time operation in the number of non-zero coefficients.
Definition at line 167 of file BoxBasedShrinkingStrategy.h.
|
inlinevirtual |
adapts the linear part of the problem and updates the internal data structures accordingly.
Definition at line 215 of file BoxBasedShrinkingStrategy.h.
|
inline |
Definition at line 140 of file BoxBasedShrinkingStrategy.h.
|
inline |
Definition at line 86 of file BoxBasedShrinkingStrategy.h.
|
inline |
Unshrink the problem.
Definition at line 114 of file BoxBasedShrinkingStrategy.h.
Referenced by shark::BoxBasedShrinkingStrategy< BoxConstrainedProblem< Problem > >::setShrinking(), and shark::BoxBasedShrinkingStrategy< BoxConstrainedProblem< Problem > >::shrink().
|
inlinevirtual |
Definition at line 73 of file BoxBasedShrinkingStrategy.h.