codac 2.0.0
Loading...
Searching...
No Matches
codac2_Matrix_addons_IntervalVector.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T, int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires (std::is_arithmetic_v<T> && IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>)
 Matrix (std::initializer_list< T > l)
 Constructs an interval vector or interval row from an initializer list of floating point values.
 
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
 Matrix (std::initializer_list< std::initializer_list< double > > l)
 Constructs an interval vector or interval row from an initializer list of initializer lists of doubles.
 
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
 Matrix (std::initializer_list< codac2::Interval > l)
 Constructs an interval vector or interval row from an initializer list of intervals.
 
template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
 Matrix (int n, const double bounds[][2])
 Constructs an interval vector or interval row from a size and array of bounds.
 

Detailed Description

This class reuses some of the functions developed for ibex::IntervalVector. The original IBEX code is revised in modern C++ and adapted to the template structure proposed in Codac, based on the Eigen library. See ibex::IntervalVector (IBEX lib, author: Gilles Chabert)

This file is included in the declaration of Eigen::MatrixBase, thanks to the preprocessor token EIGEN_MATRIX_PLUGIN. See: https://eigen.tuxfamily.org/dox/TopicCustomizing_Plugins.html and the file codac2_matrices.h


Date
2024
Author
Simon Rohou, Gilles Chabert
License: GNU Lesser General Public License (LGPL)

Function Documentation

◆ Matrix() [1/4]

template<typename T, int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires (std::is_arithmetic_v<T> && IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>)
Matrix ( std::initializer_list< T > l)

Constructs an interval vector or interval row from an initializer list of floating point values.

Converts each value in the list into a degenerate interval and stores it in the structure.

Precondition
The structure must be a vector or row vector (IsVectorOrRow).
Parameters
lInitializer list of values to convert into intervals.
Precondition
The initializer list l must not be empty.
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}
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
Matrix()=delete
Deleted default constructor to prevent default instantiation when either the number of rows or column...

◆ Matrix() [2/4]

template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
Matrix ( std::initializer_list< std::initializer_list< double > > l)

Constructs an interval vector or interval row from an initializer list of initializer lists of doubles.

Converts each inner list into an interval and stores it in the structure.

Precondition
The structure must be a vector or row vector (IsVectorOrRow).
Parameters
lInitializer list of initializer lists of doubles representing intervals.
Precondition
The initializer list l must not be empty.
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}

◆ Matrix() [3/4]

template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
Matrix ( std::initializer_list< codac2::Interval > l)

Constructs an interval vector or interval row from an initializer list of intervals.

Copies each interval in the list into the structure.

Precondition
The structure must be a vector or row vector (IsVectorOrRow).
Parameters
lInitializer list of intervals.
Precondition
The initializer list l must not be empty.
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}

◆ Matrix() [4/4]

template<int R = RowsAtCompileTime, int C = ColsAtCompileTime>
requires IsIntervalDomain<Scalar> && IsVectorOrRow<R,C>
Matrix ( int n,
const double bounds[][2] )

Constructs an interval vector or interval row from a size and array of bounds.

Initializes the structure intervals using the given array of bounds.

Precondition
The structure must be a vector or row vector (IsVectorOrRow).
Parameters
nNumber of components (must be positive).
boundsArray of bounds, each element containing lower and upper bound as double.
Precondition
n must be greater than zero.
102 : Matrix<codac2::Interval,R,C>(R == 1 ? 1 : n, C == 1 ? 1 : n, bounds)
103{
104 assert_release(n > 0);
105}