{"action":"created","comment":{"url":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/comments/117549951","pull_request_review_id":39271980,"id":117549951,"diff_hunk":"@@ -0,0 +1,294 @@\n+package matrix\n+\n+import (\n+\t\"fmt\"\n+\t\"image\"\n+\t\"math\"\n+\t\"log\"\n+\t\"runtime\"\n+)\n+\n+type Matrix [][]float64\n+\n+func NewMatrix(row int, col int) Matrix {\n+\tmatrix := make([][]float64, row)\n+\tfor i := range matrix {\n+\t\tmatrix[i] = make([]float64, col)\n+\t}\n+\treturn Matrix(matrix)\n+}\n+\n+func deepCopy(m Matrix) Matrix {\n+\trow := m.Row()\n+\tcol := m.Col()\n+\tmatrix := make([][]float64, row)\n+\tfor i := range matrix {\n+\t\tmatrix[i] = make([]float64, col)\n+\t\tfor j := range matrix[i] {\n+\t\t\tmatrix[i][j] = m[i][j]\n+\t\t}\n+\t}\n+\treturn Matrix(matrix)\n+}\n+\n+func NewMatrixFromGreyImage(grey *image.Gray) Matrix {\n+\tbounds := grey.Bounds()\n+\tdx := bounds.Dx()\n+\tdy := bounds.Dy()\n+\n+\tmatrix := make([][]float64, dx)\n+\tfor i := range matrix {\n+\t\tmatrix[i] = make([]float64, dy)\n+\t\tfor j := range matrix[i] {\n+\t\t\tmatrix[i][j] = float64(grey.GrayAt(i, j).Y)\n+\t\t}\n+\t}\n+\n+\treturn Matrix(matrix)\n+}\n+\n+func Ones(row int, col int) Matrix {\n+\tmatrix := make([][]float64, row)\n+\tfor i := range matrix {\n+\t\tmatrix[i] = make([]float64, col)\n+\t\tfor j := range matrix[i] {\n+\t\t\tmatrix[i][j] = 1\n+\t\t}\n+\t}\n+\treturn Matrix(matrix)\n+}\n+\n+func Add(a Matrix, matrices ...Matrix) (Matrix, error) {\n+\tresult := deepCopy(a)\n+\tif len(matrices) == 0 {\n+\t\treturn result, nil\n+\t}\n+\n+\tcol := a.Col()\n+\trow := a.Row()\n+\n+\tfor _, m := range matrices {\n+\t\tif m.Row() != row || m.Col() != col {\n+\t\t\treturn nil, fmt.Errorf(\"added matrices does not have same dimention\")\n+\t\t}\n+\n+\t\tfor i := 0; i < row; i++ {\n+\t\t\tfor j := 0; j < col; j++ {\n+\t\t\t\tresult[i][j] = result[i][j] + m[i][j]\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn result, nil\n+}\n+\n+func ElementWiseMultiplication(a Matrix, matrices ...Matrix) (Matrix, error) {\n+\tresult := deepCopy(a)\n+\tif len(matrices) == 0 {\n+\t\treturn result, nil\n+\t}\n+\n+\tcol := a.Col()\n+\trow := a.Row()\n+\n+\tfor _, m := range matrices {\n+\t\tif m.Row() != row || m.Col() != col {\n+\t\t\treturn nil, fmt.Errorf(\"element wise multiplicated matrices does not have same dimention\")\n+\t\t}\n+\n+\t\tfor i := 0; i < row; i++ {\n+\t\t\tfor j := 0; j < col; j++ {\n+\t\t\t\tresult[i][j] = result[i][j] * m[i][j]\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn result, nil\n+}\n+\n+func (m Matrix) Row() int {\n+\treturn len(m)\n+}\n+\n+func (m Matrix) Col() int {\n+\tif len(m) == 0 {\n+\t\treturn 0\n+\t}\n+\n+\treturn len(m[0])\n+}\n+\n+func (m Matrix) Print() {\n+\trow := m.Row()\n+\tcol := m.Col()\n+\tfor i := 0; i < row; i++ {\n+\t\tfor j := 0; j < col; j++ {\n+\t\t\tlog.Println(m[i][j])\n+\t\t}\n+\t}\n+}\n+func (m Matrix) Ctranspose() Matrix {\n+\tnewCol := m.Row()\n+\tnewRow := m.Col()\n+\tnewMatrix := NewMatrix(newRow, newCol)\n+\tfor i := 0; i < newRow; i++ {\n+\t\tfor j := 0; j < newCol; j++ {\n+\t\t\tnewMatrix[i][j] = m[j][i]\n+\t\t}\n+\t}\n+\treturn newMatrix\n+}\n+\n+func (m Matrix) Scale(s float64) Matrix {\n+\tcol := m.Col()\n+\trow := m.Row()\n+\tnewMatrix := NewMatrix(row, col)\n+\tfor i := 0; i < row; i++ {\n+\t\tfor j := 0; j < col; j++ {\n+\t\t\tnewMatrix[i][j] = m[i][j] * s\n+\t\t}\n+\t}\n+\treturn newMatrix\n+}\n+\n+func (m Matrix) Sum() float64 {\n+\tvar result float64\n+\tfor i := 0; i < m.Row(); i++ {\n+\t\tfor j := 0; j < m.Col(); j++ {\n+\t\t\tresult += m[i][j]\n+\t\t}\n+\t}\n+\treturn result\n+}\n+\n+func (m Matrix) Power(p float64) Matrix {\n+\trow := m.Row()\n+\tcol := m.Col()\n+\tnewMatrix := NewMatrix(row, col)\n+\tfor i := 0; i < row; i++ {\n+\t\tfor j := 0; j < col; j++ {\n+\t\t\tnewMatrix[i][j] = math.Pow(m[i][j], p)\n+\t\t}\n+\t}\n+\treturn newMatrix\n+}\n+\n+func (m Matrix) Compare(compared Matrix, symbol string) (Matrix, error) {","path":"matrix/matrix.go","position":null,"original_position":176,"commit_id":"038a06359605edfca75e1489dd621a6d08062e90","original_commit_id":"02f5e278ee5c8f58167918c2a9e5820fc86ec6b2","user":{"login":"yisu2015","id":16192072,"avatar_url":"https://avatars3.githubusercontent.com/u/16192072?v=3","gravatar_id":"","url":"https://api.github.com/users/yisu2015","html_url":"https://github.com/yisu2015","followers_url":"https://api.github.com/users/yisu2015/followers","following_url":"https://api.github.com/users/yisu2015/following{/other_user}","gists_url":"https://api.github.com/users/yisu2015/gists{/gist_id}","starred_url":"https://api.github.com/users/yisu2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yisu2015/subscriptions","organizations_url":"https://api.github.com/users/yisu2015/orgs","repos_url":"https://api.github.com/users/yisu2015/repos","events_url":"https://api.github.com/users/yisu2015/events{/privacy}","received_events_url":"https://api.github.com/users/yisu2015/received_events","type":"User","site_admin":false},"body":"fixed in \t7b1dc8b","created_at":"2017-05-19T18:47:45Z","updated_at":"2017-05-19T18:47:46Z","html_url":"https://github.com/ysu2017/GoRampUp/pull/1#discussion_r117549951","pull_request_url":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/comments/117549951"},"html":{"href":"https://github.com/ysu2017/GoRampUp/pull/1#discussion_r117549951"},"pull_request":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/1","id":121113410,"html_url":"https://github.com/ysu2017/GoRampUp/pull/1","diff_url":"https://github.com/ysu2017/GoRampUp/pull/1.diff","patch_url":"https://github.com/ysu2017/GoRampUp/pull/1.patch","issue_url":"https://api.github.com/repos/ysu2017/GoRampUp/issues/1","number":1,"state":"open","locked":false,"title":"YI's Go ramp up","user":{"login":"yisu2015","id":16192072,"avatar_url":"https://avatars3.githubusercontent.com/u/16192072?v=3","gravatar_id":"","url":"https://api.github.com/users/yisu2015","html_url":"https://github.com/yisu2015","followers_url":"https://api.github.com/users/yisu2015/followers","following_url":"https://api.github.com/users/yisu2015/following{/other_user}","gists_url":"https://api.github.com/users/yisu2015/gists{/gist_id}","starred_url":"https://api.github.com/users/yisu2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yisu2015/subscriptions","organizations_url":"https://api.github.com/users/yisu2015/orgs","repos_url":"https://api.github.com/users/yisu2015/repos","events_url":"https://api.github.com/users/yisu2015/events{/privacy}","received_events_url":"https://api.github.com/users/yisu2015/received_events","type":"User","site_admin":false},"body":"Implement a corner detection algorithm. The input is a image and output is a image with corner being marked. Sample output below\r\n![new](https://cloud.githubusercontent.com/assets/16192072/26167842/ffcd9e6a-3b05-11e7-9ebc-f8e21b3c2d3d.jpeg)\r\n","created_at":"2017-05-17T17:37:43Z","updated_at":"2017-05-19T18:47:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6af3aa5c0a353f4ef9fdac6a1051813f3c58b57c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ysu2017/GoRampUp/issues/1/comments","statuses_url":"https://api.github.com/repos/ysu2017/GoRampUp/statuses/038a06359605edfca75e1489dd621a6d08062e90","head":{"label":"ysu2017:compare","ref":"compare","sha":"038a06359605edfca75e1489dd621a6d08062e90","user":{"login":"ysu2017","id":28762783,"avatar_url":"https://avatars0.githubusercontent.com/u/28762783?v=3","gravatar_id":"","url":"https://api.github.com/users/ysu2017","html_url":"https://github.com/ysu2017","followers_url":"https://api.github.com/users/ysu2017/followers","following_url":"https://api.github.com/users/ysu2017/following{/other_user}","gists_url":"https://api.github.com/users/ysu2017/gists{/gist_id}","starred_url":"https://api.github.com/users/ysu2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysu2017/subscriptions","organizations_url":"https://api.github.com/users/ysu2017/orgs","repos_url":"https://api.github.com/users/ysu2017/repos","events_url":"https://api.github.com/users/ysu2017/events{/privacy}","received_events_url":"https://api.github.com/users/ysu2017/received_events","type":"User","site_admin":false},"repo":{"id":91602513,"name":"GoRampUp","full_name":"ysu2017/GoRampUp","owner":{"login":"ysu2017","id":28762783,"avatar_url":"https://avatars0.githubusercontent.com/u/28762783?v=3","gravatar_id":"","url":"https://api.github.com/users/ysu2017","html_url":"https://github.com/ysu2017","followers_url":"https://api.github.com/users/ysu2017/followers","following_url":"https://api.github.com/users/ysu2017/following{/other_user}","gists_url":"https://api.github.com/users/ysu2017/gists{/gist_id}","starred_url":"https://api.github.com/users/ysu2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysu2017/subscriptions","organizations_url":"https://api.github.com/users/ysu2017/orgs","repos_url":"https://api.github.com/users/ysu2017/repos","events_url":"https://api.github.com/users/ysu2017/events{/privacy}","received_events_url":"https://api.github.com/users/ysu2017/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ysu2017/GoRampUp","description":null,"fork":false,"url":"https://api.github.com/repos/ysu2017/GoRampUp","forks_url":"https://api.github.com/repos/ysu2017/GoRampUp/forks","keys_url":"https://api.github.com/repos/ysu2017/GoRampUp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ysu2017/GoRampUp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ysu2017/GoRampUp/teams","hooks_url":"https://api.github.com/repos/ysu2017/GoRampUp/hooks","issue_events_url":"https://api.github.com/repos/ysu2017/GoRampUp/issues/events{/number}","events_url":"https://api.github.com/repos/ysu2017/GoRampUp/events","assignees_url":"https://api.github.com/repos/ysu2017/GoRampUp/assignees{/user}","branches_url":"https://api.github.com/repos/ysu2017/GoRampUp/branches{/branch}","tags_url":"https://api.github.com/repos/ysu2017/GoRampUp/tags","blobs_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ysu2017/GoRampUp/statuses/{sha}","languages_url":"https://api.github.com/repos/ysu2017/GoRampUp/languages","stargazers_url":"https://api.github.com/repos/ysu2017/GoRampUp/stargazers","contributors_url":"https://api.github.com/repos/ysu2017/GoRampUp/contributors","subscribers_url":"https://api.github.com/repos/ysu2017/GoRampUp/subscribers","subscription_url":"https://api.github.com/repos/ysu2017/GoRampUp/subscription","commits_url":"https://api.github.com/repos/ysu2017/GoRampUp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ysu2017/GoRampUp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ysu2017/GoRampUp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ysu2017/GoRampUp/contents/{+path}","compare_url":"https://api.github.com/repos/ysu2017/GoRampUp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ysu2017/GoRampUp/merges","archive_url":"https://api.github.com/repos/ysu2017/GoRampUp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ysu2017/GoRampUp/downloads","issues_url":"https://api.github.com/repos/ysu2017/GoRampUp/issues{/number}","pulls_url":"https://api.github.com/repos/ysu2017/GoRampUp/pulls{/number}","milestones_url":"https://api.github.com/repos/ysu2017/GoRampUp/milestones{/number}","notifications_url":"https://api.github.com/repos/ysu2017/GoRampUp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ysu2017/GoRampUp/labels{/name}","releases_url":"https://api.github.com/repos/ysu2017/GoRampUp/releases{/id}","deployments_url":"https://api.github.com/repos/ysu2017/GoRampUp/deployments","created_at":"2017-05-17T17:24:54Z","updated_at":"2017-05-17T17:35:47Z","pushed_at":"2017-05-19T18:46:33Z","git_url":"git://github.com/ysu2017/GoRampUp.git","ssh_url":"git@github.com:ysu2017/GoRampUp.git","clone_url":"https://github.com/ysu2017/GoRampUp.git","svn_url":"https://github.com/ysu2017/GoRampUp","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ysu2017:master","ref":"master","sha":"452ff42af45d2db6b081eb6bdd535fbedde3ccb8","user":{"login":"ysu2017","id":28762783,"avatar_url":"https://avatars0.githubusercontent.com/u/28762783?v=3","gravatar_id":"","url":"https://api.github.com/users/ysu2017","html_url":"https://github.com/ysu2017","followers_url":"https://api.github.com/users/ysu2017/followers","following_url":"https://api.github.com/users/ysu2017/following{/other_user}","gists_url":"https://api.github.com/users/ysu2017/gists{/gist_id}","starred_url":"https://api.github.com/users/ysu2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysu2017/subscriptions","organizations_url":"https://api.github.com/users/ysu2017/orgs","repos_url":"https://api.github.com/users/ysu2017/repos","events_url":"https://api.github.com/users/ysu2017/events{/privacy}","received_events_url":"https://api.github.com/users/ysu2017/received_events","type":"User","site_admin":false},"repo":{"id":91602513,"name":"GoRampUp","full_name":"ysu2017/GoRampUp","owner":{"login":"ysu2017","id":28762783,"avatar_url":"https://avatars0.githubusercontent.com/u/28762783?v=3","gravatar_id":"","url":"https://api.github.com/users/ysu2017","html_url":"https://github.com/ysu2017","followers_url":"https://api.github.com/users/ysu2017/followers","following_url":"https://api.github.com/users/ysu2017/following{/other_user}","gists_url":"https://api.github.com/users/ysu2017/gists{/gist_id}","starred_url":"https://api.github.com/users/ysu2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysu2017/subscriptions","organizations_url":"https://api.github.com/users/ysu2017/orgs","repos_url":"https://api.github.com/users/ysu2017/repos","events_url":"https://api.github.com/users/ysu2017/events{/privacy}","received_events_url":"https://api.github.com/users/ysu2017/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ysu2017/GoRampUp","description":null,"fork":false,"url":"https://api.github.com/repos/ysu2017/GoRampUp","forks_url":"https://api.github.com/repos/ysu2017/GoRampUp/forks","keys_url":"https://api.github.com/repos/ysu2017/GoRampUp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ysu2017/GoRampUp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ysu2017/GoRampUp/teams","hooks_url":"https://api.github.com/repos/ysu2017/GoRampUp/hooks","issue_events_url":"https://api.github.com/repos/ysu2017/GoRampUp/issues/events{/number}","events_url":"https://api.github.com/repos/ysu2017/GoRampUp/events","assignees_url":"https://api.github.com/repos/ysu2017/GoRampUp/assignees{/user}","branches_url":"https://api.github.com/repos/ysu2017/GoRampUp/branches{/branch}","tags_url":"https://api.github.com/repos/ysu2017/GoRampUp/tags","blobs_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ysu2017/GoRampUp/statuses/{sha}","languages_url":"https://api.github.com/repos/ysu2017/GoRampUp/languages","stargazers_url":"https://api.github.com/repos/ysu2017/GoRampUp/stargazers","contributors_url":"https://api.github.com/repos/ysu2017/GoRampUp/contributors","subscribers_url":"https://api.github.com/repos/ysu2017/GoRampUp/subscribers","subscription_url":"https://api.github.com/repos/ysu2017/GoRampUp/subscription","commits_url":"https://api.github.com/repos/ysu2017/GoRampUp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ysu2017/GoRampUp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ysu2017/GoRampUp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ysu2017/GoRampUp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ysu2017/GoRampUp/contents/{+path}","compare_url":"https://api.github.com/repos/ysu2017/GoRampUp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ysu2017/GoRampUp/merges","archive_url":"https://api.github.com/repos/ysu2017/GoRampUp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ysu2017/GoRampUp/downloads","issues_url":"https://api.github.com/repos/ysu2017/GoRampUp/issues{/number}","pulls_url":"https://api.github.com/repos/ysu2017/GoRampUp/pulls{/number}","milestones_url":"https://api.github.com/repos/ysu2017/GoRampUp/milestones{/number}","notifications_url":"https://api.github.com/repos/ysu2017/GoRampUp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ysu2017/GoRampUp/labels{/name}","releases_url":"https://api.github.com/repos/ysu2017/GoRampUp/releases{/id}","deployments_url":"https://api.github.com/repos/ysu2017/GoRampUp/deployments","created_at":"2017-05-17T17:24:54Z","updated_at":"2017-05-17T17:35:47Z","pushed_at":"2017-05-19T18:46:33Z","git_url":"git://github.com/ysu2017/GoRampUp.git","ssh_url":"git@github.com:ysu2017/GoRampUp.git","clone_url":"https://github.com/ysu2017/GoRampUp.git","svn_url":"https://github.com/ysu2017/GoRampUp","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/1"},"html":{"href":"https://github.com/ysu2017/GoRampUp/pull/1"},"issue":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/issues/1"},"comments":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ysu2017/GoRampUp/statuses/038a06359605edfca75e1489dd621a6d08062e90"}}}}
{"actor":{"display_login":"yisu2015"}}