This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Random | |
using LinearAlgebra | |
using LowRankApprox | |
"""Orthogonalize and normalize the columns of A in-place.""" | |
function orthogonal!(A) | |
m, n = size(A) | |
@inbounds for i in 1:n | |
@inbounds for j in 1:i-1 | |
view(A, :, i) .-= dot(view(A, :, j), view(A, :, i)) .* view(A, :, j) |