diff --git a/src/phg/mvs/depth_maps/pm_fast_random.cpp b/src/phg/mvs/depth_maps/pm_fast_random.cpp index a71a40d..cefdf56 100644 --- a/src/phg/mvs/depth_maps/pm_fast_random.cpp +++ b/src/phg/mvs/depth_maps/pm_fast_random.cpp @@ -1,6 +1,7 @@ #include "pm_fast_random.h" #include +#include // Returns pseudo-random value in range [min; max] (inclusive) @@ -33,6 +34,11 @@ float phg::FastRandom::nextf(float min, float max) { rassert(result >= 0.0f, 23910121261046); rassert(result <= 1.0f, 23910121261047); result = min + result * (max - min); + if (!(result <= max)) { + std::cout << std::setprecision(20) << std::fixed << min << std::endl; + std::cout << std::setprecision(20) << std::fixed << result << std::endl; + std::cout << std::setprecision(20) << std::fixed << max << std::endl; + } rassert(result >= min, 23910121261049); rassert(result <= max, 23910121261050); return result; diff --git a/tests/utils/test_utils.cpp b/tests/utils/test_utils.cpp index 8f6c8e6..64bf9fe 100644 --- a/tests/utils/test_utils.cpp +++ b/tests/utils/test_utils.cpp @@ -213,7 +213,7 @@ Dataset loadDataset(const std::string &dataset_dir_name, int dataset_downscale) vector3d diff = tie_point - point_test; double norm2 = phg::norm2(diff); - rassert(norm2 < 0.01, 241782412410125); + rassert(norm2 < 0.0001, 241782412410125); double depth = px[2]; rassert(depth > 0.0, 238419481290132);