Skip to content

Commit f2b5e04

Browse files
author
Tomas Lycken
committed
Merge pull request #102 from tlycken/cubic-bugfix
Fix bug in cubic b-splines
2 parents 38e625d + 5e63dcf commit f2b5e04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/b-splines/cubic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function define_indices_d{BC}(::Type{BSpline{Cubic{BC}}}, d, pad)
3030
quote
3131
# ensure that all of ix_d, ixm_d, ixp_d, and ixpp_d are in-bounds no
3232
# matter the value of pad
33-
$symix = clamp(round(Int, $symx), $(2-pad), size(itp,$d)+$(pad-2))
33+
$symix = clamp(floor(Int, $symx), $(2-pad), size(itp,$d)+$(pad-2))
3434
$symfx = $symx - $symix
3535
$symix += $pad # padding for oob coefficient
3636
$symixm = $symix - 1
@@ -43,7 +43,7 @@ function define_indices_d(::Type{BSpline{Cubic{Periodic}}}, d, pad)
4343
symix, symixm, symixp = symbol("ix_",d), symbol("ixm_",d), symbol("ixp_",d)
4444
symixpp, symx, symfx = symbol("ixpp_",d), symbol("x_",d), symbol("fx_",d)
4545
quote
46-
$symix = clamp(round(Int, $symx), 1, size(itp,$d))
46+
$symix = clamp(floor(Int, $symx), 1, size(itp,$d))
4747
$symfx = $symx - $symix
4848
$symixm = mod1($symix - 1, size(itp,$d))
4949
$symixp = mod1($symix + 1, size(itp,$d))

0 commit comments

Comments
 (0)