changeset 69:8cd8d83b92e7

Add some notes to stencil
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 18 Jan 2019 10:12:23 +0100
parents 60d575e4a2d8
children d04569696918
files stencil.jl
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stencil.jl	Wed Jan 16 12:40:20 2019 +0100
+++ b/stencil.jl	Fri Jan 18 10:12:23 2019 +0100
@@ -17,6 +17,7 @@
 
 # Provides index into the Stencil based on offset for the root element
 function Base.getindex(s::Stencil, i::Int)
+    # TBD: Rearrange to mark with @boundscheck?
     if s.range[1] <= i <= s.range[2]
         return s.weights[1 + i - s.range[1]]
     else
@@ -27,7 +28,7 @@
 function apply(s::Stencil, v::AbstractVector, i::Int)
     w = zero(eltype(v))
     for j ∈ s.range[1]:s.range[2]
-        w += s[j]*v[i+j]
+        w += s[j]*v[i+j] # TBD: Make this without boundschecks?
     end
     return w
 end