{"action":"created","comment":{"url":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/comments/193163816","pull_request_review_id":126082326,"id":193163816,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzE2MzgxNg==","diff_hunk":"@@ -31,29 +31,78 @@ struct Matrix\n {\n     /// <summary>\n     /// Constructor initializing the data based on given dimensions.\n+    /// It sets all the values to zero upon creation.\n     /// </summary>\n     /// <param name=\"height\">Height of the array.</param>\n     /// <param name=\"width\">Width of the array.</param>\n     Matrix(unsigned height, unsigned width)\n     {\n+        unsigned length = height * width;\n         data = new Type*[height];\n         if (height > 0)\n         {\n-            data[0] = new Type[width * height]; // allocate data once\n+            data[0] = new Type[length]; // allocate data once\n             for (unsigned i = 1; i < height; ++i)\n                 data[i] = data[0] + i * width; // assign pointers\n         }\n-        memset(data[0], 0, width * height * sizeof(Type));\n+        memset(data[0], 0, length * sizeof(Type));\n     }\n \n+    /// <summary>\n+    /// Construct a matrix from vector of vectors.\n+    /// </summary>\n+    /// <param name=\"other\">Vector of vectors with data.</param>\n+    Matrix(std::vector<std::vector<Type>>& other)\n+    {\n+        unsigned height = (unsigned)other.size();\n+        unsigned width = height ? (unsigned)other[0].size() : 0;\n+        unsigned length = height * width;\n+        data = new Type*[height];\n+        if (height > 0)\n+        {\n+            data[0] = new Type[length]; // allocate data once\n+            for (unsigned i = 1; i < height; ++i)\n+                data[i] = data[0] + i * width; // assign pointers\n+        }\n+        for (unsigned i = 0; i < height; i++)\n+        {\n+            for (unsigned j = 0; j < width; j++)\n+            {\n+                data[i][j] = other[i][j];\n+            }\n+        }\n+    }\n+\n+    /// <summary>\n+    /// Move constructor\n+    /// </summary>\n+    /// <param name=\"other\">Old matrix object.</param>\n+    Matrix(Matrix&& other)\n+    {\n+        data = other.data;\n+        other.data = nullptr;\n+    }\n+\n+    /// <summary>\n+    /// Move constructor\n+    /// </summary>\n+    /// <param name=\"other\">Old matrix object.</param>\n+    Matrix(Matrix& other)","path":"src/Spectre.libGaussianMixtureModelling/Matrix.h","position":62,"original_position":62,"commit_id":"ffb4c0e05ebac97d87c108ff89e73b26dc6c7fc5","original_commit_id":"ffb4c0e05ebac97d87c108ff89e73b26dc6c7fc5","user":{"login":"Sand3r-","id":4967505,"node_id":"MDQ6VXNlcjQ5Njc1MDU=","avatar_url":"https://avatars3.githubusercontent.com/u/4967505?v=4","gravatar_id":"","url":"https://api.github.com/users/Sand3r-","html_url":"https://github.com/Sand3r-","followers_url":"https://api.github.com/users/Sand3r-/followers","following_url":"https://api.github.com/users/Sand3r-/following{/other_user}","gists_url":"https://api.github.com/users/Sand3r-/gists{/gist_id}","starred_url":"https://api.github.com/users/Sand3r-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sand3r-/subscriptions","organizations_url":"https://api.github.com/users/Sand3r-/orgs","repos_url":"https://api.github.com/users/Sand3r-/repos","events_url":"https://api.github.com/users/Sand3r-/events{/privacy}","received_events_url":"https://api.github.com/users/Sand3r-/received_events","type":"User","site_admin":false},"body":"I have no idea how did this end up here, thanks for catching it.","created_at":"2018-06-05T17:51:00Z","updated_at":"2018-06-05T17:51:00Z","html_url":"https://github.com/spectre-team/native-algorithms/pull/51#discussion_r193163816","pull_request_url":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/51","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/comments/193163816"},"html":{"href":"https://github.com/spectre-team/native-algorithms/pull/51#discussion_r193163816"},"pull_request":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/51"}},"in_reply_to_id":193057576},"pull_request":{"url":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/51","id":192512045,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNTEyMDQ1","html_url":"https://github.com/spectre-team/native-algorithms/pull/51","diff_url":"https://github.com/spectre-team/native-algorithms/pull/51.diff","patch_url":"https://github.com/spectre-team/native-algorithms/pull/51.patch","issue_url":"https://api.github.com/repos/spectre-team/native-algorithms/issues/51","number":51,"state":"open","locked":false,"title":"Optimized ExpectationMaximization","user":{"login":"Sand3r-","id":4967505,"node_id":"MDQ6VXNlcjQ5Njc1MDU=","avatar_url":"https://avatars3.githubusercontent.com/u/4967505?v=4","gravatar_id":"","url":"https://api.github.com/users/Sand3r-","html_url":"https://github.com/Sand3r-","followers_url":"https://api.github.com/users/Sand3r-/followers","following_url":"https://api.github.com/users/Sand3r-/following{/other_user}","gists_url":"https://api.github.com/users/Sand3r-/gists{/gist_id}","starred_url":"https://api.github.com/users/Sand3r-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sand3r-/subscriptions","organizations_url":"https://api.github.com/users/Sand3r-/orgs","repos_url":"https://api.github.com/users/Sand3r-/repos","events_url":"https://api.github.com/users/Sand3r-/events{/privacy}","received_events_url":"https://api.github.com/users/Sand3r-/received_events","type":"User","site_admin":false},"body":"Also additional enhancements for Matrix class, and optimized versions of Gaussian Distribution function\r\nand class.","created_at":"2018-06-04T19:59:32Z","updated_at":"2018-06-05T17:51:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3e4f650eb36d749db06d2e4192fdbaddbc5939b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Daroslaw","id":7458086,"node_id":"MDQ6VXNlcjc0NTgwODY=","avatar_url":"https://avatars1.githubusercontent.com/u/7458086?v=4","gravatar_id":"","url":"https://api.github.com/users/Daroslaw","html_url":"https://github.com/Daroslaw","followers_url":"https://api.github.com/users/Daroslaw/followers","following_url":"https://api.github.com/users/Daroslaw/following{/other_user}","gists_url":"https://api.github.com/users/Daroslaw/gists{/gist_id}","starred_url":"https://api.github.com/users/Daroslaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daroslaw/subscriptions","organizations_url":"https://api.github.com/users/Daroslaw/orgs","repos_url":"https://api.github.com/users/Daroslaw/repos","events_url":"https://api.github.com/users/Daroslaw/events{/privacy}","received_events_url":"https://api.github.com/users/Daroslaw/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/51/commits","review_comments_url":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/51/comments","review_comment_url":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spectre-team/native-algorithms/issues/51/comments","statuses_url":"https://api.github.com/repos/spectre-team/native-algorithms/statuses/ffb4c0e05ebac97d87c108ff89e73b26dc6c7fc5","head":{"label":"spectre-team:feature/gmm/em-steps-opt","ref":"feature/gmm/em-steps-opt","sha":"ffb4c0e05ebac97d87c108ff89e73b26dc6c7fc5","user":{"login":"spectre-team","id":25571382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTcxMzgy","avatar_url":"https://avatars2.githubusercontent.com/u/25571382?v=4","gravatar_id":"","url":"https://api.github.com/users/spectre-team","html_url":"https://github.com/spectre-team","followers_url":"https://api.github.com/users/spectre-team/followers","following_url":"https://api.github.com/users/spectre-team/following{/other_user}","gists_url":"https://api.github.com/users/spectre-team/gists{/gist_id}","starred_url":"https://api.github.com/users/spectre-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spectre-team/subscriptions","organizations_url":"https://api.github.com/users/spectre-team/orgs","repos_url":"https://api.github.com/users/spectre-team/repos","events_url":"https://api.github.com/users/spectre-team/events{/privacy}","received_events_url":"https://api.github.com/users/spectre-team/received_events","type":"Organization","site_admin":false},"repo":{"id":115797532,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU3OTc1MzI=","name":"native-algorithms","full_name":"spectre-team/native-algorithms","owner":{"login":"spectre-team","id":25571382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTcxMzgy","avatar_url":"https://avatars2.githubusercontent.com/u/25571382?v=4","gravatar_id":"","url":"https://api.github.com/users/spectre-team","html_url":"https://github.com/spectre-team","followers_url":"https://api.github.com/users/spectre-team/followers","following_url":"https://api.github.com/users/spectre-team/following{/other_user}","gists_url":"https://api.github.com/users/spectre-team/gists{/gist_id}","starred_url":"https://api.github.com/users/spectre-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spectre-team/subscriptions","organizations_url":"https://api.github.com/users/spectre-team/orgs","repos_url":"https://api.github.com/users/spectre-team/repos","events_url":"https://api.github.com/users/spectre-team/events{/privacy}","received_events_url":"https://api.github.com/users/spectre-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spectre-team/native-algorithms","description":"C++ implementations of algorithms for processing Mass Spectrometry Imaging datasets.","fork":false,"url":"https://api.github.com/repos/spectre-team/native-algorithms","forks_url":"https://api.github.com/repos/spectre-team/native-algorithms/forks","keys_url":"https://api.github.com/repos/spectre-team/native-algorithms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spectre-team/native-algorithms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spectre-team/native-algorithms/teams","hooks_url":"https://api.github.com/repos/spectre-team/native-algorithms/hooks","issue_events_url":"https://api.github.com/repos/spectre-team/native-algorithms/issues/events{/number}","events_url":"https://api.github.com/repos/spectre-team/native-algorithms/events","assignees_url":"https://api.github.com/repos/spectre-team/native-algorithms/assignees{/user}","branches_url":"https://api.github.com/repos/spectre-team/native-algorithms/branches{/branch}","tags_url":"https://api.github.com/repos/spectre-team/native-algorithms/tags","blobs_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/refs{/sha}","trees_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spectre-team/native-algorithms/statuses/{sha}","languages_url":"https://api.github.com/repos/spectre-team/native-algorithms/languages","stargazers_url":"https://api.github.com/repos/spectre-team/native-algorithms/stargazers","contributors_url":"https://api.github.com/repos/spectre-team/native-algorithms/contributors","subscribers_url":"https://api.github.com/repos/spectre-team/native-algorithms/subscribers","subscription_url":"https://api.github.com/repos/spectre-team/native-algorithms/subscription","commits_url":"https://api.github.com/repos/spectre-team/native-algorithms/commits{/sha}","git_commits_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/commits{/sha}","comments_url":"https://api.github.com/repos/spectre-team/native-algorithms/comments{/number}","issue_comment_url":"https://api.github.com/repos/spectre-team/native-algorithms/issues/comments{/number}","contents_url":"https://api.github.com/repos/spectre-team/native-algorithms/contents/{+path}","compare_url":"https://api.github.com/repos/spectre-team/native-algorithms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spectre-team/native-algorithms/merges","archive_url":"https://api.github.com/repos/spectre-team/native-algorithms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spectre-team/native-algorithms/downloads","issues_url":"https://api.github.com/repos/spectre-team/native-algorithms/issues{/number}","pulls_url":"https://api.github.com/repos/spectre-team/native-algorithms/pulls{/number}","milestones_url":"https://api.github.com/repos/spectre-team/native-algorithms/milestones{/number}","notifications_url":"https://api.github.com/repos/spectre-team/native-algorithms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spectre-team/native-algorithms/labels{/name}","releases_url":"https://api.github.com/repos/spectre-team/native-algorithms/releases{/id}","deployments_url":"https://api.github.com/repos/spectre-team/native-algorithms/deployments","created_at":"2017-12-30T13:08:15Z","updated_at":"2018-03-01T08:25:27Z","pushed_at":"2018-06-05T14:28:59Z","git_url":"git://github.com/spectre-team/native-algorithms.git","ssh_url":"git@github.com:spectre-team/native-algorithms.git","clone_url":"https://github.com/spectre-team/native-algorithms.git","svn_url":"https://github.com/spectre-team/native-algorithms","homepage":"","size":130664,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"spectre-team:develop","ref":"develop","sha":"f6e586ae1e6ed43450e657df726b1aa7d54ccf89","user":{"login":"spectre-team","id":25571382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTcxMzgy","avatar_url":"https://avatars2.githubusercontent.com/u/25571382?v=4","gravatar_id":"","url":"https://api.github.com/users/spectre-team","html_url":"https://github.com/spectre-team","followers_url":"https://api.github.com/users/spectre-team/followers","following_url":"https://api.github.com/users/spectre-team/following{/other_user}","gists_url":"https://api.github.com/users/spectre-team/gists{/gist_id}","starred_url":"https://api.github.com/users/spectre-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spectre-team/subscriptions","organizations_url":"https://api.github.com/users/spectre-team/orgs","repos_url":"https://api.github.com/users/spectre-team/repos","events_url":"https://api.github.com/users/spectre-team/events{/privacy}","received_events_url":"https://api.github.com/users/spectre-team/received_events","type":"Organization","site_admin":false},"repo":{"id":115797532,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU3OTc1MzI=","name":"native-algorithms","full_name":"spectre-team/native-algorithms","owner":{"login":"spectre-team","id":25571382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NTcxMzgy","avatar_url":"https://avatars2.githubusercontent.com/u/25571382?v=4","gravatar_id":"","url":"https://api.github.com/users/spectre-team","html_url":"https://github.com/spectre-team","followers_url":"https://api.github.com/users/spectre-team/followers","following_url":"https://api.github.com/users/spectre-team/following{/other_user}","gists_url":"https://api.github.com/users/spectre-team/gists{/gist_id}","starred_url":"https://api.github.com/users/spectre-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spectre-team/subscriptions","organizations_url":"https://api.github.com/users/spectre-team/orgs","repos_url":"https://api.github.com/users/spectre-team/repos","events_url":"https://api.github.com/users/spectre-team/events{/privacy}","received_events_url":"https://api.github.com/users/spectre-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spectre-team/native-algorithms","description":"C++ implementations of algorithms for processing Mass Spectrometry Imaging datasets.","fork":false,"url":"https://api.github.com/repos/spectre-team/native-algorithms","forks_url":"https://api.github.com/repos/spectre-team/native-algorithms/forks","keys_url":"https://api.github.com/repos/spectre-team/native-algorithms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spectre-team/native-algorithms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spectre-team/native-algorithms/teams","hooks_url":"https://api.github.com/repos/spectre-team/native-algorithms/hooks","issue_events_url":"https://api.github.com/repos/spectre-team/native-algorithms/issues/events{/number}","events_url":"https://api.github.com/repos/spectre-team/native-algorithms/events","assignees_url":"https://api.github.com/repos/spectre-team/native-algorithms/assignees{/user}","branches_url":"https://api.github.com/repos/spectre-team/native-algorithms/branches{/branch}","tags_url":"https://api.github.com/repos/spectre-team/native-algorithms/tags","blobs_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/refs{/sha}","trees_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spectre-team/native-algorithms/statuses/{sha}","languages_url":"https://api.github.com/repos/spectre-team/native-algorithms/languages","stargazers_url":"https://api.github.com/repos/spectre-team/native-algorithms/stargazers","contributors_url":"https://api.github.com/repos/spectre-team/native-algorithms/contributors","subscribers_url":"https://api.github.com/repos/spectre-team/native-algorithms/subscribers","subscription_url":"https://api.github.com/repos/spectre-team/native-algorithms/subscription","commits_url":"https://api.github.com/repos/spectre-team/native-algorithms/commits{/sha}","git_commits_url":"https://api.github.com/repos/spectre-team/native-algorithms/git/commits{/sha}","comments_url":"https://api.github.com/repos/spectre-team/native-algorithms/comments{/number}","issue_comment_url":"https://api.github.com/repos/spectre-team/native-algorithms/issues/comments{/number}","contents_url":"https://api.github.com/repos/spectre-team/native-algorithms/contents/{+path}","compare_url":"https://api.github.com/repos/spectre-team/native-algorithms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spectre-team/native-algorithms/merges","archive_url":"https://api.github.com/repos/spectre-team/native-algorithms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spectre-team/native-algorithms/downloads","issues_url":"https://api.github.com/repos/spectre-team/native-algorithms/issues{/number}","pulls_url":"https://api.github.com/repos/spectre-team/native-algorithms/pulls{/number}","milestones_url":"https://api.github.com/repos/spectre-team/native-algorithms/milestones{/number}","notifications_url":"https://api.github.com/repos/spectre-team/native-algorithms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spectre-team/native-algorithms/labels{/name}","releases_url":"https://api.github.com/repos/spectre-team/native-algorithms/releases{/id}","deployments_url":"https://api.github.com/repos/spectre-team/native-algorithms/deployments","created_at":"2017-12-30T13:08:15Z","updated_at":"2018-03-01T08:25:27Z","pushed_at":"2018-06-05T14:28:59Z","git_url":"git://github.com/spectre-team/native-algorithms.git","ssh_url":"git@github.com:spectre-team/native-algorithms.git","clone_url":"https://github.com/spectre-team/native-algorithms.git","svn_url":"https://github.com/spectre-team/native-algorithms","homepage":"","size":130664,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/51"},"html":{"href":"https://github.com/spectre-team/native-algorithms/pull/51"},"issue":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/issues/51"},"comments":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/spectre-team/native-algorithms/statuses/ffb4c0e05ebac97d87c108ff89e73b26dc6c7fc5"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Sand3r-"}}