Exemplo n.º 1
0
        private void method_1()
        {
            bool flag = true;

            this.vector_2  = this.vector_4 + (double)this.DR * (Vector.Rand(this.vector_2.NRows) - 0.5);
            this.vector_2  = Vector.Min(this.vector_2, this.vector_1);
            this.vector_2  = Vector.Max(this.vector_2, this.vector_0);
            this.double_7  = this.func_0(this.vector_2);
            this.double_11 = Math.Abs(this.double_7 - this.double_9);
            if (this.double_7 > this.double_9)
            {
                if (this.double_12 == 0.0)
                {
                    this.double_12 = this.double_11;
                }
                this.double_2 = Math.Exp(-this.double_11 / (this.double_5 * this.double_12));
                if (this.double_2 > this.random_0.NextDouble())
                {
                    flag = true;
                    this.int_4++;
                }
                else
                {
                    flag = false;
                    this.int_5++;
                }
            }
            if (flag)
            {
                this.vector_4 = this.vector_2;
                this.double_9 = this.double_7;
                if (this.double_9 < this.double_10)
                {
                    this.double_10 = this.double_9;
                    this.vector_5  = this.vector_4;
                }
                this.int_2++;
                this.double_12 = (this.double_12 * ((double)this.int_2 - 1.0) + this.double_11) / (double)this.int_2;
                return;
            }
            this.int_3++;
        }