3
0
mirror of https://github.com/triqs/dft_tools synced 2024-10-31 19:23:45 +01:00

Fix reinterpret_scalar_valued_gf_as_matrix_valued

- Was not correct (bubble_scalar) because of missing start_shift
  for multivar gf.
This commit is contained in:
Olivier Parcollet 2014-10-28 16:03:03 +01:00
parent a5a3ae9d17
commit 16b5e78e8e

View File

@ -712,7 +712,10 @@ namespace gfs {
gf_view<Variable, matrix_valued, Singularity, Opt, IsConst> gf_view<Variable, matrix_valued, Singularity, Opt, IsConst>
reinterpret_scalar_valued_gf_as_matrix_valued(gf_view<Variable, scalar_valued, Singularity, Opt, IsConst> g) { reinterpret_scalar_valued_gf_as_matrix_valued(gf_view<Variable, scalar_valued, Singularity, Opt, IsConst> g) {
using a_t = typename gf_view<Variable, matrix_valued, Singularity, Opt, IsConst>::data_view_t; using a_t = typename gf_view<Variable, matrix_valued, Singularity, Opt, IsConst>::data_view_t;
auto a = a_t{typename a_t::indexmap_type(join(g.data().shape(), make_shape(1, 1))), g.data().storage()}; auto & imap = g.data().indexmap();
typename a_t::indexmap_type index_map(join(imap.lengths(), make_shape(1, 1)), join(imap.strides(), make_shape(1, 1)),
imap.start_shift());
auto a = a_t{index_map, g.data().storage()};
return {g.mesh(), a, g.singularity(), g.symmetry(), {}, g.name}; return {g.mesh(), a, g.singularity(), g.symmetry(), {}, g.name};
} }