3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 19:53:45 +01:00
dft_tools/test/triqs/gfs/vector_expr_temp.cpp
2013-09-06 17:51:51 +02:00

21 lines
428 B
C++

#include <triqs/utility/std_vector_expr_template.hpp>
#include <iostream>
int main() {
std::vector<int> V1, V2;
for(size_t i = 0; i<5; ++i) V1.push_back(i);
for(size_t i = 0; i<5; ++i) V2.push_back(2-i);
for (size_t i =0; i<5; ++i) std::cout << (V1+ 2*V2)[i] << std::endl ;
//auto V3 = make_vector(V1/2);
std::vector<double> V3;
V3 = make_vector(V1 - V2/2.5);
for (auto &x: V3) std::cout << x << std::endl ;
}