summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-19 16:31:10 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-19 16:31:10 -0400
commit3c2ce3017120f9469a1fef83096307fc4cef43e2 (patch)
tree967a08e6b0ae8b95536c73b2b53d8f331a6bc582 /doc
parent3fe64420f18718e585cb36f4331edbf74a3d480e (diff)
downloadc++-3c2ce3017120f9469a1fef83096307fc4cef43e2.tar.gz
c++-3c2ce3017120f9469a1fef83096307fc4cef43e2.tar.bz2
c++-3c2ce3017120f9469a1fef83096307fc4cef43e2.zip
changed the way that the finite states system works
Diffstat (limited to 'doc')
-rw-r--r--doc/finite_states.rst16
1 files changed, 10 insertions, 6 deletions
diff --git a/doc/finite_states.rst b/doc/finite_states.rst
index 26178cd..c36881e 100644
--- a/doc/finite_states.rst
+++ b/doc/finite_states.rst
@@ -5,20 +5,24 @@
Finite States
*************
-One of the slower steps in running the algorithm is taking the exponent involved in computing the bond activation probabilities for each prospective bond. When the spins in your system have a finite number of possible states, the algorithm can be sped up considerably by precomputing the bond activation probabilities for every possible pair of spins. Once the appropriate things have been defined for your model, the header :file:`wolff/finite_states.hpp` can be invoked to automate this process. The provided model headers :file:`wolff/models/ising.hpp` and :file:`wolff/models/potts.hpp` demonstrate the expected usage.
+One of the slower steps in running the algorithm is taking the exponent involved in computing the bond activation probabilities for each prospective bond. When the spins in your system have a finite number of possible states, the algorithm can be sped up considerably by precomputing the bond activation probabilities for every possible pair of spins. Once the appropriate things have been defined for your model, the compile definition :c:macro:`WOLFF_USE_FINITE_STATES` can be set to automate this process. The provided model headers :file:`wolff/models/ising.hpp` and :file:`wolff/models/potts.hpp` demonstrate the expected usage.
Required Definitions
====================
+.. c:macro:: WOLFF_USE_FINITE_STATES
+
+ This macro must defined before :file:`wolff.hpp` or any of the other header files are invoked.
+
.. c:macro:: WOLFF_FINITE_STATES_N
- This macro must be defined and given a value equal to the number of states your model can take.
+ This macro must be defined and given a value equal to the number of states your model can take. It must be defined before :file:`wolff.hpp` or any of the other header files are invoked.
-.. cpp:var:: const X_t finite_states_possible[WOLFF_FINITE_STATES_N]
+.. cpp:function:: X_t::X_t(q_t)
- You must supply a constant array which lists each of the possible states of your individual spins.
+ Your spin class :cpp:class:`X_t` must have a constructor defined that takes a :cpp:type:`q_t` and returns a unique state for all arguments less than :c:macro:`WOLFF_FINITE_STATES_N`.
-.. cpp:function:: q_t finite_states_enum(const X_t&)
+.. cpp:function:: q_t X_t::enumerate()
- You must define a function which takes each state and returns its index in :cpp:var:`finite_states_possible`.
+ Your spin class :cpp:class:`X_t` must have a function defined that returns the index associated with a given state. This must be the inverse function of the constructor above.