5 #our($VERSION, @EXPORT_OK, @ISA);
9 use IO (); # Load the XS module
13 use vars qw($VERSION @ISA @EXPORT_OK);
34 sub set_canonical_name {
35 $canonical_name=$PROCESS_ID.host();
36 # $canonical_name="4279moby";
40 # These subroutines determine hostnames, archs, ...
44 $un=`uname -n`; chomp($un);
50 $us = `uname -s`; chomp($us);
51 $ur = `uname -r`; chomp($ur);
52 $up = `uname -p`; chomp($up);
53 return $us."-".$ur."-".$up;
59 if(scalar(@_)==0) {return $moy;}
72 foreach (@_) { $min = $_ if $_ < $min; }
81 foreach (@_) { $max = $_ if $_ > $max; }
102 if (($number-$e) < 0.5) {
109 ######################## fonctions aléatoires diverses #############################
115 for($i = @$tableau ; --$i; ) {
116 $j = int rand ($i+1);
118 @$tableau[$i,$j] = @$tableau[$j,$i];
130 $w = $u1*$u1 + $u2*$u2 ;
131 } while ( $w >=1 || $w==0 );
133 $w = sqrt ( (-2*log($w))/$w );
141 return ($min+rand($max-$min));