fork download
  1. /*
  2. Tool chi dung trong truong hop ham f thoa man 2 dieu kien:
  3. - Ham f bieu dien duoc duoi dang 1/2 * xT * A * x + bT * x + c
  4. - A la ma tran xac dinh duong
  5.  
  6.  
  7.  
  8.  
  9. Input:
  10. - Dong dau la 'n': So chieu cua khong gian
  11. - Dong thu hai gom (n+1)*n/2 so: Cac he so cua ham trong bieu dien phan bac 2
  12. - Dong thu ba gom n so: Cac he so cua ham trong bieu dien phan bac 1
  13. - Dong thu tu gom 1 so: He so tu do
  14. - Dong thu nam gom n so: Diem xuat phat
  15.  
  16. Output:
  17. - Bieu dien qua trinh thuc hien quy tac Exact Line Search/Armijo duoi dang bang
  18.  
  19.  
  20.  
  21.  
  22.  
  23. Vi du:
  24. Input:
  25. 4
  26. 5 1 0 1 4 1 0 3 1 2
  27. 2 4 -7 8
  28. 6
  29. 4 2 3 7
  30.  
  31. -> f(x,y,z,t) = 5x^2 + 1xy + 0xz + 1xt
  32. + 4y^2 + 1yz + 0yt
  33. + 3z^2 + 1zt
  34. + 2t^2
  35. + 2x + 4y -7z + 8t
  36. + 6
  37.  
  38. Xuat phat: (x0; y0; z0; t0) = (4; 2; 3; 7);
  39.  
  40.  
  41. Output:
  42. -> Nghiem toi uu cho bai toan min f(x,y,z,t) tren R4:
  43. (0.118055555589, -0.726851851816, 1.696759259221, -2.453703703590)
  44. Gia tri nho nhat dat duoc la -11.089120370370
  45. */
  46.  
  47.  
  48.  
  49. //------- Khoi tao ------------
  50. #include <bits/stdc++.h>
  51. #define up(i,a,b) for (int i = (int)a; i <= (int)b; i++)
  52. #define PB push_back
  53. #define ld long double
  54. using namespace std;
  55.  
  56. const int maxn = 1e5 + 10;
  57. ld epsilon;
  58. int precision_digit;
  59.  
  60. template <typename T>
  61. string to_string_precs(const T a_value, const int n = precision_digit){
  62. std::ostringstream out;
  63. out.precision(n);
  64. out << std::fixed << a_value;
  65. return std::move(out).str();
  66. }
  67.  
  68. vector<ld> x[maxn];
  69. ld t[maxn], res[maxn];
  70. vector<string> fin[maxn];
  71. string description[maxn];
  72. string indent[maxn];
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. //--------- Cac ham quan trong ---------------
  80. //Tich vo huong cua hai vector
  81. ld DOT(const vector<ld>& A, const vector<ld>& B, int n){
  82. ld sum = 0;
  83. up(i, 0, n-1) sum += A[i] * B[i];
  84. return sum;
  85. }
  86.  
  87. //Gia tri ham f doi voi ma tran A, B, C tai diem X, khong gian n chieu.
  88. //f = 1/2 * xT * A * x + bT * x + c
  89. ld f(const vector<vector<ld> >& A, const vector<ld>& B, const ld& C, const vector<ld>& X, const int& n){
  90. vector<ld> temp(n, 0);
  91. up(j, 0, n-1){
  92. for (int i = 0; i <= j; i++){
  93. ld H = A[i][j];
  94. if (i == j) H /= 2;
  95. temp[j] += X[i] * H;
  96. }
  97. }
  98.  
  99. ld sum = DOT(temp, X, n) + DOT(B, X, n) + C;
  100. return sum;
  101. }
  102.  
  103. //Gradient tai diem X
  104. vector<ld> GRAD(const vector<vector<ld> >& A, const vector<ld>& B, const vector<ld>& X, const int& n){
  105. vector<ld> temp(n, 0);
  106. up(j, 0, n-1) up(i, 0, n-1){
  107. temp[j] += X[i] * A[i][j];
  108. }
  109. up(i, 0, n-1) temp[i] += B[i];
  110.  
  111. return temp;
  112. }
  113.  
  114. //Am Gradient tai diem X
  115. vector<ld> MINUS_GRAD(const vector<vector<ld> >& A, const vector<ld>& B, const vector<ld>& X, const int& n){
  116. vector<ld> temp(n, 0);
  117. temp = GRAD(A, B, X, n);
  118. up(i, 0, n-1) temp[i] = -temp[i];
  119. return temp;
  120. }
  121.  
  122. //Tich cua mot vector [1 x n] voi mot ma tran [n x n] -> vector [1 x n]
  123. vector<ld> MXV(const vector<vector<ld> >& A, const vector<ld>& X, const int& n){
  124. vector<ld> temp(n, 0);
  125. up(j, 0, n-1) up(i, 0, n-1){
  126. temp[j] += X[i] * A[i][j];
  127. }
  128. return temp;
  129. }
  130.  
  131. //X_(k+1) = X_(k) + t_(k)*d_(k)
  132. vector<ld> FIND_NEXT(const vector<ld>& X, const ld& T, const vector<ld>& D, const int& n){
  133. vector<ld> temp(n, 0);
  134. up(i, 0, n-1) temp[i] = X[i] + T*D[i];
  135. return temp;
  136. }
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146. //------- Exact line search starts ---------
  147. ld Exact_line_search (const vector<vector<ld> >& A, const vector<ld>& B, const ld& C, const vector<ld>& X, const vector<ld>& d, const int& n){
  148. return (DOT(d, d, n))/DOT(MXV(A, d, n), d, n);
  149. }
  150.  
  151. //----- Armijo starts ---------
  152. int cnt = 0;
  153. ld t0, m, alpha, beta;
  154. ld Armijo_step_size(const vector<vector<ld> >& A, const vector<ld>& B, const ld& C, const vector<ld>& X, const vector<ld>& d, const int& n) {
  155. ld t = t0; // Reset t ve t0 cap nhat duoc gan nhat trong moi lan tim co buoc phu hop
  156.  
  157. ld fx = f(A, B, C, X, n);
  158. ld grad_dot_d = DOT(GRAD(A, B, X, n), d, n);
  159. while (true) {
  160. vector<ld> X_new = FIND_NEXT(X, t, d, n);
  161. ld fx_new = f(A, B, C, X_new, n);
  162. if (fx_new - fx <= m * t * grad_dot_d) {
  163. t0 = t;
  164. return t;
  165. }
  166. t *= alpha;
  167. if (t < beta) break;
  168. ++cnt;
  169. }
  170. return t;
  171. }
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. //------ GRADIENT DESCENT CONCEPT --------
  180. void Gradient_Descent(vector<vector<ld> >& A, vector<ld>& B, ld& C, vector<ld>& X, int n, int& lim,
  181. ld (*kind)(const vector<vector<ld> >&, const vector<ld>&, const ld&, const vector<ld>&, const vector<ld>&, const int&)){
  182. x[0] = X;
  183. res[0] = f(A, B, C, x[0], n);
  184.  
  185. for (int i = 1; i <= lim; i++){
  186. vector<ld> d = MINUS_GRAD(A, B, x[i-1], n);
  187. if (sqrt(DOT(d, d, n)) < epsilon){
  188. cout << "Desired stationary point found at iteration: " << i-1 << "\n\n";
  189. lim = i-1;
  190. break;
  191. }
  192.  
  193. t[i-1] = kind(A, B, C, X, d, n);
  194. x[i] = FIND_NEXT(x[i-1], t[i-1], d, n);
  195. res[i] = f(A, B, C, x[i], n);
  196. }
  197. }
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206. //------ INPUT + PREPROCESSING ----------
  207. void input(vector<vector<ld> >& A, vector<ld>& B, ld& C, vector<ld>& X, int& n){
  208. up(i, 0, n-1) up(j, i, n-1) cin >> A[i][j];
  209. //xx xy xz yy yz zz
  210.  
  211. up(i, 0, n-1) cin >> B[i];
  212. //x y z
  213.  
  214. cin >> C;
  215. //C
  216.  
  217. up(i, 0, n-1) cin >> X[i];
  218. //x1 x2 x3
  219.  
  220. up(i, 0, n-1){
  221. up(j, i, n-1){
  222. if (i == j) A[i][j] *= 2;
  223. else A[j][i] = A[i][j];
  224. }
  225. }
  226. // A in 1/2(xT*A*x)
  227. }
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235. // ------ OUTPUT ---------
  236. void parse_indent(const vector<string>& fin, const int& max_length){
  237. int k = (int)fin.size();
  238. description[0] = "i";
  239. description[k-1] = "delta f";
  240. description[k-1 - 1] = "ti";
  241. description[k-1 - 2] = "f";
  242.  
  243. for (int i = 1; i < k-1 - 2; i++){
  244. string cur_description = "x" + to_string(i);
  245. description[i] = cur_description;
  246. }
  247.  
  248. up(i, 0, k-1) indent[i] = string(max_length+2, ' ');
  249. }
  250.  
  251. void print_columns(const vector<string>& fin, const int& max_length){
  252. up(i, 0, fin.size()-1){
  253. cout << description[i];
  254. cout << indent[i];
  255. }
  256. cout << "\n";
  257. }
  258.  
  259. void print_result_table(const int& lim, const int& max_length){
  260. up(i,0,lim){
  261. for (int j = 0; j < (int)fin[i].size(); j++){
  262. cout << fin[i][j] << " ";
  263. if ((int)fin[i][j].size() < max_length){
  264. int dotdot = max_length - (int)fin[i][j].size();
  265. if (j == 0) dotdot -= (max_length - 7);
  266. cout << string(dotdot, ' ');
  267. }
  268. cout << "| ";
  269. }
  270. cout << "\n";
  271. }
  272. cout << "\n";
  273. }
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. //--------- MAIN -------------
  283. signed main(){
  284. ios_base::sync_with_stdio(false);
  285. cin.tie(0);
  286. #define Task "A"
  287. if (fopen(Task".inp", "r")){
  288. freopen(Task".inp", "r", stdin);
  289. freopen(Task".out", "w", stdout);
  290. }
  291.  
  292. cout << fixed << setprecision(12);
  293.  
  294. // --------- INPUT ------------
  295. int n;
  296. cin >> n;
  297.  
  298. vector<vector<ld> > A(n, vector<ld>(n, 0));
  299. vector<ld> B(n, 0);
  300. ld C;
  301. vector<ld> X(n, 0);
  302. input(A, B, C, X, n);
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314. // --------- ALGORITHM ----------
  315. /**
  316.   int lim = 10000; // So lan lap toi da
  317.   ld t0 = 1; // t0 ban dau trong thuat toan Armijo
  318.   ld m = 0.5; // He so dieu kien: nen dat trong khoang [0.5 -> 0.7]
  319.   ld alpha = 0.9; // Learning rate: nen dat trong khoang [0.5 -> 0.95]
  320.   ld beta = 1e-6; // Co buoc toi thieu: cham qua thi thoi
  321.   ld epsilon = 1e-9; // Gia tri toi thieu can dat duoc cua NORM(GRAD(diem dung)): cang chuan -> chay cang cham
  322.   int precision_digit = 12; // So chu so sau dau phay khi hien thi ket qua
  323.   **/
  324. int lim = 50000;
  325. t0 = 1;
  326. m = 0.5;
  327. alpha = 0.8;
  328. beta = 1e-6;
  329. epsilon = 1e-5;
  330. precision_digit = 5;
  331. Gradient_Descent(A, B, C, X, n, lim, Armijo_step_size);
  332. // Gradient_Descent(A, B, C, X, n, lim, Exact_line_search);
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346. //-------- Parsing Output -----------
  347. up(i, 0, lim){
  348. fin[i].PB(to_string_precs(i));
  349. up(j, 0, n-1){
  350. fin[i].PB(to_string_precs(x[i][j]));
  351. }
  352. fin[i].PB(to_string_precs(res[i]));
  353. fin[i].PB(to_string_precs(t[i]));
  354. fin[i].PB(to_string_precs(res[i] - res[i-1]));
  355. }
  356.  
  357. int max_length = 0;
  358. up(i, 0, lim){
  359. for (int j = 0; j < (int)fin[i].size(); j++){
  360. max_length = max(max_length, (int)fin[i][j].size());
  361. }
  362. }
  363.  
  364. //---- Printing the result table ----
  365. parse_indent(fin[0], max_length);
  366. print_columns(fin[0], max_length);
  367. print_result_table(lim, max_length);
  368. cout << "Tong so buoc t = alpha*t trong thuat toan Armijo: " << cnt;
  369. }
  370.  
Success #stdin #stdout 0.01s 17936KB
stdin
4
5 1 0 1 4 1 0 3 1 2
2 4 -7 8
6
4 2 3 7

3
4 1 0 3 1 2
-7 5 4
12
4 7 5

2
1 2 4
-7 5
3
4 7
stdout
Desired stationary point found at iteration: 229

i            x1            x2            x3            x4            f            ti            delta f            
0       |  4.00000    |  2.00000    |  3.00000    |  7.00000    |  341.00000  |  0.10737    |  341.00000  |  
1       |  -1.47608   |  -0.89910   |  0.85252    |  2.38291    |  39.28636   |  0.01801    |  -301.71364 |  
2       |  -1.27293   |  -0.83035   |  0.85974    |  2.07832    |  31.94151   |  0.01801    |  -7.34485   |  
3       |  -1.10213   |  -0.77530   |  0.87043    |  1.79189    |  25.87364   |  0.01801    |  -6.06787   |  
4       |  -0.95793   |  -0.73145   |  0.88414    |  1.52283    |  20.80499   |  0.01801    |  -5.06865   |  
5       |  -0.83565   |  -0.69677   |  0.90042    |  1.27031    |  16.53150   |  0.01801    |  -4.27348   |  
6       |  -0.73148   |  -0.66958   |  0.91887    |  1.03350    |  12.90062   |  0.01801    |  -3.63089   |  
7       |  -0.64229   |  -0.64851   |  0.93909    |  0.81153    |  9.79618    |  0.01801    |  -3.10444   |  
8       |  -0.56555   |  -0.63246   |  0.96076    |  0.60359    |  7.12817    |  0.01801    |  -2.66800   |  
9       |  -0.49918   |  -0.62049   |  0.98353    |  0.40887    |  4.82566    |  0.01801    |  -2.30252   |  
10      |  -0.44147   |  -0.61185   |  1.00714    |  0.22656    |  2.83182    |  0.01801    |  -1.99384   |  
11      |  -0.39103   |  -0.60592   |  1.03132    |  0.05593    |  1.10053    |  0.01801    |  -1.73130   |  
12      |  -0.34671   |  -0.60219   |  1.05586    |  -0.10375   |  -0.40618   |  0.01801    |  -1.50670   |  
13      |  -0.30756   |  -0.60024   |  1.08055    |  -0.25316   |  -1.71983   |  0.01801    |  -1.31365   |  
14      |  -0.27281   |  -0.59972   |  1.10523    |  -0.39296   |  -2.86690   |  0.01801    |  -1.14707   |  
15      |  -0.24181   |  -0.60034   |  1.12976    |  -0.52375   |  -3.86976   |  0.01801    |  -1.00287   |  
16      |  -0.21403   |  -0.60188   |  1.15400    |  -0.64613   |  -4.74747   |  0.01801    |  -0.87771   |  
17      |  -0.18902   |  -0.60413   |  1.17785    |  -0.76061   |  -5.51633   |  0.01801    |  -0.76885   |  
18      |  -0.16641   |  -0.60693   |  1.20122    |  -0.86774   |  -6.19033   |  0.01801    |  -0.67400   |  
19      |  -0.14590   |  -0.61016   |  1.22405    |  -0.96796   |  -6.78155   |  0.01801    |  -0.59122   |  
20      |  -0.12722   |  -0.61371   |  1.24628    |  -1.06175   |  -7.30045   |  0.01801    |  -0.51890   |  
21      |  -0.11015   |  -0.61748   |  1.26786    |  -1.14952   |  -7.75609   |  0.01801    |  -0.45564   |  
22      |  -0.09450   |  -0.62141   |  1.28875    |  -1.23166   |  -8.15634   |  0.01801    |  -0.40026   |  
23      |  -0.08012   |  -0.62542   |  1.30894    |  -1.30854   |  -8.50807   |  0.01801    |  -0.35173   |  
24      |  -0.06688   |  -0.62948   |  1.32840    |  -1.38050   |  -8.81726   |  0.01801    |  -0.30919   |  
25      |  -0.05465   |  -0.63355   |  1.34713    |  -1.44786   |  -9.08913   |  0.01801    |  -0.27187   |  
26      |  -0.04334   |  -0.63759   |  1.36512    |  -1.51093   |  -9.32824   |  0.01801    |  -0.23911   |  
27      |  -0.03286   |  -0.64157   |  1.38237    |  -1.56999   |  -9.53860   |  0.01801    |  -0.21035   |  
28      |  -0.02313   |  -0.64548   |  1.39890    |  -1.62528   |  -9.72368   |  0.01801    |  -0.18508   |  
29      |  -0.01408   |  -0.64930   |  1.41470    |  -1.67707   |  -9.88656   |  0.01801    |  -0.16288   |  
30      |  -0.00567   |  -0.65301   |  1.42980    |  -1.72557   |  -10.02993  |  0.01801    |  -0.14337   |  
31      |  0.00217    |  -0.65661   |  1.44421    |  -1.77100   |  -10.15613  |  0.01801    |  -0.12621   |  
32      |  0.00949    |  -0.66010   |  1.45794    |  -1.81355   |  -10.26725  |  0.01801    |  -0.11111   |  
33      |  0.01631    |  -0.66346   |  1.47102    |  -1.85342   |  -10.36508  |  0.01801    |  -0.09784   |  
34      |  0.02268    |  -0.66670   |  1.48346    |  -1.89078   |  -10.45124  |  0.01801    |  -0.08616   |  
35      |  0.02864    |  -0.66981   |  1.49529    |  -1.92578   |  -10.52712  |  0.01801    |  -0.07588   |  
36      |  0.03421    |  -0.67279   |  1.50653    |  -1.95858   |  -10.59395  |  0.01801    |  -0.06683   |  
37      |  0.03942    |  -0.67564   |  1.51720    |  -1.98932   |  -10.65281  |  0.01801    |  -0.05887   |  
38      |  0.04430    |  -0.67837   |  1.52732    |  -2.01813   |  -10.70467  |  0.01801    |  -0.05185   |  
39      |  0.04886    |  -0.68098   |  1.53691    |  -2.04514   |  -10.75035  |  0.01801    |  -0.04568   |  
40      |  0.05314    |  -0.68346   |  1.54600    |  -2.07045   |  -10.79059  |  0.01801    |  -0.04024   |  
41      |  0.05715    |  -0.68583   |  1.55461    |  -2.09418   |  -10.82605  |  0.01801    |  -0.03546   |  
42      |  0.06091    |  -0.68808   |  1.56276    |  -2.11643   |  -10.85729  |  0.01801    |  -0.03124   |  
43      |  0.06443    |  -0.69023   |  1.57047    |  -2.13729   |  -10.88481  |  0.01801    |  -0.02753   |  
44      |  0.06773    |  -0.69226   |  1.57776    |  -2.15685   |  -10.90907  |  0.01801    |  -0.02425   |  
45      |  0.07082    |  -0.69420   |  1.58465    |  -2.17519   |  -10.93044  |  0.01801    |  -0.02137   |  
46      |  0.07373    |  -0.69603   |  1.59116    |  -2.19239   |  -10.94927  |  0.01801    |  -0.01883   |  
47      |  0.07645    |  -0.69777   |  1.59732    |  -2.20852   |  -10.96587  |  0.01801    |  -0.01660   |  
48      |  0.07900    |  -0.69942   |  1.60312    |  -2.22364   |  -10.98049  |  0.01801    |  -0.01463   |  
49      |  0.08140    |  -0.70099   |  1.60861    |  -2.23783   |  -10.99338  |  0.01801    |  -0.01289   |  
50      |  0.08365    |  -0.70247   |  1.61378    |  -2.25114   |  -11.00474  |  0.01801    |  -0.01136   |  
51      |  0.08576    |  -0.70387   |  1.61866    |  -2.26362   |  -11.01475  |  0.01801    |  -0.01001   |  
52      |  0.08774    |  -0.70519   |  1.62326    |  -2.27533   |  -11.02357  |  0.01801    |  -0.00882   |  
53      |  0.08960    |  -0.70644   |  1.62760    |  -2.28631   |  -11.03135  |  0.01801    |  -0.00778   |  
54      |  0.09134    |  -0.70762   |  1.63169    |  -2.29662   |  -11.03820  |  0.01801    |  -0.00685   |  
55      |  0.09298    |  -0.70874   |  1.63555    |  -2.30628   |  -11.04424  |  0.01801    |  -0.00604   |  
56      |  0.09451    |  -0.70980   |  1.63919    |  -2.31535   |  -11.04956  |  0.01801    |  -0.00532   |  
57      |  0.09595    |  -0.71079   |  1.64261    |  -2.32386   |  -11.05426  |  0.01801    |  -0.00469   |  
58      |  0.09731    |  -0.71173   |  1.64583    |  -2.33184   |  -11.05839  |  0.01801    |  -0.00413   |  
59      |  0.09858    |  -0.71262   |  1.64887    |  -2.33933   |  -11.06203  |  0.01801    |  -0.00364   |  
60      |  0.09977    |  -0.71346   |  1.65173    |  -2.34636   |  -11.06525  |  0.01801    |  -0.00321   |  
61      |  0.10089    |  -0.71425   |  1.65442    |  -2.35295   |  -11.06808  |  0.01801    |  -0.00283   |  
62      |  0.10194    |  -0.71499   |  1.65696    |  -2.35914   |  -11.07057  |  0.01801    |  -0.00250   |  
63      |  0.10293    |  -0.71569   |  1.65934    |  -2.36495   |  -11.07277  |  0.01801    |  -0.00220   |  
64      |  0.10385    |  -0.71636   |  1.66159    |  -2.37040   |  -11.07471  |  0.01801    |  -0.00194   |  
65      |  0.10472    |  -0.71698   |  1.66370    |  -2.37551   |  -11.07642  |  0.01801    |  -0.00171   |  
66      |  0.10554    |  -0.71757   |  1.66568    |  -2.38031   |  -11.07793  |  0.01801    |  -0.00151   |  
67      |  0.10630    |  -0.71812   |  1.66755    |  -2.38481   |  -11.07925  |  0.01801    |  -0.00133   |  
68      |  0.10702    |  -0.71864   |  1.66931    |  -2.38904   |  -11.08042  |  0.01801    |  -0.00117   |  
69      |  0.10770    |  -0.71913   |  1.67097    |  -2.39300   |  -11.08145  |  0.01801    |  -0.00103   |  
70      |  0.10833    |  -0.71959   |  1.67252    |  -2.39673   |  -11.08236  |  0.01801    |  -0.00091   |  
71      |  0.10892    |  -0.72003   |  1.67398    |  -2.40022   |  -11.08316  |  0.01801    |  -0.00080   |  
72      |  0.10948    |  -0.72043   |  1.67536    |  -2.40350   |  -11.08387  |  0.01801    |  -0.00071   |  
73      |  0.11001    |  -0.72082   |  1.67665    |  -2.40658   |  -11.08449  |  0.01801    |  -0.00062   |  
74      |  0.11050    |  -0.72118   |  1.67787    |  -2.40947   |  -11.08504  |  0.01801    |  -0.00055   |  
75      |  0.11096    |  -0.72152   |  1.67901    |  -2.41218   |  -11.08553  |  0.01801    |  -0.00048   |  
76      |  0.11140    |  -0.72184   |  1.68009    |  -2.41472   |  -11.08595  |  0.01801    |  -0.00043   |  
77      |  0.11180    |  -0.72214   |  1.68109    |  -2.41711   |  -11.08633  |  0.01801    |  -0.00038   |  
78      |  0.11219    |  -0.72243   |  1.68204    |  -2.41935   |  -11.08666  |  0.01801    |  -0.00033   |  
79      |  0.11254    |  -0.72269   |  1.68294    |  -2.42146   |  -11.08695  |  0.01801    |  -0.00029   |  
80      |  0.11288    |  -0.72295   |  1.68377    |  -2.42343   |  -11.08721  |  0.01801    |  -0.00026   |  
81      |  0.11320    |  -0.72318   |  1.68456    |  -2.42529   |  -11.08743  |  0.01801    |  -0.00023   |  
82      |  0.11349    |  -0.72340   |  1.68530    |  -2.42703   |  -11.08763  |  0.01801    |  -0.00020   |  
83      |  0.11377    |  -0.72361   |  1.68600    |  -2.42866   |  -11.08781  |  0.01801    |  -0.00018   |  
84      |  0.11404    |  -0.72381   |  1.68665    |  -2.43019   |  -11.08797  |  0.01801    |  -0.00016   |  
85      |  0.11428    |  -0.72399   |  1.68727    |  -2.43163   |  -11.08810  |  0.01801    |  -0.00014   |  
86      |  0.11451    |  -0.72416   |  1.68784    |  -2.43299   |  -11.08822  |  0.01801    |  -0.00012   |  
87      |  0.11473    |  -0.72433   |  1.68838    |  -2.43425   |  -11.08833  |  0.01801    |  -0.00011   |  
88      |  0.11493    |  -0.72448   |  1.68889    |  -2.43544   |  -11.08842  |  0.01801    |  -0.00009   |  
89      |  0.11512    |  -0.72462   |  1.68937    |  -2.43656   |  -11.08851  |  0.01801    |  -0.00008   |  
90      |  0.11530    |  -0.72476   |  1.68982    |  -2.43761   |  -11.08858  |  0.01801    |  -0.00007   |  
91      |  0.11547    |  -0.72489   |  1.69024    |  -2.43860   |  -11.08864  |  0.01801    |  -0.00006   |  
92      |  0.11563    |  -0.72501   |  1.69064    |  -2.43952   |  -11.08870  |  0.01801    |  -0.00006   |  
93      |  0.11578    |  -0.72512   |  1.69101    |  -2.44039   |  -11.08875  |  0.01801    |  -0.00005   |  
94      |  0.11592    |  -0.72522   |  1.69136    |  -2.44120   |  -11.08879  |  0.01801    |  -0.00004   |  
95      |  0.11605    |  -0.72532   |  1.69169    |  -2.44197   |  -11.08883  |  0.01801    |  -0.00004   |  
96      |  0.11617    |  -0.72542   |  1.69200    |  -2.44269   |  -11.08887  |  0.01801    |  -0.00003   |  
97      |  0.11629    |  -0.72550   |  1.69229    |  -2.44336   |  -11.08890  |  0.01801    |  -0.00003   |  
98      |  0.11639    |  -0.72558   |  1.69256    |  -2.44399   |  -11.08892  |  0.01801    |  -0.00003   |  
99      |  0.11650    |  -0.72566   |  1.69282    |  -2.44459   |  -11.08895  |  0.01801    |  -0.00002   |  
100     |  0.11659    |  -0.72573   |  1.69306    |  -2.44515   |  -11.08897  |  0.01801    |  -0.00002   |  
101     |  0.11668    |  -0.72580   |  1.69328    |  -2.44567   |  -11.08899  |  0.01801    |  -0.00002   |  
102     |  0.11676    |  -0.72587   |  1.69350    |  -2.44616   |  -11.08900  |  0.01801    |  -0.00002   |  
103     |  0.11684    |  -0.72593   |  1.69370    |  -2.44662   |  -11.08902  |  0.01801    |  -0.00001   |  
104     |  0.11692    |  -0.72598   |  1.69388    |  -2.44706   |  -11.08903  |  0.01801    |  -0.00001   |  
105     |  0.11699    |  -0.72604   |  1.69406    |  -2.44746   |  -11.08904  |  0.01801    |  -0.00001   |  
106     |  0.11705    |  -0.72609   |  1.69422    |  -2.44784   |  -11.08905  |  0.01801    |  -0.00001   |  
107     |  0.11711    |  -0.72613   |  1.69438    |  -2.44820   |  -11.08906  |  0.01801    |  -0.00001   |  
108     |  0.11717    |  -0.72618   |  1.69452    |  -2.44854   |  -11.08906  |  0.01801    |  -0.00001   |  
109     |  0.11723    |  -0.72622   |  1.69466    |  -2.44886   |  -11.08907  |  0.01801    |  -0.00001   |  
110     |  0.11728    |  -0.72626   |  1.69479    |  -2.44915   |  -11.08908  |  0.01801    |  -0.00001   |  
111     |  0.11732    |  -0.72629   |  1.69491    |  -2.44943   |  -11.08908  |  0.01801    |  -0.00001   |  
112     |  0.11737    |  -0.72633   |  1.69502    |  -2.44969   |  -11.08909  |  0.01801    |  -0.00000   |  
113     |  0.11741    |  -0.72636   |  1.69513    |  -2.44994   |  -11.08909  |  0.01801    |  -0.00000   |  
114     |  0.11745    |  -0.72639   |  1.69523    |  -2.45017   |  -11.08909  |  0.01801    |  -0.00000   |  
115     |  0.11749    |  -0.72642   |  1.69532    |  -2.45038   |  -11.08910  |  0.01801    |  -0.00000   |  
116     |  0.11752    |  -0.72644   |  1.69541    |  -2.45059   |  -11.08910  |  0.01801    |  -0.00000   |  
117     |  0.11755    |  -0.72647   |  1.69549    |  -2.45078   |  -11.08910  |  0.01801    |  -0.00000   |  
118     |  0.11759    |  -0.72649   |  1.69557    |  -2.45096   |  -11.08910  |  0.01801    |  -0.00000   |  
119     |  0.11761    |  -0.72651   |  1.69564    |  -2.45112   |  -11.08911  |  0.01801    |  -0.00000   |  
120     |  0.11764    |  -0.72653   |  1.69571    |  -2.45128   |  -11.08911  |  0.01801    |  -0.00000   |  
121     |  0.11767    |  -0.72655   |  1.69577    |  -2.45143   |  -11.08911  |  0.01801    |  -0.00000   |  
122     |  0.11769    |  -0.72657   |  1.69583    |  -2.45157   |  -11.08911  |  0.01801    |  -0.00000   |  
123     |  0.11771    |  -0.72659   |  1.69589    |  -2.45170   |  -11.08911  |  0.01801    |  -0.00000   |  
124     |  0.11773    |  -0.72660   |  1.69594    |  -2.45182   |  -11.08911  |  0.01801    |  -0.00000   |  
125     |  0.11775    |  -0.72662   |  1.69599    |  -2.45194   |  -11.08911  |  0.01801    |  -0.00000   |  
126     |  0.11777    |  -0.72663   |  1.69604    |  -2.45205   |  -11.08911  |  0.01801    |  -0.00000   |  
127     |  0.11779    |  -0.72665   |  1.69608    |  -2.45215   |  -11.08912  |  0.01801    |  -0.00000   |  
128     |  0.11781    |  -0.72666   |  1.69613    |  -2.45224   |  -11.08912  |  0.01801    |  -0.00000   |  
129     |  0.11782    |  -0.72667   |  1.69616    |  -2.45233   |  -11.08912  |  0.01801    |  -0.00000   |  
130     |  0.11783    |  -0.72668   |  1.69620    |  -2.45242   |  -11.08912  |  0.01801    |  -0.00000   |  
131     |  0.11785    |  -0.72669   |  1.69623    |  -2.45249   |  -11.08912  |  0.01801    |  -0.00000   |  
132     |  0.11786    |  -0.72670   |  1.69627    |  -2.45257   |  -11.08912  |  0.01801    |  -0.00000   |  
133     |  0.11787    |  -0.72671   |  1.69630    |  -2.45264   |  -11.08912  |  0.01801    |  -0.00000   |  
134     |  0.11788    |  -0.72672   |  1.69632    |  -2.45270   |  -11.08912  |  0.01801    |  -0.00000   |  
135     |  0.11789    |  -0.72673   |  1.69635    |  -2.45276   |  -11.08912  |  0.01801    |  -0.00000   |  
136     |  0.11790    |  -0.72674   |  1.69638    |  -2.45282   |  -11.08912  |  0.01801    |  -0.00000   |  
137     |  0.11791    |  -0.72674   |  1.69640    |  -2.45288   |  -11.08912  |  0.01801    |  -0.00000   |  
138     |  0.11792    |  -0.72675   |  1.69642    |  -2.45293   |  -11.08912  |  0.01801    |  -0.00000   |  
139     |  0.11793    |  -0.72676   |  1.69644    |  -2.45297   |  -11.08912  |  0.01801    |  -0.00000   |  
140     |  0.11794    |  -0.72676   |  1.69646    |  -2.45302   |  -11.08912  |  0.01801    |  -0.00000   |  
141     |  0.11795    |  -0.72677   |  1.69648    |  -2.45306   |  -11.08912  |  0.01801    |  -0.00000   |  
142     |  0.11795    |  -0.72677   |  1.69650    |  -2.45310   |  -11.08912  |  0.01801    |  -0.00000   |  
143     |  0.11796    |  -0.72678   |  1.69651    |  -2.45314   |  -11.08912  |  0.01801    |  -0.00000   |  
144     |  0.11796    |  -0.72678   |  1.69653    |  -2.45317   |  -11.08912  |  0.01801    |  -0.00000   |  
145     |  0.11797    |  -0.72679   |  1.69654    |  -2.45320   |  -11.08912  |  0.01801    |  -0.00000   |  
146     |  0.11798    |  -0.72679   |  1.69656    |  -2.45323   |  -11.08912  |  0.01801    |  -0.00000   |  
147     |  0.11798    |  -0.72679   |  1.69657    |  -2.45326   |  -11.08912  |  0.01801    |  -0.00000   |  
148     |  0.11798    |  -0.72680   |  1.69658    |  -2.45329   |  -11.08912  |  0.01801    |  -0.00000   |  
149     |  0.11799    |  -0.72680   |  1.69659    |  -2.45332   |  -11.08912  |  0.01801    |  -0.00000   |  
150     |  0.11799    |  -0.72680   |  1.69660    |  -2.45334   |  -11.08912  |  0.01801    |  -0.00000   |  
151     |  0.11800    |  -0.72681   |  1.69661    |  -2.45336   |  -11.08912  |  0.01801    |  -0.00000   |  
152     |  0.11800    |  -0.72681   |  1.69662    |  -2.45338   |  -11.08912  |  0.01801    |  -0.00000   |  
153     |  0.11800    |  -0.72681   |  1.69663    |  -2.45340   |  -11.08912  |  0.01801    |  -0.00000   |  
154     |  0.11801    |  -0.72681   |  1.69664    |  -2.45342   |  -11.08912  |  0.01801    |  -0.00000   |  
155     |  0.11801    |  -0.72682   |  1.69664    |  -2.45344   |  -11.08912  |  0.01801    |  -0.00000   |  
156     |  0.11801    |  -0.72682   |  1.69665    |  -2.45345   |  -11.08912  |  0.01801    |  -0.00000   |  
157     |  0.11802    |  -0.72682   |  1.69666    |  -2.45347   |  -11.08912  |  0.01801    |  -0.00000   |  
158     |  0.11802    |  -0.72682   |  1.69666    |  -2.45348   |  -11.08912  |  0.01801    |  -0.00000   |  
159     |  0.11802    |  -0.72682   |  1.69667    |  -2.45350   |  -11.08912  |  0.01801    |  -0.00000   |  
160     |  0.11802    |  -0.72683   |  1.69668    |  -2.45351   |  -11.08912  |  0.01801    |  -0.00000   |  
161     |  0.11802    |  -0.72683   |  1.69668    |  -2.45352   |  -11.08912  |  0.01801    |  -0.00000   |  
162     |  0.11803    |  -0.72683   |  1.69669    |  -2.45353   |  -11.08912  |  0.01801    |  -0.00000   |  
163     |  0.11803    |  -0.72683   |  1.69669    |  -2.45354   |  -11.08912  |  0.01801    |  -0.00000   |  
164     |  0.11803    |  -0.72683   |  1.69669    |  -2.45355   |  -11.08912  |  0.01801    |  -0.00000   |  
165     |  0.11803    |  -0.72683   |  1.69670    |  -2.45356   |  -11.08912  |  0.01801    |  -0.00000   |  
166     |  0.11803    |  -0.72683   |  1.69670    |  -2.45357   |  -11.08912  |  0.01801    |  -0.00000   |  
167     |  0.11803    |  -0.72684   |  1.69671    |  -2.45358   |  -11.08912  |  0.01801    |  -0.00000   |  
168     |  0.11804    |  -0.72684   |  1.69671    |  -2.45359   |  -11.08912  |  0.01801    |  -0.00000   |  
169     |  0.11804    |  -0.72684   |  1.69671    |  -2.45359   |  -11.08912  |  0.01801    |  -0.00000   |  
170     |  0.11804    |  -0.72684   |  1.69671    |  -2.45360   |  -11.08912  |  0.01801    |  -0.00000   |  
171     |  0.11804    |  -0.72684   |  1.69672    |  -2.45361   |  -11.08912  |  0.01801    |  -0.00000   |  
172     |  0.11804    |  -0.72684   |  1.69672    |  -2.45361   |  -11.08912  |  0.01801    |  -0.00000   |  
173     |  0.11804    |  -0.72684   |  1.69672    |  -2.45362   |  -11.08912  |  0.01801    |  -0.00000   |  
174     |  0.11804    |  -0.72684   |  1.69672    |  -2.45362   |  -11.08912  |  0.01801    |  -0.00000   |  
175     |  0.11804    |  -0.72684   |  1.69673    |  -2.45363   |  -11.08912  |  0.01801    |  -0.00000   |  
176     |  0.11804    |  -0.72684   |  1.69673    |  -2.45363   |  -11.08912  |  0.01801    |  -0.00000   |  
177     |  0.11804    |  -0.72684   |  1.69673    |  -2.45364   |  -11.08912  |  0.01801    |  -0.00000   |  
178     |  0.11804    |  -0.72684   |  1.69673    |  -2.45364   |  -11.08912  |  0.01801    |  -0.00000   |  
179     |  0.11805    |  -0.72684   |  1.69673    |  -2.45365   |  -11.08912  |  0.01801    |  -0.00000   |  
180     |  0.11805    |  -0.72684   |  1.69674    |  -2.45365   |  -11.08912  |  0.01801    |  -0.00000   |  
181     |  0.11805    |  -0.72685   |  1.69674    |  -2.45365   |  -11.08912  |  0.01801    |  -0.00000   |  
182     |  0.11805    |  -0.72685   |  1.69674    |  -2.45366   |  -11.08912  |  0.01801    |  -0.00000   |  
183     |  0.11805    |  -0.72685   |  1.69674    |  -2.45366   |  -11.08912  |  0.01801    |  -0.00000   |  
184     |  0.11805    |  -0.72685   |  1.69674    |  -2.45366   |  -11.08912  |  0.01801    |  -0.00000   |  
185     |  0.11805    |  -0.72685   |  1.69674    |  -2.45366   |  -11.08912  |  0.01801    |  -0.00000   |  
186     |  0.11805    |  -0.72685   |  1.69674    |  -2.45367   |  -11.08912  |  0.01801    |  -0.00000   |  
187     |  0.11805    |  -0.72685   |  1.69674    |  -2.45367   |  -11.08912  |  0.01801    |  -0.00000   |  
188     |  0.11805    |  -0.72685   |  1.69674    |  -2.45367   |  -11.08912  |  0.01801    |  -0.00000   |  
189     |  0.11805    |  -0.72685   |  1.69675    |  -2.45367   |  -11.08912  |  0.01801    |  -0.00000   |  
190     |  0.11805    |  -0.72685   |  1.69675    |  -2.45367   |  -11.08912  |  0.01801    |  -0.00000   |  
191     |  0.11805    |  -0.72685   |  1.69675    |  -2.45368   |  -11.08912  |  0.01801    |  -0.00000   |  
192     |  0.11805    |  -0.72685   |  1.69675    |  -2.45368   |  -11.08912  |  0.01801    |  -0.00000   |  
193     |  0.11805    |  -0.72685   |  1.69675    |  -2.45368   |  -11.08912  |  0.01801    |  -0.00000   |  
194     |  0.11805    |  -0.72685   |  1.69675    |  -2.45368   |  -11.08912  |  0.01801    |  -0.00000   |  
195     |  0.11805    |  -0.72685   |  1.69675    |  -2.45368   |  -11.08912  |  0.01801    |  -0.00000   |  
196     |  0.11805    |  -0.72685   |  1.69675    |  -2.45368   |  -11.08912  |  0.01801    |  -0.00000   |  
197     |  0.11805    |  -0.72685   |  1.69675    |  -2.45368   |  -11.08912  |  0.01801    |  -0.00000   |  
198     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
199     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
200     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
201     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
202     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
203     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
204     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
205     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
206     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
207     |  0.11805    |  -0.72685   |  1.69675    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
208     |  0.11805    |  -0.72685   |  1.69676    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
209     |  0.11805    |  -0.72685   |  1.69676    |  -2.45369   |  -11.08912  |  0.01801    |  -0.00000   |  
210     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
211     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
212     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
213     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
214     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
215     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
216     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
217     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
218     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
219     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
220     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
221     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
222     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
223     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
224     |  0.11805    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
225     |  0.11806    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
226     |  0.11806    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
227     |  0.11806    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
228     |  0.11806    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.01801    |  -0.00000   |  
229     |  0.11806    |  -0.72685   |  1.69676    |  -2.45370   |  -11.08912  |  0.00000    |  -0.00000   |  

Tong so buoc t = alpha*t trong thuat toan Armijo: 18