tdigest_column_view.hpp
1 /*
2  * Copyright (c) 2021-2023, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
20 
21 namespace cudf {
22 namespace tdigest {
23 
51  public:
55  ~tdigest_column_view() = default;
68 
69  using column_view::size;
70  static_assert(std::is_same_v<offset_type, size_type>,
71  "offset_type is expected to be the same as size_type.");
72  using offset_iterator = offset_type const*;
73 
74  // mean and weight column indices within tdigest inner struct columns
75  static constexpr size_type mean_column_index{0};
76  static constexpr size_type weight_column_index{1};
77 
78  // min and max column indices within tdigest outer struct columns
79  static constexpr size_type centroid_column_index{0};
80  static constexpr size_type min_column_index{1};
81  static constexpr size_type max_column_index{2};
82 
88  [[nodiscard]] column_view parent() const;
89 
95  [[nodiscard]] lists_column_view centroids() const;
96 
102  [[nodiscard]] column_view means() const;
103 
109  [[nodiscard]] column_view weights() const;
110 
117  [[nodiscard]] double const* min_begin() const;
118 
125  [[nodiscard]] double const* max_begin() const;
126 };
127 
128 } // namespace tdigest
129 } // namespace cudf
cudf::tdigest::tdigest_column_view::tdigest_column_view
tdigest_column_view(tdigest_column_view &&)=default
Move constructor.
cudf::tdigest::tdigest_column_view::centroid_column_index
static constexpr size_type centroid_column_index
Centroid column index.
Definition: tdigest_column_view.hpp:79
cudf::tdigest::tdigest_column_view
Given a column_view containing tdigest data, an instance of this class provides a wrapper on the comp...
Definition: tdigest_column_view.hpp:50
cudf::tdigest::tdigest_column_view::tdigest_column_view
tdigest_column_view(tdigest_column_view const &)=default
Copy constructor.
cudf::tdigest::tdigest_column_view::max_begin
double const * max_begin() const
Returns the first max value for the column. Each row corresponds to the maximum value for the accompa...
cudf::size_type
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:80
cudf::column_view
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Definition: column_view.hpp:313
cudf::tdigest::tdigest_column_view::weight_column_index
static constexpr size_type weight_column_index
Weight column index.
Definition: tdigest_column_view.hpp:76
cudf::tdigest::tdigest_column_view::offset_iterator
offset_type const * offset_iterator
Iterator over offsets.
Definition: tdigest_column_view.hpp:72
cudf::tdigest::tdigest_column_view::operator=
tdigest_column_view & operator=(tdigest_column_view const &)=default
Copy assignment operator.
cudf::tdigest::tdigest_column_view::mean_column_index
static constexpr size_type mean_column_index
Mean column index.
Definition: tdigest_column_view.hpp:75
cudf::tdigest::tdigest_column_view::operator=
tdigest_column_view & operator=(tdigest_column_view &&)=default
Move assignment operator.
cudf::offset_type
int32_t offset_type
Offset type for column offsets.
Definition: types.hpp:83
cudf::tdigest::tdigest_column_view::weights
column_view weights() const
Returns the internal column of weight values.
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::tdigest::tdigest_column_view::parent
column_view parent() const
Returns the parent column.
cudf::lists_column_view
Given a column-view of lists type, an instance of this class provides a wrapper on this compound colu...
Definition: lists_column_view.hpp:39
cudf::detail::column_view_base::size
size_type size() const noexcept
Returns the number of elements in the column.
Definition: column_view.hpp:133
cudf::tdigest::tdigest_column_view::means
column_view means() const
Returns the internal column of mean values.
cudf::tdigest::tdigest_column_view::tdigest_column_view
tdigest_column_view(column_view const &)
Construct tdigest_column_view from a column_view.
cudf::tdigest::tdigest_column_view::min_begin
double const * min_begin() const
Returns the first min value for the column. Each row corresponds to the minimum value for the accompa...
cudf::tdigest::tdigest_column_view::centroids
lists_column_view centroids() const
Returns the column of centroids.
cudf::tdigest::tdigest_column_view::min_column_index
static constexpr size_type min_column_index
Min column index.
Definition: tdigest_column_view.hpp:80
column_view.hpp
column view class definitions
cudf::tdigest::tdigest_column_view::max_column_index
static constexpr size_type max_column_index
Max column index.
Definition: tdigest_column_view.hpp:81
lists_column_view.hpp
Class definition for cudf::lists_column_view.