1#ifndef ZONOOPT_INTERVALMATRIX_HPP_
2#define ZONOOPT_INTERVALMATRIX_HPP_
20 using namespace detail;
51 const Eigen::Matrix<zono_float, -1, -1>& mat_ub);
58 explicit IntervalMatrix(
const Eigen::Matrix<Interval, -1, -1>& mat);
65 std::vector<std::vector<Interval>>
to_array()
const;
72 std::tuple<int, int, std::vector<Eigen::Triplet<Interval>>>
to_triplets()
const;
80 Eigen::SparseMatrix<zono_float>
center()
const;
88 Eigen::SparseMatrix<zono_float>
diam()
const;
143 bool contains(
const Eigen::SparseMatrix<zono_float>& mat)
const;
160 Box operator*(
const Eigen::Vector<zono_float, -1>& v)
const;
471 size_t rows()
const {
return rows_; }
477 size_t cols()
const {
return cols_; }
483 std::string
print()
const;
495 std::vector<std::vector<std::pair<size_t, Interval>>> mat_;
Box (i.e., interval vector) class.
Definition Box.hpp:25
Class for interval matrices (i.e., every element of the matrix is an interval)
Definition IntervalMatrix.hpp:27
IntervalMatrix interval_hull(const IntervalMatrix &other) const
Interval matrix interval hull.
Definition IntervalMatrix.cpp:664
size_t rows() const
Get number of rows.
Definition IntervalMatrix.hpp:471
Eigen::SparseMatrix< zono_float > diam() const
Get diameter matrix.
Definition IntervalMatrix.cpp:563
IntervalMatrix operator&(const IntervalMatrix &other) const
Interval matrix intersection oeprator.
Definition IntervalMatrix.cpp:522
bool operator>=(const IntervalMatrix &other) const
Set containment operator.
Definition IntervalMatrix.cpp:537
std::string print() const
Print method.
Definition IntervalMatrix.cpp:741
zono_float width() const
Get width of interval matrix.
Definition IntervalMatrix.cpp:592
friend IntervalMatrix operator+(const Interval &interval, const IntervalMatrix &mat)
IntervalMatrix element-wise addition with interval.
Definition IntervalMatrix.cpp:167
bool contains(const Eigen::SparseMatrix< zono_float > &mat) const
Check whether the interval matrix contains a given sparse matrix.
Definition IntervalMatrix.cpp:697
void operator/=(zono_float alpha)
IntervalMatrix elementwise division by scalar.
Definition IntervalMatrix.cpp:231
IntervalMatrix intersect(const IntervalMatrix &other) const
Interval matrix intersection.
Definition IntervalMatrix.cpp:631
bool operator<=(const IntervalMatrix &other) const
Set containment operator.
Definition IntervalMatrix.cpp:532
Eigen::SparseMatrix< zono_float > center() const
Get center matrix.
Definition IntervalMatrix.cpp:547
friend std::ostream & operator<<(std::ostream &os, const IntervalMatrix &interval_matrix)
print to ostream
Definition IntervalMatrix.cpp:758
std::vector< std::vector< Interval > > to_array() const
Convert to a vector of vectors of Intervals (row-major)
Definition IntervalMatrix.cpp:85
friend IntervalMatrix operator-(const Interval &interval, const IntervalMatrix &mat)
IntervalMatrix elementwise interval subtraction.
Definition IntervalMatrix.cpp:432
bool operator==(const IntervalMatrix &other) const
Set equality operator.
Definition IntervalMatrix.cpp:542
friend IntervalMatrix operator*(zono_float alpha, const IntervalMatrix &A)
IntervalMatrix scalar multiplication.
Definition IntervalMatrix.cpp:213
bool is_empty() const
Determine whether interval matrix is empty (any contained interval is empty)
Definition IntervalMatrix.cpp:605
void operator-=(const IntervalMatrix &other)
IntervalMatrix subtraction in-place.
Definition IntervalMatrix.cpp:437
void operator*=(zono_float alpha)
IntervalMatrix scalar multiplication in-place.
Definition IntervalMatrix.cpp:185
bool is_single_valued() const
Determine whether interval matrix is single-valued (i.e., all intervals have width 0 within numerical...
Definition IntervalMatrix.cpp:618
friend IntervalMatrix operator/(zono_float alpha, const IntervalMatrix &A)
IntervalMatrix elementwise scalar division.
Definition IntervalMatrix.cpp:483
bool contains_set(const IntervalMatrix &other) const
Check whether the interval matrix contains another interval matrix.
Definition IntervalMatrix.cpp:719
IntervalMatrix operator|(const IntervalMatrix &other) const
Interval matrix interval hull operator.
Definition IntervalMatrix.cpp:527
std::tuple< int, int, std::vector< Eigen::Triplet< Interval > > > to_triplets() const
Convert to triplets.
Definition IntervalMatrix.cpp:111
size_t cols() const
Get number of columns.
Definition IntervalMatrix.hpp:477
IntervalMatrix radius() const
Get radius matrix.
Definition IntervalMatrix.cpp:579
void operator+=(const IntervalMatrix &other)
IntervalMatrix addition in-place.
Definition IntervalMatrix.cpp:365
IntervalMatrix()
IntervalMatrix default constructor.
Definition IntervalMatrix.hpp:32
Interval class.
Definition Interval.hpp:48
#define zono_float
Defines the floating-point type used in ZonoOpt.
Definition ZonoOpt.hpp:45
Definition ZonoOpt.hpp:58