18 enum LeftOrRightInv { LEFT_INV, RIGHT_INV };
46 template<LeftOrRightInv O=LEFT_INV,
typename OtherDerived,
typename OtherDerived_>
47 inline IntervalMatrix
inverse_correction(
const Eigen::MatrixBase<OtherDerived>& A,
const Eigen::MatrixBase<OtherDerived_>& B)
49 assert_release(A.is_squared());
50 assert_release(B.is_squared());
52 auto A_ = A.template cast<Interval>();
53 auto B_ = B.template cast<Interval>();
56 assert_release(N==B_.rows());
58 auto Id = IntervalMatrix::Identity(N,N);
59 auto erMat = [&]() {
if constexpr(O == LEFT_INV)
return -B_*A_+Id;
else return -A_*B_+Id; }();
63 IntervalMatrix Ep = Id+erMat*(Id+E);
67 auto res = (O == LEFT_INV) ? IntervalMatrix(Ep*B_) : IntervalMatrix(B_*Ep);
72 for (Index c=0;c<N;c++) {
73 for (Index r=0;r<N;r++) {
74 if (Ep(r,c).is_unbounded()) {
75 for (Index k=0;k<N;k++) {
76 if constexpr(O == LEFT_INV)
96 template<
typename OtherDerived>
99 assert_release(A.is_squared());
102 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.
Definition codac2_inversion.h:97
IntervalMatrix inverse_correction(const Eigen::MatrixBase< OtherDerived > &A, const Eigen::MatrixBase< OtherDerived_ > &B)
Correct the approximate inverse of a matrix.
Definition codac2_inversion.h:47
IntervalMatrix infinite_sum_enclosure(const IntervalMatrix &A, double &mrad)
Compute an upper bound of A+A^2+A^3+..., with A a matrix of intervals as an "error term" (use only bo...