3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 03:33:50 +01:00
dft_tools/test/triqs/arrays/bug2.cpp
Olivier Parcollet a857aca301 Silence warnings on gcc
gcc 4.9 with -Wall -Wno-unknown-pragmas -Wno-maybe-uninitialized -Wno-sign-compare

-> uninit : not reliable apparently.
-> sign compare : to be fixed later.
-> fix all, but parenthesis suggestion
2014-10-18 21:20:42 +02:00

30 lines
525 B
C++

#include <triqs/arrays.hpp>
using namespace triqs::arrays;
int main() {
array<double,3> A(10,2,2); A() = 0;
A(4,range(),range()) = 1;
A(5,range(),range()) = 2;
matrix_view<double> M1 = A(4,range(),range());
matrix_view<double> M2 = A(5,range(),range());
std::cout << M1 << std::endl;
std::cout << M2 << std::endl;
std::cout << M1.data_start() << std::endl;
std::cout << M2.data_start() << std::endl;
M1 = M2;
//M1 = M1*M2;
std::cout << M1 << std::endl;
std::cout << M2 << std::endl;
}