Commit 0a5070f0 authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

Update namespace scope for hessenberg and documentation

parent eafaf446
......@@ -2039,7 +2039,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
PREDEFINED = FABULOUS_USE_CHAMELEON=1
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
......
......@@ -5,8 +5,10 @@
#include <iostream>
namespace fabulous {
namespace bgcr {
template<class S> class BGCR;
};
};
#include "fabulous/data/Block.hpp"
#include "fabulous/data/Base.hpp"
......@@ -21,7 +23,7 @@ namespace fabulous {
namespace bgcr {
/**
* \brief %Block General Minimum Residual (%BGCR) algorithm
* \brief %Block General Conjugate Residual (%BGCR) algorithm
*/
template<class S>
class BGCR
......
......@@ -5,8 +5,10 @@
#include <iostream>
namespace fabulous {
namespace bgmres {
template<class S> class BGMRes;
};
};
#include "fabulous/data/Block.hpp"
#include "fabulous/data/Base.hpp"
......
......@@ -2,8 +2,10 @@
#define FABULOUS_ARNOLDI_DR_HPP
namespace fabulous {
namespace bgmres {
template<class HESSENBERG, class S> class ArnoldiDR;
};
};
#include "fabulous/data/Base.hpp"
#include "fabulous/data/Block.hpp"
......
......@@ -2,8 +2,10 @@
#define FABULOUS_ARNOLDI_IB_HPP
namespace fabulous {
namespace bgmres {
template<class HESSENBERG, class S> class ArnoldiIB;
};
};
#include "fabulous/data/Base.hpp"
#include "fabulous/data/BlockWP.hpp"
......
......@@ -2,8 +2,10 @@
#define FABULOUS_ARNOLDI_IB_DR_HPP
namespace fabulous {
namespace bgmres {
template<class HESSENBERG, class S> class ArnoldiIBDR;
};
};
#include "fabulous/data/Base.hpp"
#include "fabulous/data/BlockWP.hpp"
......
......@@ -15,8 +15,10 @@
#include <morse.h>
namespace fabulous {
namespace bgmres {
template<class S> class HessChamQR;
};
};
#include "fabulous/utils/Arithmetic.hpp"
#include "fabulous/utils/Error.hpp"
......@@ -28,6 +30,7 @@ template<class S> class HessChamQR;
#include "fabulous/data/MorseDesc.hpp"
namespace fabulous {
namespace bgmres {
inline std::string make_quad_key(int i, int j, int m, int n)
{
......@@ -364,6 +367,7 @@ public:
}; // end class HessChamQR
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_USE_CHAMELEON
......
......@@ -4,7 +4,9 @@
#ifdef FABULOUS_USE_CHAMELEON
namespace fabulous {
template< class > class HessChamTLDR;
namespace bgmres {
template<class> class HessChamTLDR;
};
};
#include "fabulous/kernel/chameleon-toplevel.hpp"
......@@ -12,6 +14,7 @@ template< class > class HessChamTLDR;
#include "fabulous/utils/Logger.hpp"
namespace fabulous {
namespace bgmres {
/*!
* \brief The Hessenberg in the standard BGMres case
......@@ -28,7 +31,7 @@ namespace fabulous {
* \warning the whole matrix is allocated, its size is driven by
* the restart parameter.
*/
template< class S >
template<class S>
class HessChamTLDR : public Block<S>
{
public:
......@@ -196,6 +199,7 @@ public:
}; // end class HessChamTLDR
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_USE_CHAMELEON
......
......@@ -2,8 +2,10 @@
#define FABULOUS_HESS_DR_HPP
namespace fabulous {
namespace bgmres {
template<class S> class HessDR;
};
};
#include "fabulous/kernel/blas.hpp"
#include "fabulous/kernel/gels.hpp"
......@@ -11,6 +13,7 @@ template<class S> class HessDR;
#include "fabulous/utils/Logger.hpp"
namespace fabulous {
namespace bgmres {
/**
* \brief The Hessenberg in the standard BGMres case
......@@ -192,6 +195,7 @@ public:
}; // end class HessDR
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_HESS_DR_HPP
......@@ -5,8 +5,10 @@
#include <cassert>
namespace fabulous {
namespace bgmres {
template<class> class HessIB;
};
};
#include "fabulous/data/BlockWP.hpp"
#include "fabulous/kernel/blas.hpp"
......@@ -14,6 +16,7 @@ template<class> class HessIB;
#include "fabulous/utils/Logger.hpp"
namespace fabulous {
namespace bgmres {
/**
* \brief Hessenberg for IB-BGMRes version.
......@@ -370,6 +373,7 @@ public:
}; // end class HessIB
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_HESS_IB_HPP
......@@ -5,8 +5,10 @@
#include <cassert>
namespace fabulous {
namespace bgmres {
template<class> class HessIBDR;
};
};
#include "fabulous/data/BlockWP.hpp"
#include "fabulous/kernel/blas.hpp"
......@@ -14,6 +16,7 @@ template<class> class HessIBDR;
#include "fabulous/utils/Logger.hpp"
namespace fabulous {
namespace bgmres {
/**
* \brief Hessenberg for IB-BGMRes version.
......@@ -457,8 +460,10 @@ public:
_nb_eigen_pair = nb_eigen_pair;
increase(nb_eigen_pair);
}
};
}; // end class HessIBDR
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_HESS_IB_DR_HPP
......@@ -2,8 +2,10 @@
#define FABULOUS_HESS_QR_HPP
namespace fabulous {
namespace bgmres {
template<class> class HessQR;
};
};
#include "fabulous/kernel/blas.hpp"
#include "fabulous/kernel/qrf.hpp"
......@@ -12,6 +14,7 @@ template<class> class HessQR;
#include "fabulous/utils/Logger.hpp"
namespace fabulous {
namespace bgmres {
/**
* \brief Hessenberg for Incremental QR version
......@@ -228,6 +231,7 @@ public:
}; // end class HessQR
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_HESS_QR_HPP
......@@ -2,8 +2,10 @@
#define FABULOUS_HESS_QR_DR_HPP
namespace fabulous {
namespace bgmres {
template<class> class HessQRDR;
};
};
#include "fabulous/kernel/blas.hpp"
#include "fabulous/kernel/qrf.hpp"
......@@ -12,6 +14,7 @@ template<class> class HessQRDR;
#include "fabulous/utils/Logger.hpp"
namespace fabulous {
namespace bgmres {
/**
* \brief Hessenberg for Incremental QR version with Deflated Restarting
......@@ -303,6 +306,7 @@ public:
}; // end class HessQRDR
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_HESS_QR_DR_HPP
......@@ -5,8 +5,10 @@
#include <cassert>
namespace fabulous {
namespace bgmres {
template<class> class HessQRIBDR;
};
};
#include "fabulous/data/BlockWP.hpp"
#include "fabulous/kernel/blas.hpp"
......@@ -15,6 +17,7 @@ template<class> class HessQRIBDR;
#include "fabulous/utils/Logger.hpp"
namespace fabulous {
namespace bgmres {
/*!
* \brief Hessenberg for IB-BGMRes version.
......@@ -707,8 +710,10 @@ public:
_nb_eigen_pair = nb_eigen_pair;
increase(nb_eigen_pair);
}
};
}; // end class HessQRIBDR
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_HESS_QR_IB_DR_HPP
......@@ -2,8 +2,11 @@
#define ARNOLDI_ORTHO_BLOCK_HPP
namespace fabulous {
class Orthogonalizer;
namespace bgmres {
template<class HESS> class OrthogonalizerBlockSTD;
};
};
#include "fabulous/utils/Traits.hpp"
#include "fabulous/data/Base.hpp"
......@@ -12,6 +15,7 @@ template<class HESS> class OrthogonalizerBlockSTD;
#include "fabulous/kernel/QR.hpp"
namespace fabulous {
namespace bgmres {
/**
* \brief Orthogonalization methods for BLOCK variants WITHOUT Inexact Breakdown
......@@ -20,7 +24,7 @@ template<class HESS>
class OrthogonalizerBlockSTD : public OrthogonalizerBlockCOMMON
{
private:
friend class Orthogonalizer;
friend class ::fabulous::Orthogonalizer;
OrthogonalizerBlockSTD(const OrthoParam &param):
OrthogonalizerBlockCOMMON{param}
......@@ -49,6 +53,7 @@ private:
}
};
}; // end namespace bgmres
}; // end namespace fabulous
#endif // ARNOLDI_ORTHO_BLOCK_HPP
......@@ -2,7 +2,9 @@
#define ARNOLDI_ORTHO_BLOCK_CGR_HPP
namespace fabulous {
class OrthogonalizerBlockCGR;
namespace bgcr {
class OrthogonalizerBlock;
};
};
#include <cassert>
......@@ -15,24 +17,17 @@ class OrthogonalizerBlockCGR;
#include "fabulous/kernel/flops.hpp"
namespace fabulous {
namespace bgcr {
/**
* \brief Orthogonalization methods for BLOCK variants
* \brief Orthogonalization method for BLOCK variants of GCR algorithm
*/
class OrthogonalizerBlockCGR : public OrthoParam
class OrthogonalizerBlock : public OrthoParam
{
private:
int64_t _nb_flops;
const int _nbrhs_alloc;
public:
OrthogonalizerBlockCGR(const OrthoParam &param, int nbrhs_alloc):
OrthoParam{param},
_nb_flops{0},
_nbrhs_alloc{nbrhs_alloc}
{
}
private:
/**
* \brief Orthogonalization process (Iterated Modified Gram Schmidt)
......@@ -91,6 +86,13 @@ private:
}
public:
OrthogonalizerBlock(const OrthoParam &param, int nbrhs_alloc):
OrthoParam{param},
_nb_flops{0},
_nbrhs_alloc{nbrhs_alloc}
{
}
/**
* \brief Orthogonalization process dispatcher.
*
......@@ -125,6 +127,7 @@ public:
}; // end class OrthogonalizerBlockCGR
}; // end namespace bgcr
}; // end namespace fabulous
#endif // ARNOLDI_ORTHO_BLOCK_CGR_HPP
......@@ -2,8 +2,11 @@
#define ARNOLDI_ORTHO_BLOCK_IB_HPP
namespace fabulous {
class Orthogonalizer;
namespace bgmres {
template<class HESS> class OrthogonalizerBlockIB;
};
};
#include "fabulous/utils/Traits.hpp"
#include "fabulous/data/Base.hpp"
......@@ -12,6 +15,7 @@ template<class HESS> class OrthogonalizerBlockIB;
#include "fabulous/kernel/QR.hpp"
namespace fabulous {
namespace bgmres {
/**
* \brief Orthogonalization methods for BLOCK variants WITH Inexact Breakdown
......@@ -20,7 +24,7 @@ template<class HESS>
class OrthogonalizerBlockIB : public OrthogonalizerBlockCOMMON
{
private:
friend class Orthogonalizer;
friend class ::fabulous::Orthogonalizer;
OrthogonalizerBlockIB(const OrthoParam &param):
OrthogonalizerBlockCOMMON{param}
......@@ -53,6 +57,7 @@ private:
}; // end class OrthogonalizerBlockIB
}; // end namespace bgmres
}; // end namespace fabulous
#endif // ARNOLDI_ORTHO_BLOCK_IB_HPP
......@@ -2,8 +2,10 @@
#define ARNOLDI_ORTHO_BLOCK_COMMON_HPP
namespace fabulous {
namespace bgmres {
class OrthogonalizerBlockCOMMON;
};
};
#include <cassert>
......@@ -14,6 +16,7 @@ class OrthogonalizerBlockCOMMON;
#include "fabulous/kernel/flops.hpp"
namespace fabulous {
namespace bgmres {
/**
* \brief Orthogonalization methods for BLOCK variants
......@@ -22,13 +25,8 @@ class OrthogonalizerBlockCOMMON : public OrthoParam
{
private:
int64_t _nb_flops;
protected:
OrthogonalizerBlockCOMMON(const OrthoParam &param):
OrthoParam{param},
_nb_flops{0}
{
}
private:
/**
* \brief Orthogonalisation process :: Classical Gram Schmidt
*
......@@ -213,6 +211,13 @@ protected:
}
}
protected:
OrthogonalizerBlockCOMMON(const OrthoParam &param):
OrthoParam{param},
_nb_flops{0}
{
}
/**
* \brief Orthogonalization process dispatcher.
*
......@@ -243,6 +248,7 @@ protected:
}; // end class OrthogonalizerBlockCOMMON
}; // end namespace bgmres
}; // end namespace fabulous
#endif // ARNOLDI_ORTHO_BLOCK_COMMON_HPP
......@@ -27,6 +27,9 @@ enum class OrthoScheme {
}; // namespace fabulous
namespace std {
/**
* \brief specialization of hash for enum class for defect prior c++14
*/
template<>
struct hash<::fabulous::OrthoType>
{
......@@ -40,6 +43,9 @@ struct hash<::fabulous::OrthoType>
}
};
/**
* \brief specialization of hash for enum class for defect prior c++14
*/
template<>
struct hash<::fabulous::OrthoScheme>
{
......
......@@ -27,7 +27,7 @@ private:
class = enable_if_t<handle_ib_t<HESS>::value > >
int64_t run_ruhe(HESS &H, Base &base, Block &W, Matrix &A)
{
OrthogonalizerRuheIB<HESS> ruhe{_param};
bgmres::OrthogonalizerRuheIB<HESS> ruhe{_param};
return ruhe.run(H, base, W, A);
}
......@@ -35,7 +35,7 @@ private:
class = enable_if_t<not handle_ib_t<HESS>::value >, class=void>
int64_t run_ruhe(HESS &H, Base &base, Block &W, Matrix &A)
{
OrthogonalizerRuheSTD<HESS> ruhe{_param};
bgmres::OrthogonalizerRuheSTD<HESS> ruhe{_param};
return ruhe.run(H, base, W, A);
}
......@@ -43,7 +43,7 @@ private:
class = enable_if_t<handle_ib_t<HESS>::value > >
int64_t run_block(HESS &H, Base &base, Block &W)
{
OrthogonalizerBlockIB<HESS> block{_param};
bgmres::OrthogonalizerBlockIB<HESS> block{_param};
return block.run(H, base, W);
}
......@@ -51,7 +51,7 @@ private:
class = enable_if_t<not handle_ib_t<HESS>::value >, class=void>
int64_t run_block(HESS &H, Base &base, Block &W)
{
OrthogonalizerBlockSTD<HESS> block{_param};
bgmres::OrthogonalizerBlockSTD<HESS> block{_param};
return block.run(H, base, W);
}
......@@ -86,7 +86,7 @@ public:
void run_cgr(Matrix &A, Base<S> &V, Base<S> &Z, Block<S> &W, Logger &logger, int nbrhs)
{
logger.notify_ortho_begin();
OrthogonalizerBlockCGR ortho{_param, nbrhs};
bgcr::OrthogonalizerBlock ortho{_param, nbrhs};
int64_t nb_flops = ortho.dispatch(A, V, Z, W);
logger.notify_ortho_end(nb_flops);
}
......
......@@ -2,8 +2,11 @@
#define FABULOUS_ORTHO_RUHE_HPP
namespace fabulous {
class Orthogonalizer;
namespace bgmres {
template<class HESS> class OrthogonalizerRuheSTD;
};
};
#include "fabulous/utils/Traits.hpp"
#include "fabulous/data/Base.hpp"
......@@ -13,6 +16,7 @@ template<class HESS> class OrthogonalizerRuheSTD;
#include "fabulous/kernel/flops.hpp"
namespace fabulous {
namespace bgmres {
/* **************************** RUHE ******************************** */
......@@ -24,7 +28,7 @@ class OrthogonalizerRuheSTD : public OrthoParam
{
private:
int64_t _nb_flops;
friend class Orthogonalizer;
friend class ::fabulous::Orthogonalizer;
OrthogonalizerRuheSTD(const OrthoParam &param):
OrthoParam{param},
......@@ -294,6 +298,7 @@ private:
}; // end class OrthogonalizerRuheSTD
}; // end namespace fabulous;
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_ORTHO_RUHE_HPP
......@@ -2,8 +2,11 @@
#define FABULOUS_ARNOLDI_ORTHO_RUHE_IB_HPP
namespace fabulous {
class Orthogonalizer;
namespace bgmres {
template<class HESS> class OrthogonalizerRuheIB;
};
};
#include "fabulous/data/Base.hpp"
#include "fabulous/data/BlockWP.hpp"
......@@ -17,6 +20,7 @@ template<class HESS> class OrthogonalizerRuheIB;
/* **************************** METHODS ******************************** */
namespace fabulous {
namespace bgmres {
/**
* \brief Orthogonalization methods for RUHE variant WITH Inexact Breakdown
......@@ -26,7 +30,7 @@ class OrthogonalizerRuheIB : public OrthoParam
{
private:
int64_t _nb_flops;
friend class Orthogonalizer;
friend class ::fabulous::Orthogonalizer;
OrthogonalizerRuheIB(const OrthoParam &param):
OrthoParam{param}
......@@ -379,6 +383,7 @@ private:
}; // end class OrthogonalizerRuheIB
}; // end namespace bgmres
}; // end namespace fabulous
#endif // FABULOUS_ARNOLDI_ORTHO_RUHE_IB_HPP
......@@ -16,11 +16,10 @@
#include "fabulous/restart/Restarter.hpp"
namespace fabulous {
namespace bgmres {
template<class> class HessIBDR;
namespace bgmres {
/*!
* \brief Handle the Deflated Restarting with eigen values
*/
......@@ -380,7 +379,6 @@ public:
}; // end class Restarter
}; // end namespace bgmres
}; // end namespace fabulous
......
......@@ -13,7 +13,7 @@ template <template<class> class U> struct Algorithm;
namespace fabulous {
/**
* \brief type holder Object
* \brief %type holder Object
*/
template <class T>
struct Type
......
......@@ -18,7 +18,6 @@ namespace bgmres {
template<class HESSENBERG, class S> class ArnoldiIB;
template<class HESSENBERG, class S> class ArnoldiDR;
template<class HESSENBERG, class S> class ArnoldiIBDR;
};// end namespace bgmres
template<class> class HessDR;
template<class> class HessQR;
......@@ -32,6 +31,7 @@ template<class> class HessChamTLDR;
template<class> class HessChamQR;
#endif
};// end namespace bgmres
}; // end namespace fabulous
namespace fabulous {
......@@ -44,7 +44,7 @@ struct arnoldiXhessenberg : public std::false_type {};
#define FABULOUS_ARNOLDI_X_HESSENBERG(ARNOLDI, HESSENBERG) \
template<class S> \
struct arnoldiXhessenberg<bgmres::ARNOLDI<HESSENBERG<S>, S>, HESSENBERG<S>> \
struct arnoldiXhessenberg<bgmres::ARNOLDI<bgmres::HESSENBERG<S>, S>, bgmres::HESSENBERG<S>> \
: public std::true_type {}; \
FABULOUS_ARNOLDI_X_HESSENBERG(ArnoldiDR, HessDR);
......@@ -68,12 +68,12 @@ struct hessenbergXrestarter : public std::false_type {};
#define FABULOUS_HESSENBERG_X_RESTARTER(HESSENBERG, RESTARTER) \
template<class S> \
struct hessenbergXrestarter<HESSENBERG<S>, RESTARTER> \
struct hessenbergXrestarter<bgmres::HESSENBERG<S>, RESTARTER> \
: public std::true_type {}; \
#define FABULOUS_HESSENBERG_X_RESTARTER_S(HESSENBERG, RESTARTER) \
template<class S> \
struct hessenbergXrestarter<HESSENBERG<S>, RESTARTER<S>> \
struct hessenbergXrestarter<bgmres::HESSENBERG<S>, RESTARTER<S>> \
: public std::true_type {}; \
FABULOUS_HESSENBERG_X_RESTARTER(HessDR, ClassicRestart);
......@@ -107,12 +107,15 @@ FABULOUS_HESSENBERG_X_RESTARTER(HessChamQR, ClassicRestart);
template<class HESS> struct handle_ib_t : public std::false_type {};
#define FABULOUS_HESSENBERG_HANDLE_IB(HESSENBERG) \
template<class S> \
struct handle_ib_t<HESSENBERG<S>> : public std::true_type {};
struct handle_ib_t<bgmres::HESSENBERG<S>> : public std::true_type {};
FABULOUS_HESSENBERG_HANDLE_IB(HessIB);
FABULOUS_HESSENBERG_HANDLE_IB(HessIBDR);
FABULOUS_HESSENBERG_HANDLE_IB(HessQRIBDR);
/**
* \brief trait to check is argument type is a supported complex arithmetic type
*/
template<class S>
struct is_complex_t : public std::false_type {};
......@@ -123,6 +126,10 @@ struct is_complex_t : public std::false_type {};
FABULOUS_TYPE_TRAITS_DEF_IS_COMPLEX(std::complex<float>);
FABULOUS_TYPE_TRAITS_DEF_IS_COMPLEX(std::complex<double>);
/**
* \brief trait to check is argument type is a supported real arithmetic type
*/
template<class S>
struct is_real_t : public std::false_type {};
......
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