

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 |
| schar * | y |
| double * | G |
| char * | alpha_status |
| double * | alpha |
| const QMatrix * | Q |
| const double * | QD |
| double | eps |
| double | Cp |
| double | Cn |
| double * | p |
| int * | active_set |
| double * | G_bar |
| int | l |
| bool | unshrink |
Private Member Functions | |
| bool | be_shrunk (int i, double Gmax1, double Gmax2) |
Definition at line 393 of file libsvm.cpp.
anonymous enum [protected] |
Definition at line 413 of file libsvm.cpp.
| Solver::Solver | ( | ) | [inline] |
Definition at line 395 of file libsvm.cpp.
| virtual Solver::~Solver | ( | ) | [inline, virtual] |
Definition at line 396 of file libsvm.cpp.
| bool Solver::be_shrunk | ( | int | i, |
| double | Gmax1, | ||
| double | Gmax2 | ||
| ) | [private] |
Definition at line 872 of file libsvm.cpp.
References G, is_lower_bound(), is_upper_bound(), and y.
Referenced by do_shrinking().
| double Solver::calculate_rho | ( | ) | [protected, virtual] |
Reimplemented in Solver_NU.
Definition at line 953 of file libsvm.cpp.
References active_size, G, INF, is_lower_bound(), is_upper_bound(), max(), min(), and y.
Referenced by Solve().
| void Solver::do_shrinking | ( | ) | [protected, virtual] |
Reimplemented in Solver_NU.
Definition at line 892 of file libsvm.cpp.
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 ) | [inline, protected] |
Definition at line 426 of file libsvm.cpp.
Referenced by Solve(), and update_alpha_status().
| bool Solver::is_free | ( | int | i ) | [inline, protected] |
Definition at line 440 of file libsvm.cpp.
References alpha_status, and FREE.
Referenced by reconstruct_gradient().
| bool Solver::is_lower_bound | ( | int | i ) | [inline, protected] |
Definition at line 439 of file libsvm.cpp.
References alpha_status, and LOWER_BOUND.
Referenced by Solver_NU::be_shrunk(), be_shrunk(), Solver_NU::calculate_rho(), calculate_rho(), Solver_NU::do_shrinking(), do_shrinking(), Solver_NU::select_working_set(), select_working_set(), and Solve().
| bool Solver::is_upper_bound | ( | int | i ) | [inline, protected] |
Definition at line 438 of file libsvm.cpp.
References alpha_status, and UPPER_BOUND.
Referenced by Solver_NU::be_shrunk(), be_shrunk(), Solver_NU::calculate_rho(), calculate_rho(), Solver_NU::do_shrinking(), do_shrinking(), Solver_NU::select_working_set(), select_working_set(), and Solve().
| void Solver::reconstruct_gradient | ( | ) | [protected] |
Definition at line 462 of file libsvm.cpp.
References active_size, alpha, G, G_bar, QMatrix::get_Q(), info(), is_free(), l, p, and Q.
Referenced by Solver_NU::do_shrinking(), do_shrinking(), and Solve().
| int Solver::select_working_set | ( | int & | i, |
| int & | j | ||
| ) | [protected, virtual] |
Reimplemented in Solver_NU.
Definition at line 773 of file libsvm.cpp.
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 | ||
| ) |
Reimplemented in Solver_NU.
Definition at line 504 of file libsvm.cpp.
References active_set, active_size, alpha, alpha_status, calculate_rho(), clone(), Cn, Cp, do_shrinking(), eps, G, G_bar, get_C(), QMatrix::get_Q(), QMatrix::get_QD(), info(), is_lower_bound(), is_upper_bound(), l, min(), Solver::SolutionInfo::obj, p, Q, QD, reconstruct_gradient(), Solver::SolutionInfo::rho, select_working_set(), TAU, unshrink, update_alpha_status(), Solver::SolutionInfo::upper_bound_n, Solver::SolutionInfo::upper_bound_p, and y.
Referenced by solve_c_svc(), solve_epsilon_svr(), and solve_one_class().
| void Solver::swap_index | ( | int | i, |
| int | j | ||
| ) | [protected] |
Definition at line 450 of file libsvm.cpp.
References active_set, alpha, alpha_status, G, G_bar, p, Q, swap(), QMatrix::swap_index(), and y.
Referenced by Solver_NU::do_shrinking(), and do_shrinking().
| void Solver::update_alpha_status | ( | int | i ) | [inline, protected] |
Definition at line 430 of file libsvm.cpp.
References alpha, alpha_status, FREE, get_C(), LOWER_BOUND, and UPPER_BOUND.
Referenced by Solve().
int* Solver::active_set [protected] |
Definition at line 421 of file libsvm.cpp.
Referenced by Solve(), and swap_index().
int Solver::active_size [protected] |
Definition at line 410 of file libsvm.cpp.
Referenced by Solver_NU::calculate_rho(), calculate_rho(), Solver_NU::do_shrinking(), do_shrinking(), reconstruct_gradient(), Solver_NU::select_working_set(), select_working_set(), and Solve().
double* Solver::alpha [protected] |
Definition at line 415 of file libsvm.cpp.
Referenced by reconstruct_gradient(), Solve(), swap_index(), and update_alpha_status().
char* Solver::alpha_status [protected] |
Definition at line 414 of file libsvm.cpp.
Referenced by is_free(), is_lower_bound(), is_upper_bound(), Solve(), swap_index(), and update_alpha_status().
double Solver::Cn [protected] |
Definition at line 419 of file libsvm.cpp.
double Solver::Cp [protected] |
Definition at line 419 of file libsvm.cpp.
double Solver::eps [protected] |
Definition at line 418 of file libsvm.cpp.
Referenced by Solver_NU::do_shrinking(), do_shrinking(), Solver_NU::select_working_set(), select_working_set(), and Solve().
double* Solver::G [protected] |
Definition at line 412 of file libsvm.cpp.
Referenced by Solver_NU::be_shrunk(), be_shrunk(), Solver_NU::calculate_rho(), calculate_rho(), Solver_NU::do_shrinking(), do_shrinking(), reconstruct_gradient(), Solver_NU::select_working_set(), select_working_set(), Solve(), and swap_index().
double* Solver::G_bar [protected] |
Definition at line 422 of file libsvm.cpp.
Referenced by reconstruct_gradient(), Solve(), and swap_index().
int Solver::l [protected] |
Definition at line 423 of file libsvm.cpp.
Referenced by Solver_NU::do_shrinking(), do_shrinking(), reconstruct_gradient(), and Solve().
double* Solver::p [protected] |
Definition at line 420 of file libsvm.cpp.
Referenced by reconstruct_gradient(), Solve(), and swap_index().
Definition at line 416 of file libsvm.cpp.
Referenced by reconstruct_gradient(), Solver_NU::select_working_set(), select_working_set(), Solve(), and swap_index().
const double* Solver::QD [protected] |
Definition at line 417 of file libsvm.cpp.
Referenced by Solver_NU::select_working_set(), select_working_set(), and Solve().
bool Solver::unshrink [protected] |
Definition at line 424 of file libsvm.cpp.
Referenced by Solver_NU::do_shrinking(), do_shrinking(), and Solve().
Definition at line 411 of file libsvm.cpp.
Referenced by Solver_NU::be_shrunk(), be_shrunk(), Solver_NU::calculate_rho(), calculate_rho(), Solver_NU::do_shrinking(), do_shrinking(), get_C(), Solver_NU::select_working_set(), select_working_set(), Solve(), and swap_index().
1.7.2