codac 2.0.0
Loading...
Searching...
No Matches
codac2_IntvFullPivLU.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <ostream>
13#include "codac2_Matrix.h"
15#include "codac2_BoolInterval.h"
16
17namespace codac2
18{
25 {
26 public:
30 explicit IntvFullPivLU(const Matrix &M);
31
37 explicit IntvFullPivLU(const IntervalMatrix &M);
38
70 Interval rank() const;
86 IntervalMatrix kernel() const;
98 template <typename Derived> Derived
99 image(const Eigen::MatrixBase<Derived> &M) const;
118 IntervalMatrix solve(const IntervalMatrix &rhs) const;
119
120
126 IntervalMatrix reconstructed_matrix() const;
131 double max_pivot() const;
132
137 const Eigen::FullPivLU<Matrix>::PermutationPType
138 &permutation_P () const;
143 const Eigen::FullPivLU<Matrix>::PermutationQType
144 &permutation_Q () const;
149 const Eigen::FullPivLU<Matrix> &eigen_LU() const;
150
156 const IntervalMatrix &matrix_LU() const;
157
158
159 private:
160 Eigen::FullPivLU<Matrix> _LU;
161
162 IntervalMatrix matrixLU_; /* LU matrix */
163
164 void compute_matrix_LU(const IntervalMatrix &M, double nonzero);
165 static IntervalMatrix build_LU_bounds(const IntervalMatrix &E);
166 };
167
168inline const IntervalMatrix &IntvFullPivLU::matrix_LU() const {
169 return this->matrixLU_;
170}
171inline const Eigen::FullPivLU<Matrix>::PermutationPType
173 return this->_LU.permutationP();
174}
175inline const Eigen::FullPivLU<Matrix>::PermutationQType
177 return this->_LU.permutationQ();
178}
179inline const Eigen::FullPivLU<Matrix> &IntvFullPivLU::eigen_LU() const {
180 return this->_LU;
181}
182
183template<typename Derived>
185 (const Eigen::MatrixBase<Derived> &M) const
186{
187 int rk = this->rank().lb();
188 if (rk==0) {
189 return Derived::Zero(M.rows(),1);
190 /* NdDamien : où est-ce qu'on dit que Derived est une
191 matrice ??? je crois que je hais le C++ ;) */
192 }
193 Derived ret =
194 Derived::Zero(M.rows(),rk);
195 Index p = 0;
196 Index dim = std::min(matrixLU_.rows(),matrixLU_.cols());
197 auto Q = this->_LU.permutationQ();
198 for (Index i = 0; i<dim; i++) {
199 if (!matrixLU_(i,i).contains(0.0)) {
200 ret.col(p) = M.col(Q.indices().coeff(i));
201 p++;
202 }
203 }
204 return ret;
205}
206
207
208}
209
210
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62
double lb() const
Returns the lower bound of this.
Definition codac2_Interval_impl.h:102
Interval rank() const
return a interval enclosing the rank. Quite precise for square matrix (number of diagonal elements of...
BoolInterval is_invertible() const
check if the initial matrix is invertible i.e. it is square and full rank
IntvFullPivLU(const Matrix &M)
constructor from Matrix of double
const Eigen::FullPivLU< Matrix >::PermutationPType & permutation_P() const
the permutation P in the decomposition P{-1}LUQ{-1}
Definition codac2_IntvFullPivLU.h:172
IntervalMatrix kernel() const
overapproximation of the kernel space as a matrix of column vectors. any vector V which is not a line...
Interval dimension_of_kernel() const
approximation of the size of the kernel space. based on the result of rank() (number of cols-rank())....
const Eigen::FullPivLU< Matrix >::PermutationQType & permutation_Q() const
the permutation Q in the decomposition P{-1}LUQ{-1}
Definition codac2_IntvFullPivLU.h:176
BoolInterval is_injective() const
check if the matrix is injective, i.e. its rank is equal to its number of rows.
IntvFullPivLU(const IntervalMatrix &M)
constructor from Matrix of intervals. Eigen decomposition is done on M.mid().
Interval determinant() const
return an interval enclosing the determinant
IntervalMatrix solve(const IntervalMatrix &rhs) const
equation solving M X = rhs precisely look for solutions where the only non-zero values are those on n...
BoolInterval is_surjective() const
check if the matrix is surjective i.e. its rank is equal to its number of cols.
IntervalMatrix reconstructed_matrix() const
rebuilding of the matrix, ie compute P^{-1}[L][U]Q^{-1} can be used to evaluate the precision of the ...
const Eigen::FullPivLU< Matrix > & eigen_LU() const
the Eigen decomposition of M.mid()
Definition codac2_IntvFullPivLU.h:179
const IntervalMatrix & matrix_LU() const
returns the matrix storing [L] and [U] ([L] for strictly lower part, [U] for upper part)
Definition codac2_IntvFullPivLU.h:168
Derived image(const Eigen::MatrixBase< Derived > &M) const
`‘underapproximation’' of the column space of the matrix, ie return a set of independant columns of t...
Definition codac2_IntvFullPivLU.h:185
double max_pivot() const
maximum magnitude of the diagonal elements of [U]
BoolInterval
Enumeration representing a boolean interval.
Definition codac2_BoolInterval.h:23