• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãoa9047d613054dcc50dc8f5fe228dfcefd4922d77 (tree)
Hora2008-11-12 23:11:03
Autoriselllo
Commiteriselllo

Mensagem de Log

I generalized the code in order to be able to take copies of 1D arrays
as well.

Mudança Sumário

Diff

diff -r 87b3de796b4e -r a9047d613054 Python-codes/replica.py
--- a/Python-codes/replica.py Wed Nov 12 13:54:51 2008 +0000
+++ b/Python-codes/replica.py Wed Nov 12 14:11:03 2008 +0000
@@ -8,20 +8,35 @@
88 #temp=pos_arr
99 dim=s.shape(pos_arr)
1010 n_row=dim[0]
11- n_col=dim[1]
12- print "n_row and n_col are, ", n_row, n_col
13-
14- copy=s.zeros(((n_row*N_rep),n_col))
11+ if (len(dim)>1):
12+ n_col=dim[1]
13+ print "n_row and n_col are, ", n_row, n_col
14+ else:
15+ print "n_row is, ", n_row
16+
17+
18+ if (len(dim)>1):
19+ copy=s.zeros(((n_row*N_rep),n_col))
20+ else:
21+ copy=s.zeros((n_row*N_rep))
22+
23+
24+
25+
1526 for i in xrange(N_rep):
16- copy[(i*n_row):((i+1)*n_row),:]=pos_arr
27+ if (len(dim)>1):
28+ copy[(i*n_row):((i+1)*n_row),:]=pos_arr
29+ else:
30+ copy[(i*n_row):((i+1)*n_row)]=pos_arr
31+
1732
1833 return copy
1934
20-cluster=p.load("initial_folded_larger_box")
35+cluster=p.load("eta_0")
2136
22-my_copy=replica(cluster,1000)
37+my_copy=replica(cluster,200)
2338
24-p.save("copy_of_cluster50_1000", my_copy)
39+p.save("eta_0_200", my_copy)
2540
2641 print "So far so good"
2742