codac 2.0.0
Loading...
Searching...
No Matches
codac2_pave.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "codac2_Paving.h"
13#include "codac2_Ctc.h"
14#include "codac2_Sep.h"
16#include "codac2_BoolInterval.h"
17
18namespace codac2
19{
20 // eps: accuracy of the paving algorithm, the undefined boxes will have their max_diam <= eps
21
22 PavingOut pave(const IntervalVector& x, std::shared_ptr<const CtcBase<IntervalVector>> c, double eps, bool verbose = false);
23 PavingOut pave(const IntervalVector& x, const CtcBase<IntervalVector>& c, double eps, bool verbose = false);
24
25 PavingInOut pave(const IntervalVector& x, std::shared_ptr<const SepBase> s, double eps, bool verbose = false);
26 PavingInOut pave(const IntervalVector& x, const SepBase& s, double eps, bool verbose = false);
27
28 PavingInOut regular_pave(const IntervalVector& x, const std::function<BoolInterval(const IntervalVector&)>& test, double eps, bool verbose = false);
29
30 template<typename Y>
31 PavingInOut sivia(const IntervalVector& x, const AnalyticFunction<Y>& f, const typename Y::Domain& y, double eps, bool verbose = false)
32 {
33 return regular_pave(x,
34 [&y,&f](const IntervalVector& x)
35 {
36 auto eval = f.eval(x);
37
38 if(eval.is_subset(y))
39 return BoolInterval::TRUE;
40
41 else if(!eval.intersects(y))
42 return BoolInterval::FALSE;
43
44 else
46 },
47 eps, verbose);
48 }
49}
BoolInterval
Enumeration representing a boolean interval.
Definition codac2_BoolInterval.h:23
@ UNKNOWN
Definition codac2_BoolInterval.h:29
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25