mirror of
https://github.com/triqs/dft_tools
synced 2024-11-01 03:33:50 +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)
28 lines
464 B
C++
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;
|
|
}
|
|
|