Do not use deprecated std::random_shuffle (#2507)

This commit is contained in:
Juha Reunanen 2022-02-12 16:16:51 +02:00 committed by GitHub
parent d665bfb899
commit 48f1167991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@
#include <algorithm> #include <algorithm>
#include <dlib/matrix.h> #include <dlib/matrix.h>
#include <cmath> #include <cmath>
#include <random>
#include "tester.h" #include "tester.h"
@ -404,6 +405,8 @@ namespace
string str = "DlibRocks"; string str = "DlibRocks";
std::minstd_rand shuffle_random;
for(int j = 0; j<5 ; j++) for(int j = 0; j<5 ; j++)
{ {
matrix<double,1,100000> dat; matrix<double,1,100000> dat;
@ -422,7 +425,7 @@ namespace
double exkurdenom = 0; double exkurdenom = 0;
double unbi_exkur = 0; double unbi_exkur = 0;
random_shuffle(str.begin(), str.end()); std::shuffle(str.begin(), str.end(), shuffle_random);
rnum.set_seed(str); rnum.set_seed(str);
for(int i = 0; i<n; i++) for(int i = 0; i<n; i++)