From 33b120948dc63f66ee257ef7a0fb49cc4f9342ba Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Fri, 13 Jun 2014 17:58:05 +0200 Subject: [PATCH] gf: inverse for gf_view and gf - correction --- triqs/gfs/gf.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/triqs/gfs/gf.hpp b/triqs/gfs/gf.hpp index 9f0a738b..722b859e 100644 --- a/triqs/gfs/gf.hpp +++ b/triqs/gfs/gf.hpp @@ -676,12 +676,17 @@ namespace gfs { g.singularity() = inverse(g.singularity()); } - template gf inverse(gf_view g) { - auto res = gf(g); - invert_in_place(res); + template gf inverse(gf const & g) { + auto res = g; + gf_view v = res; + invert_in_place(v); return res; } + template gf inverse(gf_view g) { + return inverse(gf(g)); + } + // ---- transpose : a new gf template