Skip to content

Commit

Permalink
Update fields in fit!
Browse files Browse the repository at this point in the history
  • Loading branch information
Tchanders committed Jul 11, 2017
1 parent e83f162 commit 3cf46c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SmoothingSplines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function fit!{T<:LAPACKFloat}(spl::SmoothingSpline{T})
end

function fit!{T<:LAPACKFloat}(spl::SmoothingSpline{T}, Y::AbstractVector{T})
spl.Y = Y[spl.idx]
spl.Yorig = Y[spl.Xrank]
fit!(spl)
end

Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ spl = fit(SmoothingSpline, X, Y, 1.0)

@test predict(spl,X) predict(spl)

# test explicitly setting the original values
fit!(spl, Y)

@test predict(spl,X) predict(spl)

println("testing against smooth.spline on R cars dataset")
# real data examples
# cars dataset
Expand Down

0 comments on commit 3cf46c0

Please sign in to comment.