codac 2.0.0
Loading...
Searching...
No Matches
codac2_CtcWrapper.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "codac2_Ctc.h"
13
14namespace codac2
15{
16 template<typename Y,
17 typename X = std::conditional_t<
18 std::is_same_v<Y, Interval>,
20 std::conditional_t<std::is_same_v<Y, IntervalMatrix>,
23 class CtcWrapper : public Ctc<CtcWrapper<Y>,X>
24 {
25 public:
26
27 CtcWrapper(const Y& y)
28 : Ctc<CtcWrapper<Y>,X>(y.size()), _y(y)
29 { }
30
31 CtcWrapper(Y&& y)
32 : Ctc<CtcWrapper<Y>,X>(y.size()), _y(std::move(y))
33 { }
34
35 void contract(X& x) const
36 {
37 if constexpr(std::is_same_v<X,IntervalMatrix>)
38 assert_release(x.rows() == _y.rows() && x.cols() == _y.cols());
39 else
40 assert_release(x.size() == this->size());
41 x = x & _y;
42 }
43
44 protected:
45
46 const Y _y;
47 };
48}
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:50
Definition codac2_OctaSym.h:21
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25
Eigen::Matrix< Interval,-1,-1 > IntervalMatrix
Alias for a dynamic-size matrix of intervals.
Definition codac2_IntervalMatrix.h:25