Example #1
0
 // Set how to sample system states
 // given the specified parameter. 
 protected internal override void PartialSample(
     double[] destinationArray,
     Tuple<int, int> sampleSubsetRange,
     RandomNumberGenerator randomNumberGenerator,
     DoubleMatrix parameter,
     int sampleSize)
 {
     // Must be Item1 included, Item2 excluded
     int subSampleSize = sampleSubsetRange.Item2 - sampleSubsetRange.Item1;
     int leadingDimension = Convert.ToInt32(sampleSize);
     for (int j = 0; j < this.StateDimension; j++)
     {
         var distribution = new ExponentialDistribution(1.0 / parameter[j])
         {
             RandomNumberGenerator = randomNumberGenerator
         };
         distribution.Sample(
              subSampleSize,
              destinationArray, j * leadingDimension + sampleSubsetRange.Item1);
     }
 }