@@ -35,9 +35,9 @@ For example, calculating a determinant:
3535
3636 int main()
3737 {
38- xt::xarray<double> a = {{1 , 2, 3 }, {4, 5, 6 }, {7, 8, 9 }};
38+ xt::xarray<double> a = {{3 , 2, 1 }, {0, 4, 2 }, {1, 3, 5 }};
3939 auto d = xt::linalg::det(a);
40- std::cout << d << std::endl; // 6.661338e-16
40+ std::cout << d << std::endl; // 42.0
4141 }
4242
4343 We can also try to compute the same determinant using the ``slogdet `` function, which
@@ -47,9 +47,9 @@ returning a ``std::tuple``, which can be unpacked using ``std::get<N>(tuple)``.
4747
4848.. code-block :: cpp
4949
50- xt::xarray<double> a = {{1 , 2, 3 }, {4, 5, 6 }, {7, 8, 9 }};
50+ xt::xarray<double> a = {{3 , 2, 1 }, {0, 4, 2 }, {1, 3, 5 }};
5151 auto d = xt::linalg::slogdet(a);
52- std::cout << std::get<0>(d) << ", " << std::get<1>(d) << std::endl; // 1, -34.9450...
52+ std::cout << std::get<0>(d) << ", " << std::get<1>(d) << std::endl; // + 1, 3.7376696
5353
5454 Returning tuples is used throughout the xlinalg package.
5555
0 commit comments