shark::BoxedSVMProblem< MatrixT > Class Template Reference

Boxed problem for alpha in [lower,upper]^n and equality constraints. More...

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

Public Types

typedef MatrixT MatrixType
 
typedef MatrixType::QpFloatType QpFloatType
 

Public Member Functions

 BoxedSVMProblem (MatrixType &quadratic, RealVector const &linear, double lower, double upper)
 
std::size_t dimensions () const
 
double boxMin (std::size_t i) const
 
double boxMax (std::size_t i) const
 
void flipCoordinates (std::size_t i, std::size_t j)
 exchange two variables via the permutation More...
 
void scaleBoxConstraints (double factor)
 Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor. More...
 

Public Attributes

MatrixTypequadratic
 representation of the quadratic part of the objective function More...
 
RealVector linear
 Linear part of the problem. More...
 
RealVector alpha
 Solution candidate. More...
 
RealVector diagonal
 
std::vector< std::size_t > permutation
 permutation of the variables alpha, gradient, etc. More...
 

Detailed Description

template<class MatrixT>
class shark::BoxedSVMProblem< MatrixT >

Boxed problem for alpha in [lower,upper]^n and equality constraints.

It is assumed for the initial alpha value that there exists a sum to one constraint and lower <= 1/n <= upper

Definition at line 163 of file QpSolver.h.

Member Typedef Documentation

◆ MatrixType

template<class MatrixT >
typedef MatrixT shark::BoxedSVMProblem< MatrixT >::MatrixType

Definition at line 165 of file QpSolver.h.

◆ QpFloatType

template<class MatrixT >
typedef MatrixType::QpFloatType shark::BoxedSVMProblem< MatrixT >::QpFloatType

Definition at line 166 of file QpSolver.h.

Constructor & Destructor Documentation

◆ BoxedSVMProblem()

template<class MatrixT >
shark::BoxedSVMProblem< MatrixT >::BoxedSVMProblem ( MatrixType quadratic,
RealVector const &  linear,
double  lower,
double  upper 
)
inline

Member Function Documentation

◆ boxMax()

template<class MatrixT >
double shark::BoxedSVMProblem< MatrixT >::boxMax ( std::size_t  i) const
inline

Definition at line 194 of file QpSolver.h.

◆ boxMin()

template<class MatrixT >
double shark::BoxedSVMProblem< MatrixT >::boxMin ( std::size_t  i) const
inline

Definition at line 191 of file QpSolver.h.

◆ dimensions()

template<class MatrixT >
std::size_t shark::BoxedSVMProblem< MatrixT >::dimensions ( ) const
inline

Definition at line 187 of file QpSolver.h.

References shark::GeneralQuadraticProblem< MatrixT >::quadratic.

◆ flipCoordinates()

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

exchange two variables via the permutation

Definition at line 212 of file QpSolver.h.

References shark::GeneralQuadraticProblem< MatrixT >::permutation, and shark::swap().

◆ scaleBoxConstraints()

template<class MatrixT >
void shark::BoxedSVMProblem< MatrixT >::scaleBoxConstraints ( double  factor)
inline

Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor.

Definition at line 225 of file QpSolver.h.

Member Data Documentation

◆ alpha

template<class MatrixT >
RealVector shark::BoxedSVMProblem< MatrixT >::alpha

Solution candidate.

Definition at line 205 of file QpSolver.h.

◆ diagonal

template<class MatrixT >
RealVector shark::BoxedSVMProblem< MatrixT >::diagonal

diagonal matrix entries The diagonal array is of fixed size and not subject to shrinking.

Definition at line 209 of file QpSolver.h.

◆ linear

template<class MatrixT >
RealVector shark::BoxedSVMProblem< MatrixT >::linear

Linear part of the problem.

Definition at line 202 of file QpSolver.h.

◆ permutation

template<class MatrixT >
std::vector<std::size_t> shark::BoxedSVMProblem< MatrixT >::permutation

permutation of the variables alpha, gradient, etc.

Definition at line 232 of file QpSolver.h.

◆ quadratic

template<class MatrixT >
MatrixType& shark::BoxedSVMProblem< MatrixT >::quadratic

representation of the quadratic part of the objective function

Definition at line 199 of file QpSolver.h.


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