jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
Public Member Functions | Private Types | Friends | List of all members
jubatus::core::burst::input_window Class Reference

#include <input_window.hpp>

Inheritance diagram for jubatus::core::burst::input_window:
Inheritance graph
Collaboration diagram for jubatus::core::burst::input_window:
Collaboration graph

Public Member Functions

bool add_document (uint32_t d, uint32_t r, double pos)
 
 input_window (double start_pos=0, double batch_interval=1, int32_t batch_size=0)
 
 MSGPACK_DEFINE (batches_, start_pos_, batch_interval_)
 
void swap (input_window &x)
 

Private Types

typedef basic_window< batch_inputbase_
 
- Private Types inherited from jubatus::core::burst::basic_window< batch_input >
typedef batch_input batch_type
 

Friends

void swap (input_window &x, input_window &y)
 

Additional Inherited Members

- Private Member Functions inherited from jubatus::core::burst::basic_window< batch_input >
 basic_window (double batch_interval=1)
 
 basic_window (double start_pos, double batch_interval, int32_t batch_size)
 
bool contains (double pos) const
 
double get_all_interval () const
 
batch_typeget_batch_by_index (size_t i)
 
const batch_typeget_batch_by_index (size_t i) const
 
double get_batch_interval () const
 
int32_t get_batch_size () const
 
const std::vector< batch_type > & get_batches () const
 
double get_end_pos () const
 
int get_index (double pos) const
 
double get_start_pos () const
 
void swap (basic_window &x)
 
int get_index_ (double pos) const
 
- Private Attributes inherited from jubatus::core::burst::basic_window< batch_input >
double batch_interval_
 
std::vector< batch_typebatches_
 
double start_pos_
 

Detailed Description

Definition at line 127 of file input_window.hpp.

Member Typedef Documentation

Definition at line 128 of file input_window.hpp.

Constructor & Destructor Documentation

jubatus::core::burst::input_window::input_window ( double  start_pos = 0,
double  batch_interval = 1,
int32_t  batch_size = 0 
)
inlineexplicit

Definition at line 131 of file input_window.hpp.

134  : base_(start_pos, batch_interval, batch_size) {
135  }
basic_window< batch_input > base_

Member Function Documentation

bool jubatus::core::burst::input_window::add_document ( uint32_t  d,
uint32_t  r,
double  pos 
)
inline

Definition at line 137 of file input_window.hpp.

References jubatus::core::burst::basic_window< batch_input >::batches_, and jubatus::core::burst::basic_window< batch_input >::get_index().

137  {
138  int i = base_::get_index(pos);
139 
140  if (i < 0) {
141  return false;
142  }
143 
144  batches_[i].d += d;
145  batches_[i].r += r;
146  return true;
147  }

Here is the call graph for this function:

jubatus::core::burst::input_window::MSGPACK_DEFINE ( batches_  ,
start_pos_  ,
batch_interval_   
)
void jubatus::core::burst::input_window::swap ( input_window x)
inline

Definition at line 159 of file input_window.hpp.

References jubatus::core::burst::basic_window< batch_input >::swap().

159  {
160  base_::swap(static_cast<base_&>(x));
161  }

Here is the call graph for this function:

Friends And Related Function Documentation

void swap ( input_window x,
input_window y 
)
friend

Definition at line 162 of file input_window.hpp.

162  {
163  x.swap(y);
164  }

The documentation for this class was generated from the following file: