# Pkg.add("SweepOperator") using SweepOperator srand(280) X = randn(5, 3) # predictor matrix y = randn(5) # response vector # form the augmented Gram matrix G = [X y]' * [X y] sweep!(G, 1:3) # least squares solution by QR X \ y # inverse sweep to restore original matrix sweep!(G, 1:3, true) versioninfo()