SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VwEnvironment.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Yahoo! Inc. All rights reserved. The copyrights
3  * embodied in the content of this file are licensed under the BSD
4  * (revised) open source license.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Written (W) 2011 Shashwat Lal Das
12  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society.
13  */
14 
15 #ifndef _VW_ENV_H__
16 #define _VW_ENV_H__
17 
18 #include <shogun/base/SGObject.h>
19 #include <shogun/base/DynArray.h>
20 #include <shogun/lib/DataType.h>
21 #include <shogun/lib/common.h>
22 #include <shogun/lib/v_array.h>
24 
25 namespace shogun
26 {
27 
40 {
41 public:
47 
51  virtual ~CVwEnvironment() { }
52 
57  inline void set_num_bits(vw_size_t bits) { num_bits = bits; }
58 
63  inline vw_size_t get_num_bits() { return num_bits; }
64 
69  inline void set_mask(vw_size_t m) { mask = m; }
70 
75  inline vw_size_t get_mask() { return mask; }
76 
81  inline float64_t get_min_label() { return min_label; }
82 
87  inline float64_t get_max_label() { return max_label; }
88 
93  inline vw_size_t num_threads() { return 1 << thread_bits; }
94 
99  inline vw_size_t length() { return 1 << num_bits; }
100 
107  void set_stride(vw_size_t new_stride);
108 
114  virtual const char* get_name() const { return "VwEnvironment"; }
115 
116 private:
120  virtual void init();
121 
122 public:
133 
138 
143 
145  bool adaptive;
150 
155 
158 
165 
167  int64_t example_number;
182 
187 
191  bool ignore[256];
192 
195 
197  const char* vw_version;
200 };
201 
202 }
203 #endif // _VW_ENV_H__

SHOGUN Machine Learning Toolbox - Documentation