class GeometryEncoder implements StereoEncoder {

    @Override
    public boolean encode(long[] current, long[] next) {

        int p = permutation.parity(current);

        // if is a permutation parity (all neighbors are different)
        if (p != 0) {

            // multiple with the geometric parity
            int q = geometric.parity() * p;

            // configure anticlockwise/clockwise
            if (q > 0) {
                for (int i : centres) {
                    next[i] = current[i] * ANTICLOCKWISE;
                }
            } else if (q < 0) {
                for (int i : centres) {
                    next[i] = current[i] * CLOCKWISE;
                }
            }

            // 0 parity ignored

            return true;
        }
        return false;
    }

    public  GeometryEncoder(int[] centres, PermutationParity permutation, GeometricParity geometric);
    public  GeometryEncoder(int centre, PermutationParity permutation, GeometricParity geometric);

}