KSquare Utilities
SVM233::Solver Class Reference
+ Inheritance diagram for SVM233::Solver:

Classes

struct  SolutionInfo
 

Public Member Functions

 Solver ()
 
virtual ~Solver ()
 
void Solve (kkint32 l, const Kernel &Q, const double *b_, const schar *y_, double *alpha_, double Cp, double Cn, double eps, SolutionInfo *si, kkint32 shrinking)
 
void Solve (kkint32 l, const Kernel &Q, const double *b_, const schar *y_, double *alpha_, double *C_, double eps, SolutionInfo *si, kkint32 shrinking)
 

Protected Types

enum  { LOWER_BOUND, UPPER_BOUND, FREE }
 

Protected Member Functions

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

Protected Attributes

kkint32active_set
 
kkint32 active_size
 
double * alpha
 
char * alpha_status
 
double * b
 
double * C
 
double eps
 
double * G
 
double * G_bar
 
kkint32 l
 
const KernelQ
 
bool unshrinked
 
schary
 

Detailed Description

Definition at line 532 of file svm.cpp.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
LOWER_BOUND 
UPPER_BOUND 
FREE 

Definition at line 573 of file svm.cpp.

Constructor & Destructor Documentation

SVM233::Solver::Solver ( )
inline

Definition at line 535 of file svm.cpp.

535 {};
virtual SVM233::Solver::~Solver ( )
inlinevirtual

Definition at line 536 of file svm.cpp.

536 {};

Member Function Documentation

double SVM233::Solver::calculate_rho ( )
protectedvirtual

Definition at line 2348 of file svm.cpp.

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

Referenced by Solve().

2349 {
2350  double r;
2351  kkint32 nr_free = 0;
2352  double ub = INF, lb = -INF, sum_free = 0;
2353  for (kkint32 i = 0; i < active_size; i++)
2354  {
2355  double yG = y[i]*G[i];
2356 
2357  if(is_lower_bound(i))
2358  {
2359  if(y[i] > 0)
2360  ub = min(ub,yG);
2361  else
2362  lb = max(lb,yG);
2363  }
2364  else if(is_upper_bound(i))
2365  {
2366  if(y[i] < 0)
2367  ub = min(ub,yG);
2368  else
2369  lb = max(lb,yG);
2370  }
2371  else
2372  {
2373  ++nr_free;
2374  sum_free += yG;
2375  }
2376  }
2377 
2378  if(nr_free>0)
2379  r = sum_free/nr_free;
2380  else
2381  r = (ub+lb)/2;
2382 
2383  return r;
2384 }
T max(T x, T y)
Definition: svm.cpp:680
__int32 kkint32
Definition: KKBaseTypes.h:88
double * G
Definition: svm.cpp:572
bool is_upper_bound(kkint32 i)
Definition: svm.cpp:601
#define INF
Definition: svm.cpp:698
kkint32 active_size
Definition: svm.cpp:570
bool is_lower_bound(kkint32 i)
Definition: svm.cpp:602
schar * y
Definition: svm.cpp:571
T min(T x, T y)
Definition: svm.cpp:676
void SVM233::Solver::do_shrinking ( )
protectedvirtual

Definition at line 2276 of file svm.cpp.

References active_size, eps, G, is_lower_bound(), is_upper_bound(), l, reconstruct_gradient(), select_working_set(), swap_index(), unshrinked, and y.

Referenced by Solve().

2277 {
2278  kkint32 i,j,k;
2279  if (select_working_set (i,j) != 0)
2280  return;
2281 
2282  double Gm1 = -y[j]*G[j];
2283  double Gm2 = y[i]*G[i];
2284 
2285  // shrink
2286 
2287  for (k = 0; k < active_size; k++)
2288  {
2289  if (is_lower_bound (k))
2290  {
2291  if (y[k]==+1)
2292  {
2293  if(-G[k] >= Gm1) continue;
2294  }
2295  else if (-G[k] >= Gm2) continue;
2296  }
2297  else if (is_upper_bound(k))
2298  {
2299  if(y[k]==+1)
2300  {
2301  if(G[k] >= Gm2) continue;
2302  }
2303  else if(G[k] >= Gm1) continue;
2304  }
2305  else continue;
2306 
2307  --active_size;
2308  swap_index(k,active_size);
2309  --k; // look at the newcomer
2310  }
2311 
2312  // unshrink, check all variables again before final iterations
2313 
2314  if(unshrinked || -(Gm1 + Gm2) > eps*10) return;
2315 
2316  unshrinked = true;
2318 
2319  for(k=l-1;k>=active_size;k--)
2320  {
2321  if(is_lower_bound(k))
2322  {
2323  if(y[k]==+1)
2324  {
2325  if(-G[k] < Gm1) continue;
2326  }
2327  else if(-G[k] < Gm2) continue;
2328  }
2329  else if(is_upper_bound(k))
2330  {
2331  if(y[k]==+1)
2332  {
2333  if(G[k] < Gm2) continue;
2334  }
2335  else if(G[k] < Gm1) continue;
2336  }
2337  else continue;
2338 
2339  swap_index(k,active_size);
2340  active_size++;
2341  ++k; // look at the newcomer
2342  }
2343 }
kkint32 l
Definition: svm.cpp:582
__int32 kkint32
Definition: KKBaseTypes.h:88
double * G
Definition: svm.cpp:572
bool is_upper_bound(kkint32 i)
Definition: svm.cpp:601
void swap_index(kkint32 i, kkint32 j)
Definition: svm.cpp:1881
virtual kkint32 select_working_set(kkint32 &i, kkint32 &j)
Definition: svm.cpp:2212
double eps
Definition: svm.cpp:577
kkint32 active_size
Definition: svm.cpp:570
bool is_lower_bound(kkint32 i)
Definition: svm.cpp:602
schar * y
Definition: svm.cpp:571
bool unshrinked
Definition: svm.cpp:583
void reconstruct_gradient()
Definition: svm.cpp:1897
double SVM233::Solver::get_C ( kkint32  i)
inlineprotected

Definition at line 585 of file svm.cpp.

References C.

Referenced by Solve(), and update_alpha_status().

586  {
587  return C[i];
588  }
double * C
Definition: svm.cpp:578
bool SVM233::Solver::is_free ( kkint32  i)
inlineprotected

Definition at line 603 of file svm.cpp.

References alpha_status, and FREE.

Referenced by reconstruct_gradient().

603 { return alpha_status[i] == FREE; }
char * alpha_status
Definition: svm.cpp:574
bool SVM233::Solver::is_lower_bound ( kkint32  i)
inlineprotected

Definition at line 602 of file svm.cpp.

References alpha_status, and LOWER_BOUND.

Referenced by calculate_rho(), do_shrinking(), select_working_set(), and Solve().

602 { return alpha_status[i] == LOWER_BOUND; }
char * alpha_status
Definition: svm.cpp:574
bool SVM233::Solver::is_upper_bound ( kkint32  i)
inlineprotected

Definition at line 601 of file svm.cpp.

References alpha_status, and UPPER_BOUND.

Referenced by calculate_rho(), do_shrinking(), select_working_set(), and Solve().

601 { return alpha_status[i] == UPPER_BOUND; }
char * alpha_status
Definition: svm.cpp:574
void SVM233::Solver::reconstruct_gradient ( )
protected

Definition at line 1897 of file svm.cpp.

References active_size, alpha, b, G, G_bar, SVM233::Kernel::get_Q(), is_free(), l, and Q.

Referenced by do_shrinking(), and Solve().

1898 {
1899  // reconstruct inactive elements of G from G_bar and free variables
1900 
1901  if (active_size == l)
1902  return;
1903 
1904  kkint32 i;
1905  for(i=active_size;i<l;i++)
1906  G[i] = G_bar[i] + b[i];
1907 
1908  for(i=0;i<active_size;i++)
1909  if(is_free(i))
1910  {
1911  const Qfloat *Q_i = Q->get_Q(i,l);
1912  double alpha_i = alpha[i];
1913  for(kkint32 j=active_size;j<l;j++)
1914  G[j] += alpha_i * Q_i[j];
1915  }
1916 }
bool is_free(kkint32 i)
Definition: svm.cpp:603
kkint32 l
Definition: svm.cpp:582
__int32 kkint32
Definition: KKBaseTypes.h:88
double * G
Definition: svm.cpp:572
virtual Qfloat * get_Q(kkint32 column, kkint32 len) const =0
double * alpha
Definition: svm.cpp:575
kkint32 active_size
Definition: svm.cpp:570
double * G_bar
Definition: svm.cpp:581
float Qfloat
Definition: svm2.h:287
const Kernel * Q
Definition: svm.cpp:576
double * b
Definition: svm.cpp:579
kkint32 SVM233::Solver::select_working_set ( kkint32 i,
kkint32 j 
)
protectedvirtual

Definition at line 2212 of file svm.cpp.

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

Referenced by do_shrinking(), and Solve().

2213 {
2214  // return i,j which maximize -grad(f)^T d , under constraint
2215  // if alpha_i == C, d != +1
2216  // if alpha_i == 0, d != -1
2217 
2218  double Gmax1 = -INF; // max { -grad(f)_i * d | y_i*d = +1 }
2219  kkint32 Gmax1_idx = -1;
2220 
2221  double Gmax2 = -INF; // max { -grad(f)_i * d | y_i*d = -1 }
2222  kkint32 Gmax2_idx = -1;
2223 
2224  for(kkint32 i=0;i<active_size;i++)
2225  {
2226  if(y[i]==+1) // y = +1
2227  {
2228  if(!is_upper_bound(i)) // d = +1
2229  {
2230  if(-G[i] > Gmax1)
2231  {
2232  Gmax1 = -G[i];
2233  Gmax1_idx = i;
2234  }
2235  }
2236  if(!is_lower_bound(i)) // d = -1
2237  {
2238  if(G[i] > Gmax2)
2239  {
2240  Gmax2 = G[i];
2241  Gmax2_idx = i;
2242  }
2243  }
2244  }
2245  else // y = -1
2246  {
2247  if(!is_upper_bound(i)) // d = +1
2248  {
2249  if(-G[i] > Gmax2)
2250  {
2251  Gmax2 = -G[i];
2252  Gmax2_idx = i;
2253  }
2254  }
2255  if(!is_lower_bound(i)) // d = -1
2256  {
2257  if(G[i] > Gmax1)
2258  {
2259  Gmax1 = G[i];
2260  Gmax1_idx = i;
2261  }
2262  }
2263  }
2264  }
2265 
2266  if(Gmax1+Gmax2 < eps)
2267  return 1;
2268 
2269  out_i = Gmax1_idx;
2270  out_j = Gmax2_idx;
2271  return 0;
2272 }
__int32 kkint32
Definition: KKBaseTypes.h:88
double * G
Definition: svm.cpp:572
bool is_upper_bound(kkint32 i)
Definition: svm.cpp:601
#define INF
Definition: svm.cpp:698
double eps
Definition: svm.cpp:577
kkint32 active_size
Definition: svm.cpp:570
bool is_lower_bound(kkint32 i)
Definition: svm.cpp:602
schar * y
Definition: svm.cpp:571
void SVM233::Solver::Solve ( kkint32  l,
const Kernel Q,
const double *  b_,
const schar y_,
double *  alpha_,
double  Cp,
double  Cn,
double  eps,
SolutionInfo si,
kkint32  shrinking 
)

Definition at line 2186 of file svm.cpp.

References Solve(), SVM233::Solver::SolutionInfo::upper_bound_n, and SVM233::Solver::SolutionInfo::upper_bound_p.

Referenced by SVM233::Solver_NU::Solve(), SVM233::solve_c_svc(), SVM233::solve_epsilon_svr(), and SVM233::solve_one_class().

2197 {
2198  double* C_ = new double[l];
2199  for(kkint32 i=0;i<l;i++)
2200  C_[i] = (y_[i] > 0 ? Cp : Cn);
2201 
2202  Solve (l, Q, b_, y_, alpha_, C_, eps, si, shrinking);
2203 
2204  si->upper_bound_p = Cp;
2205  si->upper_bound_n = Cn;
2206  delete [] C_;
2207 }
kkint32 l
Definition: svm.cpp:582
__int32 kkint32
Definition: KKBaseTypes.h:88
void Solve(kkint32 l, const Kernel &Q, const double *b_, const schar *y_, double *alpha_, double Cp, double Cn, double eps, SolutionInfo *si, kkint32 shrinking)
Definition: svm.cpp:2186
double eps
Definition: svm.cpp:577
void SVM233::Solver::Solve ( kkint32  l,
const Kernel Q,
const double *  b_,
const schar y_,
double *  alpha_,
double *  C_,
double  eps,
SolutionInfo si,
kkint32  shrinking 
)

Definition at line 1920 of file svm.cpp.

References active_set, active_size, alpha, alpha_status, b, C, calculate_rho(), do_shrinking(), eps, G, G_bar, get_C(), SVM233::Kernel::get_Q(), SVM233::info(), SVM233::info_flush(), is_lower_bound(), is_upper_bound(), l, SVM233::Solver::SolutionInfo::obj, Q, reconstruct_gradient(), SVM233::Solver::SolutionInfo::rho, select_working_set(), unshrinked, update_alpha_status(), and y.

Referenced by Solve(), and SVM233::solve_c_svc().

1930 {
1931  this->l = l;
1932  this->Q = &Q;
1933  clone (b, b_,l);
1934  clone (y, y_,l);
1935  clone (alpha,alpha_,l);
1936  clone (C, C_, l);
1937  this->eps = eps;
1938  unshrinked = false;
1939 
1940  // initialize alpha_status
1941  {
1942  alpha_status = new char[l];
1943  for (kkint32 i=0;i<l;i++){
1945  }
1946  }
1947 
1948  // initialize active set (for shrinking)
1949  {
1950  active_set = new kkint32[l];
1951  for(kkint32 i=0;i<l;i++)
1952  active_set[i] = i;
1953  active_size = l;
1954  }
1955 
1956  // initialize gradient
1957  {
1958  G = new double[l];
1959  G_bar = new double[l];
1960  kkint32 i;
1961  for(i=0;i<l;i++)
1962  {
1963  G[i] = b[i];
1964  G_bar[i] = 0;
1965  }
1966  for (i=0;i<l;i++)
1967  if (!is_lower_bound(i))
1968  {
1969  Qfloat *Q_i = Q.get_Q(i,l);
1970  double alpha_i = alpha[i];
1971  kkint32 j;
1972  for(j=0;j<l;j++)
1973  G[j] += alpha_i*Q_i[j];
1974  if(is_upper_bound(i))
1975  for(j=0;j<l;j++)
1976  G_bar[j] += get_C(i) * Q_i[j];
1977  }
1978  }
1979 
1980  // optimization step
1981 
1982  kkint32 iter = 0;
1983  kkint32 counter = min ((kkint32)l, (kkint32)1000) + 1;
1984 
1985  while(1)
1986  {
1987  // show progress and do shrinking
1988 
1989  if(--counter == 0)
1990  {
1991  counter = min(l,1000);
1992  if(shrinking) do_shrinking();
1993  info("."); info_flush();
1994  }
1995 
1996  kkint32 i,j;
1997  if(select_working_set(i,j)!=0)
1998  {
1999  // reconstruct the whole gradient
2001  // reset active set size and check
2002  active_size = l;
2003  info("*"); info_flush();
2004  if(select_working_set(i,j)!=0)
2005  break;
2006  else
2007  counter = 1; // do shrinking next iteration
2008  }
2009 
2010  ++iter;
2011 
2012  // update alpha[i] and alpha[j], handle bounds carefully
2013 
2014  const Qfloat *Q_i = Q.get_Q(i,active_size);
2015  const Qfloat *Q_j = Q.get_Q(j,active_size);
2016 
2017  double C_i = get_C(i);
2018  double C_j = get_C(j);
2019 
2020  double old_alpha_i = alpha[i];
2021  double old_alpha_j = alpha[j];
2022 
2023  if(y[i]!=y[j])
2024  {
2025  double delta = (-G[i]-G[j])/max(Q_i[i]+Q_j[j]+2*Q_i[j],(Qfloat)0);
2026  double diff = alpha[i] - alpha[j];
2027  alpha[i] += delta;
2028  alpha[j] += delta;
2029 
2030  if(diff > 0)
2031  {
2032  if(alpha[j] < 0)
2033  {
2034  alpha[j] = 0;
2035  alpha[i] = diff;
2036  }
2037  }
2038  else
2039  {
2040  if(alpha[i] < 0)
2041  {
2042  alpha[i] = 0;
2043  alpha[j] = -diff;
2044  }
2045  }
2046  if(diff > C_i - C_j)
2047  {
2048  if(alpha[i] > C_i)
2049  {
2050  alpha[i] = C_i;
2051  alpha[j] = C_i - diff;
2052  }
2053  }
2054  else
2055  {
2056  if(alpha[j] > C_j)
2057  {
2058  alpha[j] = C_j;
2059  alpha[i] = C_j + diff;
2060  }
2061  }
2062  }
2063  else
2064  {
2065  double delta = (G[i]-G[j])/max(Q_i[i]+Q_j[j]-2*Q_i[j],(Qfloat)0);
2066  double sum = alpha[i] + alpha[j];
2067  alpha[i] -= delta;
2068  alpha[j] += delta;
2069  if(sum > C_i)
2070  {
2071  if(alpha[i] > C_i)
2072  {
2073  alpha[i] = C_i;
2074  alpha[j] = sum - C_i;
2075  }
2076  }
2077  else
2078  {
2079  if(alpha[j] < 0)
2080  {
2081  alpha[j] = 0;
2082  alpha[i] = sum;
2083  }
2084  }
2085  if(sum > C_j)
2086  {
2087  if(alpha[j] > C_j)
2088  {
2089  alpha[j] = C_j;
2090  alpha[i] = sum - C_j;
2091  }
2092  }
2093  else
2094  {
2095  if(alpha[i] < 0)
2096  {
2097  alpha[i] = 0;
2098  alpha[j] = sum;
2099  }
2100  }
2101  }
2102 
2103  // update G
2104 
2105  double delta_alpha_i = alpha[i] - old_alpha_i;
2106  double delta_alpha_j = alpha[j] - old_alpha_j;
2107 
2108  for(kkint32 k=0;k<active_size;k++)
2109  {
2110  G[k] += Q_i[k]*delta_alpha_i + Q_j[k]*delta_alpha_j;
2111  }
2112 
2113  // update alpha_status and G_bar
2114 
2115  {
2116  bool ui = is_upper_bound(i);
2117  bool uj = is_upper_bound(j);
2120  kkint32 k;
2121  if(ui != is_upper_bound(i))
2122  {
2123  Q_i = Q.get_Q(i,l);
2124  if(ui)
2125  for(k=0;k<l;k++)
2126  G_bar[k] -= C_i * Q_i[k];
2127  else
2128  for(k=0;k<l;k++)
2129  G_bar[k] += C_i * Q_i[k];
2130  }
2131 
2132  if(uj != is_upper_bound(j))
2133  {
2134  Q_j = Q.get_Q(j,l);
2135  if(uj)
2136  for(k=0;k<l;k++)
2137  G_bar[k] -= C_j * Q_j[k];
2138  else
2139  for(k=0;k<l;k++)
2140  G_bar[k] += C_j * Q_j[k];
2141  }
2142  }
2143  }
2144 
2145  // calculate rho
2146 
2147  si->rho = calculate_rho();
2148 
2149  // calculate objective value
2150  {
2151  double v = 0;
2152  kkint32 i;
2153  for(i=0;i<l;i++)
2154  v += alpha[i] * (G[i] + b[i]);
2155 
2156  si->obj = v/2;
2157  }
2158 
2159  // put back the solution
2160  {
2161  for(kkint32 i=0;i<l;i++)
2162  alpha_[active_set[i]] = alpha[i];
2163  }
2164 
2165  // juggle everything back
2166  /*{
2167  for(kkint32 i=0;i<l;i++)
2168  while(active_set[i] != i)
2169  swap_index(i,active_set[i]);
2170  // or Q.swap_index(i,active_set[i]);
2171  }*/
2172 
2173  info("\noptimization finished, #iter = %d\n",iter);
2174 
2175  delete[] C;
2176  delete[] b;
2177  delete[] y;
2178  delete[] alpha;
2179  delete[] alpha_status;
2180  delete[] active_set;
2181  delete[] G;
2182  delete[] G_bar;
2183 }
T max(T x, T y)
Definition: svm.cpp:680
kkint32 l
Definition: svm.cpp:582
__int32 kkint32
Definition: KKBaseTypes.h:88
double * G
Definition: svm.cpp:572
bool is_upper_bound(kkint32 i)
Definition: svm.cpp:601
virtual Qfloat * get_Q(kkint32 column, kkint32 len) const =0
double * C
Definition: svm.cpp:578
double * alpha
Definition: svm.cpp:575
char * alpha_status
Definition: svm.cpp:574
virtual kkint32 select_working_set(kkint32 &i, kkint32 &j)
Definition: svm.cpp:2212
double eps
Definition: svm.cpp:577
kkint32 active_size
Definition: svm.cpp:570
double * G_bar
Definition: svm.cpp:581
void clone(T *&dst, S *src, kkint32 n)
Definition: svm.cpp:690
bool is_lower_bound(kkint32 i)
Definition: svm.cpp:602
virtual void do_shrinking()
Definition: svm.cpp:2276
schar * y
Definition: svm.cpp:571
float Qfloat
Definition: svm2.h:287
void info_flush()
Definition: svm.cpp:716
virtual double calculate_rho()
Definition: svm.cpp:2348
bool unshrinked
Definition: svm.cpp:583
void update_alpha_status(kkint32 i)
Definition: svm.cpp:589
kkint32 * active_set
Definition: svm.cpp:580
void info(const char *fmt,...)
Definition: svm.cpp:715
const Kernel * Q
Definition: svm.cpp:576
T min(T x, T y)
Definition: svm.cpp:676
double get_C(kkint32 i)
Definition: svm.cpp:585
void reconstruct_gradient()
Definition: svm.cpp:1897
double * b
Definition: svm.cpp:579
void SVM233::Solver::swap_index ( kkint32  i,
kkint32  j 
)
protected

Definition at line 1881 of file svm.cpp.

References Q, and SVM233::Kernel::swap_index().

Referenced by do_shrinking().

1882 {
1883  Q->swap_index(i,j);
1884  Swap(y[i],y[j]);
1885  Swap(G[i],G[j]);
1887  Swap(alpha[i],alpha[j]);
1888  Swap(b[i],b[j]);
1889  Swap(active_set[i],active_set[j]);
1890  Swap(G_bar[i],G_bar[j]);
1891  Swap(C[i], C[j]);
1892 }
void Swap(T &x, T &y)
Definition: svm.cpp:687
double * G
Definition: svm.cpp:572
double * C
Definition: svm.cpp:578
double * alpha
Definition: svm.cpp:575
char * alpha_status
Definition: svm.cpp:574
double * G_bar
Definition: svm.cpp:581
schar * y
Definition: svm.cpp:571
virtual void swap_index(kkint32 i, kkint32 j) const
Definition: svm.cpp:1547
kkint32 * active_set
Definition: svm.cpp:580
const Kernel * Q
Definition: svm.cpp:576
double * b
Definition: svm.cpp:579
void SVM233::Solver::update_alpha_status ( kkint32  i)
inlineprotected

Definition at line 589 of file svm.cpp.

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

Referenced by Solve().

590  {
591  if (alpha[i] >= get_C (i))
593 
594  else if(alpha[i] <= 0)
596 
597  else
598  alpha_status[i] = FREE;
599  }
double * alpha
Definition: svm.cpp:575
char * alpha_status
Definition: svm.cpp:574
double get_C(kkint32 i)
Definition: svm.cpp:585

Member Data Documentation

kkint32* SVM233::Solver::active_set
protected

Definition at line 580 of file svm.cpp.

Referenced by Solve().

kkint32 SVM233::Solver::active_size
protected

Definition at line 570 of file svm.cpp.

Referenced by calculate_rho(), do_shrinking(), reconstruct_gradient(), select_working_set(), and Solve().

double* SVM233::Solver::alpha
protected

Definition at line 575 of file svm.cpp.

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

char* SVM233::Solver::alpha_status
protected

Definition at line 574 of file svm.cpp.

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

double* SVM233::Solver::b
protected

Definition at line 579 of file svm.cpp.

Referenced by reconstruct_gradient(), and Solve().

double* SVM233::Solver::C
protected

Definition at line 578 of file svm.cpp.

Referenced by get_C(), and Solve().

double SVM233::Solver::eps
protected

Definition at line 577 of file svm.cpp.

Referenced by do_shrinking(), select_working_set(), and Solve().

double* SVM233::Solver::G
protected

Definition at line 572 of file svm.cpp.

Referenced by calculate_rho(), do_shrinking(), reconstruct_gradient(), select_working_set(), and Solve().

double* SVM233::Solver::G_bar
protected

Definition at line 581 of file svm.cpp.

Referenced by reconstruct_gradient(), and Solve().

kkint32 SVM233::Solver::l
protected

Definition at line 582 of file svm.cpp.

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

const Kernel* SVM233::Solver::Q
protected

Definition at line 576 of file svm.cpp.

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

bool SVM233::Solver::unshrinked
protected

Definition at line 583 of file svm.cpp.

Referenced by do_shrinking(), and Solve().

schar* SVM233::Solver::y
protected

Definition at line 571 of file svm.cpp.

Referenced by calculate_rho(), do_shrinking(), select_working_set(), and Solve().


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