single_linkage_output.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025, 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 
17 #pragma once
18 
19 #include <raft/core/device_mdspan.hpp>
20 
21 namespace ML {
22 
23 template <typename idx_t>
25  public:
26  idx_t m;
27  idx_t n_clusters;
28 
29  idx_t n_leaves;
31 
32  idx_t* labels;
33  idx_t* children;
34 
35  raft::device_vector_view<idx_t> get_labels()
36  {
37  return raft::make_device_vector_view<idx_t>(labels, m);
38  }
39 
40  raft::device_matrix_view<idx_t> get_children()
41  {
42  return raft::make_device_matrix_view<idx_t>(children, m - 1, 2);
43  }
44 };
45 
46 } // end namespace ML
Definition: single_linkage_output.hpp:24
idx_t * children
Definition: single_linkage_output.hpp:33
raft::device_vector_view< idx_t > get_labels()
Definition: single_linkage_output.hpp:35
raft::device_matrix_view< idx_t > get_children()
Definition: single_linkage_output.hpp:40
idx_t n_connected_components
Definition: single_linkage_output.hpp:30
idx_t n_leaves
Definition: single_linkage_output.hpp:29
idx_t * labels
Definition: single_linkage_output.hpp:32
idx_t m
Definition: single_linkage_output.hpp:26
idx_t n_clusters
Definition: single_linkage_output.hpp:27
Definition: dbscan.hpp:29