OneDark-Pro icon indicating copy to clipboard operation
OneDark-Pro copied to clipboard

Support julia is not good

Open guessable opened this issue 2 years ago • 2 comments

Hi, thank you for the extension.I like this colorscheme but I don't have enough syntax highlighting on the julia language. Snipaste_2023-11-20_10-34-04 Can we make it better?

guessable avatar Nov 20 '23 02:11 guessable

could you provide some example code

Binaryify avatar Dec 20 '23 08:12 Binaryify

could you provide some example code

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)

guessable avatar Dec 20 '23 11:12 guessable