title: Random Number Generator with Beta Distribution
body: <p>I need the c or c++ source code of a function like <code>betarand(a,b)</code> that produces random number with beta distribution . I know that I can use <em>boost</em> library but I'm going to port it for CUDA architecture so I need the code. Can somebody help me?<br>
  Meantime I have <code>betapdf</code>(Beta Probability density function). But I don't know how to use it for creating random numbers :). </p>