public final double doOperation() throws OperatorFailedException {
  final int dim=parameter.getDimension();
  final Bounds<Double> bounds=parameter.getBounds();
  double hastingsRatio=0;
  int checkStart=0, checkEnd=dim;
  if (scaleAllInd) {
    for (int i=0; i < dim; i++) {
      hastingsRatio+=scaleOne(i);
    }
  }
 else   if (scaleAll) {
    final double w=size * (MathUtils.nextDouble() - 0.5);
    final double f=Math.exp(w);
    for (int i=0; i < dim; i++) {
      parameter.setParameterValue(i,parameter.getParameterValue(i) * f);
    }
    hastingsRatio+=dim * w;
  }
 else {
    int j=MathUtils.nextInt(dim);
    hastingsRatio+=scaleOne(j);
    checkStart=j;
    checkEnd=j + 1;
  }
  for (int i=checkStart; i < checkEnd; i++) {
    final double value=parameter.getParameterValue(i);
    if (value < bounds.getLowerLimit(i) || value > bounds.getUpperLimit(i)) {
      throw new OperatorFailedException("proposed value outside boundaries");
    }
  }
  return hastingsRatio;
}

public final double doOperation ( ) throws OperatorFailedException { final int dim = parameter . getDimension ( ) ; final Bounds < Double > bounds = parameter . getBounds ( ) ; double hastingsRatio = 0 ; int checkStart = 0 , checkEnd = dim ; if ( scaleAllInd ) { for ( int i = 0 ; i < dim ; i ++ ) { hastingsRatio += scaleOne ( i ) ; } } else if ( scaleAll ) { final double w = size * ( MathUtils . nextDouble ( ) - 0.5 ) ; final double f = Math . exp ( w ) ; for ( int i = 0 ; i < dim ; i ++ ) { parameter . setParameterValue ( i , parameter . getParameterValue ( i ) * f ) ; } hastingsRatio += dim * w ; } else { int j = MathUtils . nextInt ( dim ) ; hastingsRatio += scaleOne ( j ) ; checkStart = j ; checkEnd = j + 1 ; } for ( int i = checkStart ; i < checkEnd ; i ++ ) { final double value = parameter . getParameterValue ( i ) ; if ( value < bounds . getLowerLimit ( i ) || value > bounds . getUpperLimit ( i ) ) { throw new OperatorFailedException ( "proposed value outside boundaries" ) ; } } return hastingsRatio ; }
change the parameter and return the hastings ratio .
