LSSTApplications  17.0+124,17.0+14,17.0+73,18.0.0+37,18.0.0+80,18.0.0-4-g68ffd23+4,18.1.0-1-g0001055+12,18.1.0-1-g03d53ef+5,18.1.0-1-g1349e88+55,18.1.0-1-g2505f39+44,18.1.0-1-g5315e5e+4,18.1.0-1-g5e4b7ea+14,18.1.0-1-g7e8fceb+4,18.1.0-1-g85f8cd4+48,18.1.0-1-g8ff0b9f+4,18.1.0-1-ga2c679d+1,18.1.0-1-gd55f500+35,18.1.0-10-gb58edde+2,18.1.0-11-g0997b02+4,18.1.0-13-gfe4edf0b+12,18.1.0-14-g259bd21+21,18.1.0-19-gdb69f3f+2,18.1.0-2-g5f9922c+24,18.1.0-2-gd3b74e5+11,18.1.0-2-gfbf3545+32,18.1.0-26-g728bddb4+5,18.1.0-27-g6ff7ca9+2,18.1.0-3-g52aa583+25,18.1.0-3-g8ea57af+9,18.1.0-3-gb69f684+42,18.1.0-3-gfcaddf3+6,18.1.0-32-gd8786685a,18.1.0-4-gf3f9b77+6,18.1.0-5-g1dd662b+2,18.1.0-5-g6dbcb01+41,18.1.0-6-gae77429+3,18.1.0-7-g9d75d83+9,18.1.0-7-gae09a6d+30,18.1.0-9-gc381ef5+4,w.2019.45
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: