view AbstractGrid.jl @ 81:7f72e7e14659 patch_based_test

Add benchmarktest and mark all apply functions with @inline and @inbounds
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 24 Jan 2019 14:58:22 +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