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
18namespace codac2
19{
20 struct AnalyticTypeBase
21 {
22 virtual ~AnalyticTypeBase() = default;
23 };
24
25 template<typename S, typename T, typename M>
26 struct AnalyticType : public AnalyticTypeBase
27 {
28 using Scalar = S;
29 using Domain = T;
30
31 T m;
32 T a;
33 M da;
34 bool def_domain;
35
36 AnalyticType() = delete;
37
38 AnalyticType(const T& a_, bool def_domain_)
39 : a(a_), def_domain(def_domain_)
40 { }
41
42 AnalyticType(const T& m_, const T& a_, const M& da_, bool def_domain_)
43 : m(m_), a(a_), da(da_), def_domain(def_domain_)
44 { }
45
46 AnalyticType<S,T,M>& operator&=(const AnalyticType<S,T,M>& x)
47 {
48 a &= x.a;
49 // restore this? da &= x.da;
50 def_domain &= x.def_domain;
51 return *this;
52 }
53 };
54
55 using ScalarType = AnalyticType<double,Interval,IntervalMatrix>;
56 using VectorType = AnalyticType<Vector,IntervalVector,IntervalMatrix>;
57 using MatrixType = AnalyticType<Matrix,IntervalMatrix,IntervalMatrix>;
58
59 template<typename... T>
60 bool centered_form_not_available_for_args(const T&... a)
61 {
62 return ((a.da.size() == 0) || ...);
63 }
64}