Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exercise:prog:spinglass [2020/08/17 18:19] – [Data storage] chunchung | exercise:prog:spinglass [2020/11/06 03:15] (current) – [System representation] chunchung | ||
---|---|---|---|
Line 14: | Line 14: | ||
double * j = new double [sz*(sz-1)/ | double * j = new double [sz*(sz-1)/ | ||
</ | </ | ||
+ | Since the coupling involves two spins, it is instinctive to use a two-dimensional array for '' | ||
+ | |||
+ | Since we are using %%C++%%, we will use the '' | ||
+ | <code c++> | ||
+ | std:: | ||
+ | std:: | ||
+ | std:: | ||
+ | </ | ||
+ | For couplings, we use '' | ||
+ | <code c++> | ||
+ | struct Link { | ||
+ | int n0; | ||
+ | int n1; | ||
+ | }; | ||
+ | std:: | ||
+ | </ | ||
+ | |||
=====Data storage===== | =====Data storage===== | ||
For portability of data, we use [[https:// | For portability of data, we use [[https:// | ||
Line 40: | Line 57: | ||
} | } | ||
</ | </ | ||
+ | =====All-to-all network===== |