From 9886d01907e30eccab02aa634c907afe3787f3cb Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 1 Dec 2025 17:26:27 +0100 Subject: [PATCH] RotationIndexerTest: Use FFT or FFTW indexing (if available) --- tests/RotationIndexerTest.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/RotationIndexerTest.cpp b/tests/RotationIndexerTest.cpp index 390eea2f..bd0148e7 100644 --- a/tests/RotationIndexerTest.cpp +++ b/tests/RotationIndexerTest.cpp @@ -17,18 +17,26 @@ TEST_CASE("RotationIndexer") { .DetectorDistance_mm(200); IndexingSettings settings; +#ifdef JFJOCH_USE_CUDA + settings.Algorithm(IndexingAlgorithmEnum::FFT); +#elif JFJOCH_USE_FFTW + settings.Algorithm(IndexingAlgorithmEnum::FFTW); +#else + return; +#endif + settings.RotationIndexing(true).RotationIndexingAngularStride_deg(1.0).RotationIndexingMinAngularRange_deg(30.0); exp_i.ImportIndexingSettings(settings); // Base lattice (non-pathological) - CrystalLattice latt_base(40, 50, 80, 90, 95, 90); + CrystalLattice latt_base(40, 50, 80, 90, 90, 90); // Rotation axis: around X with 1 deg per image GoniometerAxis axis("omega", 0.0f, 1.0f, Coord(1,0,0), std::nullopt); exp_i.Goniometer(axis); BraggPredictionSettings prediction_settings{ - .high_res_A = 1.5, + .high_res_A = 1.3, .ewald_dist_cutoff = 0.002 }; @@ -65,7 +73,7 @@ TEST_CASE("RotationIndexer") { CHECK (cnt == 20); auto ret = indexer.Finalize(false); - REQUIRE(ret); + REQUIRE(ret.has_value()); CHECK(ret->search_result.centering == 'P'); CHECK(ret->search_result.system == gemmi::CrystalSystem::Monoclinic); } \ No newline at end of file