title: boost::shared_ptr / QuantLib / stochastic process / path generation
body: <p>Happy Holidays, everyone !</p>
  
  <p>I'm trying to generate paths of a square root process using the QuantLib/Boost C++ libraries and have encountered what I believe to be an annoying little problem with a fast and simple solution! I'm pretty new to programming so please don't be too harsh on me :) 
  Here's what I know: 
   1. The constructor looks like this:</p>
  
  <p><code>SquareRootProcess( Real b, Real a, Volatility sigma, Real x0 = 0.0,
  const boost::shared_ptr&lt;discretization&gt;&amp; d =
  boost::shared_ptr&lt;discretization&gt;(new EulerDiscretization))</code></p>
  
  <ol>
  <li><p>The crucial function to be used when simulating a stochastic process with QuantLib is 
  evolve(t,x,dt,dw).</p></li>
  <li><p>Here's what my code looks like: </p>
  
  <pre><code>#include "stdafx.h" 
  #include &lt;ql/quantlib.hpp&gt;
  #include &lt;ql/stochasticprocess.hpp&gt;
  #include &lt;ql/processes/squarerootprocess.hpp&gt;
  #include &lt;ql/Processes/eulerdiscretization.hpp&gt;
  using namespace QuantLib;
  void SquareRootProcessSimulation()
  {
  
  Real miu0=0.0;
  Real miu;
  Real b=0.3;
  Real a=5.5;
  Volatility sigma=2.02;
  
  BigInteger seed=12324;
  MersenneTwisterUniformRng unifMt(seed);
  BoxMullerGaussianRng&lt;MersenneTwisterUniformRng&gt; bmGauss(unifMt);
  
  const boost::shared_ptr&lt;StochasticProcess1D::discretization&gt; &amp;d = 
                     boost::shared_ptr&lt;StochasticProcess1D::discretization&gt;(
                      EndEulerDiscretization);
  boost::shared_ptr&lt;SquareRootProcess&gt; squareRootProcess(new 
                                    SquareRootProcess(b, a, sigma, miu0, d&amp;));
  
  Time dt=0.1,t=0.0;
  Real dw;
  Size numVals=10;
  
  for (Size j=1;j&lt;=numVals;++j)
  {
        dw=bmGauss.next().value;
    miu=squareRootProcess-&gt;evolve(t,miu0,dt,dw);
        std::cout &lt;&lt; "Time: " &lt;&lt; t+dt &lt;&lt; ", miu_t: " &lt;&lt; miu &lt;&lt; std::endl;
    t+=dt;
  }
  };
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      SquareRootProcessSimulation();
      std::cin.get();
      return 0;
  }
  </code></pre>
  
  <p>`</p></li>
  </ol>
  
  <hr>
  
  <p>I get no errors when compiling/running the code, but what comes out is a constant value, i.e. something is obviously wrong. I think the problem is in the way I've defined the stochastic process, I cannot quite figure out how the interpret the last part of the constructor with the boost::shared_ptr.</p>
  
  <p>I'm happy to hear any suggestions and hints and thanks for taking the time to read my question!</p>
  
  <p>best regards :)</p>