{"action":"created","comment":{"url":"https://api.github.com/repos/gonum/matrix/pulls/comments/54862641","id":54862641,"diff_hunk":"@@ -5,14 +5,152 @@\n package mat64\n \n import (\n+\t\"bytes\"\n \t\"encoding/binary\"\n+\n+\t\"github.com/gonum/matrix\"\n )\n \n var (\n-\tlittleEndian  = binary.LittleEndian\n-\tbigEndian     = binary.BigEndian\n-\tdefaultEndian = littleEndian\n-\n+\tbinLE       = binary.LittleEndian\n \tsizeInt64   = binary.Size(int64(0))\n \tsizeFloat64 = binary.Size(float64(0))\n )\n+\n+// MarshalBinary encodes the receiver into a binary form and returns the result.\n+//\n+// Dense is little-endian encoded as follows:\n+//   0 -  8  number of rows    (int64)\n+//   8 - 16  number of columns (int64)\n+//  16 - ..  matrix data elements (float64)\n+//           [0,0] [0,1] ... [0,ncols-1]\n+//           [1,0] [1,1] ... [1,ncols-1]\n+//           ...\n+//           [nrows-1,0] ... [nrows-1,ncols-1]\n+func (m Dense) MarshalBinary() ([]byte, error) {\n+\tbuf := bytes.NewBuffer(make([]byte, 0, m.mat.Rows*m.mat.Cols*sizeFloat64+2*sizeInt64))","path":"mat64/io.go","position":37,"original_position":31,"commit_id":"9ec0cae79a98f73490882632a34d06153c2b33f2","original_commit_id":"8091192883a0db22712c6ebb219f7085d4f1390a","user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"body":"right. done.","created_at":"2016-03-03T10:38:07Z","updated_at":"2016-03-03T10:38:07Z","html_url":"https://github.com/gonum/matrix/pull/342#discussion_r54862641","pull_request_url":"https://api.github.com/repos/gonum/matrix/pulls/342","_links":{"self":{"href":"https://api.github.com/repos/gonum/matrix/pulls/comments/54862641"},"html":{"href":"https://github.com/gonum/matrix/pull/342#discussion_r54862641"},"pull_request":{"href":"https://api.github.com/repos/gonum/matrix/pulls/342"}}},"pull_request":{"url":"https://api.github.com/repos/gonum/matrix/pulls/342","id":61404715,"html_url":"https://github.com/gonum/matrix/pull/342","diff_url":"https://github.com/gonum/matrix/pull/342.diff","patch_url":"https://github.com/gonum/matrix/pull/342.patch","issue_url":"https://api.github.com/repos/gonum/matrix/issues/342","number":342,"state":"open","locked":false,"title":"mat64: implement Binary(Un)Marshaler for Vector","user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"body":"This CL makes *mat64.Vector implement encoding.BinaryMarshaler and\r\nencoding.BinaryUnmarshaler.\r\n\r\nFixes gonum/matrix#337.","created_at":"2016-03-02T14:07:53Z","updated_at":"2016-03-03T10:38:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f7fbee4ecfa13ad1888ed899ef47a2c58ecf2cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gonum/matrix/pulls/342/commits","review_comments_url":"https://api.github.com/repos/gonum/matrix/pulls/342/comments","review_comment_url":"https://api.github.com/repos/gonum/matrix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gonum/matrix/issues/342/comments","statuses_url":"https://api.github.com/repos/gonum/matrix/statuses/9ec0cae79a98f73490882632a34d06153c2b33f2","head":{"label":"sbinet:io-vector","ref":"io-vector","sha":"9ec0cae79a98f73490882632a34d06153c2b33f2","user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"repo":{"id":29135086,"name":"gonum-matrix","full_name":"sbinet/gonum-matrix","owner":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sbinet/gonum-matrix","description":"Scientific math package for the Go language.","fork":true,"url":"https://api.github.com/repos/sbinet/gonum-matrix","forks_url":"https://api.github.com/repos/sbinet/gonum-matrix/forks","keys_url":"https://api.github.com/repos/sbinet/gonum-matrix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sbinet/gonum-matrix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sbinet/gonum-matrix/teams","hooks_url":"https://api.github.com/repos/sbinet/gonum-matrix/hooks","issue_events_url":"https://api.github.com/repos/sbinet/gonum-matrix/issues/events{/number}","events_url":"https://api.github.com/repos/sbinet/gonum-matrix/events","assignees_url":"https://api.github.com/repos/sbinet/gonum-matrix/assignees{/user}","branches_url":"https://api.github.com/repos/sbinet/gonum-matrix/branches{/branch}","tags_url":"https://api.github.com/repos/sbinet/gonum-matrix/tags","blobs_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/refs{/sha}","trees_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sbinet/gonum-matrix/statuses/{sha}","languages_url":"https://api.github.com/repos/sbinet/gonum-matrix/languages","stargazers_url":"https://api.github.com/repos/sbinet/gonum-matrix/stargazers","contributors_url":"https://api.github.com/repos/sbinet/gonum-matrix/contributors","subscribers_url":"https://api.github.com/repos/sbinet/gonum-matrix/subscribers","subscription_url":"https://api.github.com/repos/sbinet/gonum-matrix/subscription","commits_url":"https://api.github.com/repos/sbinet/gonum-matrix/commits{/sha}","git_commits_url":"https://api.github.com/repos/sbinet/gonum-matrix/git/commits{/sha}","comments_url":"https://api.github.com/repos/sbinet/gonum-matrix/comments{/number}","issue_comment_url":"https://api.github.com/repos/sbinet/gonum-matrix/issues/comments{/number}","contents_url":"https://api.github.com/repos/sbinet/gonum-matrix/contents/{+path}","compare_url":"https://api.github.com/repos/sbinet/gonum-matrix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sbinet/gonum-matrix/merges","archive_url":"https://api.github.com/repos/sbinet/gonum-matrix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sbinet/gonum-matrix/downloads","issues_url":"https://api.github.com/repos/sbinet/gonum-matrix/issues{/number}","pulls_url":"https://api.github.com/repos/sbinet/gonum-matrix/pulls{/number}","milestones_url":"https://api.github.com/repos/sbinet/gonum-matrix/milestones{/number}","notifications_url":"https://api.github.com/repos/sbinet/gonum-matrix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sbinet/gonum-matrix/labels{/name}","releases_url":"https://api.github.com/repos/sbinet/gonum-matrix/releases{/id}","deployments_url":"https://api.github.com/repos/sbinet/gonum-matrix/deployments","created_at":"2015-01-12T12:46:30Z","updated_at":"2016-01-15T20:50:08Z","pushed_at":"2016-03-03T10:28:58Z","git_url":"git://github.com/sbinet/gonum-matrix.git","ssh_url":"git@github.com:sbinet/gonum-matrix.git","clone_url":"https://github.com/sbinet/gonum-matrix.git","svn_url":"https://github.com/sbinet/gonum-matrix","homepage":null,"size":929,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"gonum:master","ref":"master","sha":"a9e55bcdf3c9f1a90cc4758a9bd24619625a8f55","user":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"repo":{"id":8569918,"name":"matrix","full_name":"gonum/matrix","owner":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gonum/matrix","description":"Matrix packages for the Go language.","fork":false,"url":"https://api.github.com/repos/gonum/matrix","forks_url":"https://api.github.com/repos/gonum/matrix/forks","keys_url":"https://api.github.com/repos/gonum/matrix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gonum/matrix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gonum/matrix/teams","hooks_url":"https://api.github.com/repos/gonum/matrix/hooks","issue_events_url":"https://api.github.com/repos/gonum/matrix/issues/events{/number}","events_url":"https://api.github.com/repos/gonum/matrix/events","assignees_url":"https://api.github.com/repos/gonum/matrix/assignees{/user}","branches_url":"https://api.github.com/repos/gonum/matrix/branches{/branch}","tags_url":"https://api.github.com/repos/gonum/matrix/tags","blobs_url":"https://api.github.com/repos/gonum/matrix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gonum/matrix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gonum/matrix/git/refs{/sha}","trees_url":"https://api.github.com/repos/gonum/matrix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gonum/matrix/statuses/{sha}","languages_url":"https://api.github.com/repos/gonum/matrix/languages","stargazers_url":"https://api.github.com/repos/gonum/matrix/stargazers","contributors_url":"https://api.github.com/repos/gonum/matrix/contributors","subscribers_url":"https://api.github.com/repos/gonum/matrix/subscribers","subscription_url":"https://api.github.com/repos/gonum/matrix/subscription","commits_url":"https://api.github.com/repos/gonum/matrix/commits{/sha}","git_commits_url":"https://api.github.com/repos/gonum/matrix/git/commits{/sha}","comments_url":"https://api.github.com/repos/gonum/matrix/comments{/number}","issue_comment_url":"https://api.github.com/repos/gonum/matrix/issues/comments{/number}","contents_url":"https://api.github.com/repos/gonum/matrix/contents/{+path}","compare_url":"https://api.github.com/repos/gonum/matrix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gonum/matrix/merges","archive_url":"https://api.github.com/repos/gonum/matrix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gonum/matrix/downloads","issues_url":"https://api.github.com/repos/gonum/matrix/issues{/number}","pulls_url":"https://api.github.com/repos/gonum/matrix/pulls{/number}","milestones_url":"https://api.github.com/repos/gonum/matrix/milestones{/number}","notifications_url":"https://api.github.com/repos/gonum/matrix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gonum/matrix/labels{/name}","releases_url":"https://api.github.com/repos/gonum/matrix/releases{/id}","deployments_url":"https://api.github.com/repos/gonum/matrix/deployments","created_at":"2013-03-05T01:59:12Z","updated_at":"2016-03-02T18:00:55Z","pushed_at":"2016-03-03T10:28:58Z","git_url":"git://github.com/gonum/matrix.git","ssh_url":"git@github.com:gonum/matrix.git","clone_url":"https://github.com/gonum/matrix.git","svn_url":"https://github.com/gonum/matrix","homepage":"","size":1060,"stargazers_count":219,"watchers_count":219,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":18,"forks":34,"open_issues":18,"watchers":219,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gonum/matrix/pulls/342"},"html":{"href":"https://github.com/gonum/matrix/pull/342"},"issue":{"href":"https://api.github.com/repos/gonum/matrix/issues/342"},"comments":{"href":"https://api.github.com/repos/gonum/matrix/issues/342/comments"},"review_comments":{"href":"https://api.github.com/repos/gonum/matrix/pulls/342/comments"},"review_comment":{"href":"https://api.github.com/repos/gonum/matrix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gonum/matrix/pulls/342/commits"},"statuses":{"href":"https://api.github.com/repos/gonum/matrix/statuses/9ec0cae79a98f73490882632a34d06153c2b33f2"}}}}