29 INTEGER,
INTENT(IN) :: odd(:), pairs, dimension
30 INTEGER,
INTENT(OUT) :: strong, weak(3), z4, status
38 IF (dimension < 2 .OR. dimension > 3)
RETURN
39 IF (
SIZE(odd) /= 2**dimension .OR. pairs < 1 .OR. pairs > 1000000)
RETURN
40 IF (any(odd < 0) .OR. any(odd > pairs))
RETURN
41 strong = mod(sum(odd), 2)
42 IF (dimension == 3)
THEN
47 IF (btest(k, axis - 1)) weak(axis) = weak(axis) + odd(k + 1)
68 INTEGER,
INTENT(IN) :: odd(:), pairs
69 LOGICAL,
INTENT(OUT) :: signed_atomic, nonnegative_atomic
70 INTEGER,
INTENT(OUT) :: coefficients(:, :), status
72 INTEGER :: a, k, n, numerator, spare, &
76 signed_atomic = .false.
77 nonnegative_atomic = .false.
80 IF (n /= 4 .AND. n /= 8)
RETURN
81 IF (
SIZE(coefficients, 1) /= 2 .OR.
SIZE(coefficients, 2) /= n)
RETURN
82 IF (pairs < 1 .OR. pairs > 1000000 .OR. any(odd < 0) .OR. any(odd > pairs))
RETURN
87 numerator = numerator + (-1)**popcnt(iand(a, k))*(pairs - 2*odd(k + 1))
89 IF (mod(numerator, n) /= 0)
RETURN
90 difference(a + 1) = numerator/n
92 IF (mod(pairs - sum(difference), 2) /= 0)
RETURN
93 signed_atomic = .true.
94 spare = pairs - sum(abs(difference))
96 nonnegative_atomic = .true.
97 coefficients(1, :) = max(difference, 0)
98 coefficients(2, :) = max(-difference, 0)
99 coefficients(:, 1) = coefficients(:, 1) + spare/2
subroutine, public inversion_indicators(odd, pairs, dimension, strong, weak, z4, status)
Fu–Kane indices and inversion indicator with an explicit sign convention.
subroutine, public inversion_ebr_signature(odd, pairs, signed_atomic, nonnegative_atomic, coefficients, status)
Exact signed/nonnegative EBR-signature test for the inversion subgroup.