view AbstractGrid.jl @ 113:3b89aa6dc7f2 cell_based_test

Add apply_tiled! that tiles the iteration to optimize cache usage. Doesn't improve runtime at all at the moment
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 08 Feb 2019 21:19:34 +0100
parents 614b56a017b9
children 631eb9b35d72
line wrap: on
line source

abstract type AbstractGrid end

function numberOfDimensions(grid::AbstractGrid)
    error("Not implemented for abstact type AbstractGrid")
end

function numberOfPoints(grid::AbstractGrid)
    error("Not implemented for abstact type AbstractGrid")
end

function points(grid::AbstractGrid)
    error("Not implemented for abstact type AbstractGrid")
end

# Evaluate function f on the grid g
function evalOn(g::AbstractGrid, f::Function)
    F(x) = f(x...)
    return F.(points(g))
end