Skip to content
Snippets Groups Projects
  1. Mar 31, 2016
  2. Mar 30, 2016
  3. Mar 19, 2016
  4. Mar 18, 2016
  5. Mar 17, 2016
  6. Mar 15, 2016
  7. Mar 10, 2016
  8. Mar 09, 2016
  9. Mar 08, 2016
  10. Mar 07, 2016
  11. Feb 10, 2016
  12. Feb 04, 2016
  13. Feb 03, 2016
  14. Feb 02, 2016
    • Vasileios Karakasis's avatar
      Cell record cleaning. · e8bfa5b7
      Vasileios Karakasis authored
      Read in cell records and do a basic cleaning:
        1. Remove duplicates.
           Only the first occurance is considered.
        2. Sort the records if not sorted.
        3. Ignore subsequent trees if more than one are specified.
        4. Renumber records if numbering is not contiguous.
      e8bfa5b7
  15. Jan 29, 2016
  16. Jan 28, 2016
  17. Jan 26, 2016
  18. Jan 24, 2016
  19. Jan 22, 2016
  20. Jan 21, 2016
    • Vasileios Karakasis's avatar
      Compacted a couple of statements. · 0d06702f
      Vasileios Karakasis authored
      0d06702f
    • Vasileios Karakasis's avatar
      Replaced line buffer by an std::string. · b7e58f3d
      Vasileios Karakasis authored
      The line buffer is no more a pure character array but a standard string.
      For reading lines from the input stream we use the higher level
      std::getline() function which takes care of overflow issues.
      
      Side improvements: String comment prefixes are now supported.
      
      Other changes: added `-pedantic' to the compilation flags, to force
      strict C++11 compliance.
      b7e58f3d
    • Vasileios Karakasis's avatar
      Removed unnecessary headers. · 330f437f
      Vasileios Karakasis authored
      330f437f
    • Vasileios Karakasis's avatar
      Better and cleaner parser semantics. · aea81c6d
      Vasileios Karakasis authored
      The parser's semantics are now cleaner and the implementation more
      robust. Cell parsing now follows the semantics of the standard input
      stream (same as of standard UNIX's read), but instead of reading in
      bytes or builtin types, we are reading full cell records. This has the
      following implications:
      
      1. Empty and comment lines are consumed silently.
      2. End-of-file will be set on the stream only if a read operation
         returns zero. Practically, this means, eof bit will be set in the
         stream at the first attempt to read a cell record after the final
         cell record in the stream was read.
      3. Exceptional conditions in the stream (e.g., eof or bad bits) stop the
         parsing process without raising an exception and return control to the
         user which is responsible to deal with them. The only exceptional
         condition that we handle internally is the presence of very long lines,
         in which case we raise an std::runtime_error().
      
      Thanks to these cleaner semantics, the parser is now able to deal with
      files not ending with a new line. The previous version would have missed
      the last record.
      
      Due to (2) the following code for reading from an input stream will
      yield an additional default constructed cell record at the end:
      
      while (!swc_input.eof()) {
          cell_record cell;
          swc_input >> cell;
          // do sth with the cell
      }
      
      According to (2), after the final record is read, eof is not yet set at
      the stream, which means the while loop will be entered one more time.
      The attempt to read a record from the stream then will raise the eof bit
      and no cell will be read in, leaving `cell' at its default constructed
      state. To avoid such a side-effect, the best way to read records from an
      input stream is the following:
      
      cell_record cell;
      while( !(swc_input >> cell).eof()) {
          // do sth with the cell
      }
      
      In this case, after the final record is read, the next attempt to read
      in a record will set the eof bit and won't enter the loop.
      aea81c6d