iRoCS Toolbox  1.1.0
Solver_NU.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2004-2015 Olaf Ronneberger, Florian Pigorsch, Jörg Mechnich,
4  * Thorsten Falk
5  *
6  * Image Analysis Lab, University of Freiburg, Germany
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  **************************************************************************/
23 
24 /**************************************************************************
25 ** Title:
26 ** $RCSfile$
27 ** $Revision: 476 $$Name$
28 ** $Date: 2004-08-26 10:36:59 +0200 (Thu, 26 Aug 2004) $
29 ** Copyright: LGPL $Author: ronneber $
30 ** Description:
31 **
32 **
33 **
34 **-------------------------------------------------------------------------
35 **
36 ** $Log$
37 ** Revision 1.1 2004/08/26 08:36:59 ronneber
38 ** initital import
39 **
40 **
41 **
42 **************************************************************************/
43 
44 #ifndef SOLVER_NU_HH
45 #define SOLVER_NU_HH
46 
47 #ifdef HAVE_CONFIG_H
48 #include <config.hh>
49 #endif
50 
51 #include "SolutionInfo.hh"
52 #include "Solver.hh"
53 
54 namespace svt
55 {
56  //
57  // Solver for nu-svm classification and regression
58  //
59  // additional constraint: e^T \alpha = constant
60  //
61  template< typename FV, typename KF>
62  class Solver_NU : public Solver<FV,KF>
63  {
64  public:
65  Solver_NU() {}
66  void Solve(int l, const Kernel<FV,KF>& Q, const double *b, const schar *y,
67  double *alpha, double Cp, double Cn, double eps,
68  SolutionInfo* si, int shrinking,
69  ProgressReporter* progressReporter)
70  {
71  this->si = si;
72  Solver<FV,KF>::Solve(l,Q,b,y,alpha,Cp,Cn,eps,si,shrinking,
73  progressReporter);
74  }
75  private:
76  SolutionInfo *si;
77  int select_working_set(int &i, int &j);
78  double calculate_rho();
79  void do_shrinking();
80  };
81 }
82 
83 #include "Solver_NU.icc"
84 
85 #endif
double * alpha
Definition: Solver.hh:137
void Solve(int l, const Kernel< FV, KF > &Q, const double *b, const schar *y, double *alpha, double Cp, double Cn, double eps, SolutionInfo *si, int shrinking, ProgressReporter *progressReporter)
Definition: Solver_NU.hh:66
signed char schar
Definition: svm_defines.hh:67
void Solve(int l, const Kernel< FV, KF > &Q, const double *b_, const schar *y_, double *alpha_, double Cp, double Cn, double eps, SolutionInfo *si, int shrinking, ProgressReporter *progressReporter)
double Cp
Definition: Solver.hh:140
double Cn
Definition: Solver.hh:140
double * b
Definition: Solver.hh:141
double eps
Definition: Solver.hh:139
const Kernel< FV, KF > * Q
Definition: Solver.hh:138
schar * y
Definition: Solver.hh:133