Open dpsanders opened 5 years ago
Here's a possible definition for a type to wrap a function:
"""
Type representing a function to be used in a branch and bound algorithm
"""
struct BranchAndBoundFunction{F,N,T}
f::F
X::IntervalBox{N,T}
input_dim::Int
output_dim::Int
function BranchAndBoundFunction(f::F, X::IntervalBox{N,T}) where {F<:Function,N,T}
new{F,N,T}(f, X, N, length(f(X)))
end
end
(f::BranchAndBoundFunction{F,N,T})(X::IntervalBox{N,T}) where {F,N,T} = f.f(X)
It may be useful to have a
RootProblem
type that encodes the function, theIntervalBox
, the dimension, etc.