src/system.cpp
/**
 * Computes the difference in energy from a spin flip, 
 * given the index if the spin to flip.
 * 
 * @param site  (int): Index of the spin to flip.
 * @return delta_E (int): Difference in energy generated from the flip.
 */
Computes the difference in energy from a spin flip,
given the index if the spin to flip.

@param site  (int): Index of the spin to flip.
@return delta_E (int): Difference in energy generated from the flip.
Computes the difference in energy from a spin flip given the index if the spin to flip . @param site ( int ) : Index of the spin to flip . @return delta_E ( int ) : Difference in energy generated from the flip .
int System::energy_flip(int site) {
    int delta_E = 0;
    for (int a = 0; a < this->NN; ++a) {
        delta_E += - this->spins_vector[site] * this->spins_vector[this->NN_table[site * this->NN + a]];
    }
    return delta_E;
}
int System :: energy_flip ( int site ) { int delta_E = 0 ; for ( int a = 0 ; a < this -> NN ; ++ a ) { delta_E += - this -> spins_vector [ site ] * this -> spins_vector [ this -> NN_table [ site * this -> NN + a ] ] ; } return delta_E ; }
Computes the difference in energy from a spin flip,
 given the index if the spin to flip.
Computes the difference in energy from a spin flip given the index if the spin to flip .