msg-byu / symlib

Spacegroup finder. Includes symmetry-related routines for cluster expansion and other codes that rely on symmetries of lattices and crystals.
MIT License
12 stars 15 forks source link

Changed `bring_into_cell` #21

Closed wsmorgan closed 6 years ago

wsmorgan commented 6 years ago

Changed bring_into_cell to use a single call to MOD instead of a do while loop.

So now it's:

    v = MOD(v, 1.0_dp)
    ! If a component >= 1, translate by subtracting a lattice vector
    ! If a component < 0, translate by adding a lattice vector
    if (any(v >= 1.0_dp - eps) .or. any(v < 0.0_dp - eps)) then

instead of:

    do while (any(v >= 1.0_dp - eps) .or. any(v < 0.0_dp - eps))
wsmorgan commented 6 years ago

This also passes all the unit tests.