63 float elevation_ratio = 0.f,
64 float distance_exponent = 0.5f,
65 float upward_penalization = 0.1f,
66 Array *p_mask_nogo =
nullptr);
97 float dijk_elevation_ratio = 0.9f,
98 float dijk_distance_exponent = 2.f,
99 float dijk_upward_penalization = 100.f,
100 std::uint32_t seed = 0,
101 bool favor_boundary_center =
true,
102 bool favor_lower_elevation =
true,
103 bool favor_sinks =
true,
104 bool favor_domain_center =
false);
129 size_t control_points_count = 2048,
130 bool favor_boundary_center =
true,
131 bool favor_lower_elevation =
true,
132 bool favor_sinks =
true,
133 bool favor_domain_center =
false,
170 float offset_ratio = 0.2f,
172 bool favor_boundary_center =
true,
173 bool favor_lower_elevation =
true,
174 bool favor_sinks =
true,
209 int corridor_radius = 4,
210 float corridor_decay = 1.f,
211 float dijk_elevation_ratio = 0.9f,
212 float dijk_distance_exponent = 2.f,
213 float dijk_upward_penalization = 100.f,
214 std::uint32_t seed = 0,
215 bool favor_boundary_center =
true,
216 bool favor_lower_elevation =
true,
217 bool favor_sinks =
true,
218 bool use_astar =
false,
219 bool smooth_path =
false);
265 std::vector<int> &i_path,
266 std::vector<int> &j_path,
267 float elevation_ratio = 0.1f,
268 float distance_exponent = 2.f,
269 float upward_penalization = 0.1f,
270 const Array *p_mask_nogo =
nullptr,
271 const Array *p_node_weights =
nullptr);
275 std::vector<glm::ivec2> ij_end_list,
276 std::vector<std::vector<int>> &i_path_list,
277 std::vector<std::vector<int>> &j_path_list,
278 float elevation_ratio = 0.1f,
279 float distance_exponent = 2.f,
280 float upward_penalization = 0.1f,
281 const Array *p_mask_nogo =
nullptr,
282 const Array *p_node_weights =
nullptr);
304 size_t control_points_count = 2048,
305 bool favor_domain_center =
false,
327 float elevation_ratio = 0.1f,
328 float distance_exponent = 2.f,
329 float upward_penalization = 0.1f,
330 const Array *p_mask_nogo =
nullptr,
331 const Array *p_node_weights =
nullptr);
354 float elevation_ratio = 0.1f,
355 float distance_exponent = 2.f,
356 float upward_penalization = 0.1f,
357 const Array *p_mask_nogo =
nullptr,
358 const Array *p_node_weights =
nullptr);
385 float offset_ratio = 0.2f,
405 std::vector<int> &i_path,
406 std::vector<int> &j_path,
407 float offset_ratio = 0.2f,
429 float offset_ratio = 0.2f,
467 std::vector<int> &i_path,
468 std::vector<int> &j_path,
470 int corridor_radius = 4,
471 float corridor_decay = 1.f,
472 float elevation_ratio = 0.1f,
473 float distance_exponent = 2.f,
474 float upward_penalization = 0.1f,
475 const Array *p_mask_nogo =
nullptr,
476 bool use_astar =
false,
477 bool smooth_path =
false);
502 int corridor_radius = 4,
503 float corridor_decay = 1.f,
504 float elevation_ratio = 0.1f,
505 float distance_exponent = 2.f,
506 float upward_penalization = 0.1f,
507 const Array *p_mask_nogo =
nullptr,
508 bool use_astar =
false,
509 bool smooth_path =
false);
539 int corridor_radius = 4,
540 float corridor_decay = 1.f,
541 float elevation_ratio = 0.1f,
542 float distance_exponent = 2.f,
543 float upward_penalization = 0.1f,
544 const Array *p_mask_nogo =
nullptr,
545 bool use_astar =
false,
546 bool smooth_path =
false);
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Header file for boundary condition functions and utilities.
Array class, helper to manipulate 2D float array with "(i, j)" indexing.
Definition array.hpp:31
Abstract communicator interface providing MPI-style collective directives for single-source SPMD Arra...
Definition communicator_interface.hpp:60
Represents an ordered set of points in 2D, forming a polyline (open or closed).
Definition path.hpp:43
static SingleArrayComm & instance()
Definition communicator.cpp:78
Lightweight abstract SPMD communicator interface for Array and VirtualArray collective operations.
DomainBoundary
Describes which domain boundary.
Definition boundary.hpp:44
Path find_cut_path_multiscale(const Array &z, DomainBoundary start, DomainBoundary end, int n_levels=3, int corridor_radius=4, float corridor_decay=1.f, float dijk_elevation_ratio=0.9f, float dijk_distance_exponent=2.f, float dijk_upward_penalization=100.f, std::uint32_t seed=0, bool favor_boundary_center=true, bool favor_lower_elevation=true, bool favor_sinks=true, bool use_astar=false, bool smooth_path=false)
Find a fast coarse-to-fine multiscale cut path between two domain boundaries.
Definition find_cut_path.cpp:193
std::vector< glm::ivec2 > find_path_midpoint(const Array &z, glm::ivec2 ij_start, glm::ivec2 ij_end, float offset_ratio=0.2f, int max_it=0, int steps=16)
Compute a path between two points using iterative midpoint refinement.
Definition find_path_midpoint.cpp:79
Path dijkstra(const Path &path, const Array &array, const UvRect &uv_rect, float elevation_ratio=0.f, float distance_exponent=0.5f, float upward_penalization=0.1f, Array *p_mask_nogo=nullptr)
Divide the path by adding points based on the lowest elevation difference between each pair of edge e...
Definition dijsktra_path.cpp:18
void find_path_multiscale(const Array &z, glm::ivec2 ij_start, glm::ivec2 ij_end, std::vector< int > &i_path, std::vector< int > &j_path, int n_levels=3, int corridor_radius=4, float corridor_decay=1.f, float elevation_ratio=0.1f, float distance_exponent=2.f, float upward_penalization=0.1f, const Array *p_mask_nogo=nullptr, bool use_astar=false, bool smooth_path=false)
Finds a shortest path on a 2D grid using a fast coarse-to-fine multiscale approach.
Definition find_path_multiscale.cpp:225
Path find_cut_path_midpoint(const Array &z, DomainBoundary start, DomainBoundary end, std::uint32_t seed, float offset_ratio=0.2f, int steps=16, bool favor_boundary_center=true, bool favor_lower_elevation=true, bool favor_sinks=true, const UvTile ®ion=UvTile::unit(), ICommunicator &comm=SingleArrayComm::instance())
Generate a stochastic cut path using midpoint displacement.
Definition find_cut_path.cpp:150
Path find_cut_path_dijkstra(const Array &z, DomainBoundary start, DomainBoundary end, float dijk_elevation_ratio=0.9f, float dijk_distance_exponent=2.f, float dijk_upward_penalization=100.f, std::uint32_t seed=0, bool favor_boundary_center=true, bool favor_lower_elevation=true, bool favor_sinks=true, bool favor_domain_center=false)
Find a Dijkstra-based cut path between two domain boundaries.
Definition find_cut_path.cpp:17
void find_path_dijkstra(const Array &z, glm::ivec2 ij_start, glm::ivec2 ij_end, std::vector< int > &i_path, std::vector< int > &j_path, float elevation_ratio=0.1f, float distance_exponent=2.f, float upward_penalization=0.1f, const Array *p_mask_nogo=nullptr, const Array *p_node_weights=nullptr)
Finds the path with the lowest elevation and elevation difference between two points in a 2D array us...
Definition dijsktra.cpp:159
Path class for manipulating and analyzing paths in 2D space.
Definition virtual_array.hpp:54
Axis-aligned rectangle in normalized [0, 1]^2 domain/UV space.
Definition uv_rect.hpp:30
Describes an Array tile's position within the normalized [0, 1]^2 UV domain and global index grid.
Definition uv_tile.hpp:46
static const UvTile & unit()
Definition uv_tile.cpp:31
Definition virtual_array.hpp:65
Normalized UV-domain tile descriptor for single-source SPMD Array algorithms and VirtualArray dispatc...