codac 2.0.0
Loading...
Searching...
No Matches
codac2_Matrix_addons_IntervalVector.h
Go to the documentation of this file.
1
20
32template<typename T,int R=RowsAtCompileTime,int C=ColsAtCompileTime>
33 requires (std::is_arithmetic_v<T> && IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>)
34Matrix(std::initializer_list<T> l)
35 : Matrix<codac2::Interval,R,C>(R == 1 ? 1 : l.size(), C == 1 ? 1 : l.size())
36{
37 assert_release(!std::empty(l));
38 Index i = 0;
39 for(const auto& li : l)
40 (*this)[i++] = codac2::Interval(li);
41}
42
54template<int R=RowsAtCompileTime,int C=ColsAtCompileTime>
55 requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
56Matrix(std::initializer_list<std::initializer_list<double>> l)
57 : Matrix<codac2::Interval,R,C>(R == 1 ? 1 : l.size(), C == 1 ? 1 : l.size())
58{
59 assert_release(!std::empty(l));
60 Index i = 0;
61 for(const auto& li : l)
62 (*this)[i++] = codac2::Interval(li);
63}
64
76template<int R=RowsAtCompileTime,int C=ColsAtCompileTime>
77 requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
78Matrix(std::initializer_list<codac2::Interval> l)
79 : Matrix<codac2::Interval,R,C>(R == 1 ? 1 : l.size(), C == 1 ? 1 : l.size())
80{
81 assert_release(!std::empty(l));
82 Index i = 0;
83 for(const auto& li : l)
84 (*this)[i++] = li;
85}
86
99template<int R=RowsAtCompileTime,int C=ColsAtCompileTime>
100 requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
101Matrix(int n, const double bounds[][2])
102 : Matrix<codac2::Interval,R,C>(R == 1 ? 1 : n, C == 1 ? 1 : n, bounds)
103{
104 assert_release(n > 0);
105}
106
115template<int R=RowsAtCompileTime,int C=ColsAtCompileTime>
116 requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
117inline static auto empty(Index n)
118{
119 assert_release(n >= 0);
121}
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
static Interval empty()
Provides an empty interval.
Definition codac2_Interval_impl.h:551
Matrix(const Matrix< double, R, C > &lb, const Matrix< double, R, C > &ub)
Constructs an interval matrix from lower and upper bound matrices.
Definition codac2_Matrix_addons_IntervalMatrixBase.h:50
Matrix()=delete
Deleted default constructor to prevent default instantiation when either the number of rows or column...