using PreconditionBlockBase<inverse_type>::inverse;
using PreconditionBlockBase<inverse_type>::inverse_householder;
using PreconditionBlockBase<inverse_type>::inverse_svd;
+ using PreconditionBlockBase<inverse_type>::log_statistics;
/**
* @deprecated Use size() instead
*/
using PreconditionBlock<MATRIX, inverse_type>::set_same_diagonal;
using PreconditionBlock<MATRIX, inverse_type>::invert_diagblocks;
using PreconditionBlock<MATRIX, inverse_type>::set_permutation;
+ using PreconditionBlockBase<inverse_type>::log_statistics;
/**
* Execute block SOR
using PreconditionBlockBase<inverse_type>::inverse;
using PreconditionBlockBase<inverse_type>::inverse_householder;
using PreconditionBlockBase<inverse_type>::inverse_svd;
+ using PreconditionBlockBase<inverse_type>::log_statistics;
using PreconditionBlockSOR<MATRIX,inverse_type>::set_permutation;
using PreconditionBlockSOR<MATRIX, inverse_type>::empty;
using PreconditionBlockSOR<MATRIX, inverse_type>::el;
*/
const FullMatrix<number>& diagonal (unsigned int i) const;
- /**
- * Determine an estimate for the
- * memory consumption (in bytes)
- * of this object.
- */
+ /**
+ * Print some statistics about
+ * the inverses to #deallog. Output depends
+ * on #Inversion. It is richest
+ * for svd, where we obtain
+ * statistics on extremal
+ * singular values and condition
+ * numbers.
+ */
+ void log_statistics () const;
+
+ /**
+ * Determine an estimate for the
+ * memory consumption (in bytes)
+ * of this object.
+ */
std::size_t memory_consumption () const;
/**
}
+template <typename number>
+inline void
+PreconditionBlockBase<number>::log_statistics () const
+{
+ deallog << "PreconditionBlockBase: " << size() << " blocks; ";
+
+ if (inversion == svd)
+ {
+ unsigned int kermin = 100000000, kermax = 0;
+ double sigmin = 1.e300, sigmax= -1.e300;
+ double kappamin = 1.e300, kappamax= -1.e300;
+
+ for (unsigned int b=0;b<size();++b)
+ {
+ const LAPACKFullMatrix<number>& matrix = inverse_svd(b);
+ unsigned int k=1;
+ while (k <= matrix.n_cols() && matrix.singular_value(matrix.n_cols()-k) == 0)
+ ++k;
+ const double s0 = matrix.singular_value(0);
+ const double sm = matrix.singular_value(matrix.n_cols()-k);
+ const double co = sm/s0;
+
+ if (kermin > k) kermin = k-1;
+ if (kermax < k) kermax = k-1;
+ if (s0 < sigmin) sigmin = s0;
+ if (sm > sigmax) sigmax = sm;
+ if (co < kappamin) kappamin = co;
+ if (co > kappamax) kappamax = co;
+ }
+ deallog << "dim ker [" << kermin << ':' << kermax
+ << "] sigma [" << sigmin << ':' << sigmax
+ << "] kappa [" << kappamin << ':' << kappamax << ']' << std::endl;
+
+ }
+ else if (inversion == householder)
+ {
+ }
+ else if (inversion == gauss_jordan)
+ {
+ }
+ else
+ {
+ Assert(false, ExcNotImplemented());
+ }
+}
+
+
template <typename number>
inline
std::size_t
* Make function of base class public again.
*/
using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
- /**
+ using PreconditionBlockBase<inverse_type>::log_statistics;
+ /**
* Perform one step of the Jacobi
* iteration.
*/
* Make function of base class public again.
*/
using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
+ using PreconditionBlockBase<inverse_type>::log_statistics;
/**
* Perform one step of the SOR
* iteration.
* Make function of base class public again.
*/
using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
+ using PreconditionBlockBase<inverse_type>::log_statistics;
/**
* Perform one step of the SOR
* iteration.