Package ffx.xray
Class ScaleBulkMinimize
java.lang.Object
ffx.xray.ScaleBulkMinimize
- All Implemented Interfaces:
Terminatable,OptimizationListener
ScaleBulkMinimize class.
- Since:
- 1.0
- Author:
- Timothy D. Fenn
-
Constructor Summary
ConstructorsConstructorDescriptionScaleBulkMinimize(ReflectionList reflectionList, DiffractionRefinementData refinementData, CrystalReciprocalSpace crystalReciprocalSpace, ParallelTeam parallelTeam) Constructor for ScaleBulkMinimize. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getCoordinates(double[] x) getCoordinates.intRetrieves the number of variables used in the optimization process.voidPerform a grid optimization of the bulk solvent model to minimize the residual energy and improve refinement parameters.voidPerform a grid search optimization for bulk solvent and scaling parameters.minimize(double eps) Performs a minimization procedure with the specified convergence criterion (epsilon).minimize(int m, double eps) Performs a minimization process to optimize scaling and bulk solvent energy parameters.booleanoptimizationUpdate(int iter, int nBFGS, int nfun, double grms, double xrms, double f, double df, double angle, LineSearch.LineSearchResult info) This method is called by the optimizer after each step.voidThis should be implemented as a blocking interrupt; when the method returns theTerminatablealgorithm has reached a clean termination point.
-
Constructor Details
-
ScaleBulkMinimize
public ScaleBulkMinimize(ReflectionList reflectionList, DiffractionRefinementData refinementData, CrystalReciprocalSpace crystalReciprocalSpace, ParallelTeam parallelTeam) Constructor for ScaleBulkMinimize.- Parameters:
reflectionList- aReflectionListobject.refinementData- aDiffractionRefinementDataobject.crystalReciprocalSpace- aCrystalReciprocalSpaceobject.parallelTeam- the ParallelTeam to execute the ScaleBulkMinimize.
-
-
Method Details
-
getCoordinates
public double[] getCoordinates(@Nullable double[] x) getCoordinates.- Parameters:
x- the array to populate with parameters or null to create a new array.- Returns:
- an array containing the parameters.
-
getNumberOfVariables
public int getNumberOfVariables()Retrieves the number of variables used in the optimization process.- Returns:
- the number of variables.
-
minimize
Performs a minimization procedure with the specified convergence criterion (epsilon).- Parameters:
eps- the convergence threshold for the minimization process; smaller values indicate tighter convergence criteria.- Returns:
- a
ScaleBulkEnergyobject resulting from the minimization process.
-
minimize
Performs a minimization process to optimize scaling and bulk solvent energy parameters.- Parameters:
m- the number of prior gradient evaluations used by the L-BFGS algorithm; larger values can improve convergence for challenging optimizations, but may increase memory usage.eps- the convergence threshold for the minimization process; smaller values indicate tighter convergence criteria.- Returns:
- the
ScaleBulkEnergyobject representing the refined bulk solvent energy after the minimization process.
-
optimizationUpdate
public boolean optimizationUpdate(int iter, int nBFGS, int nfun, double grms, double xrms, double f, double df, double angle, LineSearch.LineSearchResult info) This method is called by the optimizer after each step.It can be used to log status messages, update the user interface, or gracefully terminate the optimizer.
- Specified by:
optimizationUpdatein interfaceOptimizationListener- Parameters:
iter- Number of iterations.nBFGS- Number of L-BFGS correction vectors.nfun- Number of function evaluations.grms- RMS gradient at current solution.xrms- RMS coordinate change at current solution.f- Function value at current solution.df- Change in the function value compared to the previous solution.angle- Current angle between gradient and search direction.info- Result of the line search (null at iteration == 0).- Returns:
- A return value of false will terminate the optimization.
-
terminate
public void terminate()This should be implemented as a blocking interrupt; when the method returns theTerminatablealgorithm has reached a clean termination point. For example, between minimize or molecular dynamics steps.- Specified by:
terminatein interfaceTerminatable
-
gridOptimizeBulkSolventModel
public void gridOptimizeBulkSolventModel()Perform a grid optimization of the bulk solvent model to minimize the residual energy and improve refinement parameters. This method adjusts the bulk solvent parameters (A and B) within a specified range using a grid search algorithm, evaluates the associated energy, and identifies optimal parameters based on the minimum residual. -
gridOptimizeKsBs
public void gridOptimizeKsBs()Perform a grid search optimization for bulk solvent and scaling parameters. The method adjusts the scaling factor and bulk solvent parameters (Ks and Bs) to minimize the energy function and improve the refinement results.
-