shark::GeneralQuadraticProblem< MatrixT > Class Template Reference

Quadratic Problem with only Box-Constraints Let K the kernel matrix, than the problem has the form. More...

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

## Public Types

typedef MatrixT MatrixType

typedef MatrixType::QpFloatType QpFloatType

## Public Member Functions

GeneralQuadraticProblem (MatrixType &quadratic, Data< unsigned int > const &labels, Data< double > const &weights, RealVector const &regularizers)
constructor which initializes a C-SVM problem with weighted datapoints and different regularizers for every class More...

std::size_t dimensions () 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

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

RealVector boxMin
component-wise lower bound More...

RealVector boxMax
component-wise upper bound More...

## Detailed Description

### template<class MatrixT> class shark::GeneralQuadraticProblem< MatrixT >

Quadratic Problem with only Box-Constraints Let K the kernel matrix, than the problem has the form.

max_ - 1/2 ^T K + ^Tv under constraints: l_i <= <= u_i

Definition at line 52 of file QpSolver.h.

## ◆ MatrixType

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

Definition at line 54 of file QpSolver.h.

## ◆ QpFloatType

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

Definition at line 55 of file QpSolver.h.

## ◆ GeneralQuadraticProblem() [1/2]

template<class MatrixT>
inline

Definition at line 58 of file QpSolver.h.

## ◆ GeneralQuadraticProblem() [2/2]

template<class MatrixT>
 shark::GeneralQuadraticProblem< MatrixT >::GeneralQuadraticProblem ( MatrixType & quadratic, Data< unsigned int > const & labels, Data< double > const & weights, RealVector const & regularizers )
inline

constructor which initializes a C-SVM problem with weighted datapoints and different regularizers for every class

Definition at line 74 of file QpSolver.h.

## ◆ dimensions()

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

## ◆ flipCoordinates()

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

exchange two variables via the permutation

Definition at line 115 of file QpSolver.h.

## ◆ scaleBoxConstraints()

template<class MatrixT>
 void shark::GeneralQuadraticProblem< 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 130 of file QpSolver.h.

## ◆ alpha

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

Solution candidate.

Definition at line 143 of file QpSolver.h.

## ◆ boxMax

template<class MatrixT>
 RealVector shark::GeneralQuadraticProblem< MatrixT >::boxMax

component-wise upper bound

Definition at line 156 of file QpSolver.h.

## ◆ boxMin

template<class MatrixT>
 RealVector shark::GeneralQuadraticProblem< MatrixT >::boxMin

component-wise lower bound

Definition at line 153 of file QpSolver.h.

## ◆ diagonal

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

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

Definition at line 147 of file QpSolver.h.

## ◆ linear

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

Linear part of the problem.

Definition at line 140 of file QpSolver.h.

## ◆ permutation

template<class MatrixT>
 std::vector shark::GeneralQuadraticProblem< MatrixT >::permutation

permutation of the variables alpha, gradient, etc.

Definition at line 150 of file QpSolver.h.