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

#include <heavydbTypes.h>

Public Member Functions

DEVICE Column (T *ptr, const int64_t num_rows)
 
DEVICE Column (const Column &other)
 
DEVICE Column (std::vector< T > &input_vec)
 
DEVICE T & operator[] (const unsigned int index) const
 
DEVICE T * getPtr () 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 Column< T > & operator= (const Column< T > &other)
 
std::string toString () const
 
template<>
DEVICE bool isNull (int64_t index) const
 
template<>
DEVICE void setNull (int64_t index)
 

Public Attributes

T * ptr_
 
int64_t num_rows_
 

Detailed Description

template<typename T>
struct Column< T >

Definition at line 1094 of file heavydbTypes.h.

Constructor & Destructor Documentation

template<typename T>
DEVICE Column< T >::Column ( T *  ptr,
const int64_t  num_rows 
)
inline

Definition at line 1098 of file heavydbTypes.h.

1098 : ptr_(ptr), num_rows_(num_rows) {}
int64_t num_rows_
template<typename T>
DEVICE Column< T >::Column ( const Column< T > &  other)
inline

Definition at line 1102 of file heavydbTypes.h.

1102 : ptr_(other.ptr_), num_rows_(other.num_rows_) {}
int64_t num_rows_
template<typename T>
DEVICE Column< T >::Column ( std::vector< T > &  input_vec)
inline

Definition at line 1103 of file heavydbTypes.h.

1104  : ptr_(input_vec.data()), num_rows_(static_cast<int64_t>(input_vec.size())) {}
int64_t num_rows_

Member Function Documentation

template<typename T>
DEVICE T* Column< T >::getPtr ( ) const
inline

Definition at line 1120 of file heavydbTypes.h.

References Column< T >::ptr_.

Referenced by get_column_mean(), get_column_stats(), get_column_std_dev(), CrossSectionTableFunctions::tf_cross_section_1d_impl(), CrossSectionTableFunctions::tf_cross_section_2d_impl(), GDALTableFunctions::tf_raster_contour_direct_impl(), and GDALTableFunctions::tf_raster_contour_rasterize_impl().

1120  {
1121  return ptr_;
1122  }

+ Here is the caller graph for this function:

template<typename T>
DEVICE bool Column< T >::isNull ( int64_t  index) const
inline

Definition at line 1130 of file heavydbTypes.h.

References is_null(), and Column< T >::ptr_.

Referenced by array_asarray__cpu_template(), ct_binding_scalar_multiply__cpu_template(), ct_copy__generic_cpu_template(), ct_make_linestring2__cpu_(), ct_overload_column_test__cpu_template(), ct_pointn__cpu_template(), ct_timestamp_add_offset(), ct_timestamp_extract(), ct_timestamp_test_columns_and_scalars__cpu(), get_column_metadata(), and row_adder().

1130  {
1131  return is_null(ptr_[index]);
1132  }
CONSTEXPR DEVICE bool is_null(const T &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2466 of file heavydbTypes.h.

References is_null().

2466  {
2467  return is_null(ptr_[index].time);
2468 }
CONSTEXPR DEVICE bool is_null(const T &value)

+ Here is the call graph for this function:

template<typename T>
DEVICE Column<T>& Column< T >::operator= ( const Column< T > &  other)
inline

Definition at line 1136 of file heavydbTypes.h.

References Column< T >::ptr_, Column< T >::size(), and heavydb.dtypes::T.

1136  {
1137 #ifndef __CUDACC__
1138  if (size() == other.size()) {
1139  memcpy(ptr_, &other[0], other.size() * sizeof(T));
1140  } else {
1141  throw std::runtime_error("cannot copy assign columns with different sizes");
1142  }
1143 #else
1144  if (size() == other.size()) {
1145  for (unsigned int i = 0; i < size(); i++) {
1146  ptr_[i] = other[i];
1147  }
1148  } else {
1149  // TODO: set error
1150  }
1151 #endif
1152  return *this;
1153  }
DEVICE int64_t size() const

+ Here is the call graph for this function:

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

Definition at line 1108 of file heavydbTypes.h.

References Column< T >::num_rows_, Column< T >::ptr_, and set_null().

1108  {
1109  if (index >= num_rows_) {
1110 #ifndef __CUDACC__
1111  throw std::runtime_error("column buffer index is out of range");
1112 #else
1113  auto& null_value = Column_null_value<T>;
1114  set_null(null_value);
1115  return null_value;
1116 #endif
1117  }
1118  return ptr_[index];
1119  }
CONSTEXPR DEVICE void set_null(T &value)
int64_t num_rows_

+ Here is the call graph for this function:

template<typename T>
DEVICE void Column< T >::setNull ( int64_t  index)
inline

Definition at line 1133 of file heavydbTypes.h.

References Column< T >::ptr_, and set_null().

Referenced by GeoRaster< T, Z >::calculate_slope_and_aspect(), ct_binding_scalar_multiply__cpu_template(), ct_coords__cpu_(), ct_copy__generic_cpu_template(), ct_make_polygon3__cpu_(), ct_overload_column_test__cpu_template(), ct_pointn__cpu_template(), ct_test_nullable(), ct_timestamp_add_offset(), ct_timestamp_extract(), ct_timestamp_test_columns_and_scalars__cpu(), ct_union_pushdown_projection__cpu_template(), ct_union_pushdown_stats__cpu_template(), GeoRaster< T, Z >::outputDenseColumn(), GeoRaster< T, Z >::outputDenseColumns(), GeoRaster< T, Z >::outputDenseColumnsAndFill(), row_adder(), and sum_along_row__cpu_template().

1133  {
1134  set_null(ptr_[index]);
1135  }
CONSTEXPR DEVICE void set_null(T &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2471 of file heavydbTypes.h.

References set_null().

2471  {
2472  set_null(ptr_[index].time);
2473 }
CONSTEXPR DEVICE void set_null(T &value)

+ Here is the call graph for this function:

template<typename T>
DEVICE void Column< T >::setSize ( int64_t  num_rows)
inline

Definition at line 1126 of file heavydbTypes.h.

References Column< T >::num_rows_.

1126  {
1127  num_rows_ = num_rows;
1128  }
int64_t num_rows_
template<typename T>
DEVICE int64_t Column< T >::size ( ) const
inline

Definition at line 1123 of file heavydbTypes.h.

References Column< T >::num_rows_.

Referenced by TableFunctionManager::allocate_output_buffers(), array_asarray__cpu_template(), GeoRaster< T, Z >::calculate_slope_and_aspect(), column_list_first_last(), column_list_get__cpu_(), GeoRaster< T, Z >::computeParallelImpl(), GeoRaster< T, Z >::computeSerialImpl(), ct_add_size_and_mul_alpha(), ct_binding_column2__cpu_template(), ct_binding_scalar_multiply__cpu_template(), ct_binding_str_length__cpu_(), ct_binding_template__cpu_template(), ct_copy__generic_cpu_template(), ct_copy_and_add_size(), ct_cursor_named_args__cpu_(), ct_get_string_chars__template(), ct_make_linestring2__cpu_(), ct_named_const_output__cpu_template(), ct_named_output__cpu_template(), ct_named_rowmul_output__cpu_template(), ct_named_user_const_output__cpu_template(), ct_overload_column_list_test2__cpu_template(), ct_overload_column_list_test__cpu_template(), ct_overload_column_test__cpu_template(), ct_pointn__cpu_template(), ct_pushdown_projection__cpu_template(), ct_pushdown_stats__cpu_template(), ct_sleep1__cpu_(), ct_sleep2(), ct_sparse_add(), ct_test_calcite_casting_bigint__cpu_(), ct_test_calcite_casting_columnlist__template_cpu_(), ct_test_calcite_casting_double__cpu_(), ct_test_calcite_casting_timestamp__cpu_(), ct_test_float_default_arg__template(), ct_test_int_default_arg__template(), ct_test_nullable(), ct_test_preflight_multicursor_qe227__cpu_(), ct_test_preflight_singlecursor_qe227__cpu_(), ct_test_preflight_sizer(), ct_test_preflight_sizer_const(), ct_test_runtime_libs_add__cpu_template_(), ct_test_runtime_libs_sub__cpu_template_(), ct_throw_if_gt_100__cpu_template(), ct_timestamp_add_interval__template(), ct_timestamp_add_offset(), ct_timestamp_extract(), ct_timestamp_test_columns_and_scalars__cpu(), ct_timestamp_truncate(), ct_union_pushdown_projection__cpu_template(), ct_union_pushdown_stats__cpu_template(), dbscan__cpu_template(), decision_tree_reg_impl(), RasterFormat_Namespace::format_raster_data(), gbt_reg_fit_impl(), GeoRaster< T, Z >::GeoRaster(), get_column_mean(), get_column_metadata(), get_column_min_max(), get_column_stats(), get_column_std_dev(), get_max_with_row_offset__cpu_(), kmeans__cpu_template(), linear_reg_fit_impl(), ml_reg_predict_impl(), Column< T >::operator=(), r2_score_impl(), random_forest_reg_fit_impl(), row_adder(), row_addsub(), row_copier(), row_copier2__cpu__(), row_repeater__cpu_template(), sort_column_limit__cpu_template(), TableFunctions_Namespace::strip_column_metadata(), CrossSectionTableFunctions::tf_cross_section_1d_impl(), CrossSectionTableFunctions::tf_cross_section_2d_impl(), GDALTableFunctions::tf_raster_contour_direct_impl(), and GDALTableFunctions::tf_raster_contour_rasterize_impl().

1123  {
1124  return num_rows_;
1125  }
int64_t num_rows_
template<typename T>
std::string Column< T >::toString ( ) const
inline

Definition at line 1156 of file heavydbTypes.h.

References Column< T >::num_rows_, Column< T >::ptr_, to_string(), and typeName().

1156  {
1157  return ::typeName(this) + "(ptr=" + ::toString(reinterpret_cast<void*>(ptr_)) +
1158  ", num_rows=" + std::to_string(num_rows_) + ")";
1159  }
std::string to_string(char const *&&v)
int64_t num_rows_
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

template<typename T>
int64_t Column< T >::num_rows_

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