root / Ising / Numpy-C / launch.py @ 310
Historique | Voir | Annoter | Télécharger (646 octet)
| 1 |
import array_module_np |
|---|---|
| 2 |
import numpy as np |
| 3 |
import pylab |
| 4 |
|
| 5 |
# x = np.arange(0, 2 * np.pi, 0.1)
|
| 6 |
# y = array_module_np.array_cos_np(x)
|
| 7 |
# z = array_module_np.array_sin_np(x)
|
| 8 |
# pylab.plot(x, y,x,z)
|
| 9 |
# pylab.show()
|
| 10 |
|
| 11 |
# x = np.arange(0, 2 * np.pi, 0.1)
|
| 12 |
# print array_module_np.array_cos_arg_np(x,1)
|
| 13 |
|
| 14 |
# x = np.arange(0,64,1).reshape(8,8).astype(np.int64)
|
| 15 |
|
| 16 |
# print x
|
| 17 |
|
| 18 |
# print array_module_np.array_operation_np(x,1,1,1,1000000000,2008,1010)
|
| 19 |
|
| 20 |
SIZE=8
|
| 21 |
|
| 22 |
x=np.where(np.random.randn(SIZE,SIZE)>0,1,-1).astype('int32') |
| 23 |
|
| 24 |
print x
|
| 25 |
|
| 26 |
y=array_module_np.array_metropolis_np(x,1,0,0.1,10000000,128,256) |
| 27 |
|
| 28 |
array_module_np.array_display_np(x) |
| 29 |
|
| 30 |
|
| 31 |
print y,y.dtype
|
| 32 |
|
| 33 |
print x,x.dtype
|