lemon/random.h
changeset 145 95d905b6e33d
parent 110 f2d66d810c88
child 177 b685e12e08c0
equal deleted inserted replaced
11:d7234d0ec3ff 12:90f288a33d28
   793 	  {
   793 	  {
   794 	    xi=1.0-std::log(V1);
   794 	    xi=1.0-std::log(V1);
   795 	    nu=V0*std::exp(-xi);
   795 	    nu=V0*std::exp(-xi);
   796 	  }
   796 	  }
   797       } while(nu>std::pow(xi,delta-1.0)*std::exp(-xi));
   797       } while(nu>std::pow(xi,delta-1.0)*std::exp(-xi));
   798       return theta*(xi-gamma(int(std::floor(k))));
   798       return theta*(xi+gamma(int(std::floor(k))));
   799     }
   799     }
   800     
   800     
   801     /// Weibull distribution
   801     /// Weibull distribution
   802 
   802 
   803     /// This function generates a Weibull distribution random number.
   803     /// This function generates a Weibull distribution random number.
   817     ///\param k shape parameter (<tt>k>0</tt>)
   817     ///\param k shape parameter (<tt>k>0</tt>)
   818     ///\param x_min location parameter (<tt>x_min>0</tt>)
   818     ///\param x_min location parameter (<tt>x_min>0</tt>)
   819     ///
   819     ///
   820     double pareto(double k,double x_min)
   820     double pareto(double k,double x_min)
   821     {
   821     {
   822       return exponential(gamma(k,1.0/x_min));
   822       return exponential(gamma(k,1.0/x_min))+x_min;
   823     }  
   823     }  
   824       
   824       
   825     /// Poisson distribution
   825     /// Poisson distribution
   826 
   826 
   827     /// This function generates a Poisson distribution random number with
   827     /// This function generates a Poisson distribution random number with