Ejemplo n.º 1
0
 /// <summary>
 /// Retruns the integral of a one dimensional function <c>f</c>. The integral is computed until the error is below either
 /// <c>epsabs</c>
 /// or <c>epsrel</c>. This routine corresponds to
 /// <see cref="JohnsHope.Analysis.Int.qa(JohnsHope.Analysis.IFunction1D, double, double, double, double, int, float, out double)"/>.
 /// </summary>
 /// <param name="f">The function to integrate</param>
 /// <param name="a">The lower bound of the integral</param>
 /// <param name="b">The upper bound of the integral</param>
 /// <param name="epsabs">The required absolute error</param>
 /// <param name="epsrel">The required relative error</param>
 /// <param name="memlimit">The maximum amount of memory used, in bytes</param>
 /// <param name="smoothness">The smoothness of the funtion, 1 meaning a maximal smooth function and 0 meaning a function
 /// with maximun local difficulties</param>
 /// <param name="abserr">The absolute error of the computed integral</param>
 /// <returns>The computed value of the integral</returns>
 public static double intqa(JohnsHope.Analysis.IFunction1D f, double a, double b, double epsabs, double epsrel, int memlimit,
                            float smoothness, out double abserr)
 {
     return(Int.qa(f, a, b, epsabs, epsrel, memlimit, smoothness, out abserr));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns df/dx for a one dimensional function <c>f</c>. This routine is an alias for
 /// <see cref="JohnsHope.Analysis.Diff.dfdx(JohnsHope.Analysis.IFunction1D, double, out double)"/>.
 /// </summary>
 /// <param name="f">The function</param>
 /// <param name="x">The x coordinate</param>
 /// <param name="abserr">The absolute error of the derivative</param>
 /// <returns>The value of the derivative of f at x</returns>
 public static double dfdx(JohnsHope.Analysis.IFunction1D f, double x, out double abserr)
 {
     return(Diff.dfdx(f, x, out abserr));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Returns the integral of a one dimensional function <c>f</c>. The integral is computed until the error is below either
 /// <c>epsabs</c> or <c>epsrel</c>. This routine corresponds to
 /// <see cref="JohnsHope.Analysis.Int.q(JohnsHope.Analysis.IFunction1D, double, double, double, double, out double)"/>.
 /// the Gnu Scientific Library.
 /// </summary>
 /// <param name="f">The function to integrate.</param>
 /// <param name="a">The lower bound of the integral</param>
 /// <param name="b">The upper bound of the integral</param>
 /// <param name="epsabs">The required absoulte error</param>
 /// <param name="epsrel">The required relative error</param>
 /// <param name="abserr">The absolute error of the computed integral</param>
 /// <returns>The computed value of the integral</returns>
 public static double intq(JohnsHope.Analysis.IFunction1D f, double a, double b, double epsabs, double epsrel,
                           out double abserr)
 {
     return(Int.q(f, a, b, epsabs, epsrel, out abserr));
 }