Changeset 7f17c7 for src/Graph/Graph6Reader.cpp
- Timestamp:
- Jun 21, 2018, 9:12:49 AM (7 years ago)
- Children:
- 20761c
- Parents:
- a951f3
- git-author:
- Frederik Heber <frederik.heber@…> (10/01/17 11:02:10)
- git-committer:
- Frederik Heber <frederik.heber@…> (06/21/18 09:12:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Graph/Graph6Reader.cpp
ra951f3 r7f17c7 36 36 //#include "CodePatterns/MemDebug.hpp" 37 37 38 #include <iterator>39 40 38 #include "CodePatterns/Assert.hpp" 39 #include "CodePatterns/Log.hpp" 41 40 42 41 #include "Graph6Reader.hpp" … … 53 52 void Graph6Reader::scan_num_nodes(std::istream_iterator<unsigned char> &_it) 54 53 { 55 int packets;56 int num_nodes;57 54 //now we're one past the optional header 58 55 //parse the number of nodes 59 ASSERT(*_it >= 6 3, "The number of nodes is not properly encoded");56 ASSERT(*_it >= 64, "The number of nodes is not properly encoded"); 60 57 if (*_it <126) { 61 58 //6-bit encoding 62 num_nodes = *_it-6 3;59 num_nodes = *_it-64; 63 60 } else if (*_it++ == 126) { 64 61 unsigned int packets = 3; … … 69 66 } 70 67 for(unsigned int i =0; i<packets*packet_size; ++i) { 71 unsigned char packet = (*_it++) - 6 3;68 unsigned char packet = (*_it++) - 64; 72 69 ASSERT(packet<=(1<<(packet_size+1)), 73 70 "The input is malformed. " … … 87 84 void Graph6Reader::next_edge(std::istream_iterator<unsigned char> &_it) { 88 85 unsigned int bit = 0; 86 int cur_byte = 0; 89 87 while(!bit && !eos) { 90 88 if (++row==column) { … … 112 110 while(!eos) { 113 111 next_edge(_it); 114 edges.push_back(std::make_pair(column,row)); 112 if (!eos) { 113 LOG(3, "DEBUG: Adding edge bit in (" << column << "," << row << ")"); 114 edges.push_back(std::make_pair(column,row)); 115 } 115 116 } 116 117 }
Note:
See TracChangeset
for help on using the changeset viewer.