pulsatrix
Loading...
Searching...
No Matches
matrix_decompositions.hpp File Reference

Small dense decompositions on the host: symmetric eigensolver, power iteration, QR and SVD (roadmap FND-4). More...

#include <cstdint>
#include "pulsatrix/tensor.hpp"
Include dependency graph for matrix_decompositions.hpp:

Go to the source code of this file.

Classes

struct  pulsatrix::EigenResult
 SymmetricEigen()'s result. More...
 
struct  pulsatrix::DominantEigenResult
 PowerIteration()'s result. More...
 
struct  pulsatrix::QRResult
 QR()'s result, the thin factorization A = Q R. More...
 
struct  pulsatrix::SVDResult
 SVD()'s result, the thin factorization A = U diag(S) V^T with k = min(m, n). More...
 

Namespaces

namespace  pulsatrix
 

Functions

EigenResult pulsatrix::SymmetricEigen (const Tensor &a)
 All eigenvalues and eigenvectors of a symmetric matrix, by Householder reduction to tridiagonal form followed by QL with implicit shifts.
 
DominantEigenResult pulsatrix::PowerIteration (const Tensor &a, int64_t max_iterations=1000, float tolerance=1e-6f, uint64_t seed=0)
 The dominant eigenpair of a symmetric matrix by power iteration – cheaper than SymmetricEigen() when only the top eigenpair is needed (spectral norm, stable rank).
 
QRResult pulsatrix::QR (const Tensor &a)
 Thin QR factorization by Householder reflections.
 
SVDResult pulsatrix::SVD (const Tensor &a)
 Thin singular value decomposition by one-sided (Hestenes) Jacobi rotations.
 

Detailed Description

Small dense decompositions on the host: symmetric eigensolver, power iteration, QR and SVD (roadmap FND-4).

Note
For the matrices interpretability works with – covariances of activations, weight matrices, Gram matrices – up to a few hundred rows and columns. Inputs are CPU tensors; arithmetic is in double; results are float tensors on the input's backend.
Eigenvector and singular-vector signs are arbitrary mathematically, so every result here is made canonical: in each vector, the largest-magnitude entry (the first, on a tie) is positive. Values come in descending order, ties kept in a fixed order. The same input therefore always gives the same output, which makes vectors comparable across runs and models (PCA directions, intruder-dimension checks).