tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
Namespaces | Functions
determinant.h File Reference

Determinant computation with compile-time dispatch. More...

#include "config.h"
#include "algorithms/decomposition/lu.h"
Include dependency graph for determinant.h:

Go to the source code of this file.

Namespaces

namespace  matrix_algorithms
 

Functions

template<typename T , my_size_t N>
matrix_algorithms::determinant (const FusedMatrix< T, N, N > &A)
 Compute the determinant of a square matrix.
 

Detailed Description

Determinant computation with compile-time dispatch.

Small sizes (1×1, 2×2, 3×3, 4×4) use unrolled cofactor expansion — O(1), works on any scalar type including integers.

Generic path (N>4) uses LU decomposition: det(A) = sign · Π U(i,i) Returns zero for singular matrices. Requires floating-point.

Complexity: O(1) for N≤4, O(2N³/3) for N>4.