mirror of
https://github.com/triqs/dft_tools
synced 2024-11-01 11:43:47 +01:00
edd1ff4529
A first general restructuration of the doc according to the pattern [tour|tutorial|reference]. In the reference part, objects are documented per topic. In each topic, [definition|c++|python|hdf5] (not yet implemented)
19 lines
569 B
C++
19 lines
569 B
C++
#include <triqs/arrays.hpp>
|
|
#include <iostream>
|
|
using triqs::arrays::vector;
|
|
using triqs::arrays::range;
|
|
int main() {
|
|
triqs::arrays::vector<double> V(3), W(4);
|
|
V() = 3;
|
|
W() = 4; // initialize
|
|
auto VV = V(range(0, 2));
|
|
auto VW = W(range(0, 2));
|
|
|
|
std::cout << "V = " << V << " W = " << W << " V view " << VV << " W view " << VW << std::endl;
|
|
swap(V, W);
|
|
std::cout << "V = " << V << " W = " << W << " V view " << VV << " W view " << VW << std::endl;
|
|
swap(VV, VW);
|
|
std::cout << "V = " << V << " W = " << W << " V view " << VV << " W view " << VW << std::endl;
|
|
}
|
|
|