TRIQS/nda 2.0.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
doc_basic_array_view.cpp
1#include <nda/nda.hpp>
2#include <iostream>
3
4int main() {
5 // create a regular 3x3 array of ones
6 auto arr = nda::ones<int>(3, 3);
7 std::cout << arr << std::endl;
8
9 // zero out the first column
10 arr(nda::range::all, 0) = 0;
11 std::cout << arr << std::endl;
12}
auto ones(std::array< Int, Rank > const &shape)
Make an array of the given shape and one-initialize it.
Includes all relevant headers for the core nda library.