2013-07-17 19:24:07 +02:00
|
|
|
#include "triqs/clef.hpp"
|
|
|
|
#include "triqs/clef/adapters/vector.hpp"
|
|
|
|
#include "triqs/clef/adapters/math.hpp"
|
|
|
|
#include <iostream>
|
|
|
|
namespace tql = triqs::clef;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
|
|
|
int N = 10;
|
|
|
|
double pi = std::acos(-1);
|
|
|
|
std::vector<double> V(N);
|
|
|
|
|
2013-09-07 15:27:10 +02:00
|
|
|
// automatic assignment of vector and use of make_expr math function
|
2013-07-17 19:24:07 +02:00
|
|
|
tql::placeholder <0> k_;
|
2013-09-07 15:27:10 +02:00
|
|
|
tql::make_expr(V) [k_] << cos( (2* pi* k_)/ N );
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
// check result...
|
|
|
|
for (size_t u=0; u<V.size(); ++u)
|
|
|
|
std::cout<< u << " "<<V[u]<< " "<< cos((2*pi*u)/N)<<std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|