You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your reply.sure,here is some julia code
using LinearAlgebra
mat = Matrix{Float64}
vec = Vector{Float64}
function GramSchmidt(𝔸::mat)::mat
m, n = size(𝔸)
𝕌 = 𝔸[:, 1] / norm(𝔸[:, 1])
@simd for j in 2:n
vⱼ = 𝔸[:, j]
@simd for i in 1:j-1
vⱼ -= (@view 𝔸[:, j])' * (@view 𝕌[:, i]) * (@view 𝕌[:, i])
end
𝕌 = cat(𝕌, vⱼ / norm(vⱼ), dims=2)
end
return 𝕌
end
function ModifiedGS(𝔸::mat)::mat
m, n = size(𝔸)
𝕌 = 𝔸[:, 1] / norm(𝔸[:, 1])
for j in 2:n
vⱼ = 𝔸[:, j]
for i in 1:j-1
vⱼ -= vⱼ' * (@view 𝕌[:, i]) * (@view 𝕌[:, i])
end
𝕌 = cat(𝕌, vⱼ / norm(vⱼ), dims=2)
end
return 𝕌
end
n = 1000
up = range(0, 1, n)
down = range(0, 1, n)
A = diagm(1 => up, -1 => down)
A += 2 * I(n + 1)
@timev ModifiedGS(A)
Hi, thank you for the extension.I like this colorscheme but I don't have enough syntax highlighting on the julia language.
Can we make it better?
The text was updated successfully, but these errors were encountered: