Package ffx.potential

Class ANIEnergy

java.lang.Object
ffx.potential.ANIEnergy
All Implemented Interfaces:
OptimizationInterface, Potential, LambdaInterface

public class ANIEnergy extends Object implements Potential, LambdaInterface
  • Constructor Details

  • Method Details

    • energy

      public double energy(boolean gradient, boolean print)
      Compute the ANI energy and gradint.
      Parameters:
      gradient - If true, compute the gradient.
      print - If true, turn on extra printing.
      Returns:
      The ANI energy.
    • energy

      public double energy(double[] x)
      Description copied from interface: OptimizationInterface
      This method is called repeatedly to compute the function energy.
      Specified by:
      energy in interface OptimizationInterface
      Parameters:
      x - Input parameters.
      Returns:
      Function value at x.
    • energyAndGradient

      public double energyAndGradient(double[] x, double[] g)
      Description copied from interface: OptimizationInterface
      This method is called repeatedly to compute the function energy and gradient.
      Specified by:
      energyAndGradient in interface OptimizationInterface
      Parameters:
      x - Input parameters.
      g - Output gradients with respect to each parameter.
      Returns:
      Function value at x.
    • getAcceleration

      public double[] getAcceleration(double[] acceleration)
      Description copied from interface: Potential
      getAcceleration.
      Specified by:
      getAcceleration in interface Potential
      Parameters:
      acceleration - an array of
      invalid reference
      double
      objects.
      Returns:
      an array of
      invalid reference
      double
      objects.
    • getCoordinates

      public double[] getCoordinates(double[] parameters)
      Description copied from interface: OptimizationInterface
      Load the current value of the parameters. If the supplied array is null or not large enough, a new one should be created. The filled array is returned.
      Specified by:
      getCoordinates in interface OptimizationInterface
      Parameters:
      parameters - Supplied array.
      Returns:
      The array filled with parameter values.
    • getEnergyTermState

      public Potential.STATE getEnergyTermState()
      Description copied from interface: Potential
      Get the Potential Energy terms that is active.
      Specified by:
      getEnergyTermState in interface Potential
      Returns:
      the STATE
    • setEnergyTermState

      public void setEnergyTermState(Potential.STATE state)
      Description copied from interface: Potential
      Set the Potential Energy terms that should be active.
      Specified by:
      setEnergyTermState in interface Potential
      Parameters:
      state - include FAST varying energy terms, SLOW varying energy terms or BOTH.
    • getMass

      public double[] getMass()
      Description copied from interface: Potential
      Get the mass of each degree of freedom. This is required for molecular dynamics.
      Specified by:
      getMass in interface Potential
      Returns:
      The mass of each degree of freedom.
    • getNumberOfVariables

      public int getNumberOfVariables()
      Description copied from interface: OptimizationInterface
      Get the number of variables being operated on.
      Specified by:
      getNumberOfVariables in interface OptimizationInterface
      Returns:
      Number of variables.
    • getPreviousAcceleration

      public double[] getPreviousAcceleration(double[] previousAcceleration)
      Description copied from interface: Potential
      getPreviousAcceleration.
      Specified by:
      getPreviousAcceleration in interface Potential
      Parameters:
      previousAcceleration - an array of
      invalid reference
      double
      objects.
      Returns:
      an array of
      invalid reference
      double
      objects.
    • getScaling

      public double[] getScaling()
      Description copied from interface: OptimizationInterface
      Get the problem scaling.
      Specified by:
      getScaling in interface OptimizationInterface
      Returns:
      The scaling value used for each variable.
    • setScaling

      public void setScaling(double[] scaling)
      Description copied from interface: OptimizationInterface
      Scale the problem. A good choice for optimization is the square root of the median eigenvalue of a typical Hessian.
      Specified by:
      setScaling in interface OptimizationInterface
      Parameters:
      scaling - The scaling value to use for each variable.
    • getTotalEnergy

      public double getTotalEnergy()
      Description copied from interface: OptimizationInterface
      Get the total energy of the system
      Specified by:
      getTotalEnergy in interface OptimizationInterface
      Returns:
      the total energy
    • getVariableTypes

      public Potential.VARIABLE_TYPE[] getVariableTypes()
      Description copied from interface: Potential
      Get the type of all variables.
      Specified by:
      getVariableTypes in interface Potential
      Returns:
      The VARIABLE_TYPE of each variable.
    • getVelocity

      public double[] getVelocity(double[] velocity)
      Description copied from interface: Potential
      getVelocity.
      Specified by:
      getVelocity in interface Potential
      Parameters:
      velocity - an array of
      invalid reference
      double
      objects.
      Returns:
      an array of
      invalid reference
      double
      objects.
    • setAcceleration

      public void setAcceleration(double[] acceleration)
      Description copied from interface: Potential
      setAcceleration.
      Specified by:
      setAcceleration in interface Potential
      Parameters:
      acceleration - an array of
      invalid reference
      double
      objects.
    • setPreviousAcceleration

      public void setPreviousAcceleration(double[] previousAcceleration)
      Description copied from interface: Potential
      setPreviousAcceleration.
      Specified by:
      setPreviousAcceleration in interface Potential
      Parameters:
      previousAcceleration - an array of
      invalid reference
      double
      objects.
    • setVelocity

      public void setVelocity(double[] velocity)
      Description copied from interface: Potential
      setVelocity.
      Specified by:
      setVelocity in interface Potential
      Parameters:
      velocity - an array of
      invalid reference
      double
      objects.
    • getLambda

      public double getLambda()
      Description copied from interface: LambdaInterface
      Get the current value of the state variable.
      Specified by:
      getLambda in interface LambdaInterface
      Returns:
      state
    • setLambda

      public void setLambda(double lambda)
      Description copied from interface: LambdaInterface
      Set the current value of the state variable. May be ignored if lambda is not being applied.
      Specified by:
      setLambda in interface LambdaInterface
      Parameters:
      lambda - a double.
    • getd2EdL2

      public double getd2EdL2()
      Description copied from interface: LambdaInterface
      Get the 2nd partial derivative of the energy with respect to lambda.
      Specified by:
      getd2EdL2 in interface LambdaInterface
      Returns:
      d2EdL2
    • getdEdL

      public double getdEdL()
      Description copied from interface: LambdaInterface
      Get the partial derivative of the energy with respect to lambda.
      Specified by:
      getdEdL in interface LambdaInterface
      Returns:
      dEdL
    • getdEdXdL

      public void getdEdXdL(double[] gradient)
      Description copied from interface: LambdaInterface
      Get the gradient of dEdL with respect to each parameter.
      Specified by:
      getdEdXdL in interface LambdaInterface
      Parameters:
      gradient - - A double array of length the number of parameters in the model (commonly 3 * number of atoms).