use of uk.ac.sussex.gdsc.smlm.fitting.nonlinear.stop.ErrorStoppingCriteria in project GDSC-SMLM by aherbert.
the class BoundedFunctionSolverTest method getLvm.
private static NonLinearFit getLvm(int bounded, int clamping, boolean mle) {
final Gaussian2DFunction f = GaussianFunctionFactory.create2D(1, size, size, flags, null);
final StoppingCriteria sc = new ErrorStoppingCriteria();
sc.setMaximumIterations(100);
final NonLinearFit solver = (bounded != 0 || clamping != 0) ? new BoundedNonLinearFit(f, sc, null) : new NonLinearFit(f, sc);
if (clamping != 0) {
final BoundedNonLinearFit bsolver = (BoundedNonLinearFit) solver;
final ParameterBounds bounds = new ParameterBounds(f);
bounds.setClampValues(defaultClampValues);
bounds.setDynamicClamp(clamping == 2);
bsolver.setBounds(bounds);
}
solver.setMle(mle);
solver.setInitialLambda(1);
return solver;
}
Aggregations