{"action":"created","comment":{"url":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/comments/73449378","id":73449378,"diff_hunk":"@@ -1021,175 +616,6 @@ impl<T: Float + FromPrimitive> Matrix<T> {\n }\n \n impl<T: Any + Float> Matrix<T> {\n-    /// Solves an upper triangular linear system.\n-    ///\n-    /// Given a matrix `U`, which is upper triangular, and a vector `y`, this function returns `x`\n-    /// such that `Ux = y`.\n-    ///\n-    /// # Examples\n-    ///\n-    /// ```\n-    /// use rulinalg::matrix::Matrix;\n-    /// use rulinalg::vector::Vector;\n-    /// use std::f32;\n-    ///\n-    /// let u = Matrix::new(2,2, vec![1.0, 2.0, 0.0, 1.0]);\n-    /// let y = Vector::new(vec![3.0, 1.0]);\n-    ///\n-    /// let x = u.solve_u_triangular(y).expect(\"A solution should exist!\");\n-    /// assert!((x[0] - 1.0) < f32::EPSILON);\n-    /// assert!((x[1] - 1.0) < f32::EPSILON);\n-    /// ```\n-    ///\n-    /// # Panics\n-    ///\n-    /// - Vector size and matrix column count are not equal.\n-    /// - Matrix is not upper triangular.\n-    ///\n-    /// # Failures\n-    ///\n-    /// Fails if there is no valid solution to the system (matrix is singular).\n-    pub fn solve_u_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error> {\n-        assert!(self.cols == y.size(),\n-                format!(\"Vector size {0} != {1} Matrix column count.\",\n-                        y.size(),\n-                        self.cols));\n-\n-        // Make sure we are upper triangular.\n-        for (row_idx, row) in self.iter_rows().enumerate() {\n-            for i in 0..row_idx {\n-                unsafe {\n-                    assert!(*row.get_unchecked(i) == T::zero(),\n-                            \"Matrix is not upper triangular.\");\n-                }\n-\n-            }\n-        }\n-\n-        self.back_substitution(y)\n-    }\n-\n-    fn back_substitution(&self, y: Vector<T>) -> Result<Vector<T>, Error> {","path":"src/matrix/mod.rs","position":575,"original_position":575,"commit_id":"1422144cb68186e3669f68e5d5a4833315589733","original_commit_id":"c5e3e7ed25ec17710e8d958360179fcf0ce2cc31","user":{"login":"tafia","id":7351502,"avatar_url":"https://avatars.githubusercontent.com/u/7351502?v=3","gravatar_id":"","url":"https://api.github.com/users/tafia","html_url":"https://github.com/tafia","followers_url":"https://api.github.com/users/tafia/followers","following_url":"https://api.github.com/users/tafia/following{/other_user}","gists_url":"https://api.github.com/users/tafia/gists{/gist_id}","starred_url":"https://api.github.com/users/tafia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tafia/subscriptions","organizations_url":"https://api.github.com/users/tafia/orgs","repos_url":"https://api.github.com/users/tafia/repos","events_url":"https://api.github.com/users/tafia/events{/privacy}","received_events_url":"https://api.github.com/users/tafia/received_events","type":"User","site_admin":false},"body":"I can put them out of the trait, as standalone private functions (in `src/matrix/mod.rs` as this is used there as well). Would that be ok ?","created_at":"2016-08-04T01:15:36Z","updated_at":"2016-08-04T01:15:37Z","html_url":"https://github.com/AtheMathmo/rulinalg/pull/18#discussion_r73449378","pull_request_url":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/comments/73449378"},"html":{"href":"https://github.com/AtheMathmo/rulinalg/pull/18#discussion_r73449378"},"pull_request":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/18","id":79674955,"html_url":"https://github.com/AtheMathmo/rulinalg/pull/18","diff_url":"https://github.com/AtheMathmo/rulinalg/pull/18.diff","patch_url":"https://github.com/AtheMathmo/rulinalg/pull/18.patch","issue_url":"https://api.github.com/repos/AtheMathmo/rulinalg/issues/18","number":18,"state":"open","locked":false,"title":"DRY: Leverage more on BaseSlice trait","user":{"login":"tafia","id":7351502,"avatar_url":"https://avatars.githubusercontent.com/u/7351502?v=3","gravatar_id":"","url":"https://api.github.com/users/tafia","html_url":"https://github.com/tafia","followers_url":"https://api.github.com/users/tafia/followers","following_url":"https://api.github.com/users/tafia/following{/other_user}","gists_url":"https://api.github.com/users/tafia/gists{/gist_id}","starred_url":"https://api.github.com/users/tafia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tafia/subscriptions","organizations_url":"https://api.github.com/users/tafia/orgs","repos_url":"https://api.github.com/users/tafia/repos","events_url":"https://api.github.com/users/tafia/events{/privacy}","received_events_url":"https://api.github.com/users/tafia/received_events","type":"User","site_admin":false},"body":"We can leverage much more on trait to avoid repeating code and to simplify logic.\r\n\r\n- Enhance `BaseSlice` (`iter`, ...), we should probably also have `iter_rows`, `select`etc ...\r\n- Have `Matrix` implement `BaseSlice` (can answer issue #14 )\r\n- Create a `BaseSliceMut` trait, which add mutability \r\n- Have `Matrix` and `MatrixSliceMut` implement `BaseSliceMut`\r\n\r\nThis is still a WIP, I think we should for instance be able to replace most arithmetic operations by something like (I cannot make it work yet):\r\n```rust\r\nimpl<'a, T, S1, S2> Add<S1> for S2 \r\n    where S1: BaseSlice<T>, S2: BaseSlice<T>,\r\n{\r\n// ...\r\n}\r\n```","created_at":"2016-08-02T04:37:03Z","updated_at":"2016-08-04T01:15:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bccab91a36c9fbb254a297a5ed206b3a5c7689b3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/18/commits","review_comments_url":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/18/comments","review_comment_url":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AtheMathmo/rulinalg/issues/18/comments","statuses_url":"https://api.github.com/repos/AtheMathmo/rulinalg/statuses/1422144cb68186e3669f68e5d5a4833315589733","head":{"label":"tafia:dry","ref":"dry","sha":"1422144cb68186e3669f68e5d5a4833315589733","user":{"login":"tafia","id":7351502,"avatar_url":"https://avatars.githubusercontent.com/u/7351502?v=3","gravatar_id":"","url":"https://api.github.com/users/tafia","html_url":"https://github.com/tafia","followers_url":"https://api.github.com/users/tafia/followers","following_url":"https://api.github.com/users/tafia/following{/other_user}","gists_url":"https://api.github.com/users/tafia/gists{/gist_id}","starred_url":"https://api.github.com/users/tafia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tafia/subscriptions","organizations_url":"https://api.github.com/users/tafia/orgs","repos_url":"https://api.github.com/users/tafia/repos","events_url":"https://api.github.com/users/tafia/events{/privacy}","received_events_url":"https://api.github.com/users/tafia/received_events","type":"User","site_admin":false},"repo":{"id":64182715,"name":"rulinalg","full_name":"tafia/rulinalg","owner":{"login":"tafia","id":7351502,"avatar_url":"https://avatars.githubusercontent.com/u/7351502?v=3","gravatar_id":"","url":"https://api.github.com/users/tafia","html_url":"https://github.com/tafia","followers_url":"https://api.github.com/users/tafia/followers","following_url":"https://api.github.com/users/tafia/following{/other_user}","gists_url":"https://api.github.com/users/tafia/gists{/gist_id}","starred_url":"https://api.github.com/users/tafia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tafia/subscriptions","organizations_url":"https://api.github.com/users/tafia/orgs","repos_url":"https://api.github.com/users/tafia/repos","events_url":"https://api.github.com/users/tafia/events{/privacy}","received_events_url":"https://api.github.com/users/tafia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tafia/rulinalg","description":"A linear algebra library in Rust designed for machine learning","fork":true,"url":"https://api.github.com/repos/tafia/rulinalg","forks_url":"https://api.github.com/repos/tafia/rulinalg/forks","keys_url":"https://api.github.com/repos/tafia/rulinalg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tafia/rulinalg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tafia/rulinalg/teams","hooks_url":"https://api.github.com/repos/tafia/rulinalg/hooks","issue_events_url":"https://api.github.com/repos/tafia/rulinalg/issues/events{/number}","events_url":"https://api.github.com/repos/tafia/rulinalg/events","assignees_url":"https://api.github.com/repos/tafia/rulinalg/assignees{/user}","branches_url":"https://api.github.com/repos/tafia/rulinalg/branches{/branch}","tags_url":"https://api.github.com/repos/tafia/rulinalg/tags","blobs_url":"https://api.github.com/repos/tafia/rulinalg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tafia/rulinalg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tafia/rulinalg/git/refs{/sha}","trees_url":"https://api.github.com/repos/tafia/rulinalg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tafia/rulinalg/statuses/{sha}","languages_url":"https://api.github.com/repos/tafia/rulinalg/languages","stargazers_url":"https://api.github.com/repos/tafia/rulinalg/stargazers","contributors_url":"https://api.github.com/repos/tafia/rulinalg/contributors","subscribers_url":"https://api.github.com/repos/tafia/rulinalg/subscribers","subscription_url":"https://api.github.com/repos/tafia/rulinalg/subscription","commits_url":"https://api.github.com/repos/tafia/rulinalg/commits{/sha}","git_commits_url":"https://api.github.com/repos/tafia/rulinalg/git/commits{/sha}","comments_url":"https://api.github.com/repos/tafia/rulinalg/comments{/number}","issue_comment_url":"https://api.github.com/repos/tafia/rulinalg/issues/comments{/number}","contents_url":"https://api.github.com/repos/tafia/rulinalg/contents/{+path}","compare_url":"https://api.github.com/repos/tafia/rulinalg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tafia/rulinalg/merges","archive_url":"https://api.github.com/repos/tafia/rulinalg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tafia/rulinalg/downloads","issues_url":"https://api.github.com/repos/tafia/rulinalg/issues{/number}","pulls_url":"https://api.github.com/repos/tafia/rulinalg/pulls{/number}","milestones_url":"https://api.github.com/repos/tafia/rulinalg/milestones{/number}","notifications_url":"https://api.github.com/repos/tafia/rulinalg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tafia/rulinalg/labels{/name}","releases_url":"https://api.github.com/repos/tafia/rulinalg/releases{/id}","deployments_url":"https://api.github.com/repos/tafia/rulinalg/deployments","created_at":"2016-07-26T02:18:56Z","updated_at":"2016-07-26T02:18:57Z","pushed_at":"2016-08-04T01:13:54Z","git_url":"git://github.com/tafia/rulinalg.git","ssh_url":"git@github.com:tafia/rulinalg.git","clone_url":"https://github.com/tafia/rulinalg.git","svn_url":"https://github.com/tafia/rulinalg","homepage":"https://crates.io/crates/rulinalg","size":1115,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"AtheMathmo:master","ref":"master","sha":"42f066a8d7bba82486e59fb7cfbd29eaa87bc2b0","user":{"login":"AtheMathmo","id":10150986,"avatar_url":"https://avatars.githubusercontent.com/u/10150986?v=3","gravatar_id":"","url":"https://api.github.com/users/AtheMathmo","html_url":"https://github.com/AtheMathmo","followers_url":"https://api.github.com/users/AtheMathmo/followers","following_url":"https://api.github.com/users/AtheMathmo/following{/other_user}","gists_url":"https://api.github.com/users/AtheMathmo/gists{/gist_id}","starred_url":"https://api.github.com/users/AtheMathmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtheMathmo/subscriptions","organizations_url":"https://api.github.com/users/AtheMathmo/orgs","repos_url":"https://api.github.com/users/AtheMathmo/repos","events_url":"https://api.github.com/users/AtheMathmo/events{/privacy}","received_events_url":"https://api.github.com/users/AtheMathmo/received_events","type":"User","site_admin":false},"repo":{"id":62955795,"name":"rulinalg","full_name":"AtheMathmo/rulinalg","owner":{"login":"AtheMathmo","id":10150986,"avatar_url":"https://avatars.githubusercontent.com/u/10150986?v=3","gravatar_id":"","url":"https://api.github.com/users/AtheMathmo","html_url":"https://github.com/AtheMathmo","followers_url":"https://api.github.com/users/AtheMathmo/followers","following_url":"https://api.github.com/users/AtheMathmo/following{/other_user}","gists_url":"https://api.github.com/users/AtheMathmo/gists{/gist_id}","starred_url":"https://api.github.com/users/AtheMathmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtheMathmo/subscriptions","organizations_url":"https://api.github.com/users/AtheMathmo/orgs","repos_url":"https://api.github.com/users/AtheMathmo/repos","events_url":"https://api.github.com/users/AtheMathmo/events{/privacy}","received_events_url":"https://api.github.com/users/AtheMathmo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AtheMathmo/rulinalg","description":"A linear algebra library in Rust designed for machine learning","fork":false,"url":"https://api.github.com/repos/AtheMathmo/rulinalg","forks_url":"https://api.github.com/repos/AtheMathmo/rulinalg/forks","keys_url":"https://api.github.com/repos/AtheMathmo/rulinalg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AtheMathmo/rulinalg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AtheMathmo/rulinalg/teams","hooks_url":"https://api.github.com/repos/AtheMathmo/rulinalg/hooks","issue_events_url":"https://api.github.com/repos/AtheMathmo/rulinalg/issues/events{/number}","events_url":"https://api.github.com/repos/AtheMathmo/rulinalg/events","assignees_url":"https://api.github.com/repos/AtheMathmo/rulinalg/assignees{/user}","branches_url":"https://api.github.com/repos/AtheMathmo/rulinalg/branches{/branch}","tags_url":"https://api.github.com/repos/AtheMathmo/rulinalg/tags","blobs_url":"https://api.github.com/repos/AtheMathmo/rulinalg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AtheMathmo/rulinalg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AtheMathmo/rulinalg/git/refs{/sha}","trees_url":"https://api.github.com/repos/AtheMathmo/rulinalg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AtheMathmo/rulinalg/statuses/{sha}","languages_url":"https://api.github.com/repos/AtheMathmo/rulinalg/languages","stargazers_url":"https://api.github.com/repos/AtheMathmo/rulinalg/stargazers","contributors_url":"https://api.github.com/repos/AtheMathmo/rulinalg/contributors","subscribers_url":"https://api.github.com/repos/AtheMathmo/rulinalg/subscribers","subscription_url":"https://api.github.com/repos/AtheMathmo/rulinalg/subscription","commits_url":"https://api.github.com/repos/AtheMathmo/rulinalg/commits{/sha}","git_commits_url":"https://api.github.com/repos/AtheMathmo/rulinalg/git/commits{/sha}","comments_url":"https://api.github.com/repos/AtheMathmo/rulinalg/comments{/number}","issue_comment_url":"https://api.github.com/repos/AtheMathmo/rulinalg/issues/comments{/number}","contents_url":"https://api.github.com/repos/AtheMathmo/rulinalg/contents/{+path}","compare_url":"https://api.github.com/repos/AtheMathmo/rulinalg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AtheMathmo/rulinalg/merges","archive_url":"https://api.github.com/repos/AtheMathmo/rulinalg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AtheMathmo/rulinalg/downloads","issues_url":"https://api.github.com/repos/AtheMathmo/rulinalg/issues{/number}","pulls_url":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls{/number}","milestones_url":"https://api.github.com/repos/AtheMathmo/rulinalg/milestones{/number}","notifications_url":"https://api.github.com/repos/AtheMathmo/rulinalg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AtheMathmo/rulinalg/labels{/name}","releases_url":"https://api.github.com/repos/AtheMathmo/rulinalg/releases{/id}","deployments_url":"https://api.github.com/repos/AtheMathmo/rulinalg/deployments","created_at":"2016-07-09T15:27:53Z","updated_at":"2016-08-02T19:22:00Z","pushed_at":"2016-08-04T01:13:55Z","git_url":"git://github.com/AtheMathmo/rulinalg.git","ssh_url":"git@github.com:AtheMathmo/rulinalg.git","clone_url":"https://github.com/AtheMathmo/rulinalg.git","svn_url":"https://github.com/AtheMathmo/rulinalg","homepage":"https://crates.io/crates/rulinalg","size":1105,"stargazers_count":44,"watchers_count":44,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":9,"forks":5,"open_issues":9,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/18"},"html":{"href":"https://github.com/AtheMathmo/rulinalg/pull/18"},"issue":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/issues/18"},"comments":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/AtheMathmo/rulinalg/statuses/1422144cb68186e3669f68e5d5a4833315589733"}}}}
{"actor":{"display_login":"tafia"}}