3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 14:23:38 +01:00
dft_tools/test/triqs/gf/vector_expr_temp.cpp
Olivier Parcollet f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +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 ;
}