From e48a45155023383bff1071dc951ff0a2786f02cc Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Sun, 20 Oct 2013 19:05:11 +0200 Subject: [PATCH] gfs: cleaning code. Using construction delegation to simplify code. --- triqs/gfs/imfreq.hpp | 5 +---- triqs/gfs/imtime.hpp | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/triqs/gfs/imfreq.hpp b/triqs/gfs/imfreq.hpp index 6fe9ff16..e68cb44b 100644 --- a/triqs/gfs/imfreq.hpp +++ b/triqs/gfs/imfreq.hpp @@ -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 { diff --git a/triqs/gfs/imtime.hpp b/triqs/gfs/imtime.hpp index b8be46ea..edab8ab0 100644 --- a/triqs/gfs/imtime.hpp +++ b/triqs/gfs/imtime.hpp @@ -35,11 +35,8 @@ namespace triqs { namespace gfs { template struct gf_mesh : linear_mesh> { typedef linear_mesh> 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 {