Pelsser.SquaredGaussianModel.B C# (CSharp) Method

B() public method

Calculates the function B(t, T) of the model, which is an integral, for all elements.
public B ( int ti, int si, double delta ) : double[]
ti int The starting Index from where to calculate.
si int The ending Index of the integration.
delta double The delta of time where to execute the calculation.
return double[]
        public double[] B(int ti, int si, double delta)
        {
            double[] intermediates = new double[si - ti];

            for (int i = ti; i < si; i++)
                intermediates[i - ti] = this.alphaT[i] / this.dDeltaT[si - i];

            double[] result = new double[si - ti];
            double IB = 0;
            for (int i = si - 1; i >= ti; i--)
            {
                IB += intermediates[i - ti];
                result[i - ti] = 2 * this.dDeltaT[si - i] * IB * delta;

            }

            /*
            for (int i = si - 1; i >= ti; i--)
            {
                var v =new Vector(
                //IB += intermediates[i - ti];
                //result[i - ti] = 2 * this.dDeltaT[si - i] * IB * delta;
            }
            */
            return result;
        }