Skip to content

Commit

Permalink
Added int() calls around m.floor return values to be used as indices
Browse files Browse the repository at this point in the history
  • Loading branch information
sjvrijn committed May 16, 2017
1 parent 718efca commit 72f0df5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyKriging/samplingplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ def perturb(self,X,PertNum):
[n,k] = np.shape(X_pert)

for pert_count in range(0,PertNum):
col = m.floor(np.random.rand(1)*k)
col = int(m.floor(np.random.rand(1)*k))

#Choosing two distinct random points
el1 = 0
el2 = 0
while el1 == el2:
el1 = m.floor(np.random.rand(1)*n)
el2 = m.floor(np.random.rand(1)*n)
el1 = int(m.floor(np.random.rand(1)*n))
el2 = int(m.floor(np.random.rand(1)*n))

#swap the two chosen elements
arrbuffer = X_pert[el1,col]
Expand Down

0 comments on commit 72f0df5

Please sign in to comment.