18 enum LeftOrRightInv { LEFT_INV, RIGHT_INV };
34 template<LeftOrRightInv O=LEFT_INV,
typename OtherDerived,
typename OtherDerived_>
35 inline IntervalMatrix
inverse_correction(
const Eigen::MatrixBase<OtherDerived>& A,
const Eigen::MatrixBase<OtherDerived_>& B)
37 assert_release(A.is_squared());
38 assert_release(B.is_squared());
40 auto A_ = A.template cast<Interval>();
41 auto B_ = B.template cast<Interval>();
44 assert_release(N==B_.rows());
46 auto Id = IntervalMatrix::Identity(N,N);
47 auto erMat = [&]() {
if constexpr(O == LEFT_INV)
return -B_*A_+Id;
else return -A_*B_+Id; }();
51 IntervalMatrix Ep = Id+erMat*(Id+E);
55 auto res = (O == LEFT_INV) ? IntervalMatrix(Ep*B_) : IntervalMatrix(B_*Ep);
60 for (Index c=0;c<N;c++) {
61 for (Index r=0;r<N;r++) {
62 if (Ep(r,c).is_unbounded()) {
63 for (Index k=0;k<N;k++) {
64 if constexpr(O == LEFT_INV)
86 template<
typename OtherDerived>
89 assert_release(A.is_squared());
92 if constexpr(std::is_same_v<typename OtherDerived::Scalar,Interval>)
94 (A.mid()).fullPivLu().solve(Matrix::Identity(N,N)));
98 A.fullPivLu().solve(Matrix::Identity(N,N)));
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62
IntervalMatrix inverse_enclosure(const Eigen::MatrixBase< OtherDerived > &A)
Enclosure of the inverse of a (non-singular) matrix expression, possibly an interval matrix.
Definition codac2_inversion.h:87
IntervalMatrix inverse_correction(const Eigen::MatrixBase< OtherDerived > &A, const Eigen::MatrixBase< OtherDerived_ > &B)
Correct the approximation of the inverse of a square matrix by providing a reliable enclosure .
Definition codac2_inversion.h:35
IntervalMatrix infinite_sum_enclosure(const IntervalMatrix &A, double &mrad)
Compute an upper bound of , with a matrix of intervals as an "error term" (uses only bounds on coeff...