iRoCS Toolbox  1.1.0
BasicCVFactory.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: 2825 $$Name$
28 ** $Date: 2009-09-15 17:04:15 +0200 (Tue, 15 Sep 2009) $
29 ** Copyright: GPL $Author: ronneber $
30 ** Description:
31 **
32 **
33 **
34 **-------------------------------------------------------------------------
35 **
36 ** $Log$
37 ** Revision 1.2 2004/09/08 14:14:46 ronneber
38 ** - changed key for two class svm selection from "svm_type" to "two_class_type"
39 **
40 ** Revision 1.1 2004/08/26 08:36:58 ronneber
41 ** initital import
42 **
43 **
44 **
45 **************************************************************************/
46 
47 #ifndef BASICCVFACTORY_HH
48 #define BASICCVFACTORY_HH
49 
50 #ifdef HAVE_CONFIG_H
51 #include <config.hh>
52 #endif
53 
54 #include "TList.hh"
55 #include "BasicCVAdapter.hh"
56 #include "BasicCVAdapterTempl.hh"
57 #include "MC_SVM_Finder.hh"
58 
59 namespace svt
60 {
61 
62 
63 
64 
65 
66  template< typename FV, typename PROBLEM, typename STDATA>
68  {
70 
71  template<typename SVMTYPE>
72  void produce( SVMTYPE*)
73  {
75  }
76  };
77 
78 
79 
80 
81 
82  /*======================================================================*/
100  /*======================================================================*/
101  template< typename FV, typename PROBLEM, typename STDATA,
102  typename MCLIST, typename TCLIST, typename KFLIST>
104  {
105  public:
106 
107  /*======================================================================*/
126  /*======================================================================*/
128  const std::string& mcName,
129  const std::string& tcName,
130  const std::string& kfName)
131  {
134  MCLIST,
135  TCLIST,
136  KFLIST
137  >::search( mcName, tcName, kfName);
138 
139  return p.cv;
140  }
141 
142 
143 
144  /*======================================================================*/
154  /*======================================================================*/
155  template< typename STDATA2>
157  {
158  std::string mcName;
159  std::string tcName;
160  std::string kfName;
161  stData.getValue( "multi_class_type", mcName);
162  stData.getValue( "two_class_type", tcName);
163  stData.getValue( "kernel_type", kfName);
164 
165  return create( mcName, tcName, kfName);
166  }
167 
168 
169  };
170 
171 }
172 
173 #endif
static BasicCVAdapter< FV, PROBLEM, STDATA > * createFromStData(STDATA2 &stData)
(description)
void produce(SVMTYPE *)
The MC_SVM_Finder class finds the appropriate combination of Multiclass, Twoclass and Kernel specifie...
BasicCVAdapter< FV, PROBLEM, STDATA > * cv
The BasicCVFactory class is a factory, that creates the appropriate template class from given strings...
static BasicCVAdapter< FV, PROBLEM, STDATA > * create(const std::string &mcName, const std::string &tcName, const std::string &kfName)
create an BasicCVAdapterTempl with the requested types.