/******************************************************************************* * * TRIQS: a Toolbox for Research in Interacting Quantum Systems * * Copyright (C) 2011 by O. Parcollet * * TRIQS is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * TRIQS is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * TRIQS. If not, see . * ******************************************************************************/ #include "./common.hpp" #include "./src/array.hpp" #include "./src/matrix.hpp" #include using std::cout; using std::endl; using namespace triqs::arrays; #include #include #include namespace BLL=boost::lambda; struct S { double x,y; int i; S(): x(0), y(0), i(0) {} S(double x0, double y0, int i0): x(x0), y(y0), i(i0) {} }; double my_fun(double x, double y) { return x+y;} std::ostream & operator << (std::ostream & out, S const & s) { return out<<"("< A(2,2); S s0(1,2,3); int p=0; for (int i =0; i<2; ++i) for (int j=0; j<2; ++j,++p) A(i,j) = S(i,j,p); std::cout<<" A "<, 2> AA(2,2); array A0(2); for (int i =0; i<2; ++i) A0(i) = i; AA()=A0; std::cout<<" AA "< > F (2,2); for (int i =0; i<2; ++i) for (int j=0; j<2; ++j,++p) F(i,j) = BLL::bind(&my_fun, BLL::_1, i+j); for (int i =0; i<2; ++i) for (int j=0; j<2; ++j,++p) std::cout<