jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
Namespaces | Classes | Typedefs | Functions | Variables
jubatus::core::common Namespace Reference

Namespaces

 exception
 
 jsonconfig
 

Classes

class  argv_error
 
class  assoc_vector
 
class  bad_storage_type
 
class  byte_buffer
 
class  config_exception
 
class  config_not_set
 
class  hash_util
 
class  invalid_parameter
 
class  key_manager
 
class  membership_error
 
class  not_found
 
class  portable_mixer
 
class  storage_not_set
 
class  unsupported_method
 

Typedefs

typedef unordered_map< string, uint64_t >::const_iterator cit
 
typedef std::vector< std::pair< std::string, float > > sfv_t
 
typedef std::vector< std::pair< uint64_t, float > > sfvi_t
 

Functions

template<class UInt >
UInt read_big_endian (const char *buf)
 
void sort_and_merge (sfv_t &sfv)
 
void swap (key_manager &l, key_manager &r)
 
void swap (byte_buffer &one, byte_buffer &another)
 
void write_big_endian (uint32_t x, char *buf)
 
void write_big_endian (uint64_t x, char *buf)
 
template<class UInt >
void write_big_endian_ (UInt x, char *buf)
 

Variables

const std::string key_not_found = ""
 

Typedef Documentation

typedef unordered_map<string, uint64_t>::const_iterator jubatus::core::common::cit

Definition at line 33 of file key_manager.cpp.

typedef std::vector<std::pair<std::string, float> > jubatus::core::common::sfv_t

Definition at line 29 of file type.hpp.

typedef std::vector<std::pair<uint64_t, float> > jubatus::core::common::sfvi_t

Definition at line 30 of file type.hpp.

Function Documentation

template<class UInt >
UInt jubatus::core::common::read_big_endian ( const char *  buf)

Definition at line 42 of file big_endian.hpp.

42  {
43  UInt x = 0;
44  for (size_t i = 0; i < sizeof(x); ++i) {
45  x = (x << 8) | (buf[i] & 0xff);
46  }
47  return x;
48 }
void jubatus::core::common::sort_and_merge ( sfv_t sfv)

Definition at line 28 of file vector_util.cpp.

Referenced by jubatus::core::recommender::recommender_base::complete_row(), jubatus::core::driver::clustering::to_sfv(), jubatus::core::driver::clustering::to_sfv_const(), and jubatus::core::driver::classifier::train().

28  {
29  if (sfv.size() <= 1) {
30  return;
31  }
32  sort(sfv.begin(), sfv.end());
33 
34  typedef sfv_t::iterator iterator;
35  iterator cur = sfv.begin();
36  iterator end = sfv.end();
37  for (iterator iter = cur+1; iter != end; ++iter) {
38  if (iter->first == cur->first) {
39  cur->second += iter->second;
40  } else {
41  ++cur;
42  *cur = *iter;
43  }
44  }
45  sfv.erase(cur+1, end);
46 }

Here is the caller graph for this function:

void jubatus::core::common::swap ( key_manager l,
key_manager r 
)
inline

Definition at line 87 of file key_manager.hpp.

References jubatus::core::common::key_manager::swap().

87  { // NOLINT
88  l.swap(r);
89 }

Here is the call graph for this function:

void jubatus::core::common::swap ( byte_buffer one,
byte_buffer another 
)
inline

Definition at line 95 of file byte_buffer.hpp.

References jubatus::core::common::byte_buffer::swap().

95  { // NOLINT
96  one.swap(another);
97 }

Here is the call graph for this function:

void jubatus::core::common::write_big_endian ( uint32_t  x,
char *  buf 
)
inline

Definition at line 34 of file big_endian.hpp.

References write_big_endian_().

Referenced by jubatus::core::storage::bit_vector_base< uint64_t >::msgpack_pack().

34  {
36 }
void write_big_endian_(UInt x, char *buf)
Definition: big_endian.hpp:28

Here is the call graph for this function:

Here is the caller graph for this function:

void jubatus::core::common::write_big_endian ( uint64_t  x,
char *  buf 
)
inline

Definition at line 37 of file big_endian.hpp.

References write_big_endian_().

37  {
39 }
void write_big_endian_(UInt x, char *buf)
Definition: big_endian.hpp:28

Here is the call graph for this function:

template<class UInt >
void jubatus::core::common::write_big_endian_ ( UInt  x,
char *  buf 
)

Definition at line 28 of file big_endian.hpp.

Referenced by write_big_endian().

28  {
29  for (int n = sizeof(x) - 1; n >= 0; --n) {
30  *(buf++) = (x >> (n * 8)) & 0xff;
31  }
32 }

Here is the caller graph for this function:

Variable Documentation

const std::string jubatus::core::common::key_not_found = ""

Definition at line 76 of file key_manager.cpp.

Referenced by jubatus::core::common::key_manager::get_key().