From 6ad78cc78f429f1ed3d2682e1580c4d5da293590 Mon Sep 17 00:00:00 2001 From: Oleg Alexandrov Date: Fri, 30 Aug 2024 21:17:52 -0700 Subject: [PATCH] Fix mac compile problem --- src/asp/Camera/JitterSolveCostFuns.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/asp/Camera/JitterSolveCostFuns.cc b/src/asp/Camera/JitterSolveCostFuns.cc index 166239269..d77399ff0 100644 --- a/src/asp/Camera/JitterSolveCostFuns.cc +++ b/src/asp/Camera/JitterSolveCostFuns.cc @@ -40,6 +40,12 @@ #include #include +#include +#include +#include +#include +#include + namespace asp { // An error function minimizing the error of projecting an xyz point @@ -1711,10 +1717,13 @@ void loadReferenceTerrain(asp::BaBaseOptions const& opt, // If they are too many, pick a subset if (reference_vec.size() > opt.max_num_reference_points) { - std::random_shuffle(reference_vec.begin(), reference_vec.end()); + // Deterministic shuffle + unsigned seed = 0; + std::mt19937 gen(seed); + std::shuffle(reference_vec.begin(), reference_vec.end(), gen); reference_vec.resize(opt.max_num_reference_points); } - + vw::vw_out() << "Read " << reference_vec.size() << " reference terrain points (after filtering by projection into camera).\n";