1#ifndef TATOOINE_CRITICAL_POINTS_H
2#define TATOOINE_CRITICAL_POINTS_H
4#include <boost/range/algorithm/copy.hpp>
5#include <boost/range/adaptor/transformed.hpp>
14template <
typename Gr
id,
typename Real,
bool HasNonConstReference>
18 HasNonConstReference>,
20 using namespace boost;
21 using namespace adaptors;
22 auto critical_points = std::vector<typename Grid::pos_type>{};
24 for (
size_t y = 0; y < s.grid().
template size<1>() - 1; ++y) {
25 for (
size_t x = 0; x < s.grid().
template size<0>() - 1; ++x) {
28 s.data_at(x, y + 1), s.data_at(x + 1, y + 1)) |
29 transformed([x, y, &s](
const auto& st) {
30 return vec{(1 - st(0)) * s.grid().template dimension<0>()[x] +
31 (st(0)) * s.grid().template dimension<0>()[x + 1],
32 (1 - st(1)) * s.grid().template dimension<1>()[y] +
33 (st(1)) * s.grid().template dimension<1>()[y + 1]};
35 std::back_inserter(critical_points));
38 return critical_points;
auto solve_bilinear(base_tensor< T0, Real, 2 > const &v00, base_tensor< T1, Real, 2 > const &v10, base_tensor< T2, Real, 2 > const &v01, base_tensor< T3, Real, 2 > const &v11)
Definition: critical_points_bilinear.h:24
Definition: algorithm.h:6
auto find_critical_points(detail::rectilinear_grid::vertex_property_sampler< detail::rectilinear_grid::typed_vertex_property_interface< Grid, vec< Real, 2 >, HasNonConstReference >, interpolation::linear, interpolation::linear > const &s)
Definition: critical_points.h:15
Definition: vertex_property.h:96
Definition: vertex_property_sampler.h:271
Definition: interpolation.h:16