10 #ifndef EIGEN_CONDITIONESTIMATOR_H
11 #define EIGEN_CONDITIONESTIMATOR_H
17 template <
typename Vector,
typename RealVector,
bool IsComplex>
20 const RealVector v_abs =
v.cwiseAbs();
22 .select(Vector::Ones(
v.size()),
v.cwiseQuotient(v_abs));
27 template <
typename Vector>
31 .select(-Vector::Ones(
v.size()), Vector::Ones(
v.size()));
55 template <
typename Decomposition>
66 const Index n = dec.rows();
71 #ifdef __INTEL_COMPILER
73 #pragma warning ( disable : 2259 )
76 #ifdef __INTEL_COMPILER
94 Index v_max_abs_index = -1;
95 Index old_v_max_abs_index = v_max_abs_index;
96 for (
int k = 0; k < 4; ++k)
99 if (k > 0 && !
is_complex && sign_vector == old_sign_vector) {
104 v = dec.adjoint().solve(sign_vector);
105 v.real().cwiseAbs().maxCoeff(&v_max_abs_index);
106 if (v_max_abs_index == old_v_max_abs_index) {
111 v = dec.solve(Vector::Unit(
n, v_max_abs_index));
112 lower_bound =
v.template lpNorm<1>();
113 if (lower_bound <= old_lower_bound) {
118 old_sign_vector = sign_vector;
120 old_v_max_abs_index = v_max_abs_index;
121 old_lower_bound = lower_bound;
137 alternating_sign = -alternating_sign;
141 return numext::maxi(lower_bound, alternate_lower_bound);
157 template <
typename Decomposition>
168 : (
RealScalar(1) / inverse_matrix_norm) / matrix_norm);