32LOG_LOGGER _log =
LOG_GET(
"lsst.jointcal.FastFinder");
40 if (
count == 0)
return;
44 for (
auto const &
ci :
list) {
72 return (E1->y < E2->y);
78 for (
unsigned i = 0;
i <
count; ++
i) {
85 if (
count == 0)
return nullptr;
87 if (*
it ==
nullptr)
return nullptr;
90 for (; *
it !=
nullptr; ++
it) {
105 if (
count == 0)
return nullptr;
107 if (*
it ==
nullptr)
return nullptr;
112 for (; *
it !=
nullptr; ++
it) {
140 if ((*middle)->y <
yVal) {
158 if ((*middle)->y >
yVal) {
181 : finder(
F), null_value(
F.stars.
end()) {
226 if (current != null_value &&
227 (current < finder.stars.begin() || current >= finder.stars.begin() + finder.count)) {
228 LOGLS_ERROR(_log,
"Error in FastFinder " << *current <<
" " << *(finder.stars.begin()) <<
' '
229 << *(finder.stars.begin() + finder.count));
Fast locator in starlists.
#define LOGLS_ERROR(logger, message)
The base class for handling stars. Used by all matching routines.
Iterator meant to traverse objects within some limiting distance.
Iterator(const FastFinder &f, const Point &where, double maxDist)
stars_element operator*() const
const FastFinder & finder
This is an auxillary class for matching objects from starlists.
decltype(stars)::const_iterator pstar
decltype(stars)::value_type stars_element
pstar locateYStart(pstar begin, pstar end, double yVal) const
void findRangeInSlice(int iSlice, double yStart, double yEnd, pstar &start, pstar &end) const
void print(std::ostream &out) const
mostly for debugging
std::shared_ptr< const BaseStar > findClosest(const Point &where, double maxDist, bool(*SkipIt)(const BaseStar &)=nullptr) const
Find the closest with some rejection capability.
FastFinder(const BaseStarList &list, unsigned nXSlice=100)
Constructor.
std::shared_ptr< const BaseStar > secondClosest(const Point &where, double maxDist, std::shared_ptr< const BaseStar > &closest, bool(*SkipIt)(const BaseStar &)=nullptr) const
Iterator beginScan(const Point &where, double maxDist) const
std::vector< unsigned > index
std::vector< std::shared_ptr< const BaseStar > > stars
pstar locateYEnd(pstar begin, pstar end, double yVal) const
double computeDist2(const Point &other) const
distance squared to other