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

MatrixType & quadratic
 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.
 
RealVector boxMin
 component-wise lower bound
 
RealVector boxMax
 component-wise upper bound
 

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_\alpha - 1/2 \alpha^T K \alpha + \alpha^Tv\) under constraints: \(l_i <= \alpha_i <= u_i\)

Definition at line 52 of file QpSolver.h.

Member Typedef Documentation

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

Constructor & Destructor Documentation

◆ GeneralQuadraticProblem() [1/2]

◆ 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

Member Function Documentation

◆ dimensions()

◆ flipCoordinates()

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

References shark::GeneralQuadraticProblem< MatrixT >::alpha, shark::GeneralQuadraticProblem< MatrixT >::boxMax, and shark::GeneralQuadraticProblem< MatrixT >::boxMin.

Member Data Documentation

◆ alpha

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

◆ boxMax

◆ boxMin

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

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

◆ linear

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

◆ permutation

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

◆ quadratic


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