Dev/rosenblatttransform (#241)

- added rosenblatttransform 
- added 3x3 eta methods 
- interpolation can be used with various eta functions
- added documentation for interpolation, eta calculation 
- exposed full eta struct in python 
- disable ClusterFinder for 2x2 clusters 
- factory function for ClusterVector

---------

Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
This commit is contained in:
2025-11-21 14:48:46 +01:00
committed by GitHub
parent 7fb500c44c
commit 267ca87ab0
49 changed files with 3253 additions and 1172 deletions

View File

@@ -192,3 +192,43 @@ TEST_CASE("Last element is different", "[algorithm]") {
std::vector<int> vec = {1, 1, 1, 1, 2};
REQUIRE(aare::all_equal(vec) == false);
}
TEST_CASE("Linear interpolation", "[algorithm]") {
SECTION("interpolated mean value") {
const double interpolated_value =
aare::linear_interpolation({0.0, 1.0}, {4.0, 6.0}, 0.5);
REQUIRE(interpolated_value == 5.0);
}
SECTION("interpolate left value") {
const double interpolated_value =
aare::linear_interpolation({0.0, 1.0}, {4.0, 6.0}, 0.0);
REQUIRE(interpolated_value == 4.0);
}
SECTION("interpolate right value") {
const double interpolated_value =
aare::linear_interpolation({0.0, 1.0}, {4.0, 6.0}, 1.0);
REQUIRE(interpolated_value == 6.0);
}
SECTION("interpolate the same value") {
const double interpolated_value =
aare::linear_interpolation({0.0, 1.0}, {4.0, 4.0}, 0.5);
REQUIRE(interpolated_value == 4.0);
}
}
TEST_CASE("Bilinear interpolation", "[algorithm]") {
SECTION("interpolated mean value") {
const double interpolated_value_left =
aare::linear_interpolation({0.0, 1.0}, {4.0, 6.0}, 0.5);
const double interpolated_value_right =
aare::linear_interpolation({0.0, 1.0}, {5.0, 6.0}, 0.5);
const double interpolated_value = aare::linear_interpolation(
{0.5, 1.0}, {interpolated_value_left, interpolated_value_right},
0.75);
REQUIRE(interpolated_value == 5.25);
}
}