From b77f1073d12be0144acf4b917c42a6a362913476 Mon Sep 17 00:00:00 2001 From: schillic Date: Fri, 24 Nov 2023 19:17:56 +0100 Subject: [PATCH 1/3] fix variable name in paper --- paper/paper.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.tex b/paper/paper.tex index 5aa9c180..360b2d56 100644 --- a/paper/paper.tex +++ b/paper/paper.tex @@ -57,7 +57,7 @@ \subsection{The enclose API} import RangeEnclosures: enclose import IntervalArithmetic: Interval function enclose(f::Function, - dom::Union{Interval,IntervalBox}, + D::Union{Interval,IntervalBox}, solver::MyEnclosure; kwargs...) # solver-specific implementation end From 2142c5b06991fd3b490af490f3b0a75c1a413f03 Mon Sep 17 00:00:00 2001 From: schillic Date: Fri, 24 Nov 2023 19:18:20 +0100 Subject: [PATCH 2/3] using instead of import in paper --- paper/paper.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.tex b/paper/paper.tex index 360b2d56..ecfcebc9 100644 --- a/paper/paper.tex +++ b/paper/paper.tex @@ -55,7 +55,7 @@ \subsection{The enclose API} \vspace*{-3mm} \begin{lstlisting}[language=Julia] import RangeEnclosures: enclose -import IntervalArithmetic: Interval +using IntervalArithmetic: Interval function enclose(f::Function, D::Union{Interval,IntervalBox}, solver::MyEnclosure; kwargs...) From 3ec567b54d8ae02a9a71bcaa282e94f8b7fdfe49 Mon Sep 17 00:00:00 2001 From: schillic Date: Fri, 24 Nov 2023 19:31:09 +0100 Subject: [PATCH 3/3] add tutorial for adding a new solver --- docs/src/tutorial.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md index cb9b8e84..49125007 100644 --- a/docs/src/tutorial.md +++ b/docs/src/tutorial.md @@ -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.