@Override
  public void process(double[] input, double[] output) {
    param.decode(input, pose);

    residual.setModel(pose);
    int index = 0;
    for (int i = 0; i < obs.size(); i++) {
      index = residual.computeResiduals(obs.get(i), output, index);
    }
  }
 @Override
 public int getM() {
   return obs.size() * residual.getN();
 }