Function Karana::Math::linSolveSVD#
Defined in File Defs.h
Function Documentation#
-
Mat Karana::Math::linSolveSVD(const Mat &A, const Mat &b, double threshold = Eigen::Default)#
Solve the linear system A x = b for x using a truncated SVD.
The
thresholdparameter determines which singular values are truncated by setting a minimum relative precision compared to the largest singular value of A. In other words, we define a k-dimensional subspace implicitly defined bythresholdand find the least-squares solution in that subspace. This corresponds to the optimal min-norm least-squares solution.- Parameters:
A – Coefficient matrix
b – Right-hand-side matrix/vector
threshold – Threshold below which we truncate singular values for numerical stability
- Returns:
x matrix/vector that best solves A x = b