 |
DAS
3.0
Das Analysis System
|
|
| ClosestPair2D (const std::vector< Coord2D > &positions, const Coord2D &left_corner, const Coord2D &right_corner) |
|
| ClosestPair2D (const std::vector< Coord2D > &positions, const Coord2D &left_corner, const Coord2D &right_corner, const unsigned int max_size) |
|
void | closest_pair (unsigned int &ID1, unsigned int &ID2, double &distance2) const |
|
void | remove (unsigned int ID) |
|
unsigned int | insert (const Coord2D &) |
|
virtual unsigned int | replace (unsigned int ID1, unsigned int ID2, const Coord2D &position) |
|
virtual void | replace_many (const std::vector< unsigned int > &IDs_to_remove, const std::vector< Coord2D > &new_positions, std::vector< unsigned int > &new_IDs) |
|
void | print_tree_depths (std::ostream &outdev) const |
|
unsigned int | size () |
|
virtual | ~ClosestPair2DBase () |
|
◆ circulator
◆ const_circulator
◆ Tree
◆ ClosestPair2D() [1/2]
736 _initialize(positions, left_corner, right_corner, positions.size());
◆ ClosestPair2D() [2/2]
741 _initialize(positions, left_corner, right_corner, max_size);
◆ _add_label()
void _add_label |
( |
Point * |
point, |
|
|
unsigned int |
review_flag |
|
) |
| |
|
inlineprivate |
1254 point->review_flag |= review_flag;
◆ _deal_with_points_to_review()
void _deal_with_points_to_review |
( |
| ) |
|
|
private |
1308 this_point->neighbour_dist2 = numeric_limits<double>::max();
1310 for (
unsigned int ishift = 0; ishift <
_nshift; ishift++) {
1313 for (
unsigned i=0; i < CP_range; i++) {
1315 double dist2 = this_point->distance2(*other->point);
1316 if (dist2 < this_point->neighbour_dist2) {
1317 this_point->neighbour_dist2 = dist2;
1318 this_point->neighbour = other->point;
1325 this_point->review_flag = 0;
◆ _ID()
int _ID |
( |
const Point * |
point | ) |
const |
|
inlineprivate |
◆ _initialize()
void _initialize |
( |
const std::vector< Coord2D > & |
positions, |
|
|
const Coord2D & |
left_corner, |
|
|
const Coord2D & |
right_corner, |
|
|
const unsigned int |
max_size |
|
) |
| |
|
private |
1193 unsigned int n_positions = positions.size();
1194 assert(max_size >= n_positions);
1196 for (
unsigned int i = n_positions; i < max_size; i++) {
1200 _range = max((right_corner.
x - left_corner.
x),
1201 (right_corner.
y - left_corner.
y));
1202 vector<Shuffle> shuffles(n_positions);
1203 for (
unsigned int i = 0; i < n_positions; i++) {
1204 _points[i].coord = positions[i];
1205 _points[i].neighbour_dist2 = numeric_limits<double>::max();
1209 for (
unsigned ishift = 0; ishift <
_nshift; ishift++) {
1216 for (
unsigned int ishift = 0; ishift <
_nshift; ishift++) {
1219 for (
unsigned int i = 0; i < shuffles.size(); i++) {
1220 shuffles[i] += rel_shift; }
1222 sort(shuffles.begin(), shuffles.end());
1227 Point * this_point = circ->point;
1228 this_point->circ[ishift] = circ;
1230 for (
unsigned i=0; i < CP_range; i++) {
1232 double dist2 = this_point->distance2(*other->point);
1233 if (dist2 < this_point->neighbour_dist2) {
1234 this_point->neighbour_dist2 = dist2;
1235 this_point->neighbour = other->point;
1238 }
while (++circ != start);
1240 vector<double> mindists2(n_positions);
1241 for (
unsigned int i = 0; i < n_positions; i++) {
1242 mindists2[i] =
_points[i].neighbour_dist2;}
◆ _insert_into_search_tree()
void _insert_into_search_tree |
( |
Point * |
new_point | ) |
|
|
private |
1369 new_point->neighbour_dist2 = numeric_limits<double>::max();
1371 for (
unsigned ishift = 0; ishift <
_nshift; ishift++) {
1372 Shuffle new_shuffle;
1375 new_point->circ[ishift] = new_circ;
1376 circulator right_edge = new_circ; right_edge++;
1378 for (
unsigned int i = 0; i < CP_range; i++) {left_edge--;}
1380 Point * left_point = left_edge->point;
1381 Point * right_point = right_edge->point;
1382 double new_dist2 = left_point->distance2(*new_point);
1383 if (new_dist2 < left_point->neighbour_dist2) {
1384 left_point->neighbour_dist2 = new_dist2;
1385 left_point->neighbour = new_point;
1388 new_dist2 = new_point->distance2(*right_point);
1389 if (new_dist2 < new_point->neighbour_dist2) {
1390 new_point->neighbour_dist2 = new_dist2;
1391 new_point->neighbour = right_point;
1393 if (left_point->neighbour == right_point) {
1397 }
while (++left_edge != new_circ);
◆ _point2shuffle()
void _point2shuffle |
( |
Point & |
point, |
|
|
Shuffle & |
shuffle, |
|
|
unsigned int |
shift |
|
) |
| |
|
private |
1174 assert(renorm_point.
x >=0);
1175 assert(renorm_point.
x <=1);
1176 assert(renorm_point.
y >=0);
1177 assert(renorm_point.
y <=1);
1178 shuffle.x =
static_cast<unsigned int>(
twopow31 * renorm_point.
x) + shift;
1179 shuffle.y =
static_cast<unsigned int>(
twopow31 * renorm_point.
y) + shift;
1180 shuffle.point = &point;
◆ _remove_from_search_tree()
void _remove_from_search_tree |
( |
Point * |
point_to_remove | ) |
|
|
private |
1269 for (
unsigned int ishift = 0; ishift <
_nshift; ishift++) {
1270 circulator removed_circ = point_to_remove->circ[ishift];
1272 _trees[ishift]->remove(removed_circ);
1273 circulator left_end = right_end, orig_right_end = right_end;
1274 for (
unsigned int i = 0; i < CP_range; i++) {left_end--;}
1276 left_end--; right_end--;
1279 Point * left_point = left_end->point;
1280 if (left_point->neighbour == point_to_remove) {
1285 double dist2 = left_point->distance2(*right_end->point);
1286 if (dist2 < left_point->neighbour_dist2) {
1287 left_point->neighbour = right_end->point;
1288 left_point->neighbour_dist2 = dist2;
1294 }
while (++left_end != orig_right_end);
◆ _set_label()
void _set_label |
( |
Point * |
point, |
|
|
unsigned int |
review_flag |
|
) |
| |
|
inlineprivate |
1258 point->review_flag = review_flag;
◆ closest_pair()
void closest_pair |
( |
unsigned int & |
ID1, |
|
|
unsigned int & |
ID2, |
|
|
double & |
distance2 |
|
) |
| const |
|
virtual |
◆ insert()
unsigned int insert |
( |
const Coord2D & |
new_coord | ) |
|
|
virtual |
◆ print_tree_depths()
void print_tree_depths |
( |
std::ostream & |
outdev | ) |
const |
|
inline |
753 outdev <<
_trees[0]->max_depth() <<
" "
754 <<
_trees[1]->max_depth() <<
" "
755 <<
_trees[2]->max_depth() <<
"\n";
◆ remove()
void remove |
( |
unsigned int |
ID | ) |
|
|
virtual |
◆ replace()
unsigned int replace |
( |
unsigned int |
ID1, |
|
|
unsigned int |
ID2, |
|
|
const Coord2D & |
position |
|
) |
| |
|
virtual |
Reimplemented from ClosestPair2DBase.
1339 Point * point_to_remove = & (
_points[ID1]);
1341 point_to_remove = & (
_points[ID2]);
1345 new_point->coord = position;
1348 return _ID(new_point);
◆ replace_many()
void replace_many |
( |
const std::vector< unsigned int > & |
IDs_to_remove, |
|
|
const std::vector< Coord2D > & |
new_positions, |
|
|
std::vector< unsigned int > & |
new_IDs |
|
) |
| |
|
virtual |
Reimplemented from ClosestPair2DBase.
1354 for (
unsigned int i = 0; i < IDs_to_remove.size(); i++) {
1358 for (
unsigned int i = 0; i < new_positions.size(); i++) {
1361 new_point->coord = new_positions[i];
1363 new_IDs.push_back(
_ID(new_point));
◆ size()
◆ _available_points
std::stack<Point *> _available_points |
|
private |
◆ _cp_search_range
unsigned int _cp_search_range |
|
private |
◆ _heap
◆ _left_corner
◆ _nshift
const unsigned int _nshift = 3 |
|
staticprivate |
◆ _points
std::vector<Point> _points |
|
private |
◆ _points_under_review
std::vector<Point *> _points_under_review |
|
private |
◆ _range
◆ _rel_shifts
◆ _remove_heap_entry
const unsigned int _remove_heap_entry = 1 |
|
staticprivate |
◆ _review_heap_entry
const unsigned int _review_heap_entry = 2 |
|
staticprivate |
◆ _review_neighbour
const unsigned int _review_neighbour = 4 |
|
staticprivate |
◆ _shifts
◆ _trees
The documentation for this class was generated from the following file:
- /builds/cms-analysis/general/DasAnalysisSystem/Core/Installer/Core/JetObservables/src/fjcore.cc
Definition: fjcore.hh:294
void _set_label(Point *point, unsigned int review_flag)
Definition: fjcore.cc:1256
void update(unsigned int, double)
Definition: fjcore.cc:3708
double _range
Definition: fjcore.cc:796
void remove(unsigned int loc)
Definition: fjcore.cc:659
void _point2shuffle(Point &, Shuffle &, unsigned int shift)
Definition: fjcore.cc:1171
Definition: fjcore.cc:647
triplet< unsigned int > _shifts
Definition: fjcore.cc:798
void _initialize(const std::vector< Coord2D > &positions, const Coord2D &left_corner, const Coord2D &right_corner, const unsigned int max_size)
Definition: fjcore.cc:1189
Coord2D _left_corner
Definition: fjcore.cc:795
double x
Definition: fjcore.cc:677
void _add_label(Point *point, unsigned int review_flag)
Definition: fjcore.cc:1252
void _remove_from_search_tree(Point *point_to_remove)
Definition: fjcore.cc:1265
int _ID(const Point *) const
Definition: fjcore.cc:817
SearchTree< Shuffle > Tree
Definition: fjcore.cc:778
void _insert_into_search_tree(Point *new_point)
Definition: fjcore.cc:1367
triplet< SharedPtr< Tree > > _trees
Definition: fjcore.cc:781
Definition: fjcore.cc:675
SharedPtr< MinHeap > _heap
Definition: fjcore.cc:782
FJCORE_END_NAMESPACE FJCORE_BEGIN_NAMESPACE const unsigned int twopow31
Definition: fjcore.cc:1169
circulator next() const
Definition: fjcore.cc:318
void swap(SharedPtr< T > &a, SharedPtr< T > &b)
Definition: fjcore.hh:412
unsigned int size()
Definition: fjcore.cc:820
static const unsigned int _review_heap_entry
Definition: fjcore.cc:787
static const unsigned int _nshift
Definition: fjcore.cc:762
std::stack< Point * > _available_points
Definition: fjcore.cc:784
unsigned int minloc() const
Definition: fjcore.cc:655
std::vector< Point * > _points_under_review
Definition: fjcore.cc:785
triplet< unsigned int > _rel_shifts
Definition: fjcore.cc:799
static const unsigned int _review_neighbour
Definition: fjcore.cc:788
std::vector< Point > _points
Definition: fjcore.cc:783
static const unsigned int _remove_heap_entry
Definition: fjcore.cc:786
Tree::circulator circulator
Definition: fjcore.cc:779
unsigned int _cp_search_range
Definition: fjcore.cc:800
double y
Definition: fjcore.cc:677
void _deal_with_points_to_review()
Definition: fjcore.cc:1297