codac 2.0.0
Loading...
Searching...
No Matches
codac2_Wrapper.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 template<typename T, typename Enable=void>
21 struct Wrapper
22 { };
23
24 template<>
25 struct Wrapper<int> {
26 using Domain = Interval;
27 };
28
29 template<>
30 struct Wrapper<Index> {
31 using Domain = Interval;
32 };
33
34 template<>
35 struct Wrapper<double> {
36 using Domain = Interval;
37 };
38
39 template<typename T,typename D>
40 struct AnalyticType;
41
42 template<typename T,typename D>
43 struct Wrapper<AnalyticType<T,D>> {
44 using Domain = D;
45 };
46
47 template<typename OtherDerived>
48 struct Wrapper<OtherDerived,
49 typename std::enable_if<std::is_base_of_v<Eigen::MatrixBase<OtherDerived>,OtherDerived>>::type>
50 {
51 using Domain = Eigen::Matrix<Interval,OtherDerived::RowsAtCompileTime,OtherDerived::ColsAtCompileTime>;
52 // Automatically sets:
53 // Wrapper<Vector>::Domain = IntervalVector
54 // Wrapper<IntervalVector>::Domain = IntervalVector
55 // Wrapper<Matrix>::Domain = IntervalMatrix
56 // Wrapper<IntervalMatrix>::Domain = IntervalMatrix
57 // + related possible expression templates
58 };
59}