Commit cef9e757 authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

Update doc again (IB-BGMRES-DR)

parent 54715a76
......@@ -27,3 +27,5 @@
* TODO iterated orthogonalization stop criterion
* TODO find out how to link fabulous with parallel mkl with spack
* TODO parallel(distributed) test case
* TODO distributed hessenberg (with chameleon)
......@@ -1494,14 +1494,16 @@ MATHJAX_FORMAT = HTML-CSS
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
# FIXME mathjax cdn closing on April 30
# MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
......
......@@ -151,7 +151,7 @@ public:
*
* \param[in,out] X Initial guess solution and solution in ouput
* \param[in] B Block containing Right Hand Side
* \param maxMVP Maximum number of Matrix Vector Product.
* \param max_mvp Maximum number of Matrix Vector Product.
* \param max_krylov_space_size maximum size of Krylov space
* \param[in] epsilon Target accuracy
* \param[in] restart_param DeflatedRestart or ClassicRestart instance
......
......@@ -198,7 +198,7 @@ public:
* \param max_krylov_space_size Maximum size of Krylov Search space.
* \param[in] epsilon tolerance (backward error) for residual
* \param[in,out] restarter hold data to deflate at restart
* \param ortho Orthogonalizer
* \param orthoparm Orthogonalizer
* or vector wise arnoldi. (In distributed, only the vector wise will works)
*
* \return whether the convergence was reached
......
......@@ -385,7 +385,7 @@ public:
* \param[in] B the right hand sides
* \param max_krylov_space_size maximum size for the Krylov search space
* \param[in] epsilon tolerance for Residual
* \param ortho Orthogonalizer
* \param orthoparm Orthogonalizer
* or vector wise arnoldi(RUHE). (In distributed, only the vector wise will works)
*
* \return whether the convergence was reached
......
......@@ -405,7 +405,8 @@ public:
* \param[in] B the right hand sides
* \param max_krylov_space_size maximum size for the Krylov search space
* \param[in] epsilon tolerance for Residual
* \param ortho Orthogonalizer
* \param[in,out] restarter hold data to deflate at restart
* \param orthoparm Orthogonalizer
* or vector wise arnoldi(RUHE). (In distributed, only the vector wise will works)
*
* \return whether the convergence was reached
......
......@@ -90,7 +90,7 @@ public:
}
/**
* \brief Initialize \f$ \Phi \f$ (refer to Annex, Eq 2.5)
* \brief Initialize \f$ \Phi \f$ (refer to Annex, Eq 2.5) (INEXACT BREAKDOWN ON R0)
* \param p1 number of direction kept in the inexact breakdown on R0
*/
void init_phi(int p1)
......@@ -106,8 +106,8 @@ public:
}
/**
* \brief Initialize \f$ \Phi \f$ (refer to Annex, Eq 2.5)
* \param p1 number of direction kept in the inexact breakdown on R0
* \brief Initialize \f$ \Phi \f$ (RESTART) (refer to IB-BGMRES-DR, Section 3.1.4 (Proposition 3))
* \param p1 number of eigen pair (size of first block) in deflated restarting
*/
void init_phi_restart(int p1)
{
......@@ -126,7 +126,7 @@ public:
}
/**
* \brief Update \f$\Phi\f$ if IB happened on R0
* \brief Update \f$\Phi\f$ if IB happened on R0 or restarted procedure
*
* \param[in] W1_W2 \f$ [\mathbb{W}_1, \mathbb{W}_2] \f$ packed in one block
* \param p_jplus1 \f$p_{j+1}\f$ number of directions kept in the last inexact breakdown
......@@ -161,9 +161,15 @@ public:
}
/**
* \brief Compute \f$\Lambda\f$ using \f$\Phi\f$ and \f$\Lambda_1\f$
* \brief Compute \f$\Lambda_{j}\f$ using \f$\Phi_j\f$ and \f$\Lambda_1\f$
*
* \param[out] Lambda \f$\Lambda = \Phi * \Lambda_1\f$
* \param[out] Lambda \f$ \Lambda_j = \begin{cases}
\Phi_j * \Lambda_1 & \text{if IB on R0 (IB-BGMRES-DR, eq 25)} \\
\left[ \begin{array}[cc] \\
I_{p_1} & \Phi_j \\
0_{(n_j+p-p1)\times p1} &
\end{array}\right] * \Lambda_1 & \text{if restarted procedure (annex eq 2.6)}
\end{cases} \f$
*/
void compute_Lambda(Block<S> &Lambda)
{
......
......@@ -10,6 +10,12 @@ class OrthoParam;
namespace fabulous {
/**
* \brief Parameters for orthogonalization
*
* wrapper for orthogonalization scheme, orthogonalization type, and iteration count (for IMGS/ICGS)
*/
class OrthoParam
{
protected:
......
......@@ -48,7 +48,8 @@ inline ClassicRestart classic_restart()
/**
* \brief parameters for restarting with eigen values deflation
*/
template<class S> class DeflatedRestart
template<class S>
class DeflatedRestart
{
private:
friend class Restarter<DeflatedRestart, S>;
......@@ -160,9 +161,10 @@ public:
template< class S >
class Restarter<DeflatedRestart<S>, S>
{
private:
public:
using value_type = typename Arithmetik<S>::value_type;
using primary_type = typename Arithmetik<S>::primary_type;
private:
using P = primary_type;
int _k; /*!<Number of eigen pair to keep*/
......@@ -172,20 +174,7 @@ private:
Block<S> _saved_WP; /*!< Last candidate generated; used only for IB+DR */
Block<S> _LS; /*!< Least square residual*/
public:
Restarter(const DeflatedRestart<S> &param, Base<S> &base):
_k{param._k}, _target{param._target},
_base{base}, _LS{}
{
}
operator bool () { return true; }
Base<S> &get_base() { return _base; }
template< class BLOCK > void save_LS(BLOCK &LS) { _LS = LS.copy(); }
template< class BLOCK > void save_hess(BLOCK &hess) { _saved_Hess = hess.copy(); }
template< class BLOCK > void save_WP(BLOCK &WP) { _saved_WP = WP.copy(); }
private:
std::tuple<Block<S>,Block<S>,int> compute_underline_G(int nm, int p)
{
// ALGORITHM 2; STEP 3
......@@ -267,6 +256,19 @@ public:
<<std::endl;
}
public:
Restarter(const DeflatedRestart<S> &param, Base<S> &base):
_k{param._k}, _target{param._target},
_base{base}, _LS{}
{
}
operator bool () { return true; }
Base<S> &get_base() { return _base; }
template< class BLOCK > void save_LS(BLOCK &LS) { _LS = LS.copy(); }
template< class BLOCK > void save_hess(BLOCK &hess) { _saved_Hess = hess.copy(); }
template< class BLOCK > void save_WP(BLOCK &WP) { _saved_WP = WP.copy(); }
/**
* \brief This function handle the deflation of eigenvalues at restart. (STD variant)
*
......@@ -349,6 +351,7 @@ public:
*
* \param[out] hess the new hessenberg to be filled with F1new
* \param[in] A user callback object
* \param[out] WPnew WP block for IB-BGMRES-DR algorithm
* \param[in] epsilon backward error threshold
*/
template<class Matrix>
......@@ -506,10 +509,9 @@ public:
std::cout<<Color::bold<<Color::yellow<<"\t\tDR done"<<Color::reset<<std::endl;
return Lambda1.check_precision(epsilon);
}
};
}; // end class Restarter
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_DEFLATED_RESTART_HPP
......@@ -4,6 +4,7 @@
#include <complex>
#include <type_traits>
#include "fabulous/data/Block.hpp"
#include "fabulous/kernel/LapackInterface.hpp"
namespace fabulous {
......@@ -115,8 +116,8 @@ void GetKIndexesReal( Block<std::complex<P>> &alpha, Block<S> &beta,
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
template< class S, class P >
void GetKEigenPairs(Block<std::complex<P>> & alpha,
Block<S> &beta, int k, S target, std::vector<int> &ind)
void GetKEigenPairs(Block<std::complex<P>> &alpha, Block<S> &beta,
int k, S target, std::vector<int> &ind)
{
FABULOUS_FATAL_ERROR("Should never be there\nExiting anyways\n");
}
......@@ -160,8 +161,8 @@ void GetKEigenPairs(Block<std::complex<double>> &alpha,
* \f$ || A*v - \lambda B * v || \f$
*/
template< class S, class P >
void CheckEigenResults(Block<S>& A, Block<S>& B, Block<S>& vr,
Block<std::complex<P>> &alpha, Block<S>& beta)
void CheckEigenResults(Block<S> &A, Block<S> &B, Block<S> &vr,
Block<std::complex<P>> &alpha, Block<S> &beta)
{
int dim = A.get_nb_row();
Block<S> res{dim,dim};
......@@ -201,6 +202,6 @@ void CheckEigenResults(Block<S>& A, Block<S>& B, Block<S>& vr,
<<minmax.second / std::max(normA,normB)<<"\n";
}
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_EIGEN_UTILS_HPP
......@@ -98,6 +98,12 @@ HESSENBERG_X_RESTARTER(HessChamQR, ClassicRestart);
#endif
/**
* \brief tell if hessenberg handle Inexact Breakdown
*
* This class have a boolean const static member 'value'
* telling wether the Hessenberg handle Inexact Breakdown.
*/
template<class HESS> struct handle_ib_t : public std::false_type {};
#define HESSENBERG_HANDLE_IB(HESSENBERG) \
template<class S> \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment