{"action":"created","comment":{"url":"https://api.github.com/repos/alvls/exa-min-light/pulls/comments/46384686","id":46384686,"diff_hunk":"@@ -184,53 +211,94 @@ TEST_F(TMethodTest, CheckStopCondition_can_stop_method_when_required_accuracy_is\n   method->FirstIteration();\n   while (!IsStop)\n   {      \n-    method->CalculateIterationPoints();\n-    IsStop = method->CheckStopCondition();\n-    method->CalculateFunctionals();\n-    method->RenewSearchData();\n-    method->EstimateOptimum();\n-    method->FinalizeIteration();\n+    IsStop = DoIteration();\n   }\n \n-  //ASSERT_GE(method->GetIterationCount(), current_MaxNumOfTrials);\n   ASSERT_LT(method->GetAchievedAccuracy(), current_eps);\n }\n \n-  \n-///*Проверка EstimateOptimum*/\n-//TEST_F(TMethodTest, EstimateOptimum)\n-//{\n-//  CreateMethod();\n-//  \n-//  TTrial BestTrial;\n-//  TTrial* pCurTrials;\n-//  bool IsStop = false;\n-//  int NumPoints = method->GetNumPoints();\n-//  int indexBestTrial = 0;\n-//  method->FirstIteration();\n-//  while (!IsStop)\n-//  {      \n-//    method->CalculateIterationPoints();\n-//    IsStop = method->CheckStopCondition();\n-//    method->CalculateFunctionals();\n-//    method->RenewSearchData();\n-//    method->EstimateOptimum();\n-//    method->FinalizeIteration();\n-//\n-//    pCurTrials = method->GetCurTrials();\n-//\n-//    for (int i = 1; i < NumPoints; i++)\n-//    {\n-//      if (pCurTrials[i].index > pCurTrials[indexBestTrial].index || \n-//          pCurTrials[i].index == pCurTrials[indexBestTrial].index && \n-//          pCurTrials[i].FuncValues[pCurTrials[indexBestTrial].index] < pCurTrials[indexBestTrial].FuncValues[pCurTrials[indexBestTrial].index])\n-//      {\n-//        indexBestTrial = i;\n-//      }\n-//    }\n-//\n-//    BestTrial = method->GetOptimEstimation();\n-//    ASSERT_EQ(  BestTrial.index, pCurTrials[indexBestTrial].index);\n-//    //ASSERT_EQ(  BestTrial.x, pCurTrials[indexBestTrial].x);\n-//  }\n-//}  \n+\n+TEST_F(TMethodTest, check_states_of_method_iterations)\n+{\n+    char nameCurrentFile[] = \"current_state.dat\";\n+    int IterationCount;\n+    double AchievedAccuracy;\n+    bool recalc;\n+    double BestTrial_FuncValue;\n+    double BestTrial_x;\n+    double BestTrial_y[MaxDim];\n+    double pCurTrials_FuncValue;\n+    double pCurTrials_x;\n+    double pCurTrials_y[MaxDim];\n+\n+    int currentIterationCount;\n+    double currentAchievedAccuracy;\n+    bool currentrecalc;\n+    double currentBestTrial_FuncValue;\n+    double currentBestTrial_x;\n+    double currentBestTrial_y[MaxDim];  \n+    double currentpCurTrials_FuncValue;\n+    double currentpCurTrials_x;\n+    double currentpCurTrials_y[MaxDim];\n+\n+    bool IsStop = false;\n+    FILE* rightf;\n+\n+    FILE* currentf = fopen(nameCurrentFile,\"w\");\n+    fclose(currentf);\n+\n+    CreateMethod();\n+\n+    method->SetBounds();\n+    method->FirstIteration();\n+\n+    while (!IsStop)\n+    {      \n+        IsStop = DoIteration();\n+\n+        if(method->GetIterationCount() % 10 == 0)\n+        {  \n+            method->PrintCurrentStateToFile(nameCurrentFile);\n+        }\n+    }\n+\n+    rightf = fopen(\"state.dat\",\"r\");\n+    currentf = fopen(nameCurrentFile,\"r\");\n+    if(rightf == 0 || currentf == 0)\n+    {\n+        ASSERT_TRUE(false);\n+    }\n+    else\n+    { \n+      int countOfIterations = (method->GetIterationCount() - 1) / 10;","path":"test/test_method.cpp","position":210,"original_position":210,"commit_id":"ea0a248cdb9a13a0007b5e758a7cd1b6c42193a5","original_commit_id":"ea0a248cdb9a13a0007b5e758a7cd1b6c42193a5","user":{"login":"ZhbanovaAnna","id":5418790,"avatar_url":"https://avatars.githubusercontent.com/u/5418790?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhbanovaAnna","html_url":"https://github.com/ZhbanovaAnna","followers_url":"https://api.github.com/users/ZhbanovaAnna/followers","following_url":"https://api.github.com/users/ZhbanovaAnna/following{/other_user}","gists_url":"https://api.github.com/users/ZhbanovaAnna/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhbanovaAnna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhbanovaAnna/subscriptions","organizations_url":"https://api.github.com/users/ZhbanovaAnna/orgs","repos_url":"https://api.github.com/users/ZhbanovaAnna/repos","events_url":"https://api.github.com/users/ZhbanovaAnna/events{/privacy}","received_events_url":"https://api.github.com/users/ZhbanovaAnna/received_events","type":"User","site_admin":false},"body":"@alvls , в файле state последняя записанная итерация 8960. А в файле который формирую я - 8970.\r\nЗапись происходит по условию ```if(method->GetIterationCount() % 10 == 0)```. Ну могу понять почему так получается. Поэтому строчка ``` int countOfIterations = (method->GetIterationCount() - 1) / 10;``` выглядит не так ``` int countOfIterations = method->GetIterationCount()  / 10;```.","created_at":"2015-12-02T07:46:09Z","updated_at":"2015-12-02T07:46:09Z","html_url":"https://github.com/alvls/exa-min-light/pull/12#discussion_r46384686","pull_request_url":"https://api.github.com/repos/alvls/exa-min-light/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/alvls/exa-min-light/pulls/comments/46384686"},"html":{"href":"https://github.com/alvls/exa-min-light/pull/12#discussion_r46384686"},"pull_request":{"href":"https://api.github.com/repos/alvls/exa-min-light/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/alvls/exa-min-light/pulls/12","id":52323509,"html_url":"https://github.com/alvls/exa-min-light/pull/12","diff_url":"https://github.com/alvls/exa-min-light/pull/12.diff","patch_url":"https://github.com/alvls/exa-min-light/pull/12.patch","issue_url":"https://api.github.com/repos/alvls/exa-min-light/issues/12","number":12,"state":"open","locked":false,"title":"check method iterations","user":{"login":"ZhbanovaAnna","id":5418790,"avatar_url":"https://avatars.githubusercontent.com/u/5418790?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhbanovaAnna","html_url":"https://github.com/ZhbanovaAnna","followers_url":"https://api.github.com/users/ZhbanovaAnna/followers","following_url":"https://api.github.com/users/ZhbanovaAnna/following{/other_user}","gists_url":"https://api.github.com/users/ZhbanovaAnna/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhbanovaAnna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhbanovaAnna/subscriptions","organizations_url":"https://api.github.com/users/ZhbanovaAnna/orgs","repos_url":"https://api.github.com/users/ZhbanovaAnna/repos","events_url":"https://api.github.com/users/ZhbanovaAnna/events{/privacy}","received_events_url":"https://api.github.com/users/ZhbanovaAnna/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-01T22:08:39Z","updated_at":"2015-12-02T07:46:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f29025ab375844e4bbc4595e7ba73af063bad690","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alvls/exa-min-light/pulls/12/commits","review_comments_url":"https://api.github.com/repos/alvls/exa-min-light/pulls/12/comments","review_comment_url":"https://api.github.com/repos/alvls/exa-min-light/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alvls/exa-min-light/issues/12/comments","statuses_url":"https://api.github.com/repos/alvls/exa-min-light/statuses/ea0a248cdb9a13a0007b5e758a7cd1b6c42193a5","head":{"label":"ZhbanovaAnna:Tests-For-Method","ref":"Tests-For-Method","sha":"ea0a248cdb9a13a0007b5e758a7cd1b6c42193a5","user":{"login":"ZhbanovaAnna","id":5418790,"avatar_url":"https://avatars.githubusercontent.com/u/5418790?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhbanovaAnna","html_url":"https://github.com/ZhbanovaAnna","followers_url":"https://api.github.com/users/ZhbanovaAnna/followers","following_url":"https://api.github.com/users/ZhbanovaAnna/following{/other_user}","gists_url":"https://api.github.com/users/ZhbanovaAnna/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhbanovaAnna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhbanovaAnna/subscriptions","organizations_url":"https://api.github.com/users/ZhbanovaAnna/orgs","repos_url":"https://api.github.com/users/ZhbanovaAnna/repos","events_url":"https://api.github.com/users/ZhbanovaAnna/events{/privacy}","received_events_url":"https://api.github.com/users/ZhbanovaAnna/received_events","type":"User","site_admin":false},"repo":{"id":46173113,"name":"exa-min-light","full_name":"ZhbanovaAnna/exa-min-light","owner":{"login":"ZhbanovaAnna","id":5418790,"avatar_url":"https://avatars.githubusercontent.com/u/5418790?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhbanovaAnna","html_url":"https://github.com/ZhbanovaAnna","followers_url":"https://api.github.com/users/ZhbanovaAnna/followers","following_url":"https://api.github.com/users/ZhbanovaAnna/following{/other_user}","gists_url":"https://api.github.com/users/ZhbanovaAnna/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhbanovaAnna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhbanovaAnna/subscriptions","organizations_url":"https://api.github.com/users/ZhbanovaAnna/orgs","repos_url":"https://api.github.com/users/ZhbanovaAnna/repos","events_url":"https://api.github.com/users/ZhbanovaAnna/events{/privacy}","received_events_url":"https://api.github.com/users/ZhbanovaAnna/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ZhbanovaAnna/exa-min-light","description":"Демонстрационная система по глобальной оптимизации","fork":true,"url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light","forks_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/forks","keys_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/teams","hooks_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/hooks","issue_events_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/issues/events{/number}","events_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/events","assignees_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/assignees{/user}","branches_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/branches{/branch}","tags_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/tags","blobs_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/statuses/{sha}","languages_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/languages","stargazers_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/stargazers","contributors_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/contributors","subscribers_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/subscribers","subscription_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/subscription","commits_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/contents/{+path}","compare_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/merges","archive_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/downloads","issues_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/issues{/number}","pulls_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/pulls{/number}","milestones_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/milestones{/number}","notifications_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/labels{/name}","releases_url":"https://api.github.com/repos/ZhbanovaAnna/exa-min-light/releases{/id}","created_at":"2015-11-14T12:05:54Z","updated_at":"2015-11-14T12:05:55Z","pushed_at":"2015-12-02T07:42:11Z","git_url":"git://github.com/ZhbanovaAnna/exa-min-light.git","ssh_url":"git@github.com:ZhbanovaAnna/exa-min-light.git","clone_url":"https://github.com/ZhbanovaAnna/exa-min-light.git","svn_url":"https://github.com/ZhbanovaAnna/exa-min-light","homepage":null,"size":325,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"alvls:master","ref":"master","sha":"12df639a644d89df05c3ab253aa5146db56ff1b8","user":{"login":"alvls","id":5449780,"avatar_url":"https://avatars.githubusercontent.com/u/5449780?v=3","gravatar_id":"","url":"https://api.github.com/users/alvls","html_url":"https://github.com/alvls","followers_url":"https://api.github.com/users/alvls/followers","following_url":"https://api.github.com/users/alvls/following{/other_user}","gists_url":"https://api.github.com/users/alvls/gists{/gist_id}","starred_url":"https://api.github.com/users/alvls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvls/subscriptions","organizations_url":"https://api.github.com/users/alvls/orgs","repos_url":"https://api.github.com/users/alvls/repos","events_url":"https://api.github.com/users/alvls/events{/privacy}","received_events_url":"https://api.github.com/users/alvls/received_events","type":"User","site_admin":false},"repo":{"id":43448193,"name":"exa-min-light","full_name":"alvls/exa-min-light","owner":{"login":"alvls","id":5449780,"avatar_url":"https://avatars.githubusercontent.com/u/5449780?v=3","gravatar_id":"","url":"https://api.github.com/users/alvls","html_url":"https://github.com/alvls","followers_url":"https://api.github.com/users/alvls/followers","following_url":"https://api.github.com/users/alvls/following{/other_user}","gists_url":"https://api.github.com/users/alvls/gists{/gist_id}","starred_url":"https://api.github.com/users/alvls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvls/subscriptions","organizations_url":"https://api.github.com/users/alvls/orgs","repos_url":"https://api.github.com/users/alvls/repos","events_url":"https://api.github.com/users/alvls/events{/privacy}","received_events_url":"https://api.github.com/users/alvls/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alvls/exa-min-light","description":"Демонстрационная система по глобальной оптимизации","fork":false,"url":"https://api.github.com/repos/alvls/exa-min-light","forks_url":"https://api.github.com/repos/alvls/exa-min-light/forks","keys_url":"https://api.github.com/repos/alvls/exa-min-light/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alvls/exa-min-light/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alvls/exa-min-light/teams","hooks_url":"https://api.github.com/repos/alvls/exa-min-light/hooks","issue_events_url":"https://api.github.com/repos/alvls/exa-min-light/issues/events{/number}","events_url":"https://api.github.com/repos/alvls/exa-min-light/events","assignees_url":"https://api.github.com/repos/alvls/exa-min-light/assignees{/user}","branches_url":"https://api.github.com/repos/alvls/exa-min-light/branches{/branch}","tags_url":"https://api.github.com/repos/alvls/exa-min-light/tags","blobs_url":"https://api.github.com/repos/alvls/exa-min-light/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alvls/exa-min-light/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alvls/exa-min-light/git/refs{/sha}","trees_url":"https://api.github.com/repos/alvls/exa-min-light/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alvls/exa-min-light/statuses/{sha}","languages_url":"https://api.github.com/repos/alvls/exa-min-light/languages","stargazers_url":"https://api.github.com/repos/alvls/exa-min-light/stargazers","contributors_url":"https://api.github.com/repos/alvls/exa-min-light/contributors","subscribers_url":"https://api.github.com/repos/alvls/exa-min-light/subscribers","subscription_url":"https://api.github.com/repos/alvls/exa-min-light/subscription","commits_url":"https://api.github.com/repos/alvls/exa-min-light/commits{/sha}","git_commits_url":"https://api.github.com/repos/alvls/exa-min-light/git/commits{/sha}","comments_url":"https://api.github.com/repos/alvls/exa-min-light/comments{/number}","issue_comment_url":"https://api.github.com/repos/alvls/exa-min-light/issues/comments{/number}","contents_url":"https://api.github.com/repos/alvls/exa-min-light/contents/{+path}","compare_url":"https://api.github.com/repos/alvls/exa-min-light/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alvls/exa-min-light/merges","archive_url":"https://api.github.com/repos/alvls/exa-min-light/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alvls/exa-min-light/downloads","issues_url":"https://api.github.com/repos/alvls/exa-min-light/issues{/number}","pulls_url":"https://api.github.com/repos/alvls/exa-min-light/pulls{/number}","milestones_url":"https://api.github.com/repos/alvls/exa-min-light/milestones{/number}","notifications_url":"https://api.github.com/repos/alvls/exa-min-light/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alvls/exa-min-light/labels{/name}","releases_url":"https://api.github.com/repos/alvls/exa-min-light/releases{/id}","created_at":"2015-09-30T17:35:48Z","updated_at":"2015-10-01T08:41:30Z","pushed_at":"2015-12-02T07:42:11Z","git_url":"git://github.com/alvls/exa-min-light.git","ssh_url":"git@github.com:alvls/exa-min-light.git","clone_url":"https://github.com/alvls/exa-min-light.git","svn_url":"https://github.com/alvls/exa-min-light","homepage":null,"size":294,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alvls/exa-min-light/pulls/12"},"html":{"href":"https://github.com/alvls/exa-min-light/pull/12"},"issue":{"href":"https://api.github.com/repos/alvls/exa-min-light/issues/12"},"comments":{"href":"https://api.github.com/repos/alvls/exa-min-light/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/alvls/exa-min-light/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/alvls/exa-min-light/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alvls/exa-min-light/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/alvls/exa-min-light/statuses/ea0a248cdb9a13a0007b5e758a7cd1b6c42193a5"}}}}