jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
Classes | Functions
jubatus::core::storage::detail Namespace Reference

Classes

class  abstract_column
 
class  abstract_column_base
 
struct  bitcount_impl
 
struct  bitcount_impl< T, 1 >
 
struct  bitcount_impl< T, 2 >
 
struct  bitcount_impl< T, 4 >
 
struct  bitcount_impl< T, 8 >
 

Functions

template<class E , class F >
std::vector< std::pair< std::string, E > > & binop (std::vector< std::pair< std::string, E > > &lhs, std::vector< std::pair< std::string, E > > rhs, F f, E default_value=E())
 
int bitcount (unsigned bits)
 
int bitcount (unsigned long bits)
 
int bitcount (unsigned long long bits)
 
template<class T >
int bitcount (T)
 
template<class T >
int bitcount_dispatcher (T bits)
 
template<class E >
std::vector< std::pair< std::string, E > > & mult_scalar (std::vector< std::pair< std::string, E > > &lhs, double d)
 

Function Documentation

template<class E , class F >
std::vector<std::pair<std::string, E> >& jubatus::core::storage::detail::binop ( std::vector< std::pair< std::string, E > > &  lhs,
std::vector< std::pair< std::string, E > >  rhs,
f,
default_value = E() 
)

Definition at line 233 of file storage_type.hpp.

Referenced by jubatus::core::framework::linear_function_mixer::mix(), jubatus::core::storage::operator*=(), jubatus::core::storage::operator+=(), jubatus::core::storage::operator-=(), and jubatus::core::storage::operator/=().

237  {
238  std::sort(lhs.begin(), lhs.end());
239  std::sort(rhs.begin(), rhs.end());
240 
241  size_t li = 0;
242  size_t lsize = lhs.size();
243  for (size_t ri = 0; ri < rhs.size(); ++ri) {
244  while (li < lsize && lhs[li].first < rhs[ri].first) {
245  lhs[li].second = f(lhs[li].second, default_value);
246  ++li;
247  }
248 
249  if (li < lsize && lhs[li].first == rhs[ri].first) {
250  lhs[li].second = f(lhs[li].second, rhs[ri].second);
251  ++li;
252  } else {
253  lhs.push_back(make_pair(rhs[ri].first, f(default_value, rhs[ri].second)));
254  }
255  }
256  while (li < lsize) {
257  lhs[li].second = f(lhs[li].second, default_value);
258  ++li;
259  }
260 
261  return lhs;
262 }

Here is the caller graph for this function:

int jubatus::core::storage::detail::bitcount ( unsigned  bits)
inline

Definition at line 102 of file bit_vector.hpp.

References bitcount_dispatcher().

Referenced by jubatus::core::storage::bit_vector_base< uint64_t >::bit_count(), and jubatus::core::storage::bit_vector_base< uint64_t >::calc_hamming_distance().

102  {
103  return bitcount_dispatcher(bits);
104 }

Here is the call graph for this function:

Here is the caller graph for this function:

int jubatus::core::storage::detail::bitcount ( unsigned long  bits)
inline

Definition at line 106 of file bit_vector.hpp.

References bitcount_dispatcher().

106  {
107  return bitcount_dispatcher(bits);
108 }

Here is the call graph for this function:

int jubatus::core::storage::detail::bitcount ( unsigned long long  bits)
inline

Definition at line 110 of file bit_vector.hpp.

References bitcount_dispatcher().

110  {
111  return bitcount_dispatcher(bits);
112 }

Here is the call graph for this function:

template<class T >
int jubatus::core::storage::detail::bitcount ( )
inline
template<class T >
int jubatus::core::storage::detail::bitcount_dispatcher ( bits)
inline

Definition at line 94 of file bit_vector.hpp.

Referenced by bitcount().

94  {
95 #ifdef __GNUG__
96  return fast_bitcount(bits);
97 #else
98  return bitcount_impl<T, sizeof(T)>::call(bits);
99 #endif
100 }

Here is the caller graph for this function:

template<class E >
std::vector<std::pair<std::string, E> >& jubatus::core::storage::detail::mult_scalar ( std::vector< std::pair< std::string, E > > &  lhs,
double  d 
)

Definition at line 265 of file storage_type.hpp.

Referenced by jubatus::core::storage::operator*=(), and jubatus::core::storage::operator/=().

267  {
268  for (size_t i = 0; i < lhs.size(); ++i) {
269  lhs[i].second = lhs[i].second * d;
270  }
271  return lhs;
272 }

Here is the caller graph for this function: