File indexing completed on 2025-02-21 09:41:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef BOOST_MATH_INTERPOLATORS_BILINEAR_UNIFORM_HPP
0018 #define BOOST_MATH_INTERPOLATORS_BILINEAR_UNIFORM_HPP
0019
0020 #include <utility>
0021 #include <memory>
0022 #include <boost/math/interpolators/detail/bilinear_uniform_detail.hpp>
0023
0024 namespace boost::math::interpolators {
0025
0026 template <class RandomAccessContainer>
0027 class bilinear_uniform
0028 {
0029 public:
0030 using Real = typename RandomAccessContainer::value_type;
0031 using Z = typename RandomAccessContainer::size_type;
0032
0033 bilinear_uniform(RandomAccessContainer && fieldData, Z rows, Z cols, Real dx = 1, Real dy = 1, Real x0 = 0, Real y0 = 0)
0034 : m_imp(std::make_shared<detail::bilinear_uniform_imp<RandomAccessContainer>>(std::move(fieldData), rows, cols, dx, dy, x0, y0))
0035 {
0036 }
0037
0038 Real operator()(Real x, Real y) const
0039 {
0040 return m_imp->operator()(x,y);
0041 }
0042
0043
0044 friend std::ostream& operator<<(std::ostream& out, bilinear_uniform<RandomAccessContainer> const & bu) {
0045 out << *bu.m_imp;
0046 return out;
0047 }
0048
0049 private:
0050 std::shared_ptr<detail::bilinear_uniform_imp<RandomAccessContainer>> m_imp;
0051 };
0052
0053 }
0054 #endif