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