Hugin trunk 0.1
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
celeste::Solver Class Reference
Inheritance diagram for celeste::Solver:
Inheritance graph

Classes

struct  SolutionInfo
 

Public Member Functions

 Solver ()
 
virtual ~Solver ()
 
void Solve (int l, const QMatrix &Q, const double *p_, const schar *y_, double *alpha_, double Cp, double Cn, double eps, SolutionInfo *si, int shrinking)
 

Protected Types

enum  { LOWER_BOUND , UPPER_BOUND , FREE }
 

Protected Member Functions

double get_C (int i)
 
void update_alpha_status (int i)
 
bool is_upper_bound (int i)
 
bool is_lower_bound (int i)
 
bool is_free (int i)
 
void swap_index (int i, int j)
 
void reconstruct_gradient ()
 
virtual int select_working_set (int &i, int &j)
 
virtual double calculate_rho ()
 
virtual void do_shrinking ()
 

Protected Attributes

int active_size
 
schary
 
doubleG
 
charalpha_status
 
doublealpha
 
const QMatrixQ
 
const doubleQD
 
double eps
 
double Cp
 
double Cn
 
doublep
 
intactive_set
 
doubleG_bar
 
int l
 
bool unshrink
 

Private Member Functions

bool be_shrunk (int i, double Gmax1, double Gmax2)
 

Detailed Description

Definition at line 440 of file svm.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
LOWER_BOUND 
UPPER_BOUND 
FREE 

Definition at line 460 of file svm.cpp.

Constructor & Destructor Documentation

◆ Solver()

celeste::Solver::Solver ( )
inline

Definition at line 442 of file svm.cpp.

◆ ~Solver()

virtual celeste::Solver::~Solver ( )
inlinevirtual

Definition at line 443 of file svm.cpp.

Member Function Documentation

◆ be_shrunk()

bool celeste::Solver::be_shrunk ( int  i,
double  Gmax1,
double  Gmax2 
)
private

Definition at line 932 of file svm.cpp.

References G, is_lower_bound(), is_upper_bound(), threshold(), and y.

Referenced by do_shrinking().

◆ calculate_rho()

double celeste::Solver::calculate_rho ( )
protectedvirtual

Reimplemented in celeste::Solver_NU.

Definition at line 1013 of file svm.cpp.

References active_size, G, INF, is_lower_bound(), is_upper_bound(), celeste::max(), celeste::min(), threshold(), and y.

Referenced by Solve().

◆ do_shrinking()

void celeste::Solver::do_shrinking ( )
protectedvirtual

◆ get_C()

double celeste::Solver::get_C ( int  i)
inlineprotected

Definition at line 473 of file svm.cpp.

References Cn, Cp, threshold(), and y.

Referenced by Solve(), and update_alpha_status().

◆ is_free()

bool celeste::Solver::is_free ( int  i)
inlineprotected

Definition at line 487 of file svm.cpp.

References alpha_status, FREE, and threshold().

Referenced by reconstruct_gradient().

◆ is_lower_bound()

bool celeste::Solver::is_lower_bound ( int  i)
inlineprotected

◆ is_upper_bound()

bool celeste::Solver::is_upper_bound ( int  i)
inlineprotected

◆ reconstruct_gradient()

void celeste::Solver::reconstruct_gradient ( )
protected

◆ select_working_set()

int celeste::Solver::select_working_set ( int i,
int j 
)
protectedvirtual

Reimplemented in celeste::Solver_NU.

Definition at line 833 of file svm.cpp.

References active_size, eps, G, celeste::QMatrix::get_Q(), INF, is_lower_bound(), is_upper_bound(), Q, QD, TAU, threshold(), and y.

Referenced by Solve().

◆ Solve()

void celeste::Solver::Solve ( int  l,
const QMatrix Q,
const double p_,
const schar y_,
double alpha_,
double  Cp,
double  Cn,
double  eps,
SolutionInfo si,
int  shrinking 
)

◆ swap_index()

void celeste::Solver::swap_index ( int  i,
int  j 
)
protected

◆ update_alpha_status()

void celeste::Solver::update_alpha_status ( int  i)
inlineprotected

Definition at line 477 of file svm.cpp.

References alpha, alpha_status, FREE, get_C(), LOWER_BOUND, threshold(), and UPPER_BOUND.

Referenced by Solve().

Member Data Documentation

◆ active_set

int* celeste::Solver::active_set
protected

Definition at line 468 of file svm.cpp.

Referenced by Solve(), and swap_index().

◆ active_size

int celeste::Solver::active_size
protected

◆ alpha

double* celeste::Solver::alpha
protected

◆ alpha_status

char* celeste::Solver::alpha_status
protected

Definition at line 461 of file svm.cpp.

Referenced by is_free(), is_lower_bound(), is_upper_bound(), Solve(), swap_index(), and update_alpha_status().

◆ Cn

double celeste::Solver::Cn
protected

Definition at line 466 of file svm.cpp.

Referenced by get_C(), celeste::Solver_NU::Solve(), and Solve().

◆ Cp

double celeste::Solver::Cp
protected

Definition at line 466 of file svm.cpp.

Referenced by get_C(), celeste::Solver_NU::Solve(), and Solve().

◆ eps

double celeste::Solver::eps
protected

◆ G

double* celeste::Solver::G
protected

◆ G_bar

double* celeste::Solver::G_bar
protected

Definition at line 469 of file svm.cpp.

Referenced by reconstruct_gradient(), Solve(), and swap_index().

◆ l

int celeste::Solver::l
protected

◆ p

double* celeste::Solver::p
protected

Definition at line 467 of file svm.cpp.

Referenced by reconstruct_gradient(), celeste::Solver_NU::Solve(), Solve(), and swap_index().

◆ Q

const QMatrix* celeste::Solver::Q
protected

◆ QD

const double* celeste::Solver::QD
protected

Definition at line 464 of file svm.cpp.

Referenced by select_working_set(), celeste::Solver_NU::select_working_set(), and Solve().

◆ unshrink

bool celeste::Solver::unshrink
protected

Definition at line 471 of file svm.cpp.

Referenced by do_shrinking(), celeste::Solver_NU::do_shrinking(), and Solve().

◆ y

schar* celeste::Solver::y
protected

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