Package ffx.xray
Class RefinementMinimize
java.lang.Object
ffx.xray.RefinementMinimize
- All Implemented Interfaces:
Terminatable,OptimizationListener
The RefinementMinimize class is responsible for performing energy minimization for refinement
tasks. It provides multiple methods for minimization, allowing customization of gradient
root mean square (RMS) values, maximum iterations, and matrix conditioning settings if necessary.
The class enables iterative optimization with monitoring capabilities through an optional listener,
and supports graceful termination during the process.
This class implements both the OptimizationListener and Terminatable interfaces and acts as an intermediary for managing refinement energy computation and convergence behavior.
- Since:
- 1.0
- Author:
- Timothy D. Fenn, Michael J. Schnieders
-
Constructor Summary
ConstructorsConstructorDescriptionRefinementMinimize(DataContainer dataContainer) Constructor for the RefinementMinimize class, which initializes the refinement process with a specified data container and no algorithm listener.RefinementMinimize(DataContainer dataContainer, AlgorithmListener algorithmListener) Constructor for the RefinementMinimize class, initializing the refinement process with a specified data container and an optional algorithm listener for updates. -
Method Summary
Modifier and TypeMethodDescriptionminimize()Minimizes the refinement energy using a default gradient root mean square (RMS) value of 1.0.minimize(double eps) Minimizes the refinement energy using a specified gradient root mean square (RMS) value.minimize(double eps, int maxIterations) Minimizes the refinement energy using a specified gradient root mean square (RMS) value and maximum number of iterations.minimize(int maxIterations) Minimizes the refinement energy with a specified maximum number of iterations, using a gradient RMS value of 1.0 and default matrix conditioning cycles.minimize(int m, double eps, int maxiter) Minimizes the refinement energy using the provided matrix conditioning cycles, gradient RMS value, and a maximum number of iterations.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
-
RefinementMinimize
Constructor for the RefinementMinimize class, which initializes the refinement process with a specified data container and no algorithm listener.- Parameters:
dataContainer- the data container object containing refinement data and methods
-
RefinementMinimize
public RefinementMinimize(DataContainer dataContainer, @Nullable AlgorithmListener algorithmListener) Constructor for the RefinementMinimize class, initializing the refinement process with a specified data container and an optional algorithm listener for updates.- Parameters:
dataContainer- the data container object containing refinement data and methodsalgorithmListener- an optional algorithm listener that provides updates during processing (can be null)
-
-
Method Details
-
minimize
Minimizes the refinement energy using a default gradient root mean square (RMS) value of 1.0.- Returns:
- a
RefinementEnergyobject representing the result of the minimization process.
-
minimize
Minimizes the refinement energy using a specified gradient root mean square (RMS) value.- Parameters:
eps- the desired gradient RMS value for the refinement process- Returns:
- a
RefinementEnergyobject representing the result of the minimization process
-
minimize
Minimizes the refinement energy with a specified maximum number of iterations, using a gradient RMS value of 1.0 and default matrix conditioning cycles.- Parameters:
maxIterations- the maximum number of iterations allowed for the minimization process- Returns:
- a
RefinementEnergyobject representing the result of the minimization process
-
minimize
Minimizes the refinement energy using a specified gradient root mean square (RMS) value and maximum number of iterations.- Parameters:
eps- the desired gradient RMS value for the refinement processmaxIterations- the maximum number of iterations allowed for the minimization process- Returns:
- a
RefinementEnergyobject representing the result of the minimization process
-
minimize
Minimizes the refinement energy using the provided matrix conditioning cycles, gradient RMS value, and a maximum number of iterations. The default number of matrix conditioning steps is 7, while 0 is for steepest decent.- Parameters:
m- the number of matrix conditioning cycles for the optimization processeps- the desired gradient root mean square (RMS) value for convergencemaxiter- the maximum number of iterations allowed for the minimization process- Returns:
- a
RefinementEnergyobject representing the outcome of the minimization process
-
optimizationUpdate
public boolean optimizationUpdate(int iter, int nBFGS, int nfun, double grms, double xrms, double f, double df, double angle, @Nullable 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
-