#include <gsl/gsl_rng.h>
#include <complex>
#include <math.h>
+#include <sys/time.h>
#include "latlib/neigh.h"
neigh *nb;
complex<double> *U, *phi;
double kappa[2], lambda[2], beta;
-
+ void _newParas();
+
private:
+ void _resetConfig();
void _makeSweep();
- void _newParas();
gsl_rng* rangsl;
double rhoPhi(const int& iphi, const int& x0, const complex<double>& candPhi);
double rhoU(const int& x0, const int& nu0, const complex<double>& candU);
sizeof(complex<double>)*
_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[1]*(2+4) ) {
+ struct timeval tv;
+
lsize4 = _O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[1];
nb = new neigh(4, _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[1]);
phi = (complex<double>*)confMem;
U = (complex<double>*)(confMem + sizeof(complex<double>)*lsize4*2);
+ gettimeofday(&tv, NULL);
rangsl = gsl_rng_alloc(gsl_rng_ranlxs0);
- gsl_rng_set(rangsl, time(NULL));
+ gsl_rng_set(rangsl, 1000000 * tv.tv_sec + tv.tv_usec);
}
void sim::_makeSweep() {
lambda[0] = (*O815->paraQ)["lambdaone"];
lambda[1] = (*O815->paraQ)["lambdatwo"];
beta = (*O815->paraQ)["beta"];
+}
+void sim::_resetConfig() {
for(int ix=0; ix<lsize4; ix++) {
for(int i=0; i<2; i++) phi[ i*lsize4 + ix ] = 0;
for(int nu=0; nu<4; nu++) U[ ix*4 + nu ] = 1;