In the following for loop, the cases i = 10,20 for d = 1 are not printed:
using LinearAlgebra, Random, Distributions p = 1000 Σ = I(p) X = zeros((p,p)) for d in 1:5 println("\nd: $d") for i in 1:20 if i % 10 == 0 print(" $i, ") end X = rand(MvNormal(zeros(p), Σ), 1000) end end
The code prints the following:
d: 1 d: 2 10, 20, d: 3 10, 20, d: 4 10, 20, d: 5 10, 20,
Update: It seems it’s a problem with JuliaPro. It works as expected if I copy-paste directly into the REPL, but if I use command+enter in the editor I get the strange result.
I am a bit intrigued by the behavior and would appreciate it if someone could explain the logic behind it.
If I comment out
X = rand(MvNormal(zeros(p), Σ), 1000) then it works as expected.
Here’s my Julia and System info:
Julia Version 1.4.2 Commit 44fa15b150* (2020-05-23 18:35 UTC) Platform Info: OS: macOS (x86_64-apple-darwin18.7.0) CPU: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-8.0.1 (ORCJIT, goldmont) Environment: JULIA_NUM_THREADS = 4 JULIA_PKG_SERVER = pkg.juliacomputing.com