Package ffx.potential
Class ANIEnergy
java.lang.Object
ffx.potential.ANIEnergy
- All Implemented Interfaces:
OptimizationInterface,Potential,LambdaInterface
-
Nested Class Summary
Nested classes/interfaces inherited from interface ffx.numerics.Potential
Potential.STATE, Potential.VARIABLE_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleenergy(boolean gradient, boolean print) Compute the ANI energy and gradint.doubleenergy(double[] x) This method is called repeatedly to compute the function energy.doubleenergyAndGradient(double[] x, double[] g) This method is called repeatedly to compute the function energy and gradient.double[]getAcceleration(double[] acceleration) getAcceleration.double[]getCoordinates(double[] parameters) Load the current value of the parameters.doubleGet the 2nd partial derivative of the energy with respect to lambda.doublegetdEdL()Get the partial derivative of the energy with respect to lambda.voidgetdEdXdL(double[] gradient) Get the gradient of dEdL with respect to each parameter.Get the Potential Energy terms that is active.doubleGet the current value of the state variable.double[]getMass()Get the mass of each degree of freedom.intGet the number of variables being operated on.double[]getPreviousAcceleration(double[] previousAcceleration) getPreviousAcceleration.double[]Get the problem scaling.doubleGet the total energy of the systemGet the type of all variables.double[]getVelocity(double[] velocity) getVelocity.voidsetAcceleration(double[] acceleration) setAcceleration.voidsetCoordinates(double[] parameters) Set the current value of the parameters.voidSet the Potential Energy terms that should be active.voidsetLambda(double lambda) Set the current value of the state variable.voidsetPreviousAcceleration(double[] previousAcceleration) setPreviousAcceleration.voidsetScaling(double[] scaling) Scale the problem.voidsetVelocity(double[] velocity) setVelocity.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ffx.potential.bonded.LambdaInterface
dEdLZeroAtEndsMethods inherited from interface ffx.numerics.OptimizationInterface
destroy, energy, energyAndGradient, getUnderlyingPotentials, scaleCoordinates, scaleCoordinatesAndGradient, unscaleCoordinatesMethods inherited from interface ffx.numerics.Potential
getConstraints, writeAdditionalRestartInfo
-
Constructor Details
-
ANIEnergy
-
-
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:OptimizationInterfaceThis method is called repeatedly to compute the function energy.- Specified by:
energyin interfaceOptimizationInterface- Parameters:
x- Input parameters.- Returns:
- Function value at
x.
-
energyAndGradient
public double energyAndGradient(double[] x, double[] g) Description copied from interface:OptimizationInterfaceThis method is called repeatedly to compute the function energy and gradient.- Specified by:
energyAndGradientin interfaceOptimizationInterface- 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:PotentialgetAcceleration.- Specified by:
getAccelerationin interfacePotential- Parameters:
acceleration- an array of double values.- Returns:
- an array of double values.
-
getCoordinates
public double[] getCoordinates(double[] parameters) Description copied from interface:OptimizationInterfaceLoad 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:
getCoordinatesin interfaceOptimizationInterface- Parameters:
parameters- Supplied array.- Returns:
- The array filled with parameter values.
-
setCoordinates
public void setCoordinates(double[] parameters) Description copied from interface:OptimizationInterfaceSet the current value of the parameters. If the supplied array is null or not large enough, no action is taken.- Specified by:
setCoordinatesin interfaceOptimizationInterface- Parameters:
parameters- The array with parameter values.
-
getEnergyTermState
Description copied from interface:PotentialGet the Potential Energy terms that is active.- Specified by:
getEnergyTermStatein interfacePotential- Returns:
- the STATE
-
setEnergyTermState
Description copied from interface:PotentialSet the Potential Energy terms that should be active.- Specified by:
setEnergyTermStatein interfacePotential- Parameters:
state- include FAST varying energy terms, SLOW varying energy terms or BOTH.
-
getMass
public double[] getMass()Description copied from interface:PotentialGet the mass of each degree of freedom. This is required for molecular dynamics. -
getNumberOfVariables
public int getNumberOfVariables()Description copied from interface:OptimizationInterfaceGet the number of variables being operated on.- Specified by:
getNumberOfVariablesin interfaceOptimizationInterface- Returns:
- Number of variables.
-
getPreviousAcceleration
public double[] getPreviousAcceleration(double[] previousAcceleration) Description copied from interface:PotentialgetPreviousAcceleration.- Specified by:
getPreviousAccelerationin interfacePotential- Parameters:
previousAcceleration- an array of double values.- Returns:
- an array of double values.
-
getScaling
public double[] getScaling()Description copied from interface:OptimizationInterfaceGet the problem scaling.- Specified by:
getScalingin interfaceOptimizationInterface- Returns:
- The scaling value used for each variable.
-
setScaling
public void setScaling(double[] scaling) Description copied from interface:OptimizationInterfaceScale the problem. A good choice for optimization is the square root of the median eigenvalue of a typical Hessian.- Specified by:
setScalingin interfaceOptimizationInterface- Parameters:
scaling- The scaling value to use for each variable.
-
getTotalEnergy
public double getTotalEnergy()Description copied from interface:OptimizationInterfaceGet the total energy of the system- Specified by:
getTotalEnergyin interfaceOptimizationInterface- Returns:
- the total energy
-
getVariableTypes
Description copied from interface:PotentialGet the type of all variables.- Specified by:
getVariableTypesin interfacePotential- Returns:
- The VARIABLE_TYPE of each variable.
-
getVelocity
public double[] getVelocity(double[] velocity) Description copied from interface:PotentialgetVelocity.- Specified by:
getVelocityin interfacePotential- Parameters:
velocity- an array of double values.- Returns:
- an array of double values.
-
setAcceleration
public void setAcceleration(double[] acceleration) Description copied from interface:PotentialsetAcceleration.- Specified by:
setAccelerationin interfacePotential- Parameters:
acceleration- an array of double values.
-
setPreviousAcceleration
public void setPreviousAcceleration(double[] previousAcceleration) Description copied from interface:PotentialsetPreviousAcceleration.- Specified by:
setPreviousAccelerationin interfacePotential- Parameters:
previousAcceleration- an array of double values.
-
setVelocity
public void setVelocity(double[] velocity) Description copied from interface:PotentialsetVelocity.- Specified by:
setVelocityin interfacePotential- Parameters:
velocity- an array of double values.
-
getLambda
public double getLambda()Description copied from interface:LambdaInterfaceGet the current value of the state variable.- Specified by:
getLambdain interfaceLambdaInterface- Returns:
- state
-
setLambda
public void setLambda(double lambda) Description copied from interface:LambdaInterfaceSet the current value of the state variable. May be ignored if lambda is not being applied.- Specified by:
setLambdain interfaceLambdaInterface- Parameters:
lambda- a double.
-
getd2EdL2
public double getd2EdL2()Description copied from interface:LambdaInterfaceGet the 2nd partial derivative of the energy with respect to lambda.- Specified by:
getd2EdL2in interfaceLambdaInterface- Returns:
- d2EdL2
-
getdEdL
public double getdEdL()Description copied from interface:LambdaInterfaceGet the partial derivative of the energy with respect to lambda.- Specified by:
getdEdLin interfaceLambdaInterface- Returns:
- dEdL
-
getdEdXdL
public void getdEdXdL(double[] gradient) Description copied from interface:LambdaInterfaceGet the gradient of dEdL with respect to each parameter.- Specified by:
getdEdXdLin interfaceLambdaInterface- Parameters:
gradient- - A double array of length the number of parameters in the model (commonly 3 * number of atoms).
-