CMakeCache.txt
CMakeFiles
data
+heatbath-heatless
+heatbath-relaxedheat
+heatbath-usualheat
add_subdirectory(latlib)
-add_executable(heatbath heatbath.cpp)
-#set_target_properties(phi4iso-local PROPERTIES COMPILE_DEFINITIONS "LOCAL_UPDATE_ALGORITHM")
-target_link_libraries(heatbath o815 gsl gslcblas lat_neigh)
+add_executable(heatbath-heatless heatbath.cpp)
+set_target_properties(heatbath-heatless PROPERTIES COMPILE_DEFINITIONS "HEATLESS_ALGORITHM")
+target_link_libraries(heatbath-heatless o815 gsl gslcblas lat_neigh)
+
+add_executable(heatbath-usualheat heatbath.cpp)
+set_target_properties(heatbath-usualheat PROPERTIES COMPILE_DEFINITIONS "USUALHEAT_ALGORITHM")
+target_link_libraries(heatbath-usualheat o815 gsl gslcblas lat_neigh)
+
+add_executable(heatbath-relaxedheat heatbath.cpp)
+set_target_properties(heatbath-relaxedheat PROPERTIES COMPILE_DEFINITIONS "RELAXEDHEAT_ALGORITHM")
+target_link_libraries(heatbath-relaxedheat o815 gsl gslcblas lat_neigh)
+#include <complex>
+
#include "latlib/o815/o815.h"
-#include "sim.hpp"
+#ifdef HEATLESS_ALGORITHM
+#define ALGORITHM "heatless"
+#include "sim-heatless.hpp"
+#elif USUALHEAT_ALGORITHM
+#define ALGORITHM "usualheat"
+#include "sim-usualheat.hpp"
+#elif RELAXEDHEAT_ALGORITHM
+#define ALGORITHM "relaxedheat"
+#include "sim-relaxedheat.hpp"
+#else
+#error NO UPDATE-ALGORITHM DEFINED!
+#endif
#include "obs_phi2.hpp"
o815 *O815;
sim *Sim;
+const complex<double> _i_ = complex<double>(0.0,1.0);
+
o815::comoption specOps[] = {
{ "mass", required_argument, NULL, 'm', "set mass", "min:max:inc" },
{ "", 0, NULL, 0, "", "" }
}
void helpHeader()
-{
- cout << "Usage: ./heatbath [OPTIONS] [obs1] ... [obsN]" << endl << endl;
+{
+ cout << "Usage: ./heatbath-"ALGORITHM" [OPTIONS] [obs1] ... [obsN]" << endl << endl;
}
void parseLonelyArgs()
int main (int argc, char *argv[])
{
- O815 = new o815(argc, argv, "heatbath", specOps, &helpHeader);
+ O815 = new o815(argc, argv, "heatbath-"ALGORITHM, specOps, &helpHeader);
O815->addPara("mass", 1);
O815->Sim = new sim(O815);
parseLonelyArgs();
-
+
O815->mainLoop();
delete O815;
int compid_phi2, compid_phi2sus;
compid_phi2 = oPhi2.computeEasy();
- compid_phi2sus = oPhi2.computeJack(obs_phi2::phi2Sus, &(Sim->LSIZE4));
+ compid_phi2sus = oPhi2.computeJack(obs_phi2::phi2Sus, &(Sim->LSIZE2));
*out << "\t" << oPhi2.getMean(compid_phi2) << "\t" << oPhi2.getErr(compid_phi2);
*out << "\t" << oPhi2.getMean(compid_phi2sus) << "\t" << oPhi2.getErr(compid_phi2sus);
{
OM->phi2 = 0;
- for (int ix = 0; ix < Sim->LSIZE4; ix++)
+ for (int ix = 0; ix < Sim->LSIZE2; ix++)
OM->phi2 += norm( Sim->conf[ix].phi );
- OM->phi2 /= Sim->LSIZE4;
+ OM->phi2 /= Sim->LSIZE2;
}
double obs_phi2::phi2Sus(vector< vector<double> > *vals, void *para) {
--- /dev/null
+#ifndef SIM_HPP
+#define SIM_HPP
+
+#include <gsl/gsl_rng.h>
+#include <complex>
+#include <math.h>
+
+#include "latlib/neigh.h"
+
+class sim : public o815::sim {
+public:
+ struct siteconf {
+ complex<double> phi;
+ };
+ sim(o815 *_O815);
+ siteconf* conf;
+ unsigned int LSIZE2;
+
+private:
+ void _makeSweep();
+ void _newParas();
+
+ gsl_rng* rangsl;
+
+ neigh *nb;
+
+ void updatePhi (const int& x);
+};
+
+
+
+sim::sim(o815 *_O815) : o815::sim( _O815,
+ sizeof(siteconf)*
+ (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) {
+ conf = (siteconf*)confMem;
+
+ rangsl = gsl_rng_alloc(gsl_rng_ranlxs0);
+ gsl_rng_set(rangsl, time(NULL));
+
+ LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1];
+
+ nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]);
+}
+
+void sim::updatePhi (const int& x)
+{
+ const double r = gsl_rng_uniform(rangsl);
+ const double theta = gsl_rng_uniform(rangsl) * 2*M_PI;
+}
+
+void sim::_makeSweep() {
+}
+
+void sim::_newParas() {
+ /* reset variables */
+}
+
+#endif
--- /dev/null
+#ifndef SIM_HPP
+#define SIM_HPP
+
+#include <gsl/gsl_rng.h>
+#include <complex>
+#include <math.h>
+
+#include "latlib/neigh.h"
+
+class sim : public o815::sim {
+public:
+ struct siteconf {
+ complex<double> phi;
+ };
+ sim(o815 *_O815);
+ siteconf* conf;
+ unsigned int LSIZE2;
+
+private:
+ void _makeSweep();
+ void _newParas();
+
+ gsl_rng* rangsl;
+
+ neigh *nb;
+
+ void updatePhi (const int& x);
+};
+
+
+
+sim::sim(o815 *_O815) : o815::sim( _O815,
+ sizeof(siteconf)*
+ (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) {
+ conf = (siteconf*)confMem;
+
+ rangsl = gsl_rng_alloc(gsl_rng_ranlxs0);
+ gsl_rng_set(rangsl, time(NULL));
+
+ LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1];
+
+ nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]);
+}
+
+void sim::updatePhi (const int& x)
+{
+ const double r = gsl_rng_uniform(rangsl);
+ const double theta = gsl_rng_uniform(rangsl) * 2*M_PI;
+}
+
+void sim::_makeSweep() {
+}
+
+void sim::_newParas() {
+ /* reset variables */
+}
+
+#endif
--- /dev/null
+#ifndef SIM_HPP
+#define SIM_HPP
+
+#include <gsl/gsl_rng.h>
+#include <complex>
+#include <math.h>
+
+#include "latlib/neigh.h"
+
+class sim : public o815::sim {
+public:
+ struct siteconf {
+ complex<double> phi;
+ };
+ sim(o815 *_O815);
+ siteconf* conf;
+ unsigned int LSIZE2;
+
+private:
+ void _makeSweep();
+ void _newParas();
+
+ gsl_rng* rangsl;
+
+ neigh *nb;
+
+ void updatePhi (const int& x);
+};
+
+
+
+sim::sim(o815 *_O815) : o815::sim( _O815,
+ sizeof(siteconf)*
+ (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) {
+ conf = (siteconf*)confMem;
+
+ rangsl = gsl_rng_alloc(gsl_rng_ranlxs0);
+ gsl_rng_set(rangsl, time(NULL));
+
+ LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1];
+
+ nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]);
+}
+
+void sim::updatePhi (const int& x)
+{
+ const double r = gsl_rng_uniform(rangsl);
+ const double theta = gsl_rng_uniform(rangsl) * 2*M_PI;
+}
+
+void sim::_makeSweep() {
+}
+
+void sim::_newParas() {
+ /* reset variables */
+}
+
+#endif
+++ /dev/null
-#ifndef SIM_HPP
-#define SIM_HPP
-
-#include <gsl/gsl_rng.h>
-#include <complex>
-
-#include "latlib/neigh.h"
-
-class sim : public o815::sim {
-public:
- struct siteconf {
- complex<double> phi;
- };
- sim(o815 *_O815);
- siteconf* conf;
- int LSIZE4;
-
-private:
- void _makeSweep();
- void _newParas();
-
- gsl_rng* rangsl;
-
- neigh *nb;
-};
-
-sim::sim(o815 *_O815) : o815::sim( _O815,
- sizeof(siteconf)*
- (_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) {
- conf = (siteconf*)confMem;
- LSIZE4 = _O815->comargs.lsize[0] * _O815->comargs.lsize[0] * _O815->comargs.lsize[0] * _O815->comargs.lsize[1];
-
- rangsl = gsl_rng_alloc(gsl_rng_ranlxs0);
- gsl_rng_set(rangsl, time(NULL));
-
- nb = new neigh(4, _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[1]);
-}
-
-void sim::_makeSweep() {
-}
-
-void sim::_newParas() {
- /* reset variables */
-}
-
-#endif