Package ffx.xray
Class RefinementMinimize
java.lang.Object
ffx.xray.RefinementMinimize
- All Implemented Interfaces:
Terminatable,OptimizationListener
Refinement minimization class using
OptimizationListener interface, constructs a RefinementEnergy object for this purpose- Since:
- 1.0
- Author:
- Timothy D. Fenn
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDifferent refinement mode selection types. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionconstructor for refinement, assumes coordinates and B factor optimizationRefinementMinimize(DataContainer data, RefinementMinimize.RefinementMode refinementmode) constructor for refinementRefinementMinimize(DataContainer data, RefinementMinimize.RefinementMode refinementMode, AlgorithmListener listener) constructor for refinement -
Method Summary
Modifier and TypeMethodDescriptiongetEps()Getter for the fieldeps.intgetNB()get the number of B factor parameters being fitintgetNOcc()get the number of occupancy parameters being fitintgetNXYZ()get the number of xyz parameters being fitminimize()minimize assuming an eps of 1.0 and Integer.MAX_VALUE cyclesminimize(double eps) minimize assuming Integer.MAX_VALUE cyclesminimize(double eps, int maxiter) minimize with input eps and cyclesminimize(int maxiter) minimize assuming an eps of 1.0 and limited cyclesminimize(int m, double eps, int maxiter) minimize with input cycles for matrix conditioning, eps and cyclesbooleanoptimizationUpdate(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.Parse a string into a refinement mode.voidThis should be implemented as a blocking interrupt; when the method returns theTerminatablealgorithm has reached a clean termination point.
-
Field Details
-
refinementEnergy
-
-
Constructor Details
-
RefinementMinimize
constructor for refinement, assumes coordinates and B factor optimization- Parameters:
data- inputDataContainerthat will be used as the model, must contain aRefinementModel
-
RefinementMinimize
constructor for refinement- Parameters:
data- inputDataContainerthat will be used as the model, must contain aRefinementModeland eitherDiffractionDataorRealSpaceDatarefinementmode-RefinementMinimize.RefinementModefor refinement
-
RefinementMinimize
public RefinementMinimize(DataContainer data, RefinementMinimize.RefinementMode refinementMode, AlgorithmListener listener) constructor for refinement- Parameters:
data- inputDataContainerthat will be used as the model, must contain aRefinementModeland eitherDiffractionDataorRealSpaceDatarefinementMode-RefinementMinimize.RefinementModefor refinementlistener-AlgorithmListenera listener for updates
-
-
Method Details
-
parseMode
Parse a string into a refinement mode.- Parameters:
str- Refinement mode string.- Returns:
- An instance of RefinementMode.
-
getEps
Getter for the fieldeps.- Returns:
- a
Doubleobject.
-
getNB
public int getNB()get the number of B factor parameters being fit- Returns:
- the number of B factor parameters
-
getNOcc
public int getNOcc()get the number of occupancy parameters being fit- Returns:
- the number of occupancy parameters
-
getNXYZ
public int getNXYZ()get the number of xyz parameters being fit- Returns:
- the number of xyz parameters
-
minimize
minimize assuming an eps of 1.0 and Integer.MAX_VALUE cycles- Returns:
RefinementEnergyresult
-
minimize
minimize assuming Integer.MAX_VALUE cycles- Parameters:
eps- input gradient rms desired- Returns:
RefinementEnergyresult
-
minimize
minimize assuming an eps of 1.0 and limited cycles- Parameters:
maxiter- maximum iterations allowed- Returns:
RefinementEnergyresult
-
minimize
minimize with input eps and cycles- Parameters:
eps- input gradient rms desiredmaxiter- maximum iterations allowed- Returns:
RefinementEnergyresult
-
minimize
minimize with input cycles for matrix conditioning, eps and cycles- Parameters:
m- number of cycles of matrix updateseps- input gradient rms desiredmaxiter- maximum iterations allowed- Returns:
RefinementEnergyresult
-
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
-