All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cube_tuning_params.h
Go to the documentation of this file.
1 /**********************************************************************
2  * File: cube_tuning_params.h
3  * Description: Declaration of the CubeTuningParameters Class
4  * Author: Ahmad Abdulkader
5  * Created: 2007
6  *
7  * (C) Copyright 2008, Google Inc.
8  ** Licensed under the Apache License, Version 2.0 (the "License");
9  ** you may not use this file except in compliance with the License.
10  ** You may obtain a copy of the License at
11  ** http://www.apache.org/licenses/LICENSE-2.0
12  ** Unless required by applicable law or agreed to in writing, software
13  ** distributed under the License is distributed on an "AS IS" BASIS,
14  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ** See the License for the specific language governing permissions and
16  ** limitations under the License.
17  *
18  **********************************************************************/
19 
20 // The CubeTuningParams class abstracts all the parameters that are used
21 // in Cube and are tuned/learned during the training process. Inherits
22 // from the TuningParams class.
23 
24 #ifndef CUBE_TUNING_PARAMS_H
25 #define CUBE_TUNING_PARAMS_H
26 
27 #include <string>
28 #include "tuning_params.h"
29 
30 namespace tesseract {
32  public:
35 
36  // Accessor functions
37  inline double OODWgt() { return ood_wgt_; }
38  inline double NumWgt() { return num_wgt_; }
39 
40  inline void SetOODWgt(double wgt) { ood_wgt_ = wgt; }
41  inline void SetNumWgt(double wgt) { num_wgt_ = wgt; }
42 
43  // Create an object given the data file path and the language by loading
44  // the approporiate file
45  static CubeTuningParams * Create(const string &data_file,
46  const string &lang);
47  // Save and load the tuning parameters to a specified file
48  bool Save(string file_name);
49  bool Load(string file_name);
50 
51  private:
52  double ood_wgt_;
53  double num_wgt_;
54 };
55 }
56 
57 #endif // CUBE_TUNING_PARAMS_H
bool Load(string file_name)
static CubeTuningParams * Create(const string &data_file, const string &lang)