optimize qr_solver