rugnux far-end check: PI from JFJochMath.h, as M_PI is not defined on MSVC; ResultReport test follows the supercell warning's wording
RugnuxFarEnd.cpp used M_PI, which MSVC does not define without _USE_MATH_DEFINES, and broke the Windows viewer build (C2065). The ResultReport_SupercellCheck test still looked for the supercell warning's wording from before the doubled-cell change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EizBKhTqrAYago9KJG3dA3
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "Rugnux.h"
|
||||
#include "RugnuxPipeline.h"
|
||||
#include "../common/JFJochMath.h" // PI - M_PI is not portable to MSVC
|
||||
#include "../image_analysis/indexing/AnalyzeIndexing.h" // SPOT_BUDGET_SIGNIFICANCE_Z
|
||||
|
||||
// The far-end check. LOG ONLY: it decides nothing and changes nothing the run writes.
|
||||
@@ -50,7 +51,7 @@ namespace {
|
||||
for (int j = 1; 2 * j + 1 <= dof - 2; j++)
|
||||
sum += term *= c2 * (2.0 * j) / (2.0 * j + 1.0);
|
||||
const double a = dof == 1 ? theta : theta + std::sin(theta) * std::cos(theta) * sum;
|
||||
return std::max(0.0, 1.0 - 2.0 * a / M_PI);
|
||||
return std::max(0.0, 1.0 - 2.0 * a / PI);
|
||||
}
|
||||
for (int j = 1; 2 * j <= dof - 2; j++)
|
||||
sum += term *= c2 * (2.0 * j - 1.0) / (2.0 * j);
|
||||
@@ -149,8 +150,8 @@ void Rugnux::FarEndCheck(PipelineLocals &p, const RotationIndexerResult &rot) {
|
||||
static_cast<float>(0.5 * (R[0][2] - R[2][0])),
|
||||
static_cast<float>(0.5 * (R[1][0] - R[0][1])));
|
||||
const double about = w * spindle;
|
||||
frame[ABOUT_SPINDLE][o] = about * 180.0 / M_PI;
|
||||
frame[OFF_SPINDLE][o] = (w - spindle * static_cast<float>(about)).Length() * 180.0 / M_PI;
|
||||
frame[ABOUT_SPINDLE][o] = about * 180.0 / PI;
|
||||
frame[OFF_SPINDLE][o] = (w - spindle * static_cast<float>(about)).Length() * 180.0 / PI;
|
||||
}
|
||||
|
||||
// The cell the strong reflections ask for: d at the observed centroid against d predicted.
|
||||
|
||||
@@ -1013,7 +1013,7 @@ TEST_CASE("ResultReport_SupercellCheck", "[Diagnostics]") {
|
||||
result.leftover_lattices = census;
|
||||
text = RenderResultReport("p", "in.h5", x, result);
|
||||
CHECK(text.find("the further lattice domains found may put spots there") != std::string::npos);
|
||||
CHECK(text.find("spots of the further lattice domains found landing on those positions") != std::string::npos);
|
||||
CHECK(text.find("spots of the further lattice domains found land on those positions") != std::string::npos);
|
||||
|
||||
// Not measured to rock: no indication.
|
||||
result.supercell->rock_pct = 1.0;
|
||||
|
||||
Reference in New Issue
Block a user