{"action":"created","comment":{"url":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/comments/47059688","id":47059688,"diff_hunk":"@@ -0,0 +1,235 @@\n+\"\"\"\n+Assuming uniform knots with spacing 1, the `i`th piece of cubic spline\n+implemented here is defined as follows.\n+\n+    y_i(x) = ϕm p(x-i) + ϕ q(x-i) + ϕp q(1- (x-i)) + ϕpp p(1 - (x-i))\n+\n+where\n+\n+    p(☆) = 1/6 *(1-☆)^3\n+    q(☆) = 2/3 - ☆^2 + 1/2 ☆^3\n+\n+and the values `ϕX` for `X ⋹ {m, _, p, pp}` are the pre-filtered coefficients.\n+\n+For future reference, this expands out to the following polynomial:\n+\n+    y_i(x) = 1/6 cm (1+i-x)^3 + c (2/3 - (x-i)^2 + 1/2 (x-i)^3) +\n+             cp (2/3 - (1+i-x)^2 + 1/2 (1+i-x)^3) + 1/6 cpp (x-i)^3\n+\n+When we derive boundary conditions we will use derivatives `y_0'(x)` and\n+`y_0''(x)`\n+\"\"\"\n+Cubic\n+\n+\"\"\"\n+Build `rowspec`, `valspec`, `colspec` such that the product\n+\n+`out = rowspec * valspec * colspec` will be equivalent to:\n+\n+```julia\n+out = zeros(n, n)\n+\n+for (i, j, v) in args\n+    out[i, j] = v\n+end\n+```\n+\n+\"\"\"\n+function _build_woodbury_specs{T}(::Type{T}, n::Int, args::Tuple{Int, Int, Any}...)\n+    m = length(args)\n+    rowspec = spzeros(T, n, m)\n+    colspec = spzeros(T, m, n)\n+    valspec = zeros(T, m, m)\n+\n+    ix = 1\n+    for (i, (row, col, val)) in enumerate(args)\n+        rowspec[row, ix] = 1\n+        colspec[ix, col] = 1\n+        valspec[ix, ix] = val\n+        ix += 1\n+    end\n+\n+    rowspec, valspec, colspec\n+end\n+\n+function define_indices_d{BC}(::Type{BSpline{Cubic{BC}}}, d, pad)\n+    symix, symixm, symixp = symbol(\"ix_\",d), symbol(\"ixm_\",d), symbol(\"ixp_\",d)\n+    symixpp, symx, symfx = symbol(\"ixpp_\",d), symbol(\"x_\",d), symbol(\"fx_\",d)\n+    quote\n+        # ensure that all three ix_d, ixm_d, and ixp_d are in-bounds no matter\n+        # the value of pad\n+        # TODO: Not sure if I'm handling the pad correctly, but relative to\n+        #       quadratic case I did move upper clamp from `_ - 1` to `_ - 2`\n+        #       to make room for the `pp` values","path":"src/b-splines/cubic.jl","position":63,"original_position":63,"commit_id":"76ad6ed5a74a74103ad3ba0db76106722e321166","original_commit_id":"76ad6ed5a74a74103ad3ba0db76106722e321166","user":{"login":"tlycken","id":1550920,"avatar_url":"https://avatars.githubusercontent.com/u/1550920?v=3","gravatar_id":"","url":"https://api.github.com/users/tlycken","html_url":"https://github.com/tlycken","followers_url":"https://api.github.com/users/tlycken/followers","following_url":"https://api.github.com/users/tlycken/following{/other_user}","gists_url":"https://api.github.com/users/tlycken/gists{/gist_id}","starred_url":"https://api.github.com/users/tlycken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlycken/subscriptions","organizations_url":"https://api.github.com/users/tlycken/orgs","repos_url":"https://api.github.com/users/tlycken/repos","events_url":"https://api.github.com/users/tlycken/events{/privacy}","received_events_url":"https://api.github.com/users/tlycken/received_events","type":"User","site_admin":false},"body":"This seems correct to me.","created_at":"2015-12-09T07:54:12Z","updated_at":"2015-12-09T07:54:12Z","html_url":"https://github.com/tlycken/Interpolations.jl/pull/90#discussion_r47059688","pull_request_url":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/comments/47059688"},"html":{"href":"https://github.com/tlycken/Interpolations.jl/pull/90#discussion_r47059688"},"pull_request":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/90","id":50683733,"html_url":"https://github.com/tlycken/Interpolations.jl/pull/90","diff_url":"https://github.com/tlycken/Interpolations.jl/pull/90.diff","patch_url":"https://github.com/tlycken/Interpolations.jl/pull/90.patch","issue_url":"https://api.github.com/repos/tlycken/Interpolations.jl/issues/90","number":90,"state":"open","locked":false,"title":"WIP on cubic","user":{"login":"spencerlyon2","id":1001948,"avatar_url":"https://avatars.githubusercontent.com/u/1001948?v=3","gravatar_id":"","url":"https://api.github.com/users/spencerlyon2","html_url":"https://github.com/spencerlyon2","followers_url":"https://api.github.com/users/spencerlyon2/followers","following_url":"https://api.github.com/users/spencerlyon2/following{/other_user}","gists_url":"https://api.github.com/users/spencerlyon2/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerlyon2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerlyon2/subscriptions","organizations_url":"https://api.github.com/users/spencerlyon2/orgs","repos_url":"https://api.github.com/users/spencerlyon2/repos","events_url":"https://api.github.com/users/spencerlyon2/events{/privacy}","received_events_url":"https://api.github.com/users/spencerlyon2/received_events","type":"User","site_admin":false},"body":"This is an early version of enabling cubic splines for the uniform case (non-gridded).\r\n\r\nFeatures that need to be implemented:\r\n\r\n- [x] Other boundary conditions\r\n- [x] OnGrid vs OnCell distinction\r\n- [ ] Gradient\r\n\r\nOther things that need to be done\r\n\r\n- [x] tests\r\n- [x] Fix bug in pre-filtering -- right now `BSpline(Cubic(Line()))` is not interpolating. \r\n- [x] docs\r\n- [ ] Add cubic to  benchmarks\r\n- [x] Did I mention tests?","created_at":"2015-11-13T19:51:50Z","updated_at":"2015-12-09T07:54:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc8a3cab86c0e2282388d3beaad7927dba94b119","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/90/commits","review_comments_url":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/90/comments","review_comment_url":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tlycken/Interpolations.jl/issues/90/comments","statuses_url":"https://api.github.com/repos/tlycken/Interpolations.jl/statuses/76ad6ed5a74a74103ad3ba0db76106722e321166","head":{"label":"spencerlyon2:sl/cubic","ref":"sl/cubic","sha":"76ad6ed5a74a74103ad3ba0db76106722e321166","user":{"login":"spencerlyon2","id":1001948,"avatar_url":"https://avatars.githubusercontent.com/u/1001948?v=3","gravatar_id":"","url":"https://api.github.com/users/spencerlyon2","html_url":"https://github.com/spencerlyon2","followers_url":"https://api.github.com/users/spencerlyon2/followers","following_url":"https://api.github.com/users/spencerlyon2/following{/other_user}","gists_url":"https://api.github.com/users/spencerlyon2/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerlyon2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerlyon2/subscriptions","organizations_url":"https://api.github.com/users/spencerlyon2/orgs","repos_url":"https://api.github.com/users/spencerlyon2/repos","events_url":"https://api.github.com/users/spencerlyon2/events{/privacy}","received_events_url":"https://api.github.com/users/spencerlyon2/received_events","type":"User","site_admin":false},"repo":{"id":44572643,"name":"Interpolations.jl","full_name":"spencerlyon2/Interpolations.jl","owner":{"login":"spencerlyon2","id":1001948,"avatar_url":"https://avatars.githubusercontent.com/u/1001948?v=3","gravatar_id":"","url":"https://api.github.com/users/spencerlyon2","html_url":"https://github.com/spencerlyon2","followers_url":"https://api.github.com/users/spencerlyon2/followers","following_url":"https://api.github.com/users/spencerlyon2/following{/other_user}","gists_url":"https://api.github.com/users/spencerlyon2/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerlyon2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerlyon2/subscriptions","organizations_url":"https://api.github.com/users/spencerlyon2/orgs","repos_url":"https://api.github.com/users/spencerlyon2/repos","events_url":"https://api.github.com/users/spencerlyon2/events{/privacy}","received_events_url":"https://api.github.com/users/spencerlyon2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spencerlyon2/Interpolations.jl","description":"B-spline interpolation in Julia","fork":true,"url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl","forks_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/forks","keys_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/teams","hooks_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/hooks","issue_events_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/issues/events{/number}","events_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/events","assignees_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/assignees{/user}","branches_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/branches{/branch}","tags_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/tags","blobs_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/languages","stargazers_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/stargazers","contributors_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/contributors","subscribers_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/subscribers","subscription_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/subscription","commits_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/contents/{+path}","compare_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/merges","archive_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/downloads","issues_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/issues{/number}","pulls_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/labels{/name}","releases_url":"https://api.github.com/repos/spencerlyon2/Interpolations.jl/releases{/id}","created_at":"2015-10-20T00:42:49Z","updated_at":"2015-10-20T00:42:49Z","pushed_at":"2015-11-17T16:05:23Z","git_url":"git://github.com/spencerlyon2/Interpolations.jl.git","ssh_url":"git@github.com:spencerlyon2/Interpolations.jl.git","clone_url":"https://github.com/spencerlyon2/Interpolations.jl.git","svn_url":"https://github.com/spencerlyon2/Interpolations.jl","homepage":"","size":2844,"stargazers_count":0,"watchers_count":0,"language":"Julia","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":"tlycken:master","ref":"master","sha":"37fee94f74764f8e02dc33c4cc6639ddcb29647f","user":{"login":"tlycken","id":1550920,"avatar_url":"https://avatars.githubusercontent.com/u/1550920?v=3","gravatar_id":"","url":"https://api.github.com/users/tlycken","html_url":"https://github.com/tlycken","followers_url":"https://api.github.com/users/tlycken/followers","following_url":"https://api.github.com/users/tlycken/following{/other_user}","gists_url":"https://api.github.com/users/tlycken/gists{/gist_id}","starred_url":"https://api.github.com/users/tlycken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlycken/subscriptions","organizations_url":"https://api.github.com/users/tlycken/orgs","repos_url":"https://api.github.com/users/tlycken/repos","events_url":"https://api.github.com/users/tlycken/events{/privacy}","received_events_url":"https://api.github.com/users/tlycken/received_events","type":"User","site_admin":false},"repo":{"id":23384417,"name":"Interpolations.jl","full_name":"tlycken/Interpolations.jl","owner":{"login":"tlycken","id":1550920,"avatar_url":"https://avatars.githubusercontent.com/u/1550920?v=3","gravatar_id":"","url":"https://api.github.com/users/tlycken","html_url":"https://github.com/tlycken","followers_url":"https://api.github.com/users/tlycken/followers","following_url":"https://api.github.com/users/tlycken/following{/other_user}","gists_url":"https://api.github.com/users/tlycken/gists{/gist_id}","starred_url":"https://api.github.com/users/tlycken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlycken/subscriptions","organizations_url":"https://api.github.com/users/tlycken/orgs","repos_url":"https://api.github.com/users/tlycken/repos","events_url":"https://api.github.com/users/tlycken/events{/privacy}","received_events_url":"https://api.github.com/users/tlycken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tlycken/Interpolations.jl","description":"B-spline interpolation in Julia","fork":false,"url":"https://api.github.com/repos/tlycken/Interpolations.jl","forks_url":"https://api.github.com/repos/tlycken/Interpolations.jl/forks","keys_url":"https://api.github.com/repos/tlycken/Interpolations.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tlycken/Interpolations.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tlycken/Interpolations.jl/teams","hooks_url":"https://api.github.com/repos/tlycken/Interpolations.jl/hooks","issue_events_url":"https://api.github.com/repos/tlycken/Interpolations.jl/issues/events{/number}","events_url":"https://api.github.com/repos/tlycken/Interpolations.jl/events","assignees_url":"https://api.github.com/repos/tlycken/Interpolations.jl/assignees{/user}","branches_url":"https://api.github.com/repos/tlycken/Interpolations.jl/branches{/branch}","tags_url":"https://api.github.com/repos/tlycken/Interpolations.jl/tags","blobs_url":"https://api.github.com/repos/tlycken/Interpolations.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tlycken/Interpolations.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tlycken/Interpolations.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/tlycken/Interpolations.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tlycken/Interpolations.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/tlycken/Interpolations.jl/languages","stargazers_url":"https://api.github.com/repos/tlycken/Interpolations.jl/stargazers","contributors_url":"https://api.github.com/repos/tlycken/Interpolations.jl/contributors","subscribers_url":"https://api.github.com/repos/tlycken/Interpolations.jl/subscribers","subscription_url":"https://api.github.com/repos/tlycken/Interpolations.jl/subscription","commits_url":"https://api.github.com/repos/tlycken/Interpolations.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/tlycken/Interpolations.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/tlycken/Interpolations.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/tlycken/Interpolations.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/tlycken/Interpolations.jl/contents/{+path}","compare_url":"https://api.github.com/repos/tlycken/Interpolations.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tlycken/Interpolations.jl/merges","archive_url":"https://api.github.com/repos/tlycken/Interpolations.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tlycken/Interpolations.jl/downloads","issues_url":"https://api.github.com/repos/tlycken/Interpolations.jl/issues{/number}","pulls_url":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/tlycken/Interpolations.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/tlycken/Interpolations.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tlycken/Interpolations.jl/labels{/name}","releases_url":"https://api.github.com/repos/tlycken/Interpolations.jl/releases{/id}","created_at":"2014-08-27T09:36:22Z","updated_at":"2015-12-01T17:12:46Z","pushed_at":"2015-11-17T16:05:24Z","git_url":"git://github.com/tlycken/Interpolations.jl.git","ssh_url":"git@github.com:tlycken/Interpolations.jl.git","clone_url":"https://github.com/tlycken/Interpolations.jl.git","svn_url":"https://github.com/tlycken/Interpolations.jl","homepage":"","size":3759,"stargazers_count":23,"watchers_count":23,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":10,"forks":7,"open_issues":10,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/90"},"html":{"href":"https://github.com/tlycken/Interpolations.jl/pull/90"},"issue":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/issues/90"},"comments":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/tlycken/Interpolations.jl/statuses/76ad6ed5a74a74103ad3ba0db76106722e321166"}}}}