codac 2.0.0
Loading...
Searching...
No Matches
codac2_CtcInverseNotIn.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <map>
13#include "codac2_CtcUnion.h"
14#include "codac2_CtcInverse.h"
15
16namespace codac2
17{
18 template<typename Y_, typename X0=IntervalVector, typename... X>
19 class CtcInverseNotIn : public CtcUnion<X0,X...>
20 {
21 public:
22
23 using Y = typename Wrapper<Y_>::Domain; // Y_ is a possible Eigen expr. type
24 using OutputType = typename ExprType<Y>::Type;
25
26 CtcInverseNotIn(const AnalyticFunction<OutputType>& f, const Y& y, bool with_centered_form = true)
27 : CtcUnion<X0,X...>(f.input_size())
28 {
29 const bool is_not_in = true;
30 Y f_codomain = f.template eval_default_codomain<X0,X...>();
31 for(const auto& complem_y : y.complementary())
32 {
33 Y w = complem_y & f_codomain;
34 if(!w.is_empty() && !w.is_subset(y))
35 *this |= CtcInverse<Y,X0,X...>(f, complem_y, with_centered_form, is_not_in);
36 }
37 }
38
39 template<typename C>
40 requires IsCtcBaseOrPtr<C,Y>
41 CtcInverseNotIn(const AnalyticFunction<OutputType>& f, const C& ctc_compl, bool with_centered_form = true)
42 : CtcUnion<X0,X...>(f.input_size())
43 {
44 const bool is_not_in = true;
45 *this |= CtcInverse<Y,X0,X...>(f, ctc_compl, with_centered_form, is_not_in);
46 }
47
48 void contract(X0& x0, X&... x) const
49 {
50 CtcUnion<X0,X...>::contract(x0,x...);
51 }
52 };
53
54 // Template deduction guides
55 // Same as CtcInverse
56
57 // ScalarType
58
59 CtcInverseNotIn(const AnalyticFunction<ScalarType>&, std::initializer_list<double>, bool = true, bool = false) ->
60 CtcInverseNotIn<Interval,IntervalVector>;
61
62 template<typename Y>
63 CtcInverseNotIn(const AnalyticFunction<ScalarType>&, std::initializer_list<Y>, bool = true, bool = false) ->
64 CtcInverseNotIn<Interval,IntervalVector>;
65
66 CtcInverseNotIn(const AnalyticFunction<ScalarType>&, const Interval&, bool = true, bool = false) ->
67 CtcInverseNotIn<Interval,IntervalVector>;
68
69 CtcInverseNotIn(const AnalyticFunction<ScalarType>&, double, bool = true, bool = false) ->
70 CtcInverseNotIn<Interval,IntervalVector>;
71
72 template<typename C>
73 requires IsCtcBaseOrPtr<C,Interval>
74 CtcInverseNotIn(const AnalyticFunction<ScalarType>&, const C&, bool = true, bool = false) ->
75 CtcInverseNotIn<Interval,IntervalVector>;
76
77 // VectorType
78
79 CtcInverseNotIn(const AnalyticFunction<VectorType>&, std::initializer_list<double>, bool = true, bool = false) ->
80 CtcInverseNotIn<IntervalVector,IntervalVector>;
81
82 CtcInverseNotIn(const AnalyticFunction<VectorType>&, std::initializer_list<std::initializer_list<double>>, bool = true, bool = false) ->
83 CtcInverseNotIn<IntervalVector,IntervalVector>;
84
85 CtcInverseNotIn(const AnalyticFunction<VectorType>&, const Vector&, bool = true, bool = false) ->
86 CtcInverseNotIn<IntervalVector,IntervalVector>;
87
88 CtcInverseNotIn(const AnalyticFunction<VectorType>&, const IntervalVector&, bool = true, bool = false) ->
89 CtcInverseNotIn<IntervalVector,IntervalVector>;
90
91 template<typename OtherDerived>
92 requires (OtherDerived::RowsAtCompileTime == -1 && OtherDerived::ColsAtCompileTime == 1)
93 CtcInverseNotIn(const AnalyticFunction<VectorType>&, const Eigen::MatrixBase<OtherDerived>&, bool = true, bool = false) ->
94 CtcInverseNotIn<IntervalVector,IntervalVector>;
95
96 template<typename C>
97 requires IsCtcBaseOrPtr<C,IntervalVector>
98 CtcInverseNotIn(const AnalyticFunction<VectorType>&, const C&, bool = true, bool = false) ->
99 CtcInverseNotIn<IntervalVector,IntervalVector>;
100
101 // MatrixType
102
103 CtcInverseNotIn(const AnalyticFunction<MatrixType>&, std::initializer_list<std::initializer_list<double>>, bool = true, bool = false) ->
104 CtcInverseNotIn<IntervalMatrix,IntervalVector>;
105
106 CtcInverseNotIn(const AnalyticFunction<MatrixType>&, std::initializer_list<std::initializer_list<std::initializer_list<double>>>, bool = true, bool = false) ->
107 CtcInverseNotIn<IntervalMatrix,IntervalVector>;
108
109 template<typename OtherDerived>
110 requires (OtherDerived::RowsAtCompileTime == -1 && OtherDerived::ColsAtCompileTime == -1)
111 CtcInverseNotIn(const AnalyticFunction<MatrixType>&, const Eigen::MatrixBase<OtherDerived>&, bool = true, bool = false) ->
112 CtcInverseNotIn<IntervalMatrix,IntervalVector>;
113
114 template<typename C>
115 requires IsCtcBaseOrPtr<C,IntervalMatrix>
116 CtcInverseNotIn(const AnalyticFunction<MatrixType>&, const C&, bool = true, bool = false) ->
117 CtcInverseNotIn<IntervalMatrix,IntervalVector>;
118}
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
Definition codac2_OctaSym.h:21
Eigen::Matrix< double,-1, 1 > Vector
Alias for a dynamically-sized column vector of doubles.
Definition codac2_Vector.h:24
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25