Changeset 40127

Show
Ignore:
Timestamp:
09/04/2017 03:52:07 PM (3 weeks ago)
Author:
eugene
Message:

build empty next_lensobj if output has no lensobj (if the entire output catalog is empty, but input catalog is empty)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvomerge/src/build_links.c

    r39926 r40127  
    448448off_t *build_lensobj_links (Average *average, off_t Naverage, Lensobj *lensobj, off_t Nlensobj) { 
    449449 
    450   fprintf (stderr, "input is not sorted but contains lensobj -- trouble\n"); 
    451   exit (2); 
    452  
    453 # if (0) 
    454  
    455   off_t i, m, k, Nm, averef; 
     450  if (Nlensobj) { 
     451    fprintf (stderr, "input is not sorted but contains lensobj -- trouble\n"); 
     452    exit (2); 
     453  } 
     454 
     455  off_t i; 
    456456  off_t *next_lensobj; 
    457457 
     
    464464  } 
    465465 
    466   for (Nm = 0; Nm < Nlensobj; Nm++) { 
    467     averef = lensobj[Nm].averef; 
    468     m = average[averef].lensobjOffset;   
    469     next_lensobj[Nm] = -1; 
    470  
    471     if (m == -1) { /* no links yet for source */ 
    472       average[averef].lensobjOffset = Nm; 
    473       average[averef].Nlensobj     = 1; 
    474       continue; 
    475     } 
    476  
    477     for (k = 0; next_lensobj[m] != -1; k++) { 
    478       m = next_lensobj[m]; 
    479       if (m >= Nlensobj) { 
    480         fprintf (stderr, "WARNING: m out of bounds (1)\n"); 
    481       } 
    482     } 
    483  
    484     average[averef].Nlensobj = k + 2; 
    485     next_lensobj[m] = Nm; 
    486     if (m >= Nlensobj) { 
    487       fprintf (stderr, "WARNING: m out of bounds (2)\n"); 
    488     } 
    489   } 
    490466  return (next_lensobj); 
    491 # endif 
    492467} 
    493468