Debian Codegraph @

src/atlas/interpolation/method/knn/KNearestNeighbours.h

raw
1 /*
2 * (C) Copyright 2013 ECMWF.
3 *
4 * This software is licensed under the terms of the Apache Licence Version 2.0
5 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 * In applying this licence, ECMWF does not waive the privileges and immunities
7 * granted to it by virtue of its status as an intergovernmental organisation
8 * nor does it submit to any jurisdiction.
9 */
10
11 #pragma once
12
13 #include "atlas/functionspace/FunctionSpace.h"
14 #include "atlas/interpolation/method/knn/KNearestNeighboursBase.h"
15
16 namespace atlas {
17 namespace interpolation {
18 namespace method {
19
20 class KNearestNeighbours : public KNearestNeighboursBase {
21 public:
22 KNearestNeighbours(const Config& config);
23 virtual ~KNearestNeighbours() override {}
24
25 /**
26 * @brief Create an interpolant sparse matrix relating two (pre-partitioned)
27 * meshes,
28 * using the k-nearest neighbours method
29 * @param source functionspace containing source elements
30 * @param target functionspace containing target points
31 */
32
33 virtual void print(std::ostream&) const override {}
34
35 virtual const FunctionSpace& source() const override { return source_; }
36 virtual const FunctionSpace& target() const override { return target_; }
37
38 private:
39 using KNearestNeighboursBase::do_setup;
40 virtual void do_setup(const FunctionSpace& source, const FunctionSpace& target) override;
41 virtual void do_setup(const Grid& source, const Grid& target, const Cache&) override;
42 virtual void do_setup(const FunctionSpace& source, const FunctionSpace& target, const Cache&) override;
43
44 FunctionSpace source_;
45 FunctionSpace target_;
46
47 size_t k_;
48 };
49
50 } // namespace method
51 } // namespace interpolation
52 } // namespace atlas