User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
exercise:prog:spinglass [2020/11/06 03:12] – [System representation] chunchungexercise:prog:spinglass [2020/11/06 03:15] (current) – [System representation] chunchung
Line 16: Line 16:
 Since the coupling involves two spins, it is instinctive to use a two-dimensional array for ''j''. However, in a more general view, it is clearer to serialize the iteration into one over links instead of two nodes. This also reduces redundancy. Since the coupling involves two spins, it is instinctive to use a two-dimensional array for ''j''. However, in a more general view, it is clearer to serialize the iteration into one over links instead of two nodes. This also reduces redundancy.
  
-Since we are using C++, we will use the ''vector'' class in place of array pointers:+Since we are using %%C++%%, we will use the ''vector'' class in place of array pointers:
 <code c++> <code c++>
 std::vector<int> spin; std::vector<int> spin;
Line 30: Line 30:
 std::vector<Link> lnks; std::vector<Link> lnks;
 </code> </code>
 +
 =====Data storage===== =====Data storage=====
 For portability of data, we use [[https://www.hdfgroup.org/solutions/hdf5/|HDF5]] library. Here, we try the C++ binding of the library. For portability of data, we use [[https://www.hdfgroup.org/solutions/hdf5/|HDF5]] library. Here, we try the C++ binding of the library.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information