src/system.cpp
/**
 * Initialize the spins randomly.
 * @param rng  (RNG): reference to a random number generator
 *                  from the RNG class.
 */
Initialize the spins randomly.
@param rng  (RNG): reference to a random number generator
from the RNG class.
Initialize the spins randomly . @param rng ( RNG ) : reference to a random number generator from the RNG class .
void System::init_spins_random(RNG &rng) {
    for (int i = 0; i < this->N_atm; ++i) {
        int idx = rand() % this->Sz;
        this->spins_vector[i] = this->spins_values[idx];
    }
    this->E_config = this->energy();
    this->M_config = this->magnetization();
}
void System :: init_spins_random ( RNG & rng ) { for ( int i = 0 ; i < this -> N_atm ; ++ i ) { int idx = rand ( ) % this -> Sz ; this -> spins_vector [ i ] = this -> spins_values [ idx ] ; } this -> E_config = this -> energy ( ) ; this -> M_config = this -> magnetization ( ) ; }
Initialize the spins randomly.
Initialize the spins randomly .