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
 
void scaleBoxConstraints (double factor)
 Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor.
 

Public Attributes

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

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

◆ flipCoordinates()

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

◆ 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.

References shark::BoxedSVMProblem< MatrixT >::alpha.

Member Data Documentation

◆ alpha

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

◆ 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.

Referenced by shark::BoxedSVMProblem< MatrixT >::BoxedSVMProblem(), and shark::BoxedSVMProblem< MatrixT >::flipCoordinates().

◆ linear

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

Linear part of the problem.

Definition at line 202 of file QpSolver.h.

Referenced by shark::BoxedSVMProblem< MatrixT >::BoxedSVMProblem(), and shark::BoxedSVMProblem< MatrixT >::flipCoordinates().

◆ 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.

Referenced by shark::BoxedSVMProblem< MatrixT >::BoxedSVMProblem(), and shark::BoxedSVMProblem< MatrixT >::flipCoordinates().

◆ 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.

Referenced by shark::BoxedSVMProblem< MatrixT >::BoxedSVMProblem(), shark::BoxedSVMProblem< MatrixT >::dimensions(), and shark::BoxedSVMProblem< MatrixT >::flipCoordinates().


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