codac 1.5.6
Loading...
Searching...
No Matches
codac2_CtcInnerOuter.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <type_traits>
13#include "codac2_Ctc.h"
14#include "codac2_Sep.h"
15#include "codac2_Collection.h"
17
18namespace codac2
19{
20 class CtcInner : public Ctc<CtcInner,IntervalVector>
21 {
22 public:
23
24 template<typename S>
25 requires IsSepBaseOrPtr<S>
26 CtcInner(const S& s)
27 : Ctc<CtcInner,IntervalVector>(size_of(s)), _seps(s)
28 { }
29
30 void contract(IntervalVector& x) const
31 {
32 auto x_sep = _seps.front().separate(x);
33 x &= x_sep.inner;
34 }
35
36 protected:
37
38 const Collection<SepBase> _seps;
39 };
40
41 class CtcOuter : public Ctc<CtcOuter,IntervalVector>
42 {
43 public:
44
45 template<typename S>
46 requires IsSepBaseOrPtr<S>
47 CtcOuter(const S& s)
48 : Ctc<CtcOuter,IntervalVector>(size_of(s)), _seps(s)
49 { }
50
51 void contract(IntervalVector& x) const
52 {
53 auto x_sep = _seps.front().separate(x);
54 x &= x_sep.outer;
55 }
56
57 protected:
58
59 const Collection<SepBase> _seps;
60 };
61}