|
tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
|
Trace of a square matrix — sum of diagonal elements. More...

Go to the source code of this file.
Namespaces | |
| namespace | matrix_algorithms |
Functions | |
| template<typename T , my_size_t N> | |
| T | matrix_algorithms::trace (const FusedMatrix< T, N, N > &A) |
| Compute the trace of a square matrix. | |
Trace of a square matrix — sum of diagonal elements.
Infallible, O(N). Works for any scalar type (not restricted to floating point).
reduce_sum call on that view, gaining SIMD acceleration for free via the existing reduction kernel.