9#ifndef __NEIGHBORS_H_INCLUDED__
10#define __NEIGHBORS_H_INCLUDED__
12#include "../geography/GeographicCoordinates.hpp"
20template <
typename T>
auto make_neighboring_cells_functor(T
const &landscape)
23 using coord_type = quetzal::geography::GeographicCoordinates;
24 return [landscape](coord_type
const &x0) {
25 auto res = landscape.get().resolution();
27 std::vector<coord_type> v;
30 x1.lon() += res.lon();
31 if (landscape.get().is_in_spatial_extent(x1))
33 v.push_back(landscape.get().reproject_to_centroid(x1));
37 x2.lat() += res.lat();
38 if (landscape.get().is_in_spatial_extent(x2))
40 v.push_back(landscape.get().reproject_to_centroid(x2));
44 x3.lon() -= res.lon();
45 if (landscape.get().is_in_spatial_extent(x3))
47 v.push_back(landscape.get().reproject_to_centroid(x3));
51 x4.lat() -= res.lat();
52 if (landscape.get().is_in_spatial_extent(x4))
54 v.push_back(landscape.get().reproject_to_centroid(x4));
Simulation of coalescence-based models of molecular evolution.
Definition coalescence.hpp:21