8#include "shiftToMinimum.h"
25 if (v[0] < -(d[0]/2) ) {
40 const double epsilon = 1.0E-8;
41 double Gsq = cell.ksq(v);
42 double Gsq_min_lo = Gsq - epsilon;
43 double Gsq_min_hi = Gsq + epsilon;
50 for (s0 = -q; s0 < q+1; ++s0) {
51 u[0] = v[0] + s0*d[0];
52 for (s1 = -q; s1 < q+1; ++s1) {
53 u[1] = v[1] + s1*d[1];
55 if (Gsq < Gsq_min_hi) {
56 if ((Gsq < Gsq_min_lo) || (r < u)) {
57 Gsq_min_lo = Gsq - epsilon;
58 Gsq_min_hi = Gsq + epsilon;
73 const double epsilon = 1.0E-8;
74 double Gsq = cell.ksq(v);
75 double Gsq_min_lo = Gsq - epsilon;
76 double Gsq_min_hi = Gsq + epsilon;
83 for (s0 = -q; s0 < q + 1; ++s0) {
84 u[0] = v[0] + s0*d[0];
85 for (s1 = -q; s1 < q + 1; ++s1) {
86 u[1] = v[1] + s1*d[1];
87 for (s2 = -q; s2 < q + 1; ++s2) {
88 u[2] = v[2] + s2*d[2];
90 if (Gsq < Gsq_min_hi) {
91 if ((Gsq < Gsq_min_lo) || (r < u)) {
92 Gsq_min_lo = Gsq - epsilon;
93 Gsq_min_hi = Gsq + epsilon;
An IntVec<D, T> is a D-component vector of elements of integer type T.
Base template for UnitCell<D> classes, D=1, 2 or 3.
File containing preprocessor macros for error handling.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
RT abs(CT const &a)
Return absolute magnitude of a complex number.
Periodic fields and crystallography.
PSCF package top-level namespace.