{"action":"created","comment":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/25887851","id":25887851,"diff_hunk":"@@ -252,26 +263,28 @@ TEST(SGSparseMatrix, get_transposed_more_vectors)\n \n TEST(SGSparseMatrix, from_dense)\n {\n-    //GenerateSparseMatrix cannot templated to generate dense matrix,\n-    //since () operator are defined differently for sparse and dense matrix\n-    CRandom randGenerator(0);\n-    float64_t sparseLevel=0.1;\n \n+    const float64_t sparseLevel=0.1;\n     const index_t numberOfFeatures=50;\n     const index_t numberOfVectors=100;\n-    SGMatrix<float64_t> denseMatrix(numberOfFeatures, numberOfVectors);\n-    for (index_t featIndex=0; featIndex<numberOfFeatures; ++featIndex)\n-        for (index_t vecIndex=0; vecIndex<numberOfVectors; ++vecIndex)\n-        {\n-            float64_t randomNumber=randGenerator.random(0.0,1.0);\n-            if (randomNumber<=sparseLevel)\n-                denseMatrix(featIndex,vecIndex)=randomNumber;\n-        }\n+    const index_t randSeed=0;\n+\n+    SGMatrix<float64_t> denseMatrix(numberOfVectors, numberOfFeatures); denseMatrix.zero();\n+    GenerateMatrixAccrodingToSparseConvention<SGMatrix<float64_t> >(sparseLevel,\n+                                                                    numberOfFeatures,\n+                                                                    numberOfVectors,\n+                                                                    randSeed,\n+                                                                    &denseMatrix);","path":"tests/unit/lib/SGSparseMatrix_unittest.cc","position":146,"original_position":146,"commit_id":"f510f3e085f5c1af2e88cc81e7143f1c17fd1633","original_commit_id":"f510f3e085f5c1af2e88cc81e7143f1c17fd1633","user":{"login":"yingryic","id":11013550,"avatar_url":"https://avatars.githubusercontent.com/u/11013550?v=3","gravatar_id":"","url":"https://api.github.com/users/yingryic","html_url":"https://github.com/yingryic","followers_url":"https://api.github.com/users/yingryic/followers","following_url":"https://api.github.com/users/yingryic/following{/other_user}","gists_url":"https://api.github.com/users/yingryic/gists{/gist_id}","starred_url":"https://api.github.com/users/yingryic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yingryic/subscriptions","organizations_url":"https://api.github.com/users/yingryic/orgs","repos_url":"https://api.github.com/users/yingryic/repos","events_url":"https://api.github.com/users/yingryic/events{/privacy}","received_events_url":"https://api.github.com/users/yingryic/received_events","type":"User","site_admin":false},"body":"I use spaces, not sure why this happen.","created_at":"2015-03-05T18:25:43Z","updated_at":"2015-03-05T18:25:43Z","html_url":"https://github.com/shogun-toolbox/shogun/pull/2759#discussion_r25887851","pull_request_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2759","_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/25887851"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/2759#discussion_r25887851"},"pull_request":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2759"}}},"pull_request":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2759","id":30492479,"html_url":"https://github.com/shogun-toolbox/shogun/pull/2759","diff_url":"https://github.com/shogun-toolbox/shogun/pull/2759.diff","patch_url":"https://github.com/shogun-toolbox/shogun/pull/2759.patch","issue_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/2759","number":2759,"state":"open","locked":false,"title":"modified sparse matrix unit test, made it cleaner","user":{"login":"yingryic","id":11013550,"avatar_url":"https://avatars.githubusercontent.com/u/11013550?v=3","gravatar_id":"","url":"https://api.github.com/users/yingryic","html_url":"https://github.com/yingryic","followers_url":"https://api.github.com/users/yingryic/followers","following_url":"https://api.github.com/users/yingryic/following{/other_user}","gists_url":"https://api.github.com/users/yingryic/gists{/gist_id}","starred_url":"https://api.github.com/users/yingryic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yingryic/subscriptions","organizations_url":"https://api.github.com/users/yingryic/orgs","repos_url":"https://api.github.com/users/yingryic/repos","events_url":"https://api.github.com/users/yingryic/events{/privacy}","received_events_url":"https://api.github.com/users/yingryic/received_events","type":"User","site_admin":false},"body":"create a template to generate both sparse and dense matrix and made the rest of the test more concise. @iglesias ","created_at":"2015-03-04T18:47:25Z","updated_at":"2015-03-05T18:25:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa82de7647737c47c7eff261a4fca46e3951106f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2759/commits","review_comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2759/comments","review_comment_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/2759/comments","statuses_url":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/f510f3e085f5c1af2e88cc81e7143f1c17fd1633","head":{"label":"yingryic:develop","ref":"develop","sha":"f510f3e085f5c1af2e88cc81e7143f1c17fd1633","user":{"login":"yingryic","id":11013550,"avatar_url":"https://avatars.githubusercontent.com/u/11013550?v=3","gravatar_id":"","url":"https://api.github.com/users/yingryic","html_url":"https://github.com/yingryic","followers_url":"https://api.github.com/users/yingryic/followers","following_url":"https://api.github.com/users/yingryic/following{/other_user}","gists_url":"https://api.github.com/users/yingryic/gists{/gist_id}","starred_url":"https://api.github.com/users/yingryic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yingryic/subscriptions","organizations_url":"https://api.github.com/users/yingryic/orgs","repos_url":"https://api.github.com/users/yingryic/repos","events_url":"https://api.github.com/users/yingryic/events{/privacy}","received_events_url":"https://api.github.com/users/yingryic/received_events","type":"User","site_admin":false},"repo":{"id":30846961,"name":"shogun","full_name":"yingryic/shogun","owner":{"login":"yingryic","id":11013550,"avatar_url":"https://avatars.githubusercontent.com/u/11013550?v=3","gravatar_id":"","url":"https://api.github.com/users/yingryic","html_url":"https://github.com/yingryic","followers_url":"https://api.github.com/users/yingryic/followers","following_url":"https://api.github.com/users/yingryic/following{/other_user}","gists_url":"https://api.github.com/users/yingryic/gists{/gist_id}","starred_url":"https://api.github.com/users/yingryic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yingryic/subscriptions","organizations_url":"https://api.github.com/users/yingryic/orgs","repos_url":"https://api.github.com/users/yingryic/repos","events_url":"https://api.github.com/users/yingryic/events{/privacy}","received_events_url":"https://api.github.com/users/yingryic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yingryic/shogun","description":"The Shogun Machine Learning Toolbox (Source Code)","fork":true,"url":"https://api.github.com/repos/yingryic/shogun","forks_url":"https://api.github.com/repos/yingryic/shogun/forks","keys_url":"https://api.github.com/repos/yingryic/shogun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yingryic/shogun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yingryic/shogun/teams","hooks_url":"https://api.github.com/repos/yingryic/shogun/hooks","issue_events_url":"https://api.github.com/repos/yingryic/shogun/issues/events{/number}","events_url":"https://api.github.com/repos/yingryic/shogun/events","assignees_url":"https://api.github.com/repos/yingryic/shogun/assignees{/user}","branches_url":"https://api.github.com/repos/yingryic/shogun/branches{/branch}","tags_url":"https://api.github.com/repos/yingryic/shogun/tags","blobs_url":"https://api.github.com/repos/yingryic/shogun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yingryic/shogun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yingryic/shogun/git/refs{/sha}","trees_url":"https://api.github.com/repos/yingryic/shogun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yingryic/shogun/statuses/{sha}","languages_url":"https://api.github.com/repos/yingryic/shogun/languages","stargazers_url":"https://api.github.com/repos/yingryic/shogun/stargazers","contributors_url":"https://api.github.com/repos/yingryic/shogun/contributors","subscribers_url":"https://api.github.com/repos/yingryic/shogun/subscribers","subscription_url":"https://api.github.com/repos/yingryic/shogun/subscription","commits_url":"https://api.github.com/repos/yingryic/shogun/commits{/sha}","git_commits_url":"https://api.github.com/repos/yingryic/shogun/git/commits{/sha}","comments_url":"https://api.github.com/repos/yingryic/shogun/comments{/number}","issue_comment_url":"https://api.github.com/repos/yingryic/shogun/issues/comments{/number}","contents_url":"https://api.github.com/repos/yingryic/shogun/contents/{+path}","compare_url":"https://api.github.com/repos/yingryic/shogun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yingryic/shogun/merges","archive_url":"https://api.github.com/repos/yingryic/shogun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yingryic/shogun/downloads","issues_url":"https://api.github.com/repos/yingryic/shogun/issues{/number}","pulls_url":"https://api.github.com/repos/yingryic/shogun/pulls{/number}","milestones_url":"https://api.github.com/repos/yingryic/shogun/milestones{/number}","notifications_url":"https://api.github.com/repos/yingryic/shogun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yingryic/shogun/labels{/name}","releases_url":"https://api.github.com/repos/yingryic/shogun/releases{/id}","created_at":"2015-02-15T23:54:04Z","updated_at":"2015-03-04T18:43:15Z","pushed_at":"2015-03-04T18:43:15Z","git_url":"git://github.com/yingryic/shogun.git","ssh_url":"git@github.com:yingryic/shogun.git","clone_url":"https://github.com/yingryic/shogun.git","svn_url":"https://github.com/yingryic/shogun","homepage":"http://www.shogun-toolbox.org","size":50041,"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":"develop"}},"base":{"label":"shogun-toolbox:develop","ref":"develop","sha":"ab95982aec8a4f39c5f21638a27d4322055a0e7f","user":{"login":"shogun-toolbox","id":690673,"avatar_url":"https://avatars.githubusercontent.com/u/690673?v=3","gravatar_id":"","url":"https://api.github.com/users/shogun-toolbox","html_url":"https://github.com/shogun-toolbox","followers_url":"https://api.github.com/users/shogun-toolbox/followers","following_url":"https://api.github.com/users/shogun-toolbox/following{/other_user}","gists_url":"https://api.github.com/users/shogun-toolbox/gists{/gist_id}","starred_url":"https://api.github.com/users/shogun-toolbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shogun-toolbox/subscriptions","organizations_url":"https://api.github.com/users/shogun-toolbox/orgs","repos_url":"https://api.github.com/users/shogun-toolbox/repos","events_url":"https://api.github.com/users/shogun-toolbox/events{/privacy}","received_events_url":"https://api.github.com/users/shogun-toolbox/received_events","type":"Organization","site_admin":false},"repo":{"id":1555094,"name":"shogun","full_name":"shogun-toolbox/shogun","owner":{"login":"shogun-toolbox","id":690673,"avatar_url":"https://avatars.githubusercontent.com/u/690673?v=3","gravatar_id":"","url":"https://api.github.com/users/shogun-toolbox","html_url":"https://github.com/shogun-toolbox","followers_url":"https://api.github.com/users/shogun-toolbox/followers","following_url":"https://api.github.com/users/shogun-toolbox/following{/other_user}","gists_url":"https://api.github.com/users/shogun-toolbox/gists{/gist_id}","starred_url":"https://api.github.com/users/shogun-toolbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shogun-toolbox/subscriptions","organizations_url":"https://api.github.com/users/shogun-toolbox/orgs","repos_url":"https://api.github.com/users/shogun-toolbox/repos","events_url":"https://api.github.com/users/shogun-toolbox/events{/privacy}","received_events_url":"https://api.github.com/users/shogun-toolbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shogun-toolbox/shogun","description":"The Shogun Machine Learning Toolbox (Source Code)","fork":false,"url":"https://api.github.com/repos/shogun-toolbox/shogun","forks_url":"https://api.github.com/repos/shogun-toolbox/shogun/forks","keys_url":"https://api.github.com/repos/shogun-toolbox/shogun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shogun-toolbox/shogun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shogun-toolbox/shogun/teams","hooks_url":"https://api.github.com/repos/shogun-toolbox/shogun/hooks","issue_events_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/events{/number}","events_url":"https://api.github.com/repos/shogun-toolbox/shogun/events","assignees_url":"https://api.github.com/repos/shogun-toolbox/shogun/assignees{/user}","branches_url":"https://api.github.com/repos/shogun-toolbox/shogun/branches{/branch}","tags_url":"https://api.github.com/repos/shogun-toolbox/shogun/tags","blobs_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/refs{/sha}","trees_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/{sha}","languages_url":"https://api.github.com/repos/shogun-toolbox/shogun/languages","stargazers_url":"https://api.github.com/repos/shogun-toolbox/shogun/stargazers","contributors_url":"https://api.github.com/repos/shogun-toolbox/shogun/contributors","subscribers_url":"https://api.github.com/repos/shogun-toolbox/shogun/subscribers","subscription_url":"https://api.github.com/repos/shogun-toolbox/shogun/subscription","commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/commits{/sha}","git_commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/commits{/sha}","comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/comments{/number}","issue_comment_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/comments{/number}","contents_url":"https://api.github.com/repos/shogun-toolbox/shogun/contents/{+path}","compare_url":"https://api.github.com/repos/shogun-toolbox/shogun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shogun-toolbox/shogun/merges","archive_url":"https://api.github.com/repos/shogun-toolbox/shogun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shogun-toolbox/shogun/downloads","issues_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues{/number}","pulls_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls{/number}","milestones_url":"https://api.github.com/repos/shogun-toolbox/shogun/milestones{/number}","notifications_url":"https://api.github.com/repos/shogun-toolbox/shogun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shogun-toolbox/shogun/labels{/name}","releases_url":"https://api.github.com/repos/shogun-toolbox/shogun/releases{/id}","created_at":"2011-04-01T10:44:32Z","updated_at":"2015-03-05T15:45:06Z","pushed_at":"2015-03-05T14:50:40Z","git_url":"git://github.com/shogun-toolbox/shogun.git","ssh_url":"git@github.com:shogun-toolbox/shogun.git","clone_url":"https://github.com/shogun-toolbox/shogun.git","svn_url":"https://github.com/shogun-toolbox/shogun","homepage":"http://www.shogun-toolbox.org","size":192343,"stargazers_count":704,"watchers_count":704,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":424,"mirror_url":null,"open_issues_count":353,"forks":424,"open_issues":353,"watchers":704,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2759"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/2759"},"issue":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/issues/2759"},"comments":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/issues/2759/comments"},"review_comments":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2759/comments"},"review_comment":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2759/commits"},"statuses":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/f510f3e085f5c1af2e88cc81e7143f1c17fd1633"}}}}