diff --git a/bin/mimp b/bin/mimp index 1ee08543..ba996793 100755 --- a/bin/mimp +++ b/bin/mimp @@ -12,7 +12,7 @@ use Config; use strict; use Getopt::Long; # External modules # -use Math::Random; +use random; # PsN includes # use PsN; use common_options; diff --git a/bin/xv_scm b/bin/xv_scm index 02e2b26f..8ea5b693 100755 --- a/bin/xv_scm +++ b/bin/xv_scm @@ -7,7 +7,7 @@ use lib "$Bin/../lib"; # Everything above this line will be replaced # use PsN; -use Math::Random; +use random; use strict; use Getopt::Long; use Cwd; diff --git a/lib/random.pm b/lib/random.pm index 2917b2dd..3b8792ec 100644 --- a/lib/random.pm +++ b/lib/random.pm @@ -4,7 +4,7 @@ use strict; use Exporter qw(import); use PsN; -our @EXPORT = qw(random_set_seed_from_phrase random_uniform_integer); +our @EXPORT = qw(random_set_seed_from_phrase random_uniform_integer random_permuted_index); our $old; @@ -37,4 +37,14 @@ sub random_uniform_integer } +sub random_permuted_index +{ + if ($old) { + return Math::Random::random_permuted_index(@_); + } else { + return Math::Random::Free::random_permuted_index(@_); + } +} + + 1; diff --git a/lib/tool/gls.pm b/lib/tool/gls.pm index 08125078..4e0739de 100644 --- a/lib/tool/gls.pm +++ b/lib/tool/gls.pm @@ -2,7 +2,7 @@ package tool::gls; use include_modules; use tool::modelfit; -use Math::Random; +use random; use Config; use Mouse; use MouseX::Params::Validate; diff --git a/lib/tool/mcmp.pm b/lib/tool/mcmp.pm index 365e9a3d..0ab478d1 100644 --- a/lib/tool/mcmp.pm +++ b/lib/tool/mcmp.pm @@ -1,7 +1,7 @@ package tool::mcmp; use include_modules; -use Math::Random; +use random; use strict; use tool::modelfit; use model; diff --git a/lib/tool/nonpb.pm b/lib/tool/nonpb.pm index cf64420d..595860c1 100644 --- a/lib/tool/nonpb.pm +++ b/lib/tool/nonpb.pm @@ -1,7 +1,7 @@ package tool::nonpb; use include_modules; -use Math::Random; +use random; use strict; use tool::modelfit; use tool::pind; diff --git a/lib/tool/npc.pm b/lib/tool/npc.pm index 7a0f699a..857be155 100644 --- a/lib/tool/npc.pm +++ b/lib/tool/npc.pm @@ -1,7 +1,7 @@ package tool::npc; use include_modules; -use Math::Random; +use random; use strict; use tool::modelfit; use model; diff --git a/lib/tool/pvar.pm b/lib/tool/pvar.pm index 8374f67e..34201ce0 100644 --- a/lib/tool/pvar.pm +++ b/lib/tool/pvar.pm @@ -1,7 +1,7 @@ package tool::pvar; use include_modules; -use Math::Random; +use random; use File::Spec; use Mouse; use MouseX::Params::Validate; diff --git a/lib/tool/qa.pm b/lib/tool/qa.pm index 55c55c62..44e12225 100644 --- a/lib/tool/qa.pm +++ b/lib/tool/qa.pm @@ -1,7 +1,7 @@ package tool::qa; use strict; -use Math::Random; +use random; use Mouse; use MouseX::Params::Validate; use File::Copy 'cp';