34namespace siscone_spherical{
47bool ve_less(CSphvicinity_elm *ve1, CSphvicinity_elm *ve2){
48 return ve1->angle < ve2->angle;
66#ifdef USE_QUADTREE_FOR_STABILITY_TEST
80#ifdef USE_QUADTREE_FOR_STABILITY_TEST
94#ifdef USE_QUADTREE_FOR_STABILITY_TEST
107#ifdef USE_QUADTREE_FOR_STABILITY_TEST
116#ifdef USE_QUADTREE_FOR_STABILITY_TEST
127 for (i=0;i<(int) _particle_list.size();i++){
131 plist.push_back(_particle_list[i]);
143#ifdef USE_QUADTREE_FOR_STABILITY_TEST
153#ifdef USE_QUADTREE_FOR_STABILITY_TEST
161#ifdef USE_QUADTREE_FOR_STABILITY_TEST
162 quadtree->add(&
plist[i]);
191 D2_R = 2.0*(1-cos(
R));
222inline double sort_angle(
double s,
double c){
223 if (s==0)
return (c>0) ? 0.0 : 2.0;
225 return (s>0) ? 1-t/(1+fabs(t)) : 3-t/(1+fabs(t));
253 double amplT = sqrt((
tan2R*(1+dot)+(dot-1))*(1+dot));
295 sqrt(1.0/inv_err2_sq);
Implementation of a 2D quadtree.
a class to keep track of inclusion status in cone and in cocircular region while using minimal resour...
base class for managing the spatial part of Cmomentum (defined after)
void build_norm()
build the spatial normfrom 4-momentum info !!! WARNING !!! !!! computing the norm is the only time-co...
void get_angular_directions(CSph3vector &angular_dir1, CSph3vector &angular_dir2)
for this direction, compute the two reference directions used to measure angles
double _norm
particle spatial norm (available ONLY after a call to build_norm)
base class for dynamic coordinates management
int index
internal particle number
element in the vicinity of a parent.
double cocircular_range
amount by which the angle can be varied while maintaining this point within co-circularity margin
bool side
true if angle on the positive side, false otherwise
CSph3vector centre
direction of the centre
std::list< CSphvicinity_elm * > cocircular
list of elements co-circular with this one NB: empty list uses less mem than vector
double angle
angle with parent
CSphmomentum * v
pointer to the second borderline particle
siscone::Cvicinity_inclusion * is_inside
variable to tell if the particle is inside or outside the cone
double VR
radius of the vicinity
~CSphvicinity()
default destructor
CSphvicinity_elm * ve_list
list of vicinity elements built from particle list (size=2*n)
std::vector< CSphmomentum > plist
the list of particles
double D2_R
euclidian distance (squared) corresp. to the arc R
double inv_R_2EPS_COCIRC
R / (2*EPSILON_COCIRCULAR)
std::vector< siscone::Cvicinity_inclusion > pincluded
the inclusion state of particles
CSph3vector angular_dir2
second direction to measure angles (sign)
CSph3vector angular_dir1
main direction to measure angles
CSphmomentum * parent
parent vector
void append_to_vicinity(CSphmomentum *v)
append a particle to the 'vicinity' list after having tested it and computed the angular-ordering qua...
std::vector< CSphvicinity_elm * > vicinity
list of points in parent's vicinity
CSphvicinity()
default constructor
double cosVR
cosine of the radius of the vicinity
double tan2R
squared tangent of the normal radius
void set_particle_list(std::vector< CSphmomentum > &_particle_list)
set the particle_list
int n_part
number of particles
CSph3vector parent_centre
parent centre
unsigned int vicinity_size
number of elements in vicinity
double VR2
squared radius of the vicinity
double inv_R_EPS_COCIRC
R / EPSILON_COCIRCULAR.
double R2
squared normal radius
void build(CSphmomentum *_parent, double _VR)
build the vicinity list from the list of points.
#define EPSILON_COCIRCULAR
The following parameter controls cocircular situations.