Apollo 10.0
自动驾驶开放平台
gnn_bipartite_graph_matcher.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
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
18#include <string>
19#include <vector>
20
23
24namespace apollo {
25namespace perception {
26namespace lidar {
27
28class MatchCost {
29 public:
30 MatchCost(size_t ridx, size_t cidx, double cost);
36 size_t RowIdx() const;
42 size_t ColIdx() const;
48 double Cost() const;
49
50 friend bool operator<(const MatchCost& m1, const MatchCost& m2);
51 friend std::ostream& operator<<(std::ostream& os, const MatchCost& m);
52
53 private:
54 size_t row_idx_ = 0;
55 size_t col_idx_ = 0;
56 double cost_ = 0.0;
57};
58
60 public:
61 explicit GnnBipartiteGraphMatcher(size_t max_size = 1000);
63
72 void Match(const BipartiteGraphMatcherOptions& options,
73 std::vector<NodeNodePair>* assignments,
74 std::vector<size_t>* unassigned_rows,
75 std::vector<size_t>* unassigned_cols);
81 std::string Name() const { return "GnnBipartiteGraphMatcher"; }
82
83 protected:
84 std::vector<int> row_tag_;
85 std::vector<int> col_tag_;
86 std::vector<int> ignore_track_;
87}; // class GnnBipartiteGraphMatcher
88
89} // namespace lidar
90} // namespace perception
91} // namespace apollo
void Match(const BipartiteGraphMatcherOptions &options, std::vector< NodeNodePair > *assignments, std::vector< size_t > *unassigned_rows, std::vector< size_t > *unassigned_cols)
Match interface
friend bool operator<(const MatchCost &m1, const MatchCost &m2)
friend std::ostream & operator<<(std::ostream &os, const MatchCost &m)
class register implement
Definition arena_queue.h:37