3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 13:53:40 +01:00
- A silly error : forgot to resize when rereading indices...
This commit is contained in:
Olivier Parcollet 2014-06-21 16:15:56 +02:00
parent c8eefe0ad6
commit 6d12c4b7f6

View File

@ -87,6 +87,8 @@ namespace gfs {
bool is_empty() const { return ind.size() == 0; } bool is_empty() const { return ind.size() == 0; }
void resize(int s) { ind.resize(s);}
template <typename G> bool check_size(G *g) const { template <typename G> bool check_size(G *g) const {
return (is_empty() || return (is_empty() ||
((ind.size() == 2) && (ind[0].size() == get_target_shape(*g)[0]) && (ind[1].size() == get_target_shape(*g)[1]))); ((ind.size() == 2) && (ind[0].size() == get_target_shape(*g)[0]) && (ind[1].size() == get_target_shape(*g)[1])));
@ -127,6 +129,7 @@ namespace gfs {
g = indices_2{}; // empty, no file g = indices_2{}; // empty, no file
return; return;
} }
g.resize(2);
h5_read(gr, "left", g.ind[0]); h5_read(gr, "left", g.ind[0]);
h5_read(gr, "right", g.ind[1]); h5_read(gr, "right", g.ind[1]);
} }