R/qr_solver.R

Defines functions qr_solver

#------------------------------------------------------------------
#QR Solver Function:
qr_solver <- function(A,b){
	#Solves linear system Ax=b.
	
	#Obtain QR decomposition of matrix A.  Extract components.
	QR <- qr(A)
	Q <- qr.Q(QR)
	R <- qr.R(QR)
	
	#Backsolve for x.
	x <- qr.solve(A,b)
	return(x)
}
jstarling1/starlib documentation built on May 20, 2019, 2:12 a.m.