Package ffx.xray.refine
Class RefinedCoordinates
java.lang.Object
ffx.xray.refine.RefinedParameter
ffx.xray.refine.RefinedCoordinates
Represents a set of coordinates that can be refined during a refinement process.
This class encapsulates an
Atom object and any additional atoms that are constrained
to follow its coordinates.-
Field Summary
Fields inherited from class ffx.xray.refine.RefinedParameter
atom, constrainedAtoms, constrainedAtomsThatScatter, index -
Constructor Summary
ConstructorsConstructorDescriptionRefinedCoordinates(Atom atom) Constructs a new RefinableCoordinates instance for the specified atom. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstrainedAtom(Atom atom) Adds an atom to the list of constrained atoms for the given primary atom.voidAdds an atom to the list of constrained atoms that contribute to experimental scattering.voidgetAcceleration(double[] acceleration) Updates a subset of the parameter array with the XYZ acceleration components of the primary atom.double[]getCoordinates(double[] xyz) Retrieves the XYZ coordinates of the primary atom, updating the provided array or returning a new array if the input array is null.voidgetGradient(double[] gradient) Updates the gradient array with the contributions from the primary atom and any constrained atoms that scatter.voidgetMass(double[] mass, double defaultMass) Updates the provided array with the atomic mass of the primary atom.intRetrieves the number of parameters associated with this refineable.voidgetParameters(double[] parameters) Updates a subset of the parameter array with the XYZ coordinates of the primary atom.voidgetPreviousAcceleration(double[] previousAcceleration) Updates a subset of the parameter array with the XYZ previous acceleration components of the primary atom.voidgetVelocity(double[] velocity) Updates a subset of the parameter array with the XYZ velocity components of the primary atom.voidsetAcceleration(double[] acceleration) Sets the acceleration components for the primary atom.voidsetCoordinates(double[] xyz) Sets the coordinates of the primary atom and updates the coordinates of all constrained atoms to match the new values.voidsetOptimizationScaling(double[] optimizationScaling) Sets the scaling factors for optimization parameters at specific indices.voidsetParameters(double[] parameters) Updates the XYZ coordinates of the primary atom and all associated constrained atoms using the provided parameters array.voidsetPreviousAcceleration(double[] previousAcceleration) Sets the previous acceleration components for the primary atom.voidsetVelocity(double[] velocity) Sets the velocity components of the primary atom using the provided parameters array.toString()voidInitialize the coordinate gradient to zero.Methods inherited from class ffx.xray.refine.RefinedParameter
getIndex, setIndex
-
Constructor Details
-
RefinedCoordinates
Constructs a new RefinableCoordinates instance for the specified atom. This instance represents a set of coordinates that can be refined, with the given atom serving as the primary reference point during the refinement process. Changes to the primary atom's coordinates will also affect any constrained atoms associated with this instance.- Parameters:
atom- theAtomwhose coordinates are being refined; this atom serves as the primary reference point for the refinement process.
-
-
Method Details
-
addConstrainedAtom
Description copied from class:RefinedParameterAdds an atom to the list of constrained atoms for the given primary atom. This method defines the relationship between the primary atom and other atoms that are constrained or related as part of the refinement process.- Specified by:
addConstrainedAtomin classRefinedParameter- Parameters:
atom- the atom to be added as a constrained atom associated with the primary atom.
-
addConstrainedAtomThatScatters
Description copied from class:RefinedParameterAdds an atom to the list of constrained atoms that contribute to experimental scattering.- Specified by:
addConstrainedAtomThatScattersin classRefinedParameter- Parameters:
atom- the atom to be added as a constrained atom that has scattering contributions.
-
getCoordinates
public double[] getCoordinates(@Nullable double[] xyz) Retrieves the XYZ coordinates of the primary atom, updating the provided array or returning a new array if the input array is null.- Parameters:
xyz- an array of doubles where the XYZ coordinates should be stored. If the input array is null, a new double array will be created and returned.- Returns:
- an array of doubles containing the XYZ coordinates of the primary atom. If the input array is not null, it will be updated with the coordinates and returned.
-
setCoordinates
public void setCoordinates(double[] xyz) Sets the coordinates of the primary atom and updates the coordinates of all constrained atoms to match the new values.- Parameters:
xyz- an array of doubles representing the XYZ coordinates to be set for the primary atom and its constrained atoms
-
getNumberOfParameters
public int getNumberOfParameters()Description copied from class:RefinedParameterRetrieves the number of parameters associated with this refineable. Concrete implementations define how the parameters are determined and counted.- Specified by:
getNumberOfParametersin classRefinedParameter- Returns:
- the number of parameters related to this refinement process.
-
getParameters
public void getParameters(double[] parameters) Updates a subset of the parameter array with the XYZ coordinates of the primary atom.- Specified by:
getParametersin classRefinedParameter- Parameters:
parameters- an array of doubles where the XYZ coordinates of the primary atom will be stored. The x, y, and z values are assigned sequentially starting at the current index value.
-
setParameters
public void setParameters(double[] parameters) Updates the XYZ coordinates of the primary atom and all associated constrained atoms using the provided parameters array.- Specified by:
setParametersin classRefinedParameter- Parameters:
parameters- an array of doubles containing all refined parameters.
-
getVelocity
public void getVelocity(double[] velocity) Updates a subset of the parameter array with the XYZ velocity components of the primary atom.- Specified by:
getVelocityin classRefinedParameter- Parameters:
velocity- an array of doubles where the XYZ velocity components of the primary atom will be stored. The x, y, and z components are assigned sequentially starting at the current index value.
-
setVelocity
public void setVelocity(double[] velocity) Sets the velocity components of the primary atom using the provided parameters array. The velocity is updated with values sequentially extracted from the array at the current index.- Specified by:
setVelocityin classRefinedParameter- Parameters:
velocity- an array of doubles containing velocity data. The x, y, and z components of the velocity are taken sequentially starting at the current index.
-
getAcceleration
public void getAcceleration(double[] acceleration) Updates a subset of the parameter array with the XYZ acceleration components of the primary atom.- Specified by:
getAccelerationin classRefinedParameter- Parameters:
acceleration- an array of doubles where the XYZ acceleration components of the primary atom will be stored. The x, y, and z components are assigned sequentially starting at the current index value.
-
setAcceleration
public void setAcceleration(double[] acceleration) Sets the acceleration components for the primary atom. The method extracts the x, y, and z components of acceleration from the provided array starting at a specified index and assigns them to the primary atom.- Specified by:
setAccelerationin classRefinedParameter- Parameters:
acceleration- an array of doubles containing the XYZ acceleration components. The x, y, and z components are retrieved sequentially from the array starting at the current index.
-
getPreviousAcceleration
public void getPreviousAcceleration(double[] previousAcceleration) Updates a subset of the parameter array with the XYZ previous acceleration components of the primary atom.- Specified by:
getPreviousAccelerationin classRefinedParameter- Parameters:
previousAcceleration- an array of doubles where the XYZ previous acceleration components of the primary atom will be stored. The x, y, and z components are assigned sequentially starting at the current index value.
-
setPreviousAcceleration
public void setPreviousAcceleration(double[] previousAcceleration) Sets the previous acceleration components for the primary atom. The method extracts the x, y, and z components of previous acceleration from the provided array starting at a specified index and assigns them to the primary atom.- Specified by:
setPreviousAccelerationin classRefinedParameter- Parameters:
previousAcceleration- an array of doubles containing the XYZ previous acceleration components. The x, y, and z components are retrieved sequentially from the array starting at the current index.
-
setOptimizationScaling
public void setOptimizationScaling(double[] optimizationScaling) Sets the scaling factors for optimization parameters at specific indices. This method updates a portion of the provided array with predefined scaling values.- Specified by:
setOptimizationScalingin classRefinedParameter- Parameters:
optimizationScaling- an array of doubles representing scaling factors for optimization. The method modifies specific indices within this array.
-
zeroGradient
public void zeroGradient()Initialize the coordinate gradient to zero.- Specified by:
zeroGradientin classRefinedParameter
-
getGradient
public void getGradient(double[] gradient) Updates the gradient array with the contributions from the primary atom and any constrained atoms that scatter. The XYZ gradient values are retrieved for each relevant atom and added to the corresponding indices of the provided gradient array.- Specified by:
getGradientin classRefinedParameter- Parameters:
gradient- an array of doubles where the gradient contributions will be accumulated.
-
getMass
public void getMass(double[] mass, double defaultMass) Updates the provided array with the atomic mass of the primary atom.- Specified by:
getMassin classRefinedParameter- Parameters:
mass- an array of doubles where the atomic mass will be stored.defaultMass- the default mass is ignored for coordinates.
-
toString
-