//#define TRIQS_ARRAYS_ENFORCE_BOUNDCHECK #include #include #include namespace tql= triqs::clef; namespace tqa= triqs::arrays; using tqa::range; using triqs::arrays::make_shape; using triqs::gfs::gf; using triqs::gfs::gf_view; using triqs::gfs::block_index; using triqs::gfs::Fermion; using triqs::gfs::imfreq; using triqs::gfs::imtime; using triqs::gfs::make_gf; using triqs::gfs::make_block_gf; using triqs::gfs::make_gf_view; #define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) < (beta, Fermion, make_shape(2,2)); auto G2 = make_gf (beta, Fermion, make_shape(2,2)); auto G3 = make_gf (beta, Fermion, make_shape(2,2)); //auto BBB = make_block_gf ({G1,G2,G2}); //auto BBB2 = make_gf> ({G1,G2,G2}); std::vector > V ; V.push_back(G1); V.push_back(G2); V.push_back(G3); std::vector > Vv; // = { G1,G2,G3}; Vv.push_back(G1); Vv.push_back(G2); Vv.push_back(G3); std::cout <<" Building gf_view of view"<< std::endl ; auto GF_v = make_gf_view> (Vv); std::cout <<" Building gf_view of gf"<< std::endl ; auto GF = make_gf_view> (V); //{G1,G2,G3}); //auto GF = make_gf_view> ( std::vector > {G1,G2,G3}); std::cout << "Number of blocks " << GF.mesh().size()<> G9; G9 = make_gf> (2, make_gf(beta, Fermion, make_shape(2,2))); // Operation g0.on_mesh(0) = 3.2; TEST( GF[0](0) ) ; GF = GF/2; TEST( GF[0](0) ) ; //TEST( g0("3.2") ) ; //TEST( GF(0)(0) ) ; // try the loop over the block. for (auto g : GF) { g.on_mesh(0) = 20;} }