|
tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
|
Classes | |
| struct | EigenResult |
| Result of eigenvalue decomposition. More... | |
| struct | GivensQRResult |
| Result of Givens QR decomposition. More... | |
| struct | LUResult |
| Result of LU decomposition with partial pivoting. More... | |
| struct | QRResult |
| Result of Householder QR decomposition. More... | |
Functions | |
| template<typename MatrixType > | |
| Expected< MatrixType, MatrixStatus > | cholesky (const MatrixType &A, typename MatrixType::value_type tol=typename MatrixType::value_type(PRECISION_TOLERANCE)) |
| Compute the Cholesky decomposition of a symmetric positive-definite matrix. | |
| template<typename MatrixType > | |
| MatrixType | cholesky_or_die (const MatrixType &A) |
| Cholesky decomposition — abort on failure. | |
| template<typename T , my_size_t N> | |
| FusedMatrix< T, N, N > | cholesky_rank1_update (const FusedMatrix< T, N, N > &L, const FusedVector< T, N > &v) |
| Rank-1 Cholesky update: compute L' where L'L'ᵀ = LLᵀ + vvᵀ. | |
| template<typename T , my_size_t N> | |
| Expected< EigenResult< T, N >, MatrixStatus > | eigen_jacobi (const FusedMatrix< T, N, N > &A, my_size_t max_iters=100, T tol=T(PRECISION_TOLERANCE)) |
| Compute eigenvalues and eigenvectors of a symmetric matrix via Jacobi. | |
| template<typename T , my_size_t N> | |
| Expected< LUResult< T, N >, MatrixStatus > | lu (const FusedMatrix< T, N, N > &A, T tol=T(PRECISION_TOLERANCE)) |
| Compute the LU decomposition of a square matrix with partial pivoting. | |
| template<typename T , my_size_t N> | |
| LUResult< T, N > | lu_or_die (const FusedMatrix< T, N, N > &A) |
| LU decomposition — abort on failure. | |
| template<typename T , my_size_t M, my_size_t N> | |
| QRResult< T, M, N > | qr_householder (const FusedMatrix< T, M, N > &A) |
| Compute the Householder QR decomposition of a rectangular matrix. | |
| template<typename T , my_size_t M, my_size_t N> | |
| GivensQRResult< T, M, N > | qr_givens (const FusedMatrix< T, M, N > &A) |
| Compute the QR decomposition using Givens rotations. | |
| template<typename T , my_size_t N, my_size_t M> | |
| Expected< FusedMatrix< T, N, M >, MatrixStatus > | kalman_gain (const FusedMatrix< T, N, N > &P, const FusedMatrix< T, M, N > &H, const FusedMatrix< T, M, M > &R) |
| Compute the Kalman gain K = P·Hᵀ·(H·P·Hᵀ + R)⁻¹. | |
| template<typename T , my_size_t N, my_size_t M> | |
| FusedMatrix< T, N, N > | joseph_update (const FusedMatrix< T, N, M > &K, const FusedMatrix< T, M, N > &H, const FusedMatrix< T, N, N > &P, const FusedMatrix< T, M, M > &R) |
| Joseph form covariance update: P' = (I-K·H)·P·(I-K·H)ᵀ + K·R·Kᵀ. | |
| template<typename T , my_size_t N> | |
| Expected< T, MatrixStatus > | condition (const FusedMatrix< T, N, N > &A) |
| Compute the condition number of A in the 1-norm: cond₁(A) = ‖A‖₁ · ‖A⁻¹‖₁. | |
| template<typename T , my_size_t N> | |
| FusedVector< T, N > | cross (const FusedVector< T, N > &a, const FusedVector< T, N > &b) |
| Compute the cross product of two 3-vectors. | |
| template<typename T , my_size_t N> | |
| T | determinant (const FusedMatrix< T, N, N > &A) |
| Compute the determinant of a square matrix. | |
| template<typename T > | |
| FusedMatrix< T, 4, 4 > | homogeneous_inverse (const FusedMatrix< T, 4, 4 > &H) |
| Compute the inverse of a 4×4 homogeneous transformation matrix. | |
| template<typename T , my_size_t N> | |
| Expected< FusedMatrix< T, N, N >, MatrixStatus > | inverse (const FusedMatrix< T, N, N > &A) |
| Compute the inverse of a square matrix. | |
| template<typename T , my_size_t N> | |
| FusedMatrix< T, N, N > | inverse_or_die (const FusedMatrix< T, N, N > &A) |
| Matrix inverse — abort on failure. | |
| template<typename T , my_size_t N> | |
| T | norm1 (const FusedMatrix< T, N, N > &A) |
| Compute the 1-norm of a square matrix: max absolute column sum. | |
| template<typename T , my_size_t N> | |
| T | norm2 (const FusedVector< T, N > &v) |
| Compute the Euclidean (2-norm) of a vector: √(Σ vᵢ²). | |
| template<typename T , my_size_t N> | |
| FusedMatrix< T, N, N > | symmetric_rank_k_update (const FusedMatrix< T, N, N > &F, const FusedMatrix< T, N, N > &P, const FusedMatrix< T, N, N > &Q) |
| Compute the symmetric rank-k update P' = F·P·Fᵀ + Q. | |
| template<typename T , my_size_t N> | |
| FusedMatrix< T, N, N > | symmetric_rank_k_update (const FusedMatrix< T, N, N > &F, const FusedMatrix< T, N, N > &P) |
| Compute the symmetric rank-k update P' = F·P·Fᵀ (no noise term). | |
| template<typename T > | |
| FusedMatrix< T, 3, 3 > | skew_symmetric (const FusedVector< T, 3 > &v) |
| Construct the 3×3 skew-symmetric matrix [v]× from a 3-vector. | |
| template<typename T > | |
| FusedMatrix< T, 3, 3 > | rodrigues (const FusedVector< T, 3 > &omega, T t=T(1)) |
| Compute the rotation matrix R = exp(t · [ω]×) via Rodrigues formula. | |
| template<typename T , my_size_t N> | |
| T | trace (const FusedMatrix< T, N, N > &A) |
| Compute the trace of a square matrix. | |
| template<typename T , my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | cholesky_solve (const FusedMatrix< T, N, N > &A, const FusedVector< T, N > &b) |
| Solve Ax = b for symmetric positive-definite A via Cholesky decomposition. | |
| template<typename T , my_size_t M, my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | least_squares (const FusedMatrix< T, M, N > &A, const FusedVector< T, M > &b) |
| Solve the least squares problem min ‖Ax - b‖² via QR. | |
| template<typename T , my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | lu_solve (const FusedMatrix< T, N, N > &A, const FusedVector< T, N > &b) |
| Solve Ax = b via LU decomposition with partial pivoting. | |
| template<typename T , my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | solve (const FusedMatrix< T, N, N > &A, const FusedVector< T, N > &b) |
| Solve Ax = b with automatic algorithm selection. | |
| template<typename T , my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | levinson_durbin (const FusedVector< T, N > &r, const FusedVector< T, N > &b) |
| Solve a symmetric Toeplitz system Tx = b using Levinson-Durbin. | |
| template<bool UnitDiag = false, typename T , my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | forward_substitute (const FusedMatrix< T, N, N > &L, const FusedVector< T, N > &b) |
| Solve the lower-triangular system Lx = b by forward substitution. | |
| template<bool UnitDiag = false, typename T , my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | back_substitute (const FusedMatrix< T, N, N > &U, const FusedVector< T, N > &b) |
| Solve the upper-triangular system Ux = b by back substitution. | |
| template<bool UnitDiag = false, typename T , my_size_t N, my_size_t Ncols> | |
| Expected< FusedMatrix< T, N, Ncols >, MatrixStatus > | forward_substitute (const FusedMatrix< T, N, N > &L, const FusedMatrix< T, N, Ncols > &B) |
| Solve the lower-triangular system LX = B for multiple right-hand sides. | |
| template<bool UnitDiag = false, typename T , my_size_t N, my_size_t Ncols> | |
| Expected< FusedMatrix< T, N, Ncols >, MatrixStatus > | back_substitute (const FusedMatrix< T, N, N > &U, const FusedMatrix< T, N, Ncols > &B) |
| Solve the upper-triangular system UX = B for multiple right-hand sides. | |
| template<typename T , my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | thomas_solve (const FusedVector< T, N > &a, const FusedVector< T, N > &d, const FusedVector< T, N > &c, const FusedVector< T, N > &b) |
| Solve a tridiagonal system Ax = b using the Thomas algorithm. | |
| Expected< FusedMatrix< T, N, Ncols >, MatrixStatus > matrix_algorithms::back_substitute | ( | const FusedMatrix< T, N, N > & | U, |
| const FusedMatrix< T, N, Ncols > & | B | ||
| ) |
Solve the upper-triangular system UX = B for multiple right-hand sides.
Each column of B is solved independently via back substitution. Uses the generic scalar path (no fixed-size unrolling).
| UnitDiag | If true, the diagonal of U is treated as all ones. |
| T | Scalar type (deduced). |
| N | System dimension (deduced). |
| Ncols | Number of right-hand side columns (deduced). |
| U | Upper-triangular NxN matrix. |
| B | Right-hand side matrix of size N × Ncols. |

| Expected< FusedVector< T, N >, MatrixStatus > matrix_algorithms::back_substitute | ( | const FusedMatrix< T, N, N > & | U, |
| const FusedVector< T, N > & | b | ||
| ) |
Solve the upper-triangular system Ux = b by back substitution.
Compile-time dispatch selects a fully unrolled path for N ∈ {3, 4, 6}; all other sizes use a generic scalar loop.
| UnitDiag | If true, the diagonal of U is treated as all ones. If false, the actual diagonal entries are used. |
| T | Scalar type (deduced). |
| N | Matrix/vector dimension (deduced). |
| U | Upper-triangular NxN matrix. |
| b | Right-hand side vector of length N. |

| Expected< MatrixType, MatrixStatus > matrix_algorithms::cholesky | ( | const MatrixType & | A, |
| typename MatrixType::value_type | tol = typename MatrixType::value_type(PRECISION_TOLERANCE) |
||
| ) |
Compute the Cholesky decomposition of a symmetric positive-definite matrix.
Decomposes A into a lower-triangular matrix L such that A = L · Lᵀ.
| MatrixType | A square FusedMatrix type exposing:
|
| A | Symmetric positive-definite input matrix. |
| tol | Diagonal tolerance. Elements ≤ tol are rejected as non-positive-definite. Defaults to PRECISION_TOLERANCE. |

| MatrixType matrix_algorithms::cholesky_or_die | ( | const MatrixType & | A | ) |
Cholesky decomposition — abort on failure.
Convenience wrapper for contexts where failure is unrecoverable (offline computation, test code). Calls MyErrorHandler::error() if the decomposition fails.
| MatrixType | Same requirements as cholesky(). |
| A | Symmetric positive-definite input matrix. |

| FusedMatrix< T, N, N > matrix_algorithms::cholesky_rank1_update | ( | const FusedMatrix< T, N, N > & | L, |
| const FusedVector< T, N > & | v | ||
| ) |
Rank-1 Cholesky update: compute L' where L'L'ᵀ = LLᵀ + vvᵀ.
Given a lower-triangular Cholesky factor L and a vector v, computes the updated factor L' in O(N²) via Givens rotations. The input L, v is not modified.
| T | Scalar type (deduced). |
| N | Matrix/vector dimension (deduced). |
| L | Lower-triangular Cholesky factor (N×N). |
| v | Update vector (N). |

| Expected< FusedVector< T, N >, MatrixStatus > matrix_algorithms::cholesky_solve | ( | const FusedMatrix< T, N, N > & | A, |
| const FusedVector< T, N > & | b | ||
| ) |
Solve Ax = b for symmetric positive-definite A via Cholesky decomposition.
Decomposes A = LLᵀ, then solves Ly = b (forward substitution) followed by Lᵀx = y (back substitution using L transposed).
The internal back substitution step accesses L(k,i) directly (i.e. Lᵀ(i,k)) to avoid creating a separate transpose. Singular checks are skipped for this step since cholesky() already guarantees a valid L with positive diagonal.
| T | Scalar type (deduced). |
| N | Matrix/vector dimension (deduced). |
| A | Symmetric positive-definite matrix (N×N). |
| b | Right-hand side vector (N). |

| Expected< T, MatrixStatus > matrix_algorithms::condition | ( | const FusedMatrix< T, N, N > & | A | ) |
Compute the condition number of A in the 1-norm: cond₁(A) = ‖A‖₁ · ‖A⁻¹‖₁.
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| A | Square input matrix (N×N). |

| FusedVector< T, N > matrix_algorithms::cross | ( | const FusedVector< T, N > & | a, |
| const FusedVector< T, N > & | b | ||
| ) |
Compute the cross product of two 3-vectors.
| T | Scalar type (deduced). Works on float, double, and integers. |
| N | Vector dimension (deduced). Must be 3. |
| a | First input vector (3×1). |
| b | Second input vector (3×1). |
| T matrix_algorithms::determinant | ( | const FusedMatrix< T, N, N > & | A | ) |
Compute the determinant of a square matrix.
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| A | Square input matrix (N×N). |

| Expected< EigenResult< T, N >, MatrixStatus > matrix_algorithms::eigen_jacobi | ( | const FusedMatrix< T, N, N > & | A, |
| my_size_t | max_iters = 100, |
||
| T | tol = T(PRECISION_TOLERANCE) |
||
| ) |
Compute eigenvalues and eigenvectors of a symmetric matrix via Jacobi.
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| A | Symmetric input matrix (N×N). |
| max_iters | Maximum number of sweeps (default 100). |
| tol | Convergence tolerance for off-diagonal norm (default PRECISION_TOLERANCE). |

| Expected< FusedMatrix< T, N, Ncols >, MatrixStatus > matrix_algorithms::forward_substitute | ( | const FusedMatrix< T, N, N > & | L, |
| const FusedMatrix< T, N, Ncols > & | B | ||
| ) |
Solve the lower-triangular system LX = B for multiple right-hand sides.
Each column of B is solved independently via forward substitution. Uses the generic scalar path (no fixed-size unrolling).
| UnitDiag | If true, the diagonal of L is treated as all ones. |
| T | Scalar type (deduced). |
| N | System dimension (deduced). |
| Ncols | Number of right-hand side columns (deduced). |
| L | Lower-triangular NxN matrix. |
| B | Right-hand side matrix of size N × Ncols. |

| Expected< FusedVector< T, N >, MatrixStatus > matrix_algorithms::forward_substitute | ( | const FusedMatrix< T, N, N > & | L, |
| const FusedVector< T, N > & | b | ||
| ) |
Solve the lower-triangular system Lx = b by forward substitution.
Compile-time dispatch selects a fully unrolled path for N ∈ {3, 4, 6}; all other sizes use a generic scalar loop.
| UnitDiag | If true, the diagonal of L is treated as all ones (implicit unit diagonal, as produced by LU with partial pivoting). If false, the actual diagonal entries are used. |
| T | Scalar type (deduced). |
| N | Matrix/vector dimension (deduced). |
| L | Lower-triangular NxN matrix. |
| b | Right-hand side vector of length N. |

| FusedMatrix< T, 4, 4 > matrix_algorithms::homogeneous_inverse | ( | const FusedMatrix< T, 4, 4 > & | H | ) |
Compute the inverse of a 4×4 homogeneous transformation matrix.
| T | Scalar type (deduced). Must be floating-point. |
| H | 4×4 homogeneous transform [R|t; 0 0 0 1]. |
| Expected< FusedMatrix< T, N, N >, MatrixStatus > matrix_algorithms::inverse | ( | const FusedMatrix< T, N, N > & | A | ) |
Compute the inverse of a square matrix.
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| A | Square input matrix (N×N). |

| FusedMatrix< T, N, N > matrix_algorithms::inverse_or_die | ( | const FusedMatrix< T, N, N > & | A | ) |
| FusedMatrix< T, N, N > matrix_algorithms::joseph_update | ( | const FusedMatrix< T, N, M > & | K, |
| const FusedMatrix< T, M, N > & | H, | ||
| const FusedMatrix< T, N, N > & | P, | ||
| const FusedMatrix< T, M, M > & | R | ||
| ) |
Joseph form covariance update: P' = (I-K·H)·P·(I-K·H)ᵀ + K·R·Kᵀ.
Numerically stable covariance update that guarantees symmetry and positive semi-definiteness of the result.
| T | Scalar type (deduced). |
| N | State dimension (deduced). |
| M | Measurement dimension (deduced). |
| K | Kalman gain (N×M). |
| H | Observation matrix (M×N). |
| P | Prior state covariance (N×N). |
| R | Measurement noise covariance (M×M). |

| Expected< FusedMatrix< T, N, M >, MatrixStatus > matrix_algorithms::kalman_gain | ( | const FusedMatrix< T, N, N > & | P, |
| const FusedMatrix< T, M, N > & | H, | ||
| const FusedMatrix< T, M, M > & | R | ||
| ) |
Compute the Kalman gain K = P·Hᵀ·(H·P·Hᵀ + R)⁻¹.
| T | Scalar type (deduced). |
| N | State dimension (deduced). |
| M | Measurement dimension (deduced). |
| P | State covariance (N×N), symmetric positive definite. |
| H | Observation matrix (M×N). |
| R | Measurement noise covariance (M×M), symmetric positive definite. |

| Expected< FusedVector< T, N >, MatrixStatus > matrix_algorithms::least_squares | ( | const FusedMatrix< T, M, N > & | A, |
| const FusedVector< T, M > & | b | ||
| ) |
Solve the least squares problem min ‖Ax - b‖² via QR.
| T | Scalar type (deduced). |
| M | Number of rows in A (deduced, M ≥ N). |
| N | Number of columns in A (deduced). |
| A | Input matrix (M×N). |
| b | Right-hand side vector (M). |

| Expected< FusedVector< T, N >, MatrixStatus > matrix_algorithms::levinson_durbin | ( | const FusedVector< T, N > & | r, |
| const FusedVector< T, N > & | b | ||
| ) |
Solve a symmetric Toeplitz system Tx = b using Levinson-Durbin.
| T | Scalar type (deduced). |
| N | System size (deduced). |
| r | First row of the Toeplitz matrix (N elements). r(0) is the diagonal. |
| b | Right-hand side vector (N). |

| Expected< LUResult< T, N >, MatrixStatus > matrix_algorithms::lu | ( | const FusedMatrix< T, N, N > & | A, |
| T | tol = T(PRECISION_TOLERANCE) |
||
| ) |
Compute the LU decomposition of a square matrix with partial pivoting.
Decomposes A into P·A = L·U where L has unit diagonal.
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| A | Square input matrix (N×N). |
| tol | Pivot tolerance. Pivots with |value| ≤ tol are rejected as singular. Defaults to PRECISION_TOLERANCE. |

| LUResult< T, N > matrix_algorithms::lu_or_die | ( | const FusedMatrix< T, N, N > & | A | ) |
| Expected< FusedVector< T, N >, MatrixStatus > matrix_algorithms::lu_solve | ( | const FusedMatrix< T, N, N > & | A, |
| const FusedVector< T, N > & | b | ||
| ) |
Solve Ax = b via LU decomposition with partial pivoting.
Works for any non-singular square matrix.
| T | Scalar type (deduced). |
| N | Matrix/vector dimension (deduced). |
| A | Square input matrix (N×N). |
| b | Right-hand side vector (N). |

| T matrix_algorithms::norm1 | ( | const FusedMatrix< T, N, N > & | A | ) |
Compute the 1-norm of a square matrix: max absolute column sum.
Works for any numeric type (not restricted to floating point).
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| A | Square input matrix (N×N). |

| T matrix_algorithms::norm2 | ( | const FusedVector< T, N > & | v | ) |
Compute the Euclidean (2-norm) of a vector: √(Σ vᵢ²).
| T | Scalar type (deduced). |
| N | Vector dimension (deduced). |
| v | Input vector (N). |

| GivensQRResult< T, M, N > matrix_algorithms::qr_givens | ( | const FusedMatrix< T, M, N > & | A | ) |
Compute the QR decomposition using Givens rotations.
| T | Scalar type (deduced). |
| M | Number of rows (deduced, M ≥ N). |
| N | Number of columns (deduced). |
| A | Input matrix (M×N). |

| QRResult< T, M, N > matrix_algorithms::qr_householder | ( | const FusedMatrix< T, M, N > & | A | ) |
Compute the Householder QR decomposition of a rectangular matrix.
| T | Scalar type (deduced). |
| M | Number of rows (deduced, M ≥ N). |
| N | Number of columns (deduced). |
| A | Input matrix (M×N). |

| FusedMatrix< T, 3, 3 > matrix_algorithms::rodrigues | ( | const FusedVector< T, 3 > & | omega, |
| T | t = T(1) |
||
| ) |
Compute the rotation matrix R = exp(t · [ω]×) via Rodrigues formula.
Computes the SO(3) rotation matrix for angular velocity ω over time step t.
| T | Scalar type (deduced). |
| omega | Angular velocity 3-vector (rad/s). |
| t | Time step (seconds). Default 1.0 (omega is then the rotation vector). |

| FusedMatrix< T, 3, 3 > matrix_algorithms::skew_symmetric | ( | const FusedVector< T, 3 > & | v | ) |
Construct the 3×3 skew-symmetric matrix [v]× from a 3-vector.
| T | Scalar type (deduced). |
| v | 3-vector [v₁, v₂, v₃]. |
| Expected< FusedVector< T, N >, MatrixStatus > matrix_algorithms::solve | ( | const FusedMatrix< T, N, N > & | A, |
| const FusedVector< T, N > & | b | ||
| ) |
Solve Ax = b with automatic algorithm selection.
Attempts Cholesky path first (cheaper for SPD matrices), falls back to LU path for general non-singular matrices.
| T | Scalar type (deduced). |
| N | Matrix/vector dimension (deduced). |
| A | Square input matrix (N×N). |
| b | Right-hand side vector (N). |

| FusedMatrix< T, N, N > matrix_algorithms::symmetric_rank_k_update | ( | const FusedMatrix< T, N, N > & | F, |
| const FusedMatrix< T, N, N > & | P | ||
| ) |
Compute the symmetric rank-k update P' = F·P·Fᵀ (no noise term).
Useful when process noise is added separately or is zero.
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| F | State transition matrix (N×N). |
| P | Covariance matrix (N×N), symmetric. |

| FusedMatrix< T, N, N > matrix_algorithms::symmetric_rank_k_update | ( | const FusedMatrix< T, N, N > & | F, |
| const FusedMatrix< T, N, N > & | P, | ||
| const FusedMatrix< T, N, N > & | Q | ||
| ) |
Compute the symmetric rank-k update P' = F·P·Fᵀ + Q.
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| F | State transition matrix (N×N). |
| P | Covariance matrix (N×N), symmetric positive (semi-)definite. |
| Q | Process noise matrix (N×N), symmetric positive (semi-)definite. |

| Expected< FusedVector< T, N >, MatrixStatus > matrix_algorithms::thomas_solve | ( | const FusedVector< T, N > & | a, |
| const FusedVector< T, N > & | d, | ||
| const FusedVector< T, N > & | c, | ||
| const FusedVector< T, N > & | b | ||
| ) |
Solve a tridiagonal system Ax = b using the Thomas algorithm.
| T | Scalar type (deduced). |
| N | System size (deduced). |
| a | Sub-diagonal vector (N). a(0) is unused. |
| d | Main diagonal vector (N). |
| c | Super-diagonal vector (N). c(N−1) is unused. |
| b | Right-hand side vector (N). |

| T matrix_algorithms::trace | ( | const FusedMatrix< T, N, N > & | A | ) |
Compute the trace of a square matrix.
| T | Scalar type (deduced). |
| N | Matrix dimension (deduced). |
| A | Square input matrix (N×N). |
