ZonoOpt 2.2.0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
ZonoOpt::IntervalMatrix Class Reference

Class for interval matrices (i.e., every element of the matrix is an interval) More...

#include <IntervalMatrix.hpp>

Public Member Functions

 IntervalMatrix ()
 IntervalMatrix default constructor.
 
 IntervalMatrix (size_t rows, size_t cols, const std::vector< Eigen::Triplet< Interval > > &triplets)
 IntervalMatrix constructor using triplets.
 
 IntervalMatrix (const Eigen::Matrix< zono_float, -1, -1 > &mat_lb, const Eigen::Matrix< zono_float, -1, -1 > &mat_ub)
 IntervalMatrix constructor using dense lower and upper bound matrices.
 
 IntervalMatrix (const Eigen::Matrix< Interval, -1, -1 > &mat)
 IntervalMatrix constructor from Eigen matrix of intervals.
 
std::vector< std::vector< Interval > > to_array () const
 Convert to a vector of vectors of Intervals (row-major)
 
std::tuple< int, int, std::vector< Eigen::Triplet< Interval > > > to_triplets () const
 Convert to triplets.
 
Eigen::SparseMatrix< zono_floatcenter () const
 Get center matrix.
 
Eigen::SparseMatrix< zono_floatdiam () const
 Get diameter matrix.
 
IntervalMatrix radius () const
 Get radius matrix.
 
zono_float width () const
 Get width of interval matrix.
 
IntervalMatrix intersect (const IntervalMatrix &other) const
 Interval matrix intersection.
 
IntervalMatrix interval_hull (const IntervalMatrix &other) const
 Interval matrix interval hull.
 
bool contains (const Eigen::SparseMatrix< zono_float > &mat) const
 Check whether the interval matrix contains a given sparse matrix.
 
bool contains_set (const IntervalMatrix &other) const
 Check whether the interval matrix contains another interval matrix.
 
Box operator* (const Eigen::Vector< zono_float, -1 > &v) const
 IntervalMatrix multiplication with vector.
 
Box operator* (const Box &box) const
 IntervalMatrix multiplication with Box.
 
IntervalMatrix operator* (zono_float alpha) const
 IntervalMatrix scalar multiplication.
 
void operator*= (zono_float alpha)
 IntervalMatrix scalar multiplication in-place.
 
IntervalMatrix operator* (const Interval &interval) const
 IntervalMatrix elementwise multiplication by interval.
 
void operator*= (const Interval &interval)
 IntervalMatrix elementwise multiplication by interval in-place.
 
IntervalMatrix operator/ (zono_float alpha) const
 IntervalMatrix elementwise division by scalar.
 
void operator/= (zono_float alpha)
 IntervalMatrix elementwise division by scalar.
 
IntervalMatrix operator/ (const Interval &interval) const
 IntervalMatrix elementwise division by interval.
 
void operator/= (const Interval &interval)
 IntervalMatrix elementwise division by interval in-place.
 
IntervalMatrix operator* (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A) const
 IntervalMatrix multiplication with sparse matrix.
 
IntervalMatrix operator* (const Eigen::Matrix< zono_float, -1, -1 > &A) const
 IntervalMatrix multiplication with dense matrix.
 
IntervalMatrix operator* (const IntervalMatrix &other) const
 IntervalMatrix multiplication with another IntervalMatrix.
 
void operator*= (const IntervalMatrix &other)
 IntervalMatrix multiplication with another IntervalMatrix in-place.
 
IntervalMatrix operator+ (const IntervalMatrix &other) const
 IntervalMatrix addition.
 
void operator+= (const IntervalMatrix &other)
 IntervalMatrix addition in-place.
 
IntervalMatrix operator+ (const Interval &interval) const
 IntervalMatrix element-wise addition with interval.
 
void operator+= (const Interval &interval)
 IntervalMatrix element-wise addition with interval in-place.
 
IntervalMatrix operator+ (zono_float alpha) const
 IntervalMatrix element-wise addition with scalar.
 
void operator+= (zono_float alpha)
 IntervalMatrix element-wise addition with scalar in-place.
 
IntervalMatrix operator- (const IntervalMatrix &other) const
 IntervalMatrix subtraction.
 
void operator-= (const IntervalMatrix &other)
 IntervalMatrix subtraction in-place.
 
IntervalMatrix operator- (const Interval &interval) const
 IntervalMatrix elementwise interval subtraction.
 
void operator-= (const Interval &interval)
 IntervalMatrix elementwise interval subtraction in-place.
 
IntervalMatrix operator- (zono_float alpha) const
 IntervalMatrix elementwise scalar subtraction.
 
void operator-= (zono_float alpha)
 IntervalMatrix elementwise scalar subtraction in-place.
 
IntervalMatrix operator- () const
 IntervalMatrix negation.
 
IntervalMatrix operator& (const IntervalMatrix &other) const
 Interval matrix intersection oeprator.
 
IntervalMatrix operator| (const IntervalMatrix &other) const
 Interval matrix interval hull operator.
 
bool operator<= (const IntervalMatrix &other) const
 Set containment operator.
 
bool operator>= (const IntervalMatrix &other) const
 Set containment operator.
 
bool operator== (const IntervalMatrix &other) const
 Set equality operator.
 
size_t rows () const
 Get number of rows.
 
size_t cols () const
 Get number of columns.
 
std::string print () const
 Print method.
 

Friends

IntervalMatrix operator* (zono_float alpha, const IntervalMatrix &A)
 IntervalMatrix scalar multiplication.
 
IntervalMatrix operator* (const Interval &interval, const IntervalMatrix &A)
 IntervalMatrix elementwise multiplication by interval.
 
IntervalMatrix operator/ (zono_float alpha, const IntervalMatrix &A)
 IntervalMatrix elementwise scalar division.
 
IntervalMatrix operator/ (const Interval &interval, const IntervalMatrix &A)
 IntervalMatrix elementwise interval division.
 
IntervalMatrix operator* (const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &A, const IntervalMatrix &B)
 IntervalMatrix multiplication with sparse matrix.
 
IntervalMatrix operator* (const Eigen::Matrix< zono_float, -1, -1 > &A, const IntervalMatrix &B)
 IntervalMatrix multiplication with dense matrix.
 
IntervalMatrix operator+ (const Interval &interval, const IntervalMatrix &mat)
 IntervalMatrix element-wise addition with interval.
 
IntervalMatrix operator+ (zono_float alpha, const IntervalMatrix &A)
 IntervalMatrix element-wise addition with scalar.
 
IntervalMatrix operator- (const Interval &interval, const IntervalMatrix &mat)
 IntervalMatrix elementwise interval subtraction.
 
IntervalMatrix operator- (zono_float alpha, const IntervalMatrix &A)
 IntervalMatrix elementwise scalar subtraction.
 
std::ostream & operator<< (std::ostream &os, const IntervalMatrix &interval_matrix)
 print to ostream
 

Detailed Description

Class for interval matrices (i.e., every element of the matrix is an interval)

Constructor & Destructor Documentation

◆ IntervalMatrix() [1/4]

ZonoOpt::IntervalMatrix::IntervalMatrix ( )
inline

IntervalMatrix default constructor.

◆ IntervalMatrix() [2/4]

ZonoOpt::IntervalMatrix::IntervalMatrix ( size_t  rows,
size_t  cols,
const std::vector< Eigen::Triplet< Interval > > &  triplets 
)

IntervalMatrix constructor using triplets.

Parameters
rowsnumber of rows
colsnumber of columns
tripletstriplets for interval matrix (row, col, interval)

◆ IntervalMatrix() [3/4]

ZonoOpt::IntervalMatrix::IntervalMatrix ( const Eigen::Matrix< zono_float, -1, -1 > &  mat_lb,
const Eigen::Matrix< zono_float, -1, -1 > &  mat_ub 
)

IntervalMatrix constructor using dense lower and upper bound matrices.

Parameters
mat_lblower bound matrix
mat_ubupper bound matrix

◆ IntervalMatrix() [4/4]

ZonoOpt::IntervalMatrix::IntervalMatrix ( const Eigen::Matrix< Interval, -1, -1 > &  mat)
explicit

IntervalMatrix constructor from Eigen matrix of intervals.

Parameters
matmatrix of intervals

Member Function Documentation

◆ center()

Eigen::SparseMatrix< zono_float > ZonoOpt::IntervalMatrix::center ( ) const

Get center matrix.

Returns
center matrix

Each element of center matrix is the center of the corresponding interval in the interval matrix

◆ cols()

size_t ZonoOpt::IntervalMatrix::cols ( ) const
inline

Get number of columns.

Returns
number of cols

◆ contains()

bool ZonoOpt::IntervalMatrix::contains ( const Eigen::SparseMatrix< zono_float > &  mat) const

Check whether the interval matrix contains a given sparse matrix.

Parameters
matmatrix
Returns
true if mat is contained in the interval matrix, false otherwise

◆ contains_set()

bool ZonoOpt::IntervalMatrix::contains_set ( const IntervalMatrix other) const

Check whether the interval matrix contains another interval matrix.

Parameters
otherinterval matrix
Returns
true if other is contained in this, false otherwise

◆ diam()

Eigen::SparseMatrix< zono_float > ZonoOpt::IntervalMatrix::diam ( ) const

Get diameter matrix.

Returns
diameter matrix

Each element of the diameter matrix is the width of the corresponding interval in the interval matrix

◆ intersect()

IntervalMatrix ZonoOpt::IntervalMatrix::intersect ( const IntervalMatrix other) const

Interval matrix intersection.

Parameters
otherinterval matrix to intersect with
Returns
IntervalMatrix

◆ interval_hull()

IntervalMatrix ZonoOpt::IntervalMatrix::interval_hull ( const IntervalMatrix other) const

Interval matrix interval hull.

Parameters
otherinterval matrix to compute hull with
Returns
IntervalMatrix

◆ operator&()

IntervalMatrix ZonoOpt::IntervalMatrix::operator& ( const IntervalMatrix other) const

Interval matrix intersection oeprator.

Parameters
otherinterval matrix to intersect with
Returns
IntervalMatrix

◆ operator*() [1/7]

Box ZonoOpt::IntervalMatrix::operator* ( const Box box) const

IntervalMatrix multiplication with Box.

Parameters
boxrhs box
Returns
resulting box

◆ operator*() [2/7]

IntervalMatrix ZonoOpt::IntervalMatrix::operator* ( const Eigen::Matrix< zono_float, -1, -1 > &  A) const

IntervalMatrix multiplication with dense matrix.

Parameters
Arhs matrix
Returns
resulting interval matrix

◆ operator*() [3/7]

IntervalMatrix ZonoOpt::IntervalMatrix::operator* ( const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &  A) const

IntervalMatrix multiplication with sparse matrix.

Parameters
Arhs matrix
Returns
resulting interval matrix

◆ operator*() [4/7]

Box ZonoOpt::IntervalMatrix::operator* ( const Eigen::Vector< zono_float, -1 > &  v) const

IntervalMatrix multiplication with vector.

Parameters
vrhs vector
Returns
resulting box

◆ operator*() [5/7]

IntervalMatrix ZonoOpt::IntervalMatrix::operator* ( const Interval interval) const

IntervalMatrix elementwise multiplication by interval.

Parameters
intervalinterval to multiply
Returns
resulting interval matrix

◆ operator*() [6/7]

IntervalMatrix ZonoOpt::IntervalMatrix::operator* ( const IntervalMatrix other) const

IntervalMatrix multiplication with another IntervalMatrix.

Parameters
otherrhs interval matrix
Returns
resulting interval matrix

◆ operator*() [7/7]

IntervalMatrix ZonoOpt::IntervalMatrix::operator* ( zono_float  alpha) const

IntervalMatrix scalar multiplication.

Parameters
alphascalar multiplier
Returns
resulting interval matrix

◆ operator*=() [1/3]

void ZonoOpt::IntervalMatrix::operator*= ( const Interval interval)

IntervalMatrix elementwise multiplication by interval in-place.

Parameters
intervalinterval to multiply

◆ operator*=() [2/3]

void ZonoOpt::IntervalMatrix::operator*= ( const IntervalMatrix other)

IntervalMatrix multiplication with another IntervalMatrix in-place.

Parameters
otherrhs interval matrix

◆ operator*=() [3/3]

void ZonoOpt::IntervalMatrix::operator*= ( zono_float  alpha)

IntervalMatrix scalar multiplication in-place.

Parameters
alphascalar multiplier

◆ operator+() [1/3]

IntervalMatrix ZonoOpt::IntervalMatrix::operator+ ( const Interval interval) const

IntervalMatrix element-wise addition with interval.

Parameters
intervalinterval to add
Returns
resulting interval matrix

◆ operator+() [2/3]

IntervalMatrix ZonoOpt::IntervalMatrix::operator+ ( const IntervalMatrix other) const

IntervalMatrix addition.

Parameters
otherrhs interval matrix
Returns
resulting interval matrix

◆ operator+() [3/3]

IntervalMatrix ZonoOpt::IntervalMatrix::operator+ ( zono_float  alpha) const

IntervalMatrix element-wise addition with scalar.

Parameters
alphascalar to add
Returns
resulting interval matrix

◆ operator+=() [1/3]

void ZonoOpt::IntervalMatrix::operator+= ( const Interval interval)

IntervalMatrix element-wise addition with interval in-place.

Parameters
intervalinterval to add

◆ operator+=() [2/3]

void ZonoOpt::IntervalMatrix::operator+= ( const IntervalMatrix other)

IntervalMatrix addition in-place.

Parameters
otherrhs interval matrix

◆ operator+=() [3/3]

void ZonoOpt::IntervalMatrix::operator+= ( zono_float  alpha)

IntervalMatrix element-wise addition with scalar in-place.

Parameters
alphascalar to add

◆ operator-() [1/4]

IntervalMatrix ZonoOpt::IntervalMatrix::operator- ( ) const

IntervalMatrix negation.

Returns
negated interval matrix

◆ operator-() [2/4]

IntervalMatrix ZonoOpt::IntervalMatrix::operator- ( const Interval interval) const

IntervalMatrix elementwise interval subtraction.

Parameters
intervalinterval to subtract
Returns
resulting interval matrix

◆ operator-() [3/4]

IntervalMatrix ZonoOpt::IntervalMatrix::operator- ( const IntervalMatrix other) const

IntervalMatrix subtraction.

Parameters
otherrhs interval matrix
Returns
resulting interval matrix

◆ operator-() [4/4]

IntervalMatrix ZonoOpt::IntervalMatrix::operator- ( zono_float  alpha) const

IntervalMatrix elementwise scalar subtraction.

Parameters
alphascalar to subtract
Returns
resulting interval matrix

◆ operator-=() [1/3]

void ZonoOpt::IntervalMatrix::operator-= ( const Interval interval)

IntervalMatrix elementwise interval subtraction in-place.

Parameters
intervalinterval

◆ operator-=() [2/3]

void ZonoOpt::IntervalMatrix::operator-= ( const IntervalMatrix other)

IntervalMatrix subtraction in-place.

Parameters
otherrhs interval matrix

◆ operator-=() [3/3]

void ZonoOpt::IntervalMatrix::operator-= ( zono_float  alpha)

IntervalMatrix elementwise scalar subtraction in-place.

Parameters
alphascalar to subtract

◆ operator/() [1/2]

IntervalMatrix ZonoOpt::IntervalMatrix::operator/ ( const Interval interval) const

IntervalMatrix elementwise division by interval.

Parameters
intervalinterval to divide
Returns
resulting interval matrix (this / interval)

◆ operator/() [2/2]

IntervalMatrix ZonoOpt::IntervalMatrix::operator/ ( zono_float  alpha) const

IntervalMatrix elementwise division by scalar.

Parameters
alphascalar to divide
Returns
resulting interval matrix (this / alpha)

◆ operator/=() [1/2]

void ZonoOpt::IntervalMatrix::operator/= ( const Interval interval)

IntervalMatrix elementwise division by interval in-place.

Parameters
intervalinterval to divide

◆ operator/=() [2/2]

void ZonoOpt::IntervalMatrix::operator/= ( zono_float  alpha)

IntervalMatrix elementwise division by scalar.

Parameters
alphascalar to divide

◆ operator<=()

bool ZonoOpt::IntervalMatrix::operator<= ( const IntervalMatrix other) const

Set containment operator.

Parameters
other
Returns
true if this is subset of other

◆ operator==()

bool ZonoOpt::IntervalMatrix::operator== ( const IntervalMatrix other) const

Set equality operator.

Parameters
other
Returns
true if this and other are equal

◆ operator>=()

bool ZonoOpt::IntervalMatrix::operator>= ( const IntervalMatrix other) const

Set containment operator.

Parameters
other
Returns
true if this is superset of other

◆ operator|()

IntervalMatrix ZonoOpt::IntervalMatrix::operator| ( const IntervalMatrix other) const

Interval matrix interval hull operator.

Parameters
otherinterval matrix to compute hull with
Returns
IntervalMatrix

◆ print()

std::string ZonoOpt::IntervalMatrix::print ( ) const

Print method.

Returns
string display of IntervalMatrix

◆ radius()

IntervalMatrix ZonoOpt::IntervalMatrix::radius ( ) const

Get radius matrix.

Returns
radius matrix

Returns the IntervalMatrix with each interval shifted to be centered at zero

◆ rows()

size_t ZonoOpt::IntervalMatrix::rows ( ) const
inline

Get number of rows.

Returns
number of rows

◆ to_array()

std::vector< std::vector< Interval > > ZonoOpt::IntervalMatrix::to_array ( ) const

Convert to a vector of vectors of Intervals (row-major)

Returns
vector of vectors of Intervals

◆ to_triplets()

std::tuple< int, int, std::vector< Eigen::Triplet< Interval > > > ZonoOpt::IntervalMatrix::to_triplets ( ) const

Convert to triplets.

Returns
std::tuple<int, int, std::vector<Eigen::Triplet<Interval>>>

◆ width()

zono_float ZonoOpt::IntervalMatrix::width ( ) const

Get width of interval matrix.

Returns
width of interval matrix

Specifically, this returns the max width for any interval in the interval matrix

Friends And Related Symbol Documentation

◆ operator* [1/4]

IntervalMatrix operator* ( const Eigen::Matrix< zono_float, -1, -1 > &  A,
const IntervalMatrix B 
)
friend

IntervalMatrix multiplication with dense matrix.

Parameters
Alhs matrix
Brhs interval matrix
Returns
resulting interval matrix

◆ operator* [2/4]

IntervalMatrix operator* ( const Eigen::SparseMatrix< zono_float, Eigen::RowMajor > &  A,
const IntervalMatrix B 
)
friend

IntervalMatrix multiplication with sparse matrix.

Parameters
Alhs matrix
Brhs interval matrix
Returns
resulting interval matrix

◆ operator* [3/4]

IntervalMatrix operator* ( const Interval interval,
const IntervalMatrix A 
)
friend

IntervalMatrix elementwise multiplication by interval.

Parameters
intervalinterval to multiply
Ainterval matrix
Returns
resulting interval matrix

◆ operator* [4/4]

IntervalMatrix operator* ( zono_float  alpha,
const IntervalMatrix A 
)
friend

IntervalMatrix scalar multiplication.

Parameters
alphascalar multiplier
Ainterval matrix
Returns
resulting interval matrix

◆ operator+ [1/2]

IntervalMatrix operator+ ( const Interval interval,
const IntervalMatrix mat 
)
friend

IntervalMatrix element-wise addition with interval.

Parameters
intervalinterval to add
matinterval matrix
Returns
resulting interval matrix

◆ operator+ [2/2]

IntervalMatrix operator+ ( zono_float  alpha,
const IntervalMatrix A 
)
friend

IntervalMatrix element-wise addition with scalar.

Parameters
alphascalar to add
Ainterval matrix
Returns
resulting interval matrix

◆ operator- [1/2]

IntervalMatrix operator- ( const Interval interval,
const IntervalMatrix mat 
)
friend

IntervalMatrix elementwise interval subtraction.

Parameters
intervalinterval
matinterval matrix to subtract
Returns
resulting interval matrix

◆ operator- [2/2]

IntervalMatrix operator- ( zono_float  alpha,
const IntervalMatrix A 
)
friend

IntervalMatrix elementwise scalar subtraction.

Parameters
alphascalar
Ainterval matrix to subtract
Returns
resulting interval matrix

◆ operator/ [1/2]

IntervalMatrix operator/ ( const Interval interval,
const IntervalMatrix A 
)
friend

IntervalMatrix elementwise interval division.

Parameters
intervalinterval
Amatrix to divide
Returns
resulting interval matrix (interval / this)

◆ operator/ [2/2]

IntervalMatrix operator/ ( zono_float  alpha,
const IntervalMatrix A 
)
friend

IntervalMatrix elementwise scalar division.

Parameters
alphascalar
Amatrix to divide
Returns
resulting interval matrix (alpha / this)

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const IntervalMatrix interval_matrix 
)
friend

print to ostream

Parameters
osostream
interval_matrixreference to interval matrix
Returns
ostream

The documentation for this class was generated from the following files: