verry.linalg.IntervalMatrix#
- class verry.linalg.IntervalMatrix(inf, sup=None, **kwargs)#
Bases:
ABC
,Generic
Abstract base class for inf-sup type interval matrices.
- Parameters:
inf (ndarray | Sequence)
sup (ndarray | Sequence, optional)
- Variables:
inf (ndarray) – Infimum of the interval matrix.
sup (ndarray) – Supremum of the interval matrix.
- classmethod empty(shape)#
Return a new interval matrix of given shape, without initializing entries.
- classmethod eye(n, m=None)#
Return a matrix with ones on the diagonal and zeros elsewhere.
- classmethod ones(shape)#
Return a new interval matrix of given shape, filled with ones.
- classmethod zeros(shape)#
Return a new interval matrix of given shape, filled with zeros.
- copy()#
Return a copy of the interval matrix.
- diam()#
Return component-wise upper bounds of the diameter.
- empty_like()#
Return a new interval matrix with the same shape as self.
- flatten()#
Return a copy of the interval matrix collapsed into one dimension.
- interiorcontains(other)#
Return
True
if the interior of the interval matrix contains other.
- isbounded()#
Return
True
if both inf and sup are bounded.
- isdisjoint(other)#
Return
True
if the interval matrix has no elements in common with other.
- issubset(other)#
Test whether every element in the interval matrix is in other.
- issuperset(other)#
Test whether every element in other is in the interval matrix.
- mid()#
Return an approximation of the midpoint.
As with scalar intervals,
x.mid() in x
is guaranteed to beTrue
.
- ones_like()#
Return an interval matrix of ones with the same shape as self.
- rad()#
Return component-wise upper bounds of the radius.
- reshape(shape)#
Give a new shape to an interval matrix without changing its data.
- transpose()#
Return a view of the transposed matrix.
- zeros_like()#
Return an interval matrix of zeros with the same shape as self.
- property T#
Shorthand for
transpose()
.See also
- property ndim#
Shorthand for
len(self.shape)
.Unlike NumPy’s ndarray,
x.ndim
is always greater than or equal to 1, i.e., there is no 0D matrix.
- property shape#
Tuple of matrix dimensions.
Examples
>>> from verry.linalg import FloatIntervalMatrix as FIM >>> x = FIM([[1, 2, 3], [4, 5, 6]]) >>> y = FIM([1.0, 2.0]) >>> x.shape (2, 3) >>> y.shape (2,)