//#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::Fermion; using triqs::gfs::imfreq; using triqs::gfs::imtime; using triqs::gfs::make_gf; #define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) < using block_gf = gf>; // block_gf ... // but not on gcc 4.6 ! // int main() { triqs::gfs::freq_infty inf; double beta =1; auto G = make_gf (beta, Fermion, make_shape(2,2)); auto Gc = make_gf (beta, Fermion, make_shape(2,2)); auto G3 = make_gf (beta, Fermion, make_shape(2,2)); auto Gt = make_gf (beta, Fermion, make_shape(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_; TEST( G(om_) ) ; TEST( tql::eval(G(om_), om_=0) ) ; TEST( Gv(om_) ) ; TEST( tql::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); }