From 497e80b7f5a68bb3def207c10b825d1e7ea91c71 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Tue, 12 Nov 2024 16:33:43 +0100 Subject: [PATCH 01/10] Add functions to check if the provided interpolation points are valid --- .../ddc/kernels/splines/spline_builder.hpp | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/include/ddc/kernels/splines/spline_builder.hpp b/include/ddc/kernels/splines/spline_builder.hpp index d10262eef..338344b4e 100644 --- a/include/ddc/kernels/splines/spline_builder.hpp +++ b/include/ddc/kernels/splines/spline_builder.hpp @@ -467,6 +467,13 @@ class SplineBuilder std::optional preconditioner_max_block_size = std::nullopt); void build_matrix_system(); + + void check_valid_grid(); + + template + static void check_n_points_in_cell( + int n_points_in_cell, + KnotElement current_cell_end_idx); }; template < @@ -1066,4 +1073,82 @@ SplineBuilder< std::move(coefficients_derivs_xmax_out)); } +template < + class ExecSpace, + class MemorySpace, + class BSplines, + class InterpolationDDim, + ddc::BoundCond BcLower, + ddc::BoundCond BcUpper, + SplineSolver Solver, + class... IDimX> +template +void SplineBuilder< + ExecSpace, + MemorySpace, + BSplines, + InterpolationDDim, + BcLower, + BcUpper, + Solver, + IDimX...>::check_n_points_in_cell( + int n_points_in_cell, + KnotElement current_cell_end_idx) +{ + if (n_points_in_cell > BSplines::degree() + 1) { + KnotElement rmin_idx = ddc::discrete_space().break_point_domain().front(); + int failed_cell = (current_cell_end_idx - rmin_idx).value(); + throw std::runtime_error( + "The spline problem is overconstrained. There are " + + std::to_string(n_points_in_cell) + " points in the " + + std::to_string(failed_cell) + "-th cell."); + } +} + +template < + class ExecSpace, + class MemorySpace, + class BSplines, + class InterpolationDDim, + ddc::BoundCond BcLower, + ddc::BoundCond BcUpper, + SplineSolver Solver, + class... IDimX> +void SplineBuilder< + ExecSpace, + MemorySpace, + BSplines, + InterpolationDDim, + BcLower, + BcUpper, + Solver, + IDimX...>::check_valid_grid() +{ + const std::size_t n_interp_points = interpolation_domain().size(); + std::size_t const expected_npoints = ddc::discrete_space().nbasis() - s_nbc_xmin - s_nbc_xmax; + if (n_interp_points != expected_npoints) { + throw std::runtime_error( + "Incorrect number of points supplied to NonUniformInterpolationPoints. " + "(Received : " + + std::to_string(n_interp_points) + + ", expected : " + std::to_string(expected_npoints)); + } + int n_points_in_cell = 0; + auto current_cell_end_idx + = ddc::discrete_space().break_point_domain().front() + 1; + ddc::for_each(interpolation_domain(), [&](auto idx) { + ddc::Coordinate point = ddc::coordinate(idx); + if (point == ddc::coordinate(current_cell_end_idx)) { + check_n_points_in_cell(n_points_in_cell + 1, current_cell_end_idx); + n_points_in_cell = 1; + } else if (point > ddc::coordinate(current_cell_end_idx)) { + check_n_points_in_cell(n_points_in_cell, current_cell_end_idx); + n_points_in_cell = 1; + } else { + n_points_in_cell += 1; + } + }); + check_n_points_in_cell(n_points_in_cell, current_cell_end_idx); +} + } // namespace ddc From 8cac7078956e7916c375ae284faf99a20397332d Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Tue, 12 Nov 2024 16:37:36 +0100 Subject: [PATCH 02/10] Clang format --- include/ddc/kernels/splines/spline_builder.hpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/include/ddc/kernels/splines/spline_builder.hpp b/include/ddc/kernels/splines/spline_builder.hpp index 338344b4e..3b62ff450 100644 --- a/include/ddc/kernels/splines/spline_builder.hpp +++ b/include/ddc/kernels/splines/spline_builder.hpp @@ -471,9 +471,7 @@ class SplineBuilder void check_valid_grid(); template - static void check_n_points_in_cell( - int n_points_in_cell, - KnotElement current_cell_end_idx); + static void check_n_points_in_cell(int n_points_in_cell, KnotElement current_cell_end_idx); }; template < @@ -1091,17 +1089,15 @@ void SplineBuilder< BcLower, BcUpper, Solver, - IDimX...>::check_n_points_in_cell( - int n_points_in_cell, - KnotElement current_cell_end_idx) + IDimX...>::check_n_points_in_cell(int n_points_in_cell, KnotElement current_cell_end_idx) { if (n_points_in_cell > BSplines::degree() + 1) { KnotElement rmin_idx = ddc::discrete_space().break_point_domain().front(); int failed_cell = (current_cell_end_idx - rmin_idx).value(); throw std::runtime_error( "The spline problem is overconstrained. There are " - + std::to_string(n_points_in_cell) + " points in the " - + std::to_string(failed_cell) + "-th cell."); + + std::to_string(n_points_in_cell) + " points in the " + std::to_string(failed_cell) + + "-th cell."); } } @@ -1125,7 +1121,8 @@ void SplineBuilder< IDimX...>::check_valid_grid() { const std::size_t n_interp_points = interpolation_domain().size(); - std::size_t const expected_npoints = ddc::discrete_space().nbasis() - s_nbc_xmin - s_nbc_xmax; + std::size_t const expected_npoints + = ddc::discrete_space().nbasis() - s_nbc_xmin - s_nbc_xmax; if (n_interp_points != expected_npoints) { throw std::runtime_error( "Incorrect number of points supplied to NonUniformInterpolationPoints. " @@ -1134,8 +1131,7 @@ void SplineBuilder< + ", expected : " + std::to_string(expected_npoints)); } int n_points_in_cell = 0; - auto current_cell_end_idx - = ddc::discrete_space().break_point_domain().front() + 1; + auto current_cell_end_idx = ddc::discrete_space().break_point_domain().front() + 1; ddc::for_each(interpolation_domain(), [&](auto idx) { ddc::Coordinate point = ddc::coordinate(idx); if (point == ddc::coordinate(current_cell_end_idx)) { From beb82a7028775806f6c4bed81e92d1491ee1fb95 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Thu, 28 Nov 2024 09:24:52 +0100 Subject: [PATCH 03/10] Update current_cell_end_idx --- include/ddc/kernels/splines/bsplines_uniform.hpp | 4 ++-- include/ddc/kernels/splines/spline_builder.hpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/ddc/kernels/splines/bsplines_uniform.hpp b/include/ddc/kernels/splines/bsplines_uniform.hpp index 73c33ea49..83f8481ea 100644 --- a/include/ddc/kernels/splines/bsplines_uniform.hpp +++ b/include/ddc/kernels/splines/bsplines_uniform.hpp @@ -373,7 +373,7 @@ class UniformBSplines : detail::UniformBSplinesBase } KOKKOS_INLINE_FUNCTION discrete_element_type - eval_basis(DSpan1D values, ddc::Coordinate const& x, std::size_t degree) const; + eval_basis(DSpan1D values, ddc::Coordinate const& x, [[maybe_unused]] std::size_t degree) const; KOKKOS_INLINE_FUNCTION void get_icell_and_offset( int& icell, @@ -401,7 +401,7 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement UniformBSplines:: Impl::eval_basis( DSpan1D values, ddc::Coordinate const& x, - [[maybe_unused]] std::size_t const deg) const + [[maybe_unused]] std::size_t const degree) const { assert(values.size() == deg + 1); diff --git a/include/ddc/kernels/splines/spline_builder.hpp b/include/ddc/kernels/splines/spline_builder.hpp index 3b62ff450..248dec03d 100644 --- a/include/ddc/kernels/splines/spline_builder.hpp +++ b/include/ddc/kernels/splines/spline_builder.hpp @@ -1137,9 +1137,11 @@ void SplineBuilder< if (point == ddc::coordinate(current_cell_end_idx)) { check_n_points_in_cell(n_points_in_cell + 1, current_cell_end_idx); n_points_in_cell = 1; + current_cell_end_idx += 1; } else if (point > ddc::coordinate(current_cell_end_idx)) { check_n_points_in_cell(n_points_in_cell, current_cell_end_idx); n_points_in_cell = 1; + current_cell_end_idx += 1; } else { n_points_in_cell += 1; } From ba851ad3459c1e36194579470bbb7af44524ca25 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Thu, 28 Nov 2024 09:28:49 +0100 Subject: [PATCH 04/10] Add comments --- include/ddc/kernels/splines/spline_builder.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/ddc/kernels/splines/spline_builder.hpp b/include/ddc/kernels/splines/spline_builder.hpp index 248dec03d..f292b16f3 100644 --- a/include/ddc/kernels/splines/spline_builder.hpp +++ b/include/ddc/kernels/splines/spline_builder.hpp @@ -1134,18 +1134,26 @@ void SplineBuilder< auto current_cell_end_idx = ddc::discrete_space().break_point_domain().front() + 1; ddc::for_each(interpolation_domain(), [&](auto idx) { ddc::Coordinate point = ddc::coordinate(idx); - if (point == ddc::coordinate(current_cell_end_idx)) { - check_n_points_in_cell(n_points_in_cell + 1, current_cell_end_idx); + if (point > ddc::coordinate(current_cell_end_idx)) { + // Check the points found in the previous cell + check_n_points_in_cell(n_points_in_cell, current_cell_end_idx); + // Initialise the number of points in the subsequent cell, including the new point n_points_in_cell = 1; + // Move to the next cell current_cell_end_idx += 1; - } else if (point > ddc::coordinate(current_cell_end_idx)) { - check_n_points_in_cell(n_points_in_cell, current_cell_end_idx); + } else if (point == ddc::coordinate(current_cell_end_idx)) { + // Check the points found in the previous cell including the point on the boundary + check_n_points_in_cell(n_points_in_cell + 1, current_cell_end_idx); + // Initialise the number of points in the subsequent cell, including the point on the boundary n_points_in_cell = 1; + // Move to the next cell current_cell_end_idx += 1; } else { + // Indicate that the point is in the cell n_points_in_cell += 1; } }); + // Check the number of points in the final cell check_n_points_in_cell(n_points_in_cell, current_cell_end_idx); } From 014e30296125a52587d099f1d8d06914adb4ace1 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Thu, 28 Nov 2024 09:31:47 +0100 Subject: [PATCH 05/10] Clang format --- include/ddc/kernels/splines/bsplines_uniform.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/ddc/kernels/splines/bsplines_uniform.hpp b/include/ddc/kernels/splines/bsplines_uniform.hpp index 83f8481ea..b2e0effb9 100644 --- a/include/ddc/kernels/splines/bsplines_uniform.hpp +++ b/include/ddc/kernels/splines/bsplines_uniform.hpp @@ -372,8 +372,10 @@ class UniformBSplines : detail::UniformBSplinesBase return 1.0 / ddc::step(); } - KOKKOS_INLINE_FUNCTION discrete_element_type - eval_basis(DSpan1D values, ddc::Coordinate const& x, [[maybe_unused]] std::size_t degree) const; + KOKKOS_INLINE_FUNCTION discrete_element_type eval_basis( + DSpan1D values, + ddc::Coordinate const& x, + [[maybe_unused]] std::size_t degree) const; KOKKOS_INLINE_FUNCTION void get_icell_and_offset( int& icell, From 596cd07029c92e68ea0fb4bb5a5bde1899d6c086 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Thu, 28 Nov 2024 12:05:17 +0100 Subject: [PATCH 06/10] Remove attribute and fix variable name --- include/ddc/kernels/splines/bsplines_uniform.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/ddc/kernels/splines/bsplines_uniform.hpp b/include/ddc/kernels/splines/bsplines_uniform.hpp index b2e0effb9..ff2042a61 100644 --- a/include/ddc/kernels/splines/bsplines_uniform.hpp +++ b/include/ddc/kernels/splines/bsplines_uniform.hpp @@ -372,10 +372,8 @@ class UniformBSplines : detail::UniformBSplinesBase return 1.0 / ddc::step(); } - KOKKOS_INLINE_FUNCTION discrete_element_type eval_basis( - DSpan1D values, - ddc::Coordinate const& x, - [[maybe_unused]] std::size_t degree) const; + KOKKOS_INLINE_FUNCTION discrete_element_type + eval_basis(DSpan1D values, ddc::Coordinate const& x, std::size_t degree) const; KOKKOS_INLINE_FUNCTION void get_icell_and_offset( int& icell, @@ -405,7 +403,7 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement UniformBSplines:: ddc::Coordinate const& x, [[maybe_unused]] std::size_t const degree) const { - assert(values.size() == deg + 1); + assert(values.size() == degree + 1); double offset; int jmin; From 5ca017d4b3bc51bc7bdc38c6adfb9e9df5116704 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Thu, 28 Nov 2024 14:29:32 +0100 Subject: [PATCH 07/10] Call new method --- include/ddc/kernels/splines/spline_builder.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/ddc/kernels/splines/spline_builder.hpp b/include/ddc/kernels/splines/spline_builder.hpp index f292b16f3..7da2f6cb8 100644 --- a/include/ddc/kernels/splines/spline_builder.hpp +++ b/include/ddc/kernels/splines/spline_builder.hpp @@ -204,6 +204,7 @@ class SplineBuilder static_assert( ((BcLower == BoundCond::PERIODIC) == (BcUpper == BoundCond::PERIODIC)), "Incompatible boundary conditions"); + check_valid_grid(); // Calculate block sizes int lower_block_size; From b21db2bea69dbc5dab9b4187f9af719d7ec01a73 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Thu, 28 Nov 2024 18:45:48 +0100 Subject: [PATCH 08/10] Fix constness --- include/ddc/kernels/splines/spline_builder.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/ddc/kernels/splines/spline_builder.hpp b/include/ddc/kernels/splines/spline_builder.hpp index 7da2f6cb8..7878af938 100644 --- a/include/ddc/kernels/splines/spline_builder.hpp +++ b/include/ddc/kernels/splines/spline_builder.hpp @@ -1090,11 +1090,12 @@ void SplineBuilder< BcLower, BcUpper, Solver, - IDimX...>::check_n_points_in_cell(int n_points_in_cell, KnotElement current_cell_end_idx) + IDimX...>:: + check_n_points_in_cell(int const n_points_in_cell, KnotElement const current_cell_end_idx) { if (n_points_in_cell > BSplines::degree() + 1) { - KnotElement rmin_idx = ddc::discrete_space().break_point_domain().front(); - int failed_cell = (current_cell_end_idx - rmin_idx).value(); + KnotElement const rmin_idx = ddc::discrete_space().break_point_domain().front(); + int const failed_cell = (current_cell_end_idx - rmin_idx).value(); throw std::runtime_error( "The spline problem is overconstrained. There are " + std::to_string(n_points_in_cell) + " points in the " + std::to_string(failed_cell) @@ -1121,7 +1122,7 @@ void SplineBuilder< Solver, IDimX...>::check_valid_grid() { - const std::size_t n_interp_points = interpolation_domain().size(); + std::size_t const n_interp_points = interpolation_domain().size(); std::size_t const expected_npoints = ddc::discrete_space().nbasis() - s_nbc_xmin - s_nbc_xmax; if (n_interp_points != expected_npoints) { @@ -1134,7 +1135,7 @@ void SplineBuilder< int n_points_in_cell = 0; auto current_cell_end_idx = ddc::discrete_space().break_point_domain().front() + 1; ddc::for_each(interpolation_domain(), [&](auto idx) { - ddc::Coordinate point = ddc::coordinate(idx); + ddc::Coordinate const point = ddc::coordinate(idx); if (point > ddc::coordinate(current_cell_end_idx)) { // Check the points found in the previous cell check_n_points_in_cell(n_points_in_cell, current_cell_end_idx); From c8622c5d10746f802c823946ec7f13c23b13c310 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Mon, 2 Dec 2024 14:14:52 +0100 Subject: [PATCH 09/10] Add tests --- .../ddc/kernels/splines/spline_builder.hpp | 14 +- tests/splines/CMakeLists.txt | 8 +- tests/splines/spline_builder.cpp | 139 ++++++++++++++++++ 3 files changed, 153 insertions(+), 8 deletions(-) create mode 100644 tests/splines/spline_builder.cpp diff --git a/include/ddc/kernels/splines/spline_builder.hpp b/include/ddc/kernels/splines/spline_builder.hpp index 7878af938..304f5dc20 100644 --- a/include/ddc/kernels/splines/spline_builder.hpp +++ b/include/ddc/kernels/splines/spline_builder.hpp @@ -165,7 +165,7 @@ class SplineBuilder private: batched_interpolation_domain_type m_batched_interpolation_domain; - int m_offset; + int m_offset = 0; double m_dx; // average cell size for normalization of derivatives @@ -173,7 +173,7 @@ class SplineBuilder std::unique_ptr> matrix; /// Calculate offset so that the matrix is diagonally dominant - int compute_offset(interpolation_domain_type const& interpolation_domain); + void compute_offset(interpolation_domain_type const& interpolation_domain, int& offset); public: /** @@ -197,7 +197,6 @@ class SplineBuilder std::optional cols_per_chunk = std::nullopt, std::optional preconditioner_max_block_size = std::nullopt) : m_batched_interpolation_domain(batched_interpolation_domain) - , m_offset(compute_offset(interpolation_domain())) , m_dx((ddc::discrete_space().rmax() - ddc::discrete_space().rmin()) / ddc::discrete_space().ncells()) { @@ -206,6 +205,8 @@ class SplineBuilder "Incompatible boundary conditions"); check_valid_grid(); + compute_offset(interpolation_domain(), m_offset); + // Calculate block sizes int lower_block_size; int upper_block_size; @@ -484,7 +485,7 @@ template < ddc::BoundCond BcUpper, SplineSolver Solver, class... IDimX> -int SplineBuilder< +void SplineBuilder< ExecSpace, MemorySpace, BSplines, @@ -492,9 +493,9 @@ int SplineBuilder< BcLower, BcUpper, Solver, - IDimX...>::compute_offset(interpolation_domain_type const& interpolation_domain) + IDimX...>:: + compute_offset(interpolation_domain_type const& interpolation_domain, int& offset) { - int offset; if constexpr (bsplines_type::is_periodic()) { // Calculate offset so that the matrix is diagonally dominant std::array values_ptr; @@ -517,7 +518,6 @@ int SplineBuilder< } else { offset = 0; } - return offset; } template < diff --git a/tests/splines/CMakeLists.txt b/tests/splines/CMakeLists.txt index 12d99dc48..c11def96a 100644 --- a/tests/splines/CMakeLists.txt +++ b/tests/splines/CMakeLists.txt @@ -9,7 +9,13 @@ include(GoogleTest) set(SPLINES_TEST_DEGREE_MIN 3 CACHE STRING "Minimum degree to test splines.") set(SPLINES_TEST_DEGREE_MAX 3 CACHE STRING "Maximum degree to test splines.") -add_executable(splines_tests ../main.cpp knots_as_interpolation_points.cpp view.cpp) +add_executable( + splines_tests + ../main.cpp + knots_as_interpolation_points.cpp + spline_builder.cpp + view.cpp +) target_compile_features(splines_tests PUBLIC cxx_std_17) target_link_libraries(splines_tests PUBLIC DDC::core DDC::splines GTest::gtest) diff --git a/tests/splines/spline_builder.cpp b/tests/splines/spline_builder.cpp new file mode 100644 index 000000000..a52ebb2bb --- /dev/null +++ b/tests/splines/spline_builder.cpp @@ -0,0 +1,139 @@ +// Copyright (C) The DDC development team, see COPYRIGHT.md file +// +// SPDX-License-Identifier: MIT + +#include +#include +#include + +#include +#include + +#include + +#include + +struct DimX +{ + static constexpr bool PERIODIC = true; +}; + +using CoordX = ddc::Coordinate; + +static constexpr std::size_t s_degree_x = 2; + +struct BSplinesX : ddc::UniformBSplines +{ +}; + +struct IDimX : ddc::NonUniformPointSampling +{ +}; + +using execution_space = Kokkos::DefaultHostExecutionSpace; +using memory_space = Kokkos::HostSpace; + +TEST(SplineBuilder, ShortInterpolationGrid) +{ + CoordX const x0(0.); + CoordX const xN(1.); + std::size_t const ncells = 5; + + ddc::init_discrete_space(x0, xN, ncells); + + // One point missing + std::vector const range {0.1, 0.3, 0.5, 0.7}; + + ddc::DiscreteDomain const interpolation_domain + = ddc::init_discrete_space(IDimX::init(range)); + + EXPECT_THROW( + (ddc::SplineBuilder< + execution_space, + memory_space, + BSplinesX, + IDimX, + ddc::BoundCond::PERIODIC, + ddc::BoundCond::PERIODIC, + ddc::SplineSolver::GINKGO, + IDimX>(interpolation_domain)), + std::runtime_error); +} + +TEST(SplineBuilder, LongInterpolationGrid) +{ + CoordX const x0(0.); + CoordX const xN(1.); + std::size_t const ncells = 5; + + ddc::init_discrete_space(x0, xN, ncells); + + // One point too much + std::vector const range {0.1, 0.3, 0.5, 0.7, 0.9, 0.95}; + + ddc::DiscreteDomain const interpolation_domain + = ddc::init_discrete_space(IDimX::init(range)); + + EXPECT_THROW( + (ddc::SplineBuilder< + execution_space, + memory_space, + BSplinesX, + IDimX, + ddc::BoundCond::PERIODIC, + ddc::BoundCond::PERIODIC, + ddc::SplineSolver::GINKGO, + IDimX>(interpolation_domain)), + std::runtime_error); +} + +TEST(SplineBuilder, BadShapeInterpolationGrid) +{ + CoordX const x0(0.); + CoordX const xN(1.); + std::size_t const ncells = 5; + + ddc::init_discrete_space(x0, xN, ncells); + + // All points end up in the first cell ]0, 0.2[ + std::vector const range {0.1, 0.11, 0.12, 0.13, 0.14}; + + ddc::DiscreteDomain const interpolation_domain + = ddc::init_discrete_space(IDimX::init(range)); + + EXPECT_THROW( + (ddc::SplineBuilder< + execution_space, + memory_space, + BSplinesX, + IDimX, + ddc::BoundCond::PERIODIC, + ddc::BoundCond::PERIODIC, + ddc::SplineSolver::GINKGO, + IDimX>(interpolation_domain)), + std::runtime_error); +} + +TEST(SplineBuilder, CorrectInterpolationGrid) +{ + CoordX const x0(0.); + CoordX const xN(1.); + std::size_t const ncells = 5; + + ddc::init_discrete_space(x0, xN, ncells); + + std::vector const range {0.1, 0.11, 0.25, 0.23, 0.24}; + + ddc::DiscreteDomain const interpolation_domain + = ddc::init_discrete_space(IDimX::init(range)); + + EXPECT_NO_THROW((ddc::SplineBuilder< + execution_space, + memory_space, + BSplinesX, + IDimX, + ddc::BoundCond::PERIODIC, + ddc::BoundCond::PERIODIC, + ddc::SplineSolver::GINKGO, + IDimX>(interpolation_domain))); +} From 04523404841cbe4ac863839a5be1797d41bd7a55 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Tue, 3 Dec 2024 18:15:25 +0100 Subject: [PATCH 10/10] Fix ordering of points in spline builder test --- tests/splines/spline_builder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/splines/spline_builder.cpp b/tests/splines/spline_builder.cpp index a52ebb2bb..8a1d60ffd 100644 --- a/tests/splines/spline_builder.cpp +++ b/tests/splines/spline_builder.cpp @@ -122,7 +122,7 @@ TEST(SplineBuilder, CorrectInterpolationGrid) ddc::init_discrete_space(x0, xN, ncells); - std::vector const range {0.1, 0.11, 0.25, 0.23, 0.24}; + std::vector const range {0.05, 0.15, 0.5, 0.85, 0.95}; ddc::DiscreteDomain const interpolation_domain = ddc::init_discrete_space(IDimX::init(range));