Skip to content

Commit

Permalink
add tutorial for adding a new solver
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Nov 24, 2023
1 parent 2142c5b commit 3ec567b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,24 @@ savefig("tutorial-3d.png"); nothing # hide
```

![](tutorial-3d.png)

## Adding a new enclosure algorithm

To add a new enclosure algorithm, or *solver*, just add a corresponding struct (let us call it `MyEnclosure`) and extend the method `enclose`, as the following code snippet demonstrates.

```@example
using RangeEnclosures
import RangeEnclosures: enclose
using IntervalArithmetic: Interval
struct MyEnclosure end
function enclose(f::Function,
D::Union{Interval,IntervalBox},
solver::MyEnclosure; kwargs...)
# solver-specific implementation
end
nothing # hide
```

Note that the domain `D` can be of type `Interval` for univariate (``n = 1``) functions or of type `IntervalBox` for multivariate (``n > 1``) functions.

0 comments on commit 3ec567b

Please sign in to comment.