protected void quickSort(int l, int r) { double x = list_of_Trials[l + (r - l) / 2].GetPoint(); int i = l; int j = r; while (i <= j) { while (list_of_Trials[i].GetPoint() < x) { i++; } while (list_of_Trials[j].GetPoint() > x) { j--; } if (i <= j) { SearchInformationElement temp = list_of_Trials[i]; list_of_Trials[i] = list_of_Trials[j]; list_of_Trials[j] = temp; i++; j--; } } if (i < r) { quickSort(i, r); } if (l < j) { quickSort(l, j); } }
protected int n; // число шагов public void Init(FunkDelegate _f, double left, double right, int _n) { f = _f; a = left; b = right; n = _n; BestTrial = new SearchInformationElement(); list_of_Trials = new List <SearchInformationElement>(); list_of_test_points = new List <double>(); measurement_counterer = 0; list_of_interval_characteristic = new List <double>(); index_Max_Interval_Characteristic = 0; }