LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | List of all members
lsst::jointcal::FastFinder::Iterator Class Reference

Iterator meant to traverse objects within some limiting distance. More...

#include <FastFinder.h>

Public Member Functions

void check () const
 
 Iterator (const FastFinder &f, const Point &where, double maxDist)
 
void operator++ ()
 
stars_element operator* () const
 

Public Attributes

const FastFinderfinder
 
int currentSlice
 
int endSlice
 
double yStart
 
double yEnd
 
pstar current
 
pstar pend
 
pstar null_value
 

Detailed Description

Iterator meant to traverse objects within some limiting distance.

Initializer is beginScan and end condition is (*it == NULL). Used by findClosest & co.

Definition at line 90 of file FastFinder.h.

Constructor & Destructor Documentation

◆ Iterator()

lsst::jointcal::Iterator::Iterator ( const FastFinder f,
const Point where,
double  maxDist 
)

Definition at line 181 of file FastFinder.cc.

182  : finder(F), null_value(F.stars.end()) {
183  current = pend = null_value; // does not iterate
184  int startSlice = 0;
185  if (finder.xstep != 0) // means we have several slices
186  {
187  startSlice = std::max(0, int((where.x - maxDist - finder.xmin) / finder.xstep));
188  /* obviously, endSlice (and starSlice) can be negative.
189  This is why slice indices are "int" rather than "unsigned". */
190  endSlice = std::min(int(finder.nslice), int((where.x + maxDist - finder.xmin) / finder.xstep) + 1);
191  } else {
192  startSlice = 0;
193  endSlice = 1;
194  }
195  // beyond limits:
196  if (startSlice >= int(finder.nslice) || endSlice < 0) return;
197  // we are inside in x, so, we setup the y range:
198  yStart = where.y - maxDist;
199  yEnd = where.y + maxDist;
200  /* rather than initializing here, we step back one
201  slice and let "++" do its job */
202  currentSlice = startSlice - 1; // again, this requires "int" slices
203  ++(*this);
204 }
T min(T... args)
T max(T... args)

Member Function Documentation

◆ check()

void lsst::jointcal::FastFinder::Iterator::check ( ) const

Definition at line 226 of file FastFinder.cc.

226  {
227  if (current != null_value &&
228  (current < finder.stars.begin() || current >= finder.stars.begin() + finder.count)) {
229  LOGLS_ERROR(_log, "Error in FastFinder " << *current << " " << *(finder.stars.begin()) << ' '
230  << *(finder.stars.begin() + finder.count));
231  }
232 }
std::vector< std::shared_ptr< const BaseStar > > stars
Definition: FastFinder.h:64
#define LOGLS_ERROR(logger, message)
Log a error-level message using an iostream-based interface.
Definition: Log.h:668

◆ operator*()

FastFinder::stars_element lsst::jointcal::Iterator::operator* ( ) const

Definition at line 206 of file FastFinder.cc.

206  {
207  if (current != null_value) return *current;
208  return nullptr;
209 }

◆ operator++()

void lsst::jointcal::Iterator::operator++ ( )

Definition at line 211 of file FastFinder.cc.

211  {
212  if (current != pend) {
213  current++;
214  } else
215  do {
216  currentSlice++;
217  if (currentSlice >= endSlice) {
219  return;
220  }
222  } while (current == null_value);
223  check();
224 }
void findRangeInSlice(const int iSlice, const double yStart, const double yEnd, pstar &start, pstar &end) const
Definition: FastFinder.cc:169

Member Data Documentation

◆ current

pstar lsst::jointcal::FastFinder::Iterator::current

Definition at line 97 of file FastFinder.h.

◆ currentSlice

int lsst::jointcal::FastFinder::Iterator::currentSlice

Definition at line 93 of file FastFinder.h.

◆ endSlice

int lsst::jointcal::FastFinder::Iterator::endSlice

Definition at line 93 of file FastFinder.h.

◆ finder

const FastFinder& lsst::jointcal::FastFinder::Iterator::finder

Definition at line 92 of file FastFinder.h.

◆ null_value

pstar lsst::jointcal::FastFinder::Iterator::null_value

Definition at line 98 of file FastFinder.h.

◆ pend

pstar lsst::jointcal::FastFinder::Iterator::pend

Definition at line 97 of file FastFinder.h.

◆ yEnd

double lsst::jointcal::FastFinder::Iterator::yEnd

Definition at line 94 of file FastFinder.h.

◆ yStart

double lsst::jointcal::FastFinder::Iterator::yStart

Definition at line 94 of file FastFinder.h.


The documentation for this class was generated from the following files: