SpatialSearch.h File Reference
#include "ResizeArray.h"
Go to the source code of this file.
Compounds
linked list of atom index pairs generated by the vmd_gridsearch1 and vmd_gridsearch2 XXX on 64-bit machines the next pointers are as large as the atom index data in each node, so half of the memory is wasted in pointer chasing. Calling malloc/free once per pair when building the linked list is a severe multithreading scalability bottleneck due to OS-level mutex locks in malloc/free and/or the kernel VM. On Linux, it is also problematic due to the threaded version of malloc allocating huge blocks and fragmenting memory tremendously. This implementation should not be used for any threaded code. More...
Linked list of ResizeArrays containing pairlists, optimized for multithreading. Compared with the GridSearchPair linked list, The list of ResizeArrays uses half as much memory per pair, reduces the malloc calls so they are logarithmic rather than linear with the number of bonds, and reduces free call count to one per-thread down from one per-bond. Since the ResizeArray results in a contiguous block of memory, the traversal coherency is also significantly improved. Ultimately we should convert all of the grid search routines to use this type of data structure, or one like it. More...
Functions
Grid search for the case of a single set of atoms. It ignore pairs between atoms with identical coords. The maxpairs parameter is set to -1 for no-limit pairlist calculation, or a maximum value otherwise. More...
Grid search for two different sets of atoms in same molecule. (will eventually be obsoleted by the faster and more useful vmd_gridsearch3). right now, is still needed by measure hbonds (until problems resolved) The maxpairs parameter is set to -1 for no-limit pairlist calculation, or a maximum value otherwise. More...
GridSearchPair *
vmd_gridsearch3 (const float *posA, int natomsA, const int *A, const float *posB, int natomsB, const int *B, float pairdist, int allow_double_counting, int maxpairs)
Grid search for two different sets of atoms and/or molecules. By default, if (posA == posB), all bonds are unique. Otherwise, double-counting is allowed. This can be overridden by setting the allow_double_counting param (true=1, false=0, or default=-1). The maxpairs parameter is set to -1 for no-limit pairlist calculation, or a maximum value otherwise. More...
Find axis-aligned bounding box for all atoms in the list. More...
int
find_minmax_selected (int n, const int *flgs, const float *pos, float &_xmin, float &_ymin, float &_zmin, float &_xmax, float &_ymax, float &_zmax)
Find axis-aligned bounding box for selected atoms in the list Return true if minmax was found, false if all flags are zero. More...
void
find_minmax (const float *pos, int n, const int *on, float *min, float *max, int *oncount)
Find axis-aligned bounding box for selected atoms in the list. More...
void
find_within (const float *xyz, int *flgs, const int *others, int
num, float r)
Find selected atoms within a specified distance of a second set of points. More...
Function Documentation
void find_minmax
(
const float *
pos,
int
n,
const int *
on,
float *
min,
float *
max,
int *
oncount
)
void find_minmax_all
(
const float *
pos,
int
n,
float *
min,
float *
max
)
int find_minmax_selected
(
int
n,
const int *
flgs,
const float *
pos,
float &
_xmin,
float &
_ymin,
float &
_zmin,
float &
_xmax,
float &
_ymax,
float &
_zmax
)
Find axis-aligned bounding box for selected atoms in the list Return true if minmax was found, false if all flags are zero.
Definition at line 74 of file SpatialSearch.C.
References n, and num.
Referenced by find_within.
void find_within
(
const float *
xyz,
int *
flgs,
const int *
others,
int
num,
float
r
)
int make_neighborlist
(
int **
nbrlist,
int
xb,
int
yb,
int
zb
)
int
n,
const int *
on,
float
dist,
int
allow_double_counting,
int
maxpairs
)
int
natoms,
const int *
A,
const int *
B,
float
pairdist,
int
maxpairs
)
Grid search for two different sets of atoms in same molecule. (will eventually be obsoleted by the faster and more useful vmd_gridsearch3). right now, is still needed by measure hbonds (until problems resolved) The maxpairs parameter is set to -1 for no-limit pairlist calculation, or a maximum value otherwise.
Definition at line 476 of file SpatialSearch.C.
Referenced by measure_hbonds.
int
natomsA,
const int *
A,
const float *
posB,
int
natomsB,
const int *
B,
float
pairdist,
int
allow_double_counting,
int
maxpairs
)
Generated on Wed Nov 19 02:47:54 2025 for VMD (current) by
doxygen1.2.14 written by Dimitri van Heesch,
© 1997-2002