#define TRIQS_ARRAYS_ENFORCE_BOUNDCHECK #include using namespace triqs::gfs; using namespace triqs::arrays; #define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) < // example //template using block_gf = gf>; // block_gf ... // but not on gcc 4.6 ! // int main() { try { triqs::gfs::freq_infty inf; double beta =1; auto G = gf{ {beta, Fermion}, {2,2} }; auto Gc = gf{ {beta, Fermion}, {2,2} }; auto G3 = gf{ {beta, Fermion}, {2,2} }; auto Gt = gf{ {beta, Fermion,100}, {2,2} }; auto Gv = G(); TEST( G( 0) ) ; Gv.on_mesh(0) = 20; TEST( Gv( 0) ) ; TEST( G( 0) ) ; Gv.on_mesh(0) = 0; auto Gv2 = slice_target(G(),range(0,1),range(0,1)); TEST( Gv2( 0) ) ; Gv2.on_mesh(0) = 10; TEST( Gv2( 0) ) ; TEST( G( 0) ) ; triqs::clef::placeholder<0> om_; triqs::clef::placeholder<1> nu_; TEST( G(om_) ) ; TEST( eval(G(om_), om_=0) ) ; TEST( Gv(om_) ) ; TEST( eval(Gv(om_), om_=0) ) ; std::cout <<"-------------lazy assign 1 ------------------"< A(1,2,3,4,5,6,7,8,9); A()=0; //auto x = local::impl::gf_impl::wrap_infty (G.tail_view()) + 2.0; // test hdf5 H5::H5File file("ess_gf.h5", H5F_ACC_TRUNC ); h5_write(file, "g", G); // { auto G0w = gf{{beta, Fermion, 100}}; auto D0w = gf{{beta, Boson, 100}}; auto Sigma_w = gf{{beta, Fermion, 100}}; G0w(om_) << 1 / (om_ - 3); for (auto const& nu : D0w.mesh()) Sigma_w(om_) << 2 * G0w(om_ - nu); } // { auto G0w = gf{{beta, Fermion, 100}, {1,1}}; auto D0w = gf{{beta, Boson, 100}, {1,1}}; auto Sigma_w = gf{{beta, Fermion, 100}, {1,1}} ; G0w(om_) << 1 / (om_ - 3); for (auto const& nu : D0w.mesh()) Sigma_w(om_) << 2 * G0w(om_ - nu); } } TRIQS_CATCH_AND_ABORT; }