Initialize all Spin Values

The function init() visits every spin and assigns it either +1 or -1 randomly.
void init ( int ** M, int L, gsl_rng * r ) {
  int i,j;
  for (i=0;i<L;i++) {
    for (j=0;j<L;j++) {
      M[i][j]=2*(int)gsl_rng_uniform_int(r,2)-1;
    }
  }
}



cfa22@drexel.edu