jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
stat.cpp
Go to the documentation of this file.
1 // Jubatus: Online machine learning framework for distributed environment
2 // Copyright (C) 2011,2012 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 #include "stat.hpp"
18 
19 #include <algorithm>
20 #include <string>
21 
22 #include "../framework/mixable.hpp"
23 
24 
25 namespace jubatus {
26 namespace core {
27 namespace driver {
28 
30  : stat_(stat_method),
31  mixable_stat_(stat_) {
33 }
34 
36 }
37 
38 void stat::push(const std::string& key, double value) {
39  stat_->push(key, value);
40 }
41 
42 double stat::sum(const std::string& key) const {
43  return stat_->sum(key);
44 }
45 
46 double stat::stddev(const std::string& key) const {
47  return stat_->stddev(key);
48 }
49 
50 double stat::max(const std::string& key) const {
51  return stat_->max(key);
52 }
53 
54 double stat::min(const std::string& key) const {
55  return stat_->min(key);
56 }
57 
58 double stat::entropy() const {
59  return stat_->entropy();
60 }
61 
62 double stat::moment(const std::string& key, int n, double c) const {
63  return stat_->moment(key, n, c);
64 }
65 
66 void stat::pack(framework::packer& pk) const {
67  stat_->pack(pk);
68 }
69 
70 void stat::unpack(msgpack::object o) {
71  stat_->unpack(o);
72 }
73 
74 void stat::clear() {
75  stat_->clear();
76 }
77 
78 } // namespace driver
79 } // namespace core
80 } // namespace jubatus
stat(jubatus::core::stat::stat *stat_method)
Definition: stat.cpp:29
void push(const std::string &key, double value)
Definition: stat.cpp:38
void pack(framework::packer &pk) const
Definition: stat.cpp:66
double stddev(const std::string &) const
Definition: stat.cpp:46
double moment(const std::string &, int, double) const
Definition: stat.cpp:62
double entropy() const
Definition: stat.cpp:58
void unpack(msgpack::object o)
Definition: stat.cpp:70
jubatus::util::lang::shared_ptr< jubatus::core::stat::stat > stat_
Definition: stat.hpp:54
double sum(const std::string &) const
Definition: stat.cpp:42
double min(const std::string &) const
Definition: stat.cpp:54
core::stat::mixable_stat mixable_stat_
Definition: stat.hpp:55
double max(const std::string &) const
Definition: stat.cpp:50
void register_mixable(framework::mixable *mixable)
Definition: driver.cpp:242