Package ffx.xray

Class ScaleBulkMinimize

java.lang.Object
ffx.xray.ScaleBulkMinimize
All Implemented Interfaces:
Terminatable, OptimizationListener

public class ScaleBulkMinimize extends Object implements OptimizationListener, Terminatable
ScaleBulkMinimize class.
Since:
1.0
Author:
Timothy D. Fenn
  • Constructor Details

  • 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

      public ScaleBulkEnergy minimize(double eps)
      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 ScaleBulkEnergy object resulting from the minimization process.
    • minimize

      public ScaleBulkEnergy minimize(int m, double eps)
      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 ScaleBulkEnergy object 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:
      optimizationUpdate in interface OptimizationListener
      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 the Terminatable algorithm has reached a clean termination point. For example, between minimize or molecular dynamics steps.
      Specified by:
      terminate in interface Terminatable
    • 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.