3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-27 06:43:40 +01:00
dft_tools/test/triqs/gfs/vector_expr_temp.cpp

21 lines
428 B
C++
Raw Normal View History

#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 ;
}