Loading...
Searching...
No Matches
multipoint_ref.cuh
1/*
2 * Copyright (c) 2022, 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#include <cuspatial/cuda_utils.hpp>
18#include <cuspatial/traits.hpp>
19
20namespace cuspatial {
21
27template <typename VecIterator>
29 public:
30 using point_t = iterator_value_type<VecIterator>;
31
32 CUSPATIAL_HOST_DEVICE multipoint_ref(VecIterator begin, VecIterator end);
33
35 CUSPATIAL_HOST_DEVICE auto point_begin() const;
37 CUSPATIAL_HOST_DEVICE auto point_end() const;
38
40 CUSPATIAL_HOST_DEVICE auto begin() const { return point_begin(); }
42 CUSPATIAL_HOST_DEVICE auto end() const { return point_end(); }
43
45 CUSPATIAL_HOST_DEVICE auto num_points() const;
47 CUSPATIAL_HOST_DEVICE auto size() const { return num_points(); }
48
49 template <typename IndexType>
50 CUSPATIAL_HOST_DEVICE auto operator[](IndexType point_idx);
51
52 protected:
53 VecIterator _points_begin;
54 VecIterator _points_end;
55};
56
57} // namespace cuspatial
58
59#include <cuspatial/detail/geometry_collection/multipoint_ref.cuh>
Represent a reference to multipoint stored in a structure of arrays.
CUSPATIAL_HOST_DEVICE auto point_begin() const
Return iterator to the starting point of the multipoint.
CUSPATIAL_HOST_DEVICE auto num_points() const
Return the number of points in multipoint.
CUSPATIAL_HOST_DEVICE auto end() const
Return iterator the the one-past the last point of the multipoint.
CUSPATIAL_HOST_DEVICE auto size() const
Return the number of points in multipoint.
CUSPATIAL_HOST_DEVICE auto begin() const
Return iterator to the starting point of the multipoint.
CUSPATIAL_HOST_DEVICE auto point_end() const
Return iterator to one-past the last point of the multipoint.