meshi.geometry
Class FreeDistance

java.lang.Object
  extended by meshi.geometry.Distance
      extended by meshi.geometry.FreeDistance
All Implemented Interfaces:
Attributable

public class FreeDistance
extends Distance

The distance between two Atoms
. Almost any measurable feature of a molecule is related to distances between pairs of Atoms. Thus, The calculation of distances (and their inverse and derivatives) are typically a computational bottleneck in computational structural biology applications. In all applications that we are aware of (Please, enlighten us if you know better) distance calculation is done as part of the procedures that use it (say, as part of the van-der-Waals energy calculation). As a result the distance between two atoms may be calculated more then once. For example the distance between two atoms may be calculated both during angle and torsion angle energies calculations. In Meshi We tried to consentrate all distance related issues in a few classes: this one, its subclasses and the closely connected class DistanceMatrix.

Possible pitfalls

  1. The object variables dx, dy, dz, distance, distance2, invDistance, dDistanceDx, dDistanceDy and dDistanceDz should have been private and accessed through "get methods". Energy functions though, use the values of these variables intensively and a considerable computational gain is achieved granting them public accessability (protected for dx, dy and dz) and removing the function call overhead. Thus, changing the values of these variables by other classes is possible (from the compiler point of view) but not very much recommended.
  2. The distance object "is not aware" of changes in the atoms coordinates. The values stored in this object are correct only after the update method is explicitly called.


    Field Summary
    private static double d2
               
     
    Fields inherited from class meshi.geometry.Distance
    atom1, atom1Number, atom2, atom2Number, distance, dx, dy, dz, INFINITE_DISTANCE, invDistance, largeType, mode, smallType
     
    Constructor Summary
    FreeDistance(Atom atom1, Atom atom2)
               
     
    Method Summary
    static double getDistance(Atom atom1, Atom atom2)
               
    static double getDx(Atom atom1, Atom atom2)
               
    static double getDy(Atom atom1, Atom atom2)
               
    static double getDz(Atom atom1, Atom atom2)
               
     void update()
               
     
    Methods inherited from class meshi.geometry.Distance
    addAttribute, atom1, atom2, atom2Number, dDistanceDx, dDistanceDy, dDistanceDz, dead, distance, dx, dy, dz, getAttribute, invDistance, mode, setMode, toString, update
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    d2

    private static double d2
    Constructor Detail

    FreeDistance

    public FreeDistance(Atom atom1,
                        Atom atom2)
    Method Detail

    getDx

    public static double getDx(Atom atom1,
                               Atom atom2)

    getDy

    public static double getDy(Atom atom1,
                               Atom atom2)

    getDz

    public static double getDz(Atom atom1,
                               Atom atom2)

    getDistance

    public static double getDistance(Atom atom1,
                                     Atom atom2)

    update

    public void update()