Safe matrix inversion with conditioning check
safe_solve(A, B = NULL, reg = 1e-12, rcond_tol = 1e-12, verbose = FALSE)matrix
matrix
Numeric scalar (default: 1e-12). Small ridge term added to the diagonal of A when the system is ill-conditioned.
Numeric, default = 1e-12. Tolerance threshold for the reciprocal condition number.
Logical flag controlling function messaging.