/// <summary>
 /// Ctor: the domain must be specified here.
 /// </summary>
 public WeierstrassContinuity(
     double a, double b, int RequestedMapCardinality,
     Functional_form the_continuousFunction,
     double targetPointInImage,
     int howManyImageSequenceElements,
     ImageSequenceChoice the_imageSequence,
     double par_toleranceInComparisonPseudoAnteImage
     )
 {
     if (this.isTheSame(a, b))    // a==b
     {
         throw new System.Exception("Domain: empty interval.");
     }// else can continue.
     //
     this.currentFunctionalForm = the_continuousFunction;
     //
     this.MapCardinality = RequestedMapCardinality;
     //
     if (a < b)
     {
         this.A = a;
         this.B = b;
     }
     else if (a > b)
     {
         this.A = b;
         this.B = a;
     }
     //
     this.targetPointInImage                   = targetPointInImage;
     this.ImageSequenceCardinality             = howManyImageSequenceElements;             // decide how many points, in image sequence.
     this.ImageSequenceChosen                  = the_imageSequence;                        // the method this.Sequencemanager will select the appropriate things to do, due to this choice.
     this.toleranceInComparisonPseudoAnteImage = par_toleranceInComparisonPseudoAnteImage; // the tolerance in comparison yn=?=f(xn).
 }// end Ctor
Exemplo n.º 2
0
        }//

        /// <summary>
        /// Integrate_percentile trapezium
        /// </summary>
        /// <param name="measure"></param>
        /// <returns></returns>
        public static double Integrate_percentile_trapezium(double left_bound, double measure, double delta)
        {
            Functional_form functional_form = new Functional_form(f);
            // NB. delta = 0.03  resulted optimal in a test, for 1/ln(t)
            double res = 0.0,
                   x   = left_bound;

            //
            for (; res <= measure; x += delta)
            {
                res += 0.5 * delta * (functional_form(x + delta) + functional_form(x));
            }
            //
            return(x); // return the value, until which I integrated
        }//
Exemplo n.º 3
0
        }//

        /// <summary>
        /// Trapezium Integration.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <param name="n"></param>
        /// <returns></returns>
        public static double Integrate_equi_trapezium(double a, double b, Int64 n)
        {
            Functional_form functional_form = new Functional_form(f); // NB. default==LogIntegral. Modificare questa riga del sorgente per variare l'integrando.
            double          delta           = (b - a) / (double)n,
                            res = 0.0,
                            x   = a + delta;// start from inf + delta

            //
            for (; x < b; x += delta)
            {// sum all the internal sides
                res += functional_form(x);
            }
            res *= delta;                                                   // multiply them for the common base
            res += (functional_form(a) + functional_form(b)) * 0.5 * delta; // (add extrema) * base/2
            //
            return(res);
        }//
Exemplo n.º 4
0
        }//

        /// <summary>
        /// Integrate_percentile equilog
        /// </summary>
        /// <param name="measure"></param>
        /// <returns></returns>
        public static double Integrate_percentile_equilog(double left_bound, double measure, double delta)
        {
            Functional_form functional_form = new Functional_form(f);
            // NB. delta = 0.03  resulted optimal in a test, for 1/ln(t)
            double res = 0.0,
                   f_x_delta, f_x,
                   x = left_bound;

            //
            for (; res <= measure; x += delta)
            {
                f_x_delta = functional_form(x + delta);
                f_x       = functional_form(x);
                res      += delta * (f_x_delta - f_x) / (Math.Log(f_x_delta) - Math.Log(f_x));
            }
            //
            return(x); // return the value, until which I integrated
        }//
Exemplo n.º 5
0
        }//

        /// <summary>
        /// Integrate_equi_log
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <param name="n"></param>
        /// <returns></returns>
        public static double Integrate_equi_log(double a, double b, Int64 n)
        {
            Functional_form functional_form = new Functional_form(f);
            double          res             = 0.0,
                            delta = (b - a) / (double)n,
                            f_x_delta, f_x,
                            x = a;

            //
            for (; x < b; x += delta)
            {
                f_x_delta = functional_form(x + delta);
                f_x       = functional_form(x);
                res      += delta * (f_x_delta - f_x) / (Math.Log(f_x_delta) - Math.Log(f_x));
            }
            //
            return(res);
        } //