def R_solve(R, b): """ returns x This function solves the triangular system R x = b for the N-by-N matrix R. """ x = zeros(R.shape[1], get_typecode(R)) _gslwrap.gsl_linalg_QR_QRsolve(R, b, x) return x
def QR_QRsolve(Q, R, b): """ returns x This function solves the system R x = Q^T b for x. It can be used when the QR decomposition of a matrix is available in unpacked form as (Q,R). """ x = zeros(R.shape[1], get_typecode(R)) _gslwrap.gsl_linalg_QR_QRsolve(Q, R, b, x) return x