11
2+ doc"""
3+ `Contractor` represents a `Contractor` from $\m athbb{R}^N$ to $\m athbb{R}^N$.
4+ Nout is the output dimension of the forward part.
25"""
3- `Contractor` represents a contractor from ``\\ mathbb{R}^N`` to ``\\ mathbb{R}^N``.
4- `Nout` is the output dimension of the forward part.
5- """
6- struct Contractor{N, Nout, F1<: Function , F2<: Function }
6+ immutable Contractor{N, Nout, F1<: Function , F2<: Function }
77 variables:: Vector{Symbol} # input variables
88 forward:: GeneratedFunction{F1}
99 backward:: GeneratedFunction{F2}
@@ -32,7 +32,7 @@ function Contractor(variables::Vector{Symbol}, top, forward, backward, expressio
3232 Contractor {N, Nout, typeof(forward.f), typeof(backward.f)} (variables, forward, backward, expression)
3333end
3434
35- function Base. show (io:: IO , C:: Contractor{N,Nout,F1,F2} ) where {N,Nout,F1,F2}
35+ function Base. show {N,Nout,F1,F2} (io:: IO , C:: Contractor{N,Nout,F1,F2} )
3636 println (io, " Contractor in $(N) dimensions:" )
3737 println (io, " - forward pass contracts to $(Nout) dimensions" )
3838 println (io, " - variables: $(C. variables) " )
4141
4242
4343
44- function (C:: Contractor{N,Nout,F1,F2} )(
45- A:: IntervalBox{Nout,T} , X:: IntervalBox{N,T} ) where {N,Nout,F1,F2,T}
44+ function (C:: Contractor{N,Nout,F1,F2} ){N,Nout,F1,F2,T} (
45+ A:: IntervalBox{Nout,T} , X:: IntervalBox{N,T} )
4646
4747 output, intermediate = C. forward (X)
4848
@@ -67,7 +67,7 @@ function (C::Contractor{N,Nout,F1,F2})(
6767end
6868
6969# allow 1D contractors to take Interval instead of IntervalBox for simplicty:
70- (C:: Contractor{N,1,F1,F2} )(A:: Interval{T} , X:: IntervalBox{N,T} ) where {N,F1,F2,T} = C (IntervalBox (A), X)
70+ (C:: Contractor{N,1,F1,F2} ){N,F1,F2,T} (A:: Interval{T} , X:: IntervalBox{N,T} ) = C (IntervalBox (A), X)
7171
7272function make_contractor (expr:: Expr )
7373 # println("Entering Contractor(ex) with ex=$ex")
@@ -109,7 +109,7 @@ function make_contractor(expr::Expr)
109109end
110110
111111
112- """ Usage:
112+ doc """Usage:
113113```
114114C = @contractor(x^2 + y^2)
115115A = -∞..1 # the constraint interval
0 commit comments