Exemple #1
0
        public double GetRandom()
        {
            double SearchValue = FreeQuant.Quant.Random.Rndm();
            int    Index       = FinMath.BinarySearch(this.fNBins, this.GetIntegral(), SearchValue);

            if (Index >= 0 && Index < this.fNBins)
            {
                return(this.GetBinMin(Index) + this.fBinSize * (SearchValue - this.fIntegral[Index]) / (this.fIntegral[Index + 1] - this.fIntegral[Index]));
            }
            Console.WriteLine("Index111" + Index);
            return(0.0);
        }