I’m completely puzzled with a problem concerning my code:
using LinearAlgebra
using DeterminantalPointProcesses
L=Symmetric(rand(100,100))
variables=collect(1:100)
dpp=DPP(eigen(L))
M0=rand(dpp,1)
function proposal(Mt::Array{Int64,1})
compl=setdiff(variables,Mt)
Lcompl=L[compl,compl]
dpp_compl=DPP(eigen(Lcompl))
M1=compl[rand(dpp_compl,1)[1]]
return M1
end
When I run map(x->proposal(M0[1]),1:3)
I get
3-element Array{Array{Int64,1},1}:
[2, 3, 4, 5, 6, 8, 10, 11, 12, 13 … 84, 87, 88, 89, 93, 94, 97, 98, 99, 100]
[2, 3, 4, 5, 6, 8, 10, 11, 12, 13 … 84, 87, 88, 89, 93, 94, 97, 98, 99, 100]
[2, 3, 4, 5, 6, 8, 10, 11, 12, 13 … 84, 87, 88, 89, 93, 94, 97, 98, 99, 100]
but I’m supposed to obtain 3 different arrays, because of the random command rand(dpp_compl,1)[1]
.
When I try to run
Mt=M0
compl=setdiff(variables,Mt[1])
Lcompl=L[compl,compl]
dpp_compl=DPP(eigen(Lcompl))
compl[rand(dpp_compl,1)[1]]
compl[rand(dpp_compl,1)[1]]
compl[rand(dpp_compl,1)[1]]
I obtain 3 different arrays and that’s what I should obtain. I’ completely puzzled because the first code should produce different arrays just like the second code! Has anyone an idea of what’s wrong??