3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 06:14:14 +01:00

gfs: cleaning code.

Using construction delegation to simplify code.
This commit is contained in:
Olivier Parcollet 2013-10-20 19:05:11 +02:00
parent cbf2142af6
commit e48a451550
2 changed files with 3 additions and 9 deletions

View File

@ -36,10 +36,7 @@ namespace triqs { namespace gfs {
gf_mesh() = default;
gf_mesh (typename B::domain_t const & d, int Nmax = 1025) :
B(d, d.statistic==Fermion?m1(d.beta):0, d.statistic==Fermion?(2*Nmax+1)*m1(d.beta): 2*Nmax*m1(d.beta), Nmax, without_last){}
// use delegating...
gf_mesh (double beta, statistic_enum S, int Nmax = 1025) :
//gf_mesh({beta,S}, Nmax){}
B(typename B::domain_t(beta,S), S==Fermion?m1(beta):0, S==Fermion?(2*Nmax+1)*m1(beta): 2*Nmax*m1(beta), Nmax, without_last){}
gf_mesh (double beta, statistic_enum S, int Nmax = 1025) : gf_mesh({beta,S}, Nmax){}
};
namespace gfs_implementation {

View File

@ -35,11 +35,8 @@ namespace triqs { namespace gfs {
template<typename Opt> struct gf_mesh<imtime,Opt> : linear_mesh<matsubara_domain<false>> {
typedef linear_mesh<matsubara_domain<false>> B;
gf_mesh() = default;
gf_mesh (typename B::domain_t d, int n_time_slices, mesh_kind mk=half_bins):
B( d, 0, d.beta, n_time_slices, mk){}
gf_mesh (double beta, statistic_enum S, int n_time_slices, mesh_kind mk=half_bins):
//gf_mesh( {beta,S}, n_time_slices, mk){}
B( typename B::domain_t(beta,S), 0, beta, n_time_slices, mk){}
gf_mesh(typename B::domain_t d, int n_time_slices, mesh_kind mk = half_bins) : B(d, 0, d.beta, n_time_slices, mk) {}
gf_mesh (double beta, statistic_enum S, int n_time_slices, mesh_kind mk=half_bins): gf_mesh( {beta,S}, n_time_slices, mk){}
};
namespace gfs_implementation {