Function Karana::Math::linSolveQR

Function Karana::Math::linSolveQR#

Function Documentation#

Mat Karana::Math::linSolveQR(const Mat &A, const Mat &b, double threshold = Eigen::Default)#

Solve the linear system A x = b for x using QR decomposition. Prefer linSolveCOD for numerically safe systems, or linSolveSVD for nearly-singular or singular systems.

Parameters:
  • A – Coefficient matrix

  • b – Right-hand-side matrix/vector

  • threshold – Threshold for pruning zero pivots to stabilize solve; default is machine epsilon.

Returns:

x matrix/vector that best solves A x = b