@Override
  public double[] cycle(double[] S, int first, int second, int third) {
    double temp = S[first];
    S[first] = S[second];
    S[second] = S[third];