OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Column< TextEncodingDict > Struct Template Reference

#include <heavydbTypes.h>

+ Collaboration diagram for Column< TextEncodingDict >:

Public Member Functions

DEVICE Column (const Column &other)
 
DEVICE Column (TextEncodingDict *ptr, const int64_t num_rows, StringDictionaryProxy *string_dict_proxy)
 
DEVICE Column (std::vector< TextEncodingDict > &input_vec)
 
DEVICE TextEncodingDictoperator[] (const unsigned int index) const
 
DEVICE TextEncodingDictgetPtr () const
 
DEVICE int64_t size () const
 
DEVICE void setSize (int64_t num_rows)
 
DEVICE bool isNull (int64_t index) const
 
DEVICE void setNull (int64_t index)
 
DEVICE int32_t getDictDbId () const
 
DEVICE int32_t getDictId () const
 
DEVICE const std::string getString (int64_t index) const
 
DEVICE const TextEncodingDict getOrAddTransient (const std::string &str)
 
DEVICE Column< TextEncodingDict > & operator= (const Column< TextEncodingDict > &other)
 
std::string toString () const
 

Public Attributes

TextEncodingDictptr_
 
int64_t num_rows_
 
StringDictionaryProxystring_dict_proxy_
 

Detailed Description

template<>
struct Column< TextEncodingDict >

Definition at line 2364 of file heavydbTypes.h.

Constructor & Destructor Documentation

DEVICE Column< TextEncodingDict >::Column ( const Column< TextEncodingDict > &  other)
inline

Definition at line 2370 of file heavydbTypes.h.

2371  : ptr_(other.ptr_)
2372  , num_rows_(other.num_rows_)
2373  , string_dict_proxy_(other.string_dict_proxy_) {}
StringDictionaryProxy * string_dict_proxy_
int64_t num_rows_
TextEncodingDict * ptr_
DEVICE Column< TextEncodingDict >::Column ( TextEncodingDict ptr,
const int64_t  num_rows,
StringDictionaryProxy string_dict_proxy 
)
inline

Definition at line 2374 of file heavydbTypes.h.

2377  : ptr_(ptr), num_rows_(num_rows), string_dict_proxy_(string_dict_proxy) {}
StringDictionaryProxy * string_dict_proxy_
TextEncodingDict * ptr_
DEVICE Column< TextEncodingDict >::Column ( std::vector< TextEncodingDict > &  input_vec)
inline

Definition at line 2378 of file heavydbTypes.h.

2379  : ptr_(input_vec.data())
2380  , num_rows_(static_cast<int64_t>(input_vec.size()))
2381  , string_dict_proxy_(nullptr) {}
StringDictionaryProxy * string_dict_proxy_
TextEncodingDict * ptr_

Member Function Documentation

DEVICE int32_t Column< TextEncodingDict >::getDictDbId ( ) const
inline

Definition at line 2423 of file heavydbTypes.h.

2423  {
2425  }
StringDictionaryProxy * string_dict_proxy_
const shared::StringDictKey & getDictKey() const noexcept
DEVICE int32_t Column< TextEncodingDict >::getDictId ( ) const
inline

Definition at line 2426 of file heavydbTypes.h.

2426  {
2428  }
StringDictionaryProxy * string_dict_proxy_
const shared::StringDictKey & getDictKey() const noexcept
DEVICE const TextEncodingDict Column< TextEncodingDict >::getOrAddTransient ( const std::string &  str)
inline

Definition at line 2432 of file heavydbTypes.h.

Referenced by ct_string_concat__cpu_(), ct_substr__cpu_(), ct_synthesize_new_dict__cpu_(), ct_test_string_default_arg__cpu_(), decision_tree_reg_impl(), gbt_reg_fit_impl(), linear_reg_coefs__cpu_1(), linear_reg_fit_impl(), pca_fit_impl(), random_forest_reg_fit_impl(), and random_forest_reg_var_importance__cpu_1().

2432  {
2434  }
StringDictionaryProxy * string_dict_proxy_
int32_t getOrAddTransient(const std::string &)

+ Here is the caller graph for this function:

DEVICE TextEncodingDict* Column< TextEncodingDict >::getPtr ( ) const
inline

Definition at line 2403 of file heavydbTypes.h.

Referenced by get_column_metadata(), and get_column_min_max().

2403  {
2404  return ptr_;
2405  }
TextEncodingDict * ptr_

+ Here is the caller graph for this function:

DEVICE const std::string Column< TextEncodingDict >::getString ( int64_t  index) const
inline

Definition at line 2429 of file heavydbTypes.h.

Referenced by ct_binding_str_length__cpu_(), ct_substr__cpu_(), ct_test_string_default_arg__cpu_(), get_decision_trees__cpu_2(), linear_reg_coefs__cpu_2(), ml_reg_predict__cpu_template(), r2_score__cpu_template(), and random_forest_reg_var_importance__cpu_2().

2429  {
2430  return isNull(index) ? "" : string_dict_proxy_->getString(ptr_[index].value);
2431  }
std::string getString(int32_t string_id) const
StringDictionaryProxy * string_dict_proxy_
TextEncodingDict * ptr_
DEVICE bool isNull(int64_t index) const

+ Here is the caller graph for this function:

DEVICE bool Column< TextEncodingDict >::isNull ( int64_t  index) const
inline

Definition at line 2413 of file heavydbTypes.h.

References is_null().

Referenced by TableFunctions_Namespace::OneHotEncoder_Namespace::get_top_k_keys().

2413  {
2414  return is_null(ptr_[index].value);
2415  }
CONSTEXPR DEVICE bool is_null(const T &value)
TextEncodingDict * ptr_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE Column<TextEncodingDict>& Column< TextEncodingDict >::operator= ( const Column< TextEncodingDict > &  other)
inline

Definition at line 2438 of file heavydbTypes.h.

References ptr_, and size().

2438  {
2439 #ifndef __CUDACC__
2440  if (size() == other.size()) {
2441  memcpy(ptr_, other.ptr_, other.size() * sizeof(TextEncodingDict));
2442  } else {
2443  throw std::runtime_error("cannot copy assign columns with different sizes");
2444  }
2445 #else
2446  if (size() == other.size()) {
2447  for (unsigned int i = 0; i < size(); i++) {
2448  ptr_[i] = other[i];
2449  }
2450  } else {
2451  // TODO: set error
2452  }
2453 #endif
2454  return *this;
2455  }
TextEncodingDict * ptr_
DEVICE int64_t size() const

+ Here is the call graph for this function:

DEVICE TextEncodingDict& Column< TextEncodingDict >::operator[] ( const unsigned int  index) const
inline

Definition at line 2391 of file heavydbTypes.h.

References DEVICE, and set_null().

2391  {
2392  if (index >= num_rows_) {
2393 #ifndef __CUDACC__
2394  throw std::runtime_error("column buffer index is out of range");
2395 #else
2396  static DEVICE TextEncodingDict null_value;
2397  set_null(null_value.value);
2398  return null_value;
2399 #endif
2400  }
2401  return ptr_[index];
2402  }
#define DEVICE
CONSTEXPR DEVICE void set_null(T &value)
TextEncodingDict * ptr_

+ Here is the call graph for this function:

DEVICE void Column< TextEncodingDict >::setNull ( int64_t  index)
inline

Definition at line 2417 of file heavydbTypes.h.

References set_null().

Referenced by ct_binding_str_equals__cpu_(), ct_string_concat__cpu_(), and tf_torch_raster_obj_detect__cpu_template().

2417  {
2418  set_null(ptr_[index].value);
2419  }
CONSTEXPR DEVICE void set_null(T &value)
TextEncodingDict * ptr_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE void Column< TextEncodingDict >::setSize ( int64_t  num_rows)
inline

Definition at line 2409 of file heavydbTypes.h.

2409  {
2410  num_rows_ = num_rows;
2411  }
std::string Column< TextEncodingDict >::toString ( ) const
inline

Definition at line 2458 of file heavydbTypes.h.

References to_string(), toString(), and typeName().

2458  {
2459  return ::typeName(this) + "(ptr=" + ::toString(reinterpret_cast<void*>(ptr_)) +
2460  ", num_rows=" + std::to_string(num_rows_) + ")";
2461  }
std::string to_string(char const *&&v)
TextEncodingDict * ptr_
std::string typeName(const T *v)
Definition: toString.h:106
std::string toString() const

+ Here is the call graph for this function:

Member Data Documentation

int64_t Column< TextEncodingDict >::num_rows_

Definition at line 2366 of file heavydbTypes.h.

Definition at line 2365 of file heavydbTypes.h.

Referenced by operator=().


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