View PCAGD.jl
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) |