Skip to content

Commit

Permalink
task05 ??
Browse files Browse the repository at this point in the history
  • Loading branch information
I-7 committed Jun 16, 2024
1 parent e19fddc commit fec581b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/phg/mvs/depth_maps/pm_fast_random.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "pm_fast_random.h"

#include <libutils/rasserts.h>
#include <iomanip>


// Returns pseudo-random value in range [min; max] (inclusive)
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fec581b

Please sign in to comment.