jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
window_fwd.hpp
Go to the documentation of this file.
1 // Jubatus: Online machine learning framework for distributed environment
2 // Copyright (C) 2014 Preferred Networks and Nippon Telegraph and Telephone Corporation.
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License version 2.1 as published by the Free Software Foundation.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 #ifndef JUBATUS_CORE_BURST_WINDOW_FWD_HPP_
18 #define JUBATUS_CORE_BURST_WINDOW_FWD_HPP_
19 
20 #include <stdint.h>
21 #include <msgpack.hpp>
22 
23 namespace jubatus {
24 namespace core {
25 namespace burst {
26 
27 struct batch_input {
28  int32_t d; // all data count
29  int32_t r; // relevant data count
30 
32  : d(0), r(0) {
33  }
34 
35  batch_input(int32_t d_, int32_t r_)
36  : d(d_), r(r_) {
37  }
38 
39  MSGPACK_DEFINE(d, r);
40 };
41 
42 class input_window;
43 
44 struct batch_result {
45  int32_t d, r;
46  double burst_weight; // -1 if unanalysed
47 
49  : d(0), r(0), burst_weight(-1) {
50  }
51 
52  batch_result(int32_t d_, int32_t r_, double w = -1)
53  : d(d_), r(r_), burst_weight(w) {
54  }
55 
56  explicit batch_result(const batch_input& input, double w = -1)
57  : d(input.d), r(input.r), burst_weight(w) {
58  }
59 
60  MSGPACK_DEFINE(d, r, burst_weight);
61 
62  bool is_bursted() const {
63  return burst_weight > 0;
64  }
65 };
66 
67 class result_window;
68 
69 } // namespace burst
70 } // namespace core
71 } // namespace jubatus
72 
73 #endif // JUBATUS_CORE_BURST_WINDOW_FWD_HPP_
MSGPACK_DEFINE(d, r, burst_weight)
batch_result(int32_t d_, int32_t r_, double w=-1)
Definition: window_fwd.hpp:52
batch_input(int32_t d_, int32_t r_)
Definition: window_fwd.hpp:35
batch_result(const batch_input &input, double w=-1)
Definition: window_fwd.hpp:56