Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Solver Class Reference
Inheritance diagram for Solver:
Inheritance graph
[legend]

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
 
char * alpha_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 382 of file Svm.cc.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
LOWER_BOUND 
UPPER_BOUND 
FREE 

Definition at line 402 of file Svm.cc.

Constructor & Destructor Documentation

Solver::Solver ( )
inline

Definition at line 384 of file Svm.cc.

virtual Solver::~Solver ( )
inlinevirtual

Definition at line 385 of file Svm.cc.

Member Function Documentation

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

Definition at line 856 of file Svm.cc.

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

Referenced by do_shrinking().

double Solver::calculate_rho ( )
protectedvirtual

Reimplemented in Solver_NU.

Definition at line 930 of file Svm.cc.

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

Referenced by Solve().

void Solver::do_shrinking ( )
protectedvirtual

Reimplemented in Solver_NU.

Definition at line 875 of file Svm.cc.

References active_size, be_shrunk(), eps, G, INF, info(), is_lower_bound(), is_upper_bound(), l, reconstruct_gradient(), swap_index(), unshrink, and y.

Referenced by Solve().

double Solver::get_C ( int  i)
inlineprotected

Definition at line 415 of file Svm.cc.

References Cn, Cp, and y.

Referenced by Solve(), and update_alpha_status().

bool Solver::is_free ( int  i)
inlineprotected

Definition at line 429 of file Svm.cc.

References alpha_status, and FREE.

Referenced by reconstruct_gradient().

bool Solver::is_lower_bound ( int  i)
inlineprotected
bool Solver::is_upper_bound ( int  i)
inlineprotected
void Solver::reconstruct_gradient ( )
protected

Definition at line 451 of file Svm.cc.

References active_size, alpha, G, G_bar, QMatrix::get_Q(), info(), is_free(), l, p, and Q.

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

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

Reimplemented in Solver_NU.

Definition at line 763 of file Svm.cc.

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

Referenced by Solve().

void 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 
)
void Solver::swap_index ( int  i,
int  j 
)
protected

Definition at line 439 of file Svm.cc.

References active_set, alpha, alpha_status, G, G_bar, p, Q, swap(), QMatrix::swap_index(), and y.

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

void Solver::update_alpha_status ( int  i)
inlineprotected

Definition at line 419 of file Svm.cc.

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

Referenced by Solve().

Member Data Documentation

int* Solver::active_set
protected

Definition at line 410 of file Svm.cc.

Referenced by Solve(), and swap_index().

int Solver::active_size
protected
double* Solver::alpha
protected

Definition at line 404 of file Svm.cc.

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

char* Solver::alpha_status
protected

Definition at line 403 of file Svm.cc.

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

double Solver::Cn
protected

Definition at line 408 of file Svm.cc.

Referenced by get_C(), and Solve().

double Solver::Cp
protected

Definition at line 408 of file Svm.cc.

Referenced by get_C(), and Solve().

double Solver::eps
protected
double* Solver::G
protected
double* Solver::G_bar
protected

Definition at line 411 of file Svm.cc.

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

int Solver::l
protected

Definition at line 412 of file Svm.cc.

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

double* Solver::p
protected

Definition at line 409 of file Svm.cc.

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

const QMatrix* Solver::Q
protected
const double* Solver::QD
protected

Definition at line 406 of file Svm.cc.

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

bool Solver::unshrink
protected

Definition at line 413 of file Svm.cc.

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

schar* Solver::y
protected

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