iRoCS Toolbox  1.1.0
GridSearch.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: perform a grid search on parameters for best crossval result
26 ** $RCSfile$
27 ** $Revision: 476 $$Name$
28 ** $Date: 2004-08-26 10:36:59 +0200 (Thu, 26 Aug 2004) $
29 ** Copyright: GPL $Author: ronneber $
30 ** Description:
31 **
32 **
33 **
34 **-------------------------------------------------------------------------
35 **
36 ** $Log$
37 ** Revision 1.1 2004/08/26 08:36:58 ronneber
38 ** initital import
39 **
40 **
41 **
42 **************************************************************************/
43 
44 #ifndef GRIDSEARCH_HH
45 #define GRIDSEARCH_HH
46 
47 #ifdef HAVE_CONFIG_H
48 #include <config.hh>
49 #endif
50 
51 #include <iomanip>
53 
54 namespace svt
55 {
56  class GridSearch
57  {
58  public:
59 
61  :_pr(0),
62  _printGridLevel(0)
63  {}
64 
65 
66  /*======================================================================*/
76  /*======================================================================*/
78  {
79  _pr = pr;
80  }
81 
82 
83  /*======================================================================*/
91  /*======================================================================*/
92  void setPrintGridFlag( int printGridLevel)
93  {
94  _printGridLevel = printGridLevel;
95  }
96 
97 
98  /*======================================================================*/
119  /*======================================================================*/
120  template< typename CROSSVALIDATOR>
121  void search2D( const GridAxis& row, const GridAxis& col,
122  CROSSVALIDATOR* cv,
123  const std::vector<int>& subsetIndexByUID,
124  std::vector<svt::StDataASCII>& gridPointInfos,
125  unsigned int& bestGridPointIndex,
126  std::vector<svt::SingleClassResult>& bestResultTable);
127 
128  private:
129  ProgressReporter* _pr;
130  int _printGridLevel;
131 
132  };
133 }
134 
135 #include "GridSearch.icc"
136 
137 #endif
138 
void setProgressReporter(ProgressReporter *pr)
set progress reporter object.
Definition: GridSearch.hh:77
void setPrintGridFlag(int printGridLevel)
wether to print the grid (via ProgressReporter) during evaluation (default 0)
Definition: GridSearch.hh:92
void search2D(const GridAxis &row, const GridAxis &col, CROSSVALIDATOR *cv, const std::vector< int > &subsetIndexByUID, std::vector< svt::StDataASCII > &gridPointInfos, unsigned int &bestGridPointIndex, std::vector< svt::SingleClassResult > &bestResultTable)
search on a 2D grid (line wise).