28#include <initializer_list>
91 return {b, std::move(v)};
102 template <
typename V,
typename T,
typename L>
119 return {details::_make_block_names1(
sizeof...(G) + 1), {std::forward<G0>(g0), std::forward<G>(g)...}};
130 static_assert(Gf::is_view);
131 return {details::_make_block_names1(v.size()), v};
136 static_assert(Gf::is_view);
137 return {details::_make_block_names1(v.size()), std::move(v)};
149 static_assert(Gf::is_view);
150 return {std::move(b), v};
155 static_assert(Gf::is_view);
156 return {std::move(b), std::move(v)};
171 return {details::_make_block_names1(
sizeof...(G) + 1), {std::forward<G0>(g0), std::forward<G>(g)...}};
182 static_assert(Gf::is_view);
183 return {details::_make_block_names1(v.size()), v};
188 static_assert(Gf::is_view);
189 return {details::_make_block_names1(v.size()), std::move(v)};
201 static_assert(Gf::is_view);
202 return {std::move(b), v};
207 static_assert(Gf::is_view);
208 return {std::move(b), std::move(v)};
222 template <
typename V,
typename T,
typename L>
block2_gf<V, T, L> make_block2_gf(
int n,
int p,
gf<V, T, L> const &g) {
return {n, p, g}; }
236 template <
typename V,
typename T,
typename L>
239 if (block_names1.size() != vv.size())
240 TRIQS_RUNTIME_ERROR <<
"make_block2_gf(vector<string>, vector<string>>, vector<vector<gf>>): incompatible outer vector size!";
241 for (
auto const &v : vv) {
242 if (block_names2.size() != v.size())
243 TRIQS_RUNTIME_ERROR <<
"make_block2_gf(vector<string>, vector<string>>, vector<vector<gf>>): incompatible inner vector size!";
245 return {{block_names1, block_names2}, std::move(vv)};
258 static_assert(Gf::is_view);
259 if (v.size() == 0)
return {details::_make_block_names2(0, 0), v};
260 return {details::_make_block_names2(v.size(), v[0].size()), v};
265 static_assert(Gf::is_view);
266 if (v.size() == 0)
return {details::_make_block_names2(0, 0), v};
267 return {details::_make_block_names2(v.size(), v[0].size()), std::move(v)};
279 template <
typename Gf>
281 std::vector<std::vector<Gf>> &v) {
282 static_assert(Gf::is_view);
283 return {{std::move(block_names1), std::move(block_names2)}, v};
287 template <
typename Gf>
289 std::vector<std::vector<Gf>> &&v) {
290 static_assert(Gf::is_view);
291 return {{std::move(block_names1), std::move(block_names2)}, std::move(v)};
304 static_assert(Gf::is_view);
305 if (v.size() == 0)
return {details::_make_block_names2(0, 0), v};
306 return {details::_make_block_names2(v.size(), v[0].size()), v};
311 static_assert(Gf::is_view);
312 if (v.size() == 0)
return {details::_make_block_names2(0, 0), v};
313 return {details::_make_block_names2(v.size(), v[0].size()), std::move(v)};
325 template <
typename Gf>
327 std::vector<std::vector<Gf>> &v) {
328 static_assert(Gf::is_view);
329 return {{std::move(block_names1), std::move(block_names2)}, v};
333 template <
typename Gf>
335 std::vector<std::vector<Gf>> &&v) {
336 static_assert(Gf::is_view);
337 return {{std::move(block_names1), std::move(block_names2)}, std::move(v)};
Provides the block Green's function container.
The owning block Green's function container.
The owning Green's function container.
TRIQS exception hierarchy and related macros.
block_gf< Mesh, Target, Layout, 2 > block2_gf
Owning two-index block Green's function (a matrix of blocks).
block_gf_const_view_of< G0 > make_block_gf_const_view(G0 &&g0, G &&...g)
Make a triqs::gfs::block_gf_const_view from a list of Green's function views (block names default to ...
block2_gf_const_view_of< Gf > make_block2_gf_const_view(std::vector< std::vector< Gf > > &v)
Make a triqs::gfs::block2_gf_const_view from a matrix of views (block names default to "0",...
block2_gf_view_of< Gf > make_block2_gf_view(std::vector< std::vector< Gf > > &v)
Make a triqs::gfs::block2_gf_view from a matrix of views (block names default to "0",...
block_gf_view_of< G0 > make_block_gf_view(G0 &&g0, G &&...g)
Make a triqs::gfs::block_gf_view from a list of Green's function views (block names default to "0",...
block2_gf< V, T, L > make_block2_gf(int n, int p, gf< V, T, L > const &g)
Make a triqs::gfs::block2_gf of n x p copies of a Green's function.
block_gf< V, T, L > make_block_gf(int n, gf< V, T, L > const &g)
Make a triqs::gfs::block_gf of n copies of a Green's function (block names default to "0",...
block2_gf_const_view< get_mesh_t< G >, get_target_t< G > > block2_gf_const_view_of
The triqs::gfs::block2_gf_const_view type matching the mesh and target of G.
block2_gf_view< get_mesh_t< G >, get_target_t< G > > block2_gf_view_of
The triqs::gfs::block2_gf_view type matching the mesh and target of G.
block_gf_const_view< get_mesh_t< G >, get_target_t< G > > block_gf_const_view_of
The triqs::gfs::block_gf_const_view type matching the mesh and target of G.
block_gf_view< get_mesh_t< G >, get_target_t< G > > block_gf_view_of
The triqs::gfs::block_gf_view type matching the mesh and target of G.
#define TRIQS_RUNTIME_ERROR
Throw a triqs::runtime_error with the current source location.