Mercurial > repos > public > sbplib_julia
view src/Grids/AbstractGrid.jl @ 760:e7176fb09e98 test/type_stability
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 02 Jul 2021 14:02:45 +0200 |
parents | 01b851161018 |
children | c16abc564b82 |
line wrap: on
line source
""" AbstractGrid Should implement dimension(grid::AbstractGrid) points(grid::AbstractGrid) """ abstract type AbstractGrid end function dimension end function points end export dimension, points """ evalOn(g::AbstractGrid, f::Function) Evaluate function f on the grid g """ function evalOn(g::AbstractGrid, f::Function) F(x) = f(x...) return F.(points(g)) end export evalOn