mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 06:14:14 +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)
17 lines
382 B
C++
17 lines
382 B
C++
#include <triqs/arrays/array.hpp>
|
|
using triqs::arrays::array;
|
|
using triqs::arrays::array_view;
|
|
using triqs::arrays::range;
|
|
int main() {
|
|
array<double, 2> A(3, 3);
|
|
A() = 2.5;
|
|
std::cout << A << std::endl;
|
|
|
|
array_view<double, 1> B = A(1, range()); // select the first line of the matrix
|
|
std::cout << "B = " << B << std::endl;
|
|
B(0) = 1;
|
|
|
|
std::cout << "A = " << A << std::endl;
|
|
}
|
|
|