Mercurial > repos > public > sbplib_julia
comparison Grids/src/AbstractGrid.jl @ 212:aa17d4d9d09e package_refactor
Export some functions from AbstractGrid and move documentation to docstrings
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 26 Jun 2019 11:00:34 +0200 |
parents | 1ad91e11b1f4 |
children | b3506cfbb9d8 |
comparison
equal
deleted
inserted
replaced
211:1ad91e11b1f4 | 212:aa17d4d9d09e |
---|---|
1 """ | |
2 AbstractGrid | |
3 | |
4 Should implement | |
5 dimension(grid::AbstractGrid) | |
6 points(grid::AbstractGrid) | |
7 | |
8 """ | |
1 abstract type AbstractGrid end | 9 abstract type AbstractGrid end |
2 | 10 |
3 function dimension(grid::AbstractGrid) | 11 function dimension end |
4 error("Not implemented for abstact type AbstractGrid") | 12 function points end |
5 end | 13 export dimension, points |
6 | 14 |
7 function points(grid::AbstractGrid) | 15 """ |
8 error("Not implemented for abstact type AbstractGrid") | 16 evalOn(g::AbstractGrid, f::Function) |
9 end | |
10 | 17 |
11 # Evaluate function f on the grid g | 18 Evaluate function f on the grid g |
19 """ | |
12 function evalOn(g::AbstractGrid, f::Function) | 20 function evalOn(g::AbstractGrid, f::Function) |
13 F(x) = f(x...) | 21 F(x) = f(x...) |
14 return F.(points(g)) | 22 return F.(points(g)) |
15 end | 23 end |