codac 1.5.6
Loading...
Searching...
No Matches
codac2_AnalyticType.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "codac2_Interval.h"
13#include "codac2_Vector.h"
14#include "codac2_Matrix.h"
17#include "codac2_Wrapper.h"
18
19namespace codac2
20{
21 struct AnalyticTypeBase
22 {
23 virtual ~AnalyticTypeBase() = default;
24 };
25
26 template<typename T,typename D>
27 struct AnalyticType : public AnalyticTypeBase
28 {
29 using Scalar = T;
30 using Domain = D;
31
32 D m;
33 D a;
34 IntervalMatrix da;
35 bool def_domain;
36
37 AnalyticType() = delete;
38
39 AnalyticType(const D& a_, bool def_domain_)
40 : a(a_), def_domain(def_domain_)
41 { }
42
43 AnalyticType(const D& m_, const D& a_, const IntervalMatrix& da_, bool def_domain_)
44 : m(m_), a(a_), da(da_), def_domain(def_domain_)
45 { }
46
47 AnalyticType<T,D>& operator&=(const AnalyticType<T,D>& x)
48 {
49 a &= x.a;
50 // restore this? da &= x.da;
51 def_domain &= x.def_domain;
52 return *this;
53 }
54 };
55
56 using ScalarType = AnalyticType<double,Interval>;
57 using VectorType = AnalyticType<Vector,IntervalVector>;
58 using MatrixType = AnalyticType<Matrix,IntervalMatrix>;
59
60 template<typename... T>
61 bool centered_form_not_available_for_args(const T&... a)
62 {
63 return ((a.da.size() == 0) || ...);
64 }
65}