Class StructureOptimizer

java.lang.Object
_global.tri.oxidationstates.structure.StructureOptimizer
All Implemented Interfaces:
matsci.engine.IContinuousFunctionState

public class StructureOptimizer extends Object implements matsci.engine.IContinuousFunctionState
Finds a structure that is the average of a set of given structures, as determined by the mean squared log ratio of the elements of the minimum-distance matrices for the structures.
  • Constructor Summary

    Constructors
    Constructor
    Description
    StructureOptimizer(matsci.structure.Structure[] targetStructures)
    Initialize the structure optimizer from a set of target structures.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    getDistanceError(matsci.structure.Structure structure1, matsci.structure.Structure structure2)
    Calculates the mean squared ratios of the entries in the distance matrices for two structures, assuming the sites in the two structures are in the same order (e.g.
    double[]
    getGradient(double[] template)
     
    matsci.structure.Structure
    Returns the optimized structure
    double[]
    getUnboundedParameters(double[] template)
     
    double
     
    int
     
    matsci.engine.IContinuousFunctionState
    setUnboundedParameters(double[] parameters)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StructureOptimizer

      public StructureOptimizer(matsci.structure.Structure[] targetStructures)
      Initialize the structure optimizer from a set of target structures. These structures should all have the same lattice and sites listed in the same order. TODO make this call the lattice optimizer in the future.
      Parameters:
      targetStructures - The structure optimizer will try to optimize the sites of the structure to make the distance matrix between sites as close as possible to the distance matrices of the target structures, as determined by the mean square log ratio of corresponding elements in the distance matrices.
  • Method Details

    • numParameters

      public int numParameters()
      Specified by:
      numParameters in interface matsci.engine.IContinuousFunctionState
    • getUnboundedParameters

      public double[] getUnboundedParameters(double[] template)
      Specified by:
      getUnboundedParameters in interface matsci.engine.IContinuousFunctionState
    • getGradient

      public double[] getGradient(double[] template)
      Specified by:
      getGradient in interface matsci.engine.IContinuousFunctionState
    • setUnboundedParameters

      public matsci.engine.IContinuousFunctionState setUnboundedParameters(double[] parameters)
      Specified by:
      setUnboundedParameters in interface matsci.engine.IContinuousFunctionState
    • getDistanceError

      public double getDistanceError(matsci.structure.Structure structure1, matsci.structure.Structure structure2)
      Calculates the mean squared ratios of the entries in the distance matrices for two structures, assuming the sites in the two structures are in the same order (e.g. site 1 in structure1 corresponds to site 1 in structure2, etc.)
      Parameters:
      structure1 - One of the structures we are comparing
      structure2 - One of the structures we are comparing
      Returns:
      the mean squared ratios of the entries in the distance matrices for two structures, assuming the sites in the two structures are in the same order (e.g. site 1 in structure1 corresponds to site 1 in structure2, etc.)
    • getValue

      public double getValue()
      Specified by:
      getValue in interface matsci.engine.IContinuousFunctionState
    • getStructure

      public matsci.structure.Structure getStructure()
      Returns the optimized structure
      Returns:
      the optimized structure