8 std::cout <<
"A1 = " << A1 << std::endl;
9 std::cout <<
"A1.size() = " << A1.size() << std::endl;
10 std::cout <<
"A1.shape() = " << A1.shape() << std::endl;
14 std::cout <<
"A1.size() = " << A1.size() << std::endl;
15 std::cout <<
"A1.shape() = " << A1.shape() << std::endl;
19 std::cout <<
"A1.size() = " << A1.size() << std::endl;
20 std::cout <<
"A1.shape() = " << A1.shape() << std::endl;
24 std::cout <<
"M1.size() = " << M1.size() << std::endl;
25 std::cout <<
"M1.shape() = " << M1.shape() << std::endl;
28 using namespace std::complex_literals;
30 std::cout <<
"v1 = " << v1 << std::endl;
31 std::cout <<
"v1.size() = " << v1.size() << std::endl;
32 std::cout <<
"v1.shape() = " << v1.
shape() << std::endl;
36 std::cout <<
"v2 = " << v2 << std::endl;
37 std::cout <<
"v2.size() = " << v2.
size() << std::endl;
38 std::cout <<
"v2.shape() = " << v2.shape() << std::endl;
41 auto v3 = std::move(v2);
42 std::cout <<
"v3 = " << v3 << std::endl;
43 std::cout <<
"v3.size() = " << v3.size() << std::endl;
44 std::cout <<
"v3.shape() = " << v3.shape() << std::endl;
45 std::cout <<
"v2.empty() = " << v2.empty() << std::endl;
49 std::cout <<
"A1_il = " << A1_il << std::endl;
50 std::cout <<
"A1_il.size() = " << A1_il.size() << std::endl;
51 std::cout <<
"A1_il.shape() = " << A1_il.shape() << std::endl;
55 std::cout <<
"A2_il = " << A2_il << std::endl;
56 std::cout <<
"A2_il.size() = " << A2_il.size() << std::endl;
57 std::cout <<
"A2_il.shape() = " << A2_il.shape() << std::endl;
60 auto A3_il =
nda::array<int, 3>{{{1, 2}, {3, 4}, {5, 6}}, {{7, 8}, {9, 10}, {11, 12}}};
61 std::cout <<
"A3_il = " << A3_il << std::endl;
62 std::cout <<
"A3_il.size() = " << A3_il.size() << std::endl;
63 std::cout <<
"A3_il.shape() = " << A3_il.shape() << std::endl;
67 std::cout <<
"A1_sum = " << A1_sum << std::endl;
68 std::cout <<
"A1_sum.size() = " << A1_sum.
size() << std::endl;
69 std::cout <<
"A1_sum.shape() = " << A1_sum.
shape() << std::endl;
73 std::cout <<
"A2_f = " << A2_f << std::endl;
74 std::cout <<
"A2_f.size() = " << A2_f.size() << std::endl;
75 std::cout <<
"A2_f.shape() = " << A2_f.shape() << std::endl;
79 std::cout <<
"v4 = " << v4 << std::endl;
83 std::cout <<
"I = " << I << std::endl;
87 std::cout <<
"R = " << R << std::endl;
88 std::cout <<
"R.shape() = " << R.shape() << std::endl;
92 std::cout <<
"Z = " << Z << std::endl;
auto const & shape() const noexcept
Get the shape of the view/array.
long size() const noexcept
Get the total size of the view/array.
auto eye(Int dim)
Create an identity nda::matrix with ones on the diagonal.
auto zeros(std::array< Int, Rank > const &shape)
Make an array of the given shape on the given address space and zero-initialize it.
auto arange(long first, long last, long step=1)
Make a 1-dimensional integer array and initialize it with values of a given nda::range.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
basic_array< ValueType, Rank, Layout, 'A', ContainerPolicy > array
Alias template of an nda::basic_array with an 'A' algebra.
basic_array< ValueType, 1, C_layout, 'V', ContainerPolicy > vector
Alias template of an nda::basic_array with rank 1 and a 'V' algebra.
basic_array< ValueType, 2, Layout, 'M', ContainerPolicy > matrix
Alias template of an nda::basic_array with rank 2 and an 'M' algebra.
Includes all relevant headers for the core nda library.