Commit 3a9c694
committed
Simplify data_ and data_interface_ in KDTreeFlann.
KDTreeFlann::SetRawData had some confusion around data, data_, and
data_interface_. As a result, the data from the parameter was copied to
the member std::vector, but the interface (which takes an Eigen::Map)
used the data passed as an argument to the method.
As a result, the searches risked to be run on a dangling pointer,
instead of the intended internal storage.
However, rather than adjusting the pointer for Eigen::Map, I preferred
simplifying the code, and copy the argument to an Eigen::MatrixXd.1 parent 80ae047 commit 3a9c694
2 files changed
+8
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
| |||
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
124 | | - | |
125 | | - | |
| 123 | + | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
| |||
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
151 | | - | |
152 | | - | |
| 149 | + | |
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
| |||
166 | 163 | | |
167 | 164 | | |
168 | 165 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 166 | + | |
172 | 167 | | |
173 | 168 | | |
174 | 169 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 170 | + | |
| 171 | + | |
181 | 172 | | |
182 | 173 | | |
183 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 101 | + | |
105 | 102 | | |
106 | | - | |
107 | | - | |
| 103 | + | |
108 | 104 | | |
109 | | - | |
110 | | - | |
111 | 105 | | |
112 | 106 | | |
113 | 107 | | |
| |||
0 commit comments