| 292 | } |
| 293 | |
| 294 | void InflationLayer::DeleteKernels() { |
| 295 | if (cached_distances_ != NULL) { |
| 296 | for (unsigned int i = 0; i <= cached_cell_inflation_radius_ + 1; ++i) { |
| 297 | if (cached_distances_[i]) |
| 298 | delete[] cached_distances_[i]; |
| 299 | } |
| 300 | if (cached_distances_) |
| 301 | delete[] cached_distances_; |
| 302 | cached_distances_ = NULL; |
| 303 | } |
| 304 | |
| 305 | if (cached_costs_ != NULL) { |
| 306 | for (unsigned int i = 0; i <= cached_cell_inflation_radius_ + 1; ++i) { |
| 307 | if (cached_costs_[i]) |
| 308 | delete[] cached_costs_[i]; |
| 309 | } |
| 310 | delete[] cached_costs_; |
| 311 | cached_costs_ = NULL; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | void InflationLayer::SetInflationParameters(double inflation_radius, double cost_scaling_factor) { |
| 316 | if (weight_ != cost_scaling_factor || inflation_radius_ != inflation_radius) { |
nothing calls this directly
no outgoing calls
no test coverage detected