|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmeshi.util.MeshiProgram
meshi.geometry.DistanceMatrix
meshi.geometry.OldDistanceMatrix
public class OldDistanceMatrix
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 |
OldDistanceMatrix.Indicator
|
private class |
OldDistanceMatrix.RowIterator
|
| Field Summary | |
|---|---|
protected Atom[] |
atomArray
An array of all atoms in the molecular system. |
protected AtomList |
atomList
The list of all atoms in the molecular system. |
protected static int |
BASE_ATOM_NUMBER
|
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 OldGrid |
grid
|
private OldDistanceMatrix.Indicator |
indicatorToUpdateHB
|
protected MatrixRow[] |
matrix
Internal data structure. |
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.geometry.DistanceMatrix |
|---|
molecularSystem |
| Fields inherited from class meshi.util.MeshiProgram |
|---|
commandLine, name |
| Constructor Summary | |
|---|---|
OldDistanceMatrix(AtomList atomList,
double rMax,
double buffer,
double edge,
int bondedListDepth)
|
|
| Method Summary | |
|---|---|
AtomList |
atomList()
|
static int |
base()
|
DistanceList |
bondedList()
|
double |
buffer()
|
void |
DebugOFF()
Exit DistanceMatrix debug mode. |
void |
debugON()
Enter DistanceMatrix debug mode. |
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(java.lang.Object[] atomArray,
int depth,
MatrixRow[] matrix)
|
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. |
java.lang.String |
upperLeft()
|
| Methods inherited from class meshi.geometry.DistanceMatrix |
|---|
DEFAULT_EDGE, getBondedList, indicatorToUpdateHB |
| 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 OldDistanceMatrix.Indicator indicatorToUpdateHB
protected static int BASE_ATOM_NUMBER
protected AtomList atomList
protected Atom[] atomArray
protected MatrixRow[] matrix
protected OldGrid 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 OldDistanceMatrix(AtomList atomList,
double rMax,
double buffer,
double edge,
int bondedListDepth)
| Method Detail |
|---|
public static int base()
public java.util.ArrayList<DistanceList> energyTermsDistanceLists()
energyTermsDistanceLists in class DistanceMatrixpublic void debugON()
debugON in class DistanceMatrixpublic void DebugOFF()
DebugOFF in class DistanceMatrixprivate void reset()
public void update(int numberOfUpdates)
throws UpdateableException
update in interface Updateableupdate in class DistanceMatrixUpdateableException
protected void update()
throws UpdateableException
update in class DistanceMatrixUpdateableExceptionpublic MatrixRow rowNumber(int index)
rowNumber in class DistanceMatrixpublic DistanceList nonBondedList()
nonBondedList in class DistanceMatrixpublic DistanceList bondedList()
bondedList in class DistanceMatrix
public Distance distance(Atom atom1,
Atom atom2)
distance in class DistanceMatrixpublic Distance distance(AtomPair atomPair)
distance in class DistanceMatrix
public Distance distance(int atom1Number,
int atom2Number)
distance in class DistanceMatrixpublic double radius()
radius in class DistanceMatrixpublic java.lang.String toString()
toString in class DistanceMatrixpublic java.lang.String upperLeft()
public int nonBondedListSize()
nonBondedListSize in class DistanceMatrix
public static DistanceList getBondedList(java.lang.Object[] atomArray,
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()
doNotUpdateNonBondedList in class DistanceMatrixpublic static double rMax()
public static double rMax2()
public double buffer()
buffer in class DistanceMatrixpublic static double rMaxPlusBuffer2()
public static double rMaxPlusBuffer()
public AtomList atomList()
public java.util.Iterator rowIterator()
rowIterator in class DistanceMatrix
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||