|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmeshi.util.MeshiProgram
meshi.geometry.DistanceMatrix
public class DistanceMatrix
Where all the headache of distances is handled.
Almost any measurable feature of a molecule is related to distances
between pairs of meshi.molecularElements.atoms.
Thus, The calculation of distances (and their inverse and derivatives)
are typically a computational bottleneck in 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 encapsulate all distance related issues in few
classes: Distance, its subclasses and this one.
The motivation behind this class is twofold: first, to keep all the headache of
cutoff distances (see below) in a single place. Second, to arrange all the
distances
of a molecular system in a single data
structure so that no distance is calculated more than once in a single energy
evaluation.
Distance cutoff
Calculating and storing all the distances of a molecular system requires O(n^2) time
and storage, where n is the number of atoms. Heuristic algorithms reduces it to O(n),
under certain assumptions.
The heuristic algorithms (see references below) relays on three characteristics
of energy functions and energy based simulations:
The first step of the algorithm is to separate the set of distances into two groups:
| Nested Class Summary | |
|---|---|
class |
DistanceMatrix.Indicator
|
private class |
DistanceMatrix.RowIterator
|
| Field Summary | |
|---|---|
protected DistanceList |
bondedList
Atom pairs with inter-atomic distances that are always relatively small. |
protected int |
bondedListDepth
|
protected double |
buffer
|
protected static double |
bufferOneThirdSqr
(buffer/3)^2 |
protected boolean |
debug
|
static int |
DEFAULT_BONDED_LIST_DEPTH
|
static double |
DEFAULT_BUFFER
|
static double |
DEFAULT_RMAX
|
protected static double |
edge
|
protected java.util.ArrayList<DistanceList> |
energyTermsDistanceLists
List of DistanceLists Every DistanceList contains distances needed for one EnergyTerm, selected by its filter For example: - Distances of good hydrogen bonds candidate that were added in the current update opperation - Applicable distances between nonBonded C-N candidate that were added in the current update opperation |
protected Grid |
grid
|
private DistanceMatrix.Indicator |
indicatorToUpdateHB
|
protected MatrixRow[] |
matrix
Internal data structure. |
MolecularSystem |
molecularSystem
The list of all atoms in the molecular system. |
private int |
newConstant
|
private boolean |
nonBondedFlag
|
protected DistanceList |
nonBondedList
Atom pairs with inter-atomic distances below rMax (and some of the pairs below rMax+buffer). |
protected int |
numberOfUpdates
|
protected static double |
rMax
Maximal distance for nonzero interactions. |
protected static double |
rMax2
|
protected static double |
rMaxPlusBuffer
rMax+buffer |
protected static double |
rMaxPlusBuffer2
(rMax+buffer)^2 |
static Terminator |
terminator
|
| Fields inherited from class meshi.util.MeshiProgram |
|---|
commandLine, name |
| Constructor Summary | |
|---|---|
DistanceMatrix(MolecularSystem molecularSystem)
|
|
DistanceMatrix(MolecularSystem molecularSystem,
double rMax,
double buffer,
double edge,
int bondedListDepth)
|
|
| Method Summary | |
|---|---|
DistanceList |
bondedList()
|
double |
buffer()
|
void |
DebugOFF()
Exit DistanceMatrix debug mode. |
void |
debugON()
Enter DistanceMatrix debug mode. |
static double |
DEFAULT_EDGE(double rMax,
double buffer)
|
Distance |
distance(Atom atom1,
Atom atom2)
Returns the Distance object of the parameters. |
Distance |
distance(AtomPair atomPair)
|
Distance |
distance(int atom1Number,
int atom2Number)
Returns the Distance object of the parameters. |
void |
doNotUpdateNonBondedList()
|
java.util.ArrayList<DistanceList> |
energyTermsDistanceLists()
|
static AtomList |
getBonded(Atom atom,
int depth)
|
static void |
getBonded(Atom atom,
int depth,
AtomList out,
int rootNumber)
|
static DistanceList |
getBondedList(MolecularSystem molecularSystem,
int depth,
MatrixRow[] matrix)
|
DistanceMatrix.Indicator |
indicatorToUpdateHB()
|
DistanceList |
nonBondedList()
Returns the non-bonded-list. |
int |
nonBondedListSize()
Returns the bonded list |
double |
radius()
|
private void |
reset()
|
static double |
rMax()
|
static double |
rMax2()
|
static double |
rMaxPlusBuffer()
|
static double |
rMaxPlusBuffer2()
|
java.util.Iterator |
rowIterator()
|
MatrixRow |
rowNumber(int index)
|
java.lang.String |
toString()
|
protected void |
update()
|
void |
update(int numberOfUpdates)
Updates the distance matrix. |
| Methods inherited from class meshi.util.MeshiProgram |
|---|
about, debug, get2ndString, getb, getB, getd, getD, getFlag, getFlagedArgument, geti, getI, getOrderedArgument, getS, getS, initRandom, initRandom, initRandom, printGlobalTable, randomNumberGenerator, seed, tableGet, tableIncludes, tableSet, verbose |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Terminator terminator
public static final double DEFAULT_RMAX
public static final double DEFAULT_BUFFER
public static final int DEFAULT_BONDED_LIST_DEPTH
private DistanceMatrix.Indicator indicatorToUpdateHB
public final MolecularSystem molecularSystem
protected MatrixRow[] matrix
protected Grid grid
protected static double rMax
protected static double rMax2
protected static double edge
protected static double rMaxPlusBuffer
protected static double rMaxPlusBuffer2
protected double buffer
protected static double bufferOneThirdSqr
protected DistanceList nonBondedList
protected java.util.ArrayList<DistanceList> energyTermsDistanceLists
protected DistanceList bondedList
private int newConstant
private boolean nonBondedFlag
protected int bondedListDepth
protected int numberOfUpdates
protected boolean debug
| Constructor Detail |
|---|
public DistanceMatrix(MolecularSystem molecularSystem)
public DistanceMatrix(MolecularSystem molecularSystem,
double rMax,
double buffer,
double edge,
int bondedListDepth)
| Method Detail |
|---|
public static final double DEFAULT_EDGE(double rMax,
double buffer)
public java.util.ArrayList<DistanceList> energyTermsDistanceLists()
public void debugON()
public void DebugOFF()
private void reset()
public void update(int numberOfUpdates)
throws UpdateableException
update in interface UpdateableUpdateableException
protected void update()
throws UpdateableException
UpdateableExceptionpublic MatrixRow rowNumber(int index)
public DistanceList nonBondedList()
public DistanceList bondedList()
public Distance distance(Atom atom1,
Atom atom2)
public Distance distance(AtomPair atomPair)
public Distance distance(int atom1Number,
int atom2Number)
public double radius()
public java.lang.String toString()
toString in class MeshiProgrampublic int nonBondedListSize()
public static DistanceList getBondedList(MolecularSystem molecularSystem,
int depth,
MatrixRow[] matrix)
public static AtomList getBonded(Atom atom,
int depth)
public static void getBonded(Atom atom,
int depth,
AtomList out,
int rootNumber)
public void doNotUpdateNonBondedList()
public static double rMax()
public static double rMax2()
public double buffer()
public static double rMaxPlusBuffer2()
public static double rMaxPlusBuffer()
public DistanceMatrix.Indicator indicatorToUpdateHB()
public java.util.Iterator rowIterator()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||