3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 22:33:48 +01:00
dft_tools/test/triqs/clef_examples/sum3.cpp
Olivier Parcollet efb00ea5d3 clef: first version of generic sum function
- to improve with in the case where function return an expression
  template, not a regular type, with a make_regular function
2014-04-04 17:47:21 +02:00

22 lines
415 B
C++

#include <triqs/arrays.hpp>
/// ---- test ------------
using triqs::arrays::range;
int main() {
triqs::clef::placeholder<0> a_;
triqs::clef::placeholder<1> i_;
triqs::clef::placeholder<2> j_;
auto expr = i_ + 2* j_;
auto xa = sum(a_*i_ , i_=range(0,5));
auto x = eval(xa, a_=2);
std::cout << x << std::endl;
auto y = sum(2*i_ + j_ , i_=range(0,3), j_= range (0,2));
std::cout << y << std::endl;
}