3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 06:14:14 +01:00
dft_tools/doc/tutorials/array_tutorial_4.cpp
tayral edd1ff4529 Restructuring documentation.
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)
2014-10-18 12:21:08 +01:00

28 lines
464 B
C++

#include <triqs/arrays.hpp>
using triqs::arrays::array;
using triqs::arrays::matrix;
using triqs::arrays::vector;
int main() {
array<double, 2> A(2, 2), B(2, 2), C;
A() = 3;
B() = 1;
C = A * B;
std::cout << "A*B = " << C << std::endl;
matrix<double> D(2, 2), E(2, 2), F;
E() = 3;
E() = 1;
F = D * E;
std::cout << "C*D = " << F << std::endl;
vector<double> u(2), v(2), w;
u() = 1;
v() = 2;
w = u + v;
std::cout << "u+v = " << w << std::endl;
}