Changeset 36576
- Timestamp:
- Mar 6, 2014, 9:33:47 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140206/Ohana/src/libdvo
- Files:
-
- 2 edited
-
include/dvo.h (modified) (2 diffs)
-
src/RegionHostTable.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h
r36575 r36576 286 286 287 287 // A RegionHost processes data for some region in parallel with other regions 288 typedef struct {289 double Rmin; 290 double Rmax; 291 double Dmin; 292 double Dmax; 293 294 double RminCat; 295 double RmaxCat; 296 double DminCat; 288 typedef struct RegionHostInfo { 289 double Rmin; // (Rmin,Rmax),(Dmin,Dmax) arehard RA,DEC boundaries of the 290 double Rmax; // region for which each host is responsible. A given host 291 double Dmin; // calibrates the images for which the fiducial point (center) 292 double Dmax; // lands in the region, and all objects in the region 293 294 double RminCat; // (RminCat,RmaxCat),(DminCat,DmaxCat) are the region for which 295 double RmaxCat; // the catalogs need to be loaded : this is the outer bounds 296 double DminCat; // of the region containing all images completely 297 297 double DmaxCat; 298 298 … … 310 310 Image *image; 311 311 off_t *imseq; 312 313 int *neighbors; 314 int Nneighbors; 312 315 } RegionHostInfo; 313 316 -
branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c
r36575 r36576 27 27 hosts[i].Nimage = 0; 28 28 hosts[i].NIMAGE = 0; 29 30 hosts[i].neighbors = NULL; 31 hosts[i].Nneighbors = 0; 29 32 } 30 33 return; … … 167 170 } 168 171 172 for (i = 0; i < table->Nhosts; i++) { 173 RegionHostFindNeighbors (table, i); 174 } 175 169 176 free (filename); 170 177 fclose (f); 171 178 return table; 179 } 180 181 int RegionHostFindNeighbors (RegionHostTable *table, int Nhost) { 182 183 // given a specific host (by table sequence), find all of its neighbors 184 // (eg, (host->Rmin == althost->Rmax && (host->Dmin <= althost->Dmax) && (host->Dmax >= althost->Dmin) 185 186 RegionHostInfo *myhost = &table->hosts[Nhost]; 187 myAssert (!myhost->neighbors, "myhost neighbors already allocated"); 188 myAssert (!myhost->Nneighbors, "myhost Nneighbors not zero?"); 189 ALLOCATE (myhost->neighbors, int, 1); // always allocate 1 extra 190 191 for (i = 0; i < table->Nhosts; i++) { 192 193 if (i == Nhost) continue; 194 RegionHostInfo *althost = &table->hosts[i]; 195 196 int onBorder; 197 198 onBorder = 199 (myhost->Rmin == altHost->Rmax) && 200 (myhost->Dmin <= altHost->Dmax) && 201 (myhost->Dmax >= altHost->Dmin); 202 if (onBorder) goto add_neighbor; 203 204 onBorder = 205 (myhost->Rmax == altHost->Rmin) && 206 (myhost->Dmin <= altHost->Dmax) && 207 (myhost->Dmax >= altHost->Dmin); 208 if (onBorder) goto add_neighbor; 209 210 onBorder = 211 (myhost->Dmin == altHost->Dmax) && 212 (myhost->Rmin <= altHost->Rmax) && 213 (myhost->Rmax >= altHost->Rmin); 214 if (onBorder) goto add_neighbor; 215 216 onBorder = 217 (myhost->Dmax == altHost->Dmin) && 218 (myhost->Rmin <= altHost->Rmax) && 219 (myhost->Rmax >= altHost->Rmin); 220 if (onBorder) goto add_neighbor; 221 222 continue; 223 224 add_neighbor: 225 myhost->neighbors[myhost->Nneighbors] = i; 226 myhost->Nneighbors ++; 227 REALLOCATE (myhost->neighbors, int, myhost->Nneighbors + 1); 228 } 229 return TRUE; 172 230 } 173 231
Note:
See TracChangeset
for help on using the changeset viewer.
