Public Types | Public Member Functions | Public Attributes | List of all members
Chirp Struct Reference

Public Types

typedef std::unordered_set< std::size_t > indices_t
 

Public Member Functions

void operator() (const int &x)
 
 Chirp (const blobs_t &one, const blobs_t &two, Coordinates &coords, JsonEvent &dumper)
 
bool in (const blobref_t &a, const blobref_t &b)
 
void operator() (const blobref_t &a, const blobref_t &b)
 
void dump (JsonEvent &dumper)
 

Public Attributes

const blobs_tone
 
const blobs_ttwo
 
Coordinatescoords
 
indices_tsel1
 
indices_tsel2
 

Detailed Description

Definition at line 38 of file test_tbb_join.cxx.

Member Typedef Documentation

typedef std::unordered_set<std::size_t> Chirp::indices_t

Definition at line 126 of file test_rayclustering.cxx.

Constructor & Destructor Documentation

Chirp::Chirp ( const blobs_t one,
const blobs_t two,
Coordinates coords,
JsonEvent dumper 
)
inline

Definition at line 130 of file test_rayclustering.cxx.

132  : one(one)
133  , two(two)
134  , coords(coords)
135  , sel1(new indices_t)
136  , sel2(new indices_t)
137  {}
indices_t * sel2
std::unordered_set< std::size_t > indices_t
const blobs_t & two
Coordinates & coords
const blobs_t & one
indices_t * sel1

Member Function Documentation

void Chirp::dump ( JsonEvent dumper)
inline

Definition at line 213 of file test_rayclustering.cxx.

213  {
214  int number = 0;
215  for (const auto ind : *sel1) {
216  const auto& br = one[ind];
217  dumper(br, 10.0, 1.0, 1, ind);
218  ++number;
219  }
220  number = 0;
221  for (const auto ind : *sel2) {
222  const auto& br = two[ind];
223  dumper(br, 20.0, 1.0, 2, ind);
224  ++number;
225  }
226 
227  return;
228  }
indices_t * sel2
const blobs_t & two
const blobs_t & one
indices_t * sel1
bool Chirp::in ( const blobref_t a,
const blobref_t b 
)
inline

Definition at line 139 of file test_rayclustering.cxx.

139  {
140  if (surrounding(a, b)) {
141  return true;
142  }
143 
144  const auto& astrips = a->strips();
145  const int nlayers = astrips.size();
146 
147  // if at least one corner of b is in side a, return true
148  for (const auto& c : b->corners()) {
149  int found = 0;
150  // go through each layer of blob a
151  for (layer_index_t layer = 0; layer < nlayers; ++layer) {
152  const auto& astrip = astrips[layer];
153  if (layer == c.first.layer) {
154  info("L{} A: {} {}", layer, astrip, c);
155  if (astrip.on(c.first.grid)) {
156  info("\ton with found={} nlayers={}", found, nlayers);
157  ++found;
158  continue;
159  }
160  info("\toff with found={} nlayers={}", found, nlayers);
161  break;
162  }
163  if (layer == c.second.layer) {
164  info("L{} A: {} {}", layer, astrip, c);
165  if (astrip.on(c.second.grid)) {
166  info("\ton with found={} nlayers={}", found, nlayers);
167  ++found;
168  continue;
169  }
170  info("\toff with found={} nlayers={}",found, nlayers);
171  break;
172  }
173  const double ploc = coords.pitch_location(c.first, c.second, layer);
174  const int pind = coords.pitch_index(ploc, layer);
175 
176  info("L{} A: {} pind={} ploc={} {}", layer, astrip, pind, ploc, c);
177 
178  if (astrip.in(pind)) {
179  info("\tin with found={} nlayers={}", found, nlayers);
180  ++found;
181  }
182  else {
183  info("\tout with found={} nlayers={}", found, nlayers);
184  break;
185  }
186  }
187  if (found == nlayers) {
188  return true;
189  }
190  }
191  return false;
192  }
double pitch_location(const coordinate_t &one, const coordinate_t &two, layer_index_t other) const
Definition: RayGrid.cxx:133
int pitch_index(double pitch, layer_index_t layer) const
Definition: RayGrid.h:82
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
Coordinates & coords
static bool * b
Definition: config.cpp:1043
bool surrounding(const blobref_t &a, const blobref_t &b)
void Chirp::operator() ( const int &  x)
inline

Definition at line 39 of file test_tbb_join.cxx.

39  {
40  cerr << x << endl;
41  }
list x
Definition: train.py:276
QTextStream & endl(QTextStream &s)
void Chirp::operator() ( const blobref_t a,
const blobref_t b 
)
inline

Definition at line 194 of file test_rayclustering.cxx.

194  {
195 
196 
197  const std::size_t d1 = a-one.begin();
198  const std::size_t d2 = b-two.begin();
199 
200  info("overlap: a{} and b{}", d1, d2);
201  info("\tblob a #{}: {}", d1, a->as_string());
202  info("\tblob b #{}: {}", d2, b->as_string());
203 
204  if (!this->in(a,b)) {
205  warn("NO CONTAINED CORNERS");
206  //Assert(this->in(a,b));
207  }
208 
209  sel1->insert(d1);
210  sel2->insert(d2);
211  }
indices_t * sel2
const blobs_t & two
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
const blobs_t & one
bool in(const blobref_t &a, const blobref_t &b)
static bool * b
Definition: config.cpp:1043
indices_t * sel1

Member Data Documentation

Coordinates& Chirp::coords

Definition at line 124 of file test_rayclustering.cxx.

const blobs_t& Chirp::one

Definition at line 122 of file test_rayclustering.cxx.

indices_t* Chirp::sel1

Definition at line 127 of file test_rayclustering.cxx.

indices_t* Chirp::sel2

Definition at line 128 of file test_rayclustering.cxx.

const blobs_t& Chirp::two

Definition at line 123 of file test_rayclustering.cxx.


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