- Timestamp:
- Jun 22, 2018, 7:26:30 AM (7 years ago)
- Branches:
- Candidate_v1.6.1, ChemicalSpaceEvaluator
- Children:
- d661b2
- Parents:
- f5ea10
- git-author:
- Frederik Heber <frederik.heber@…> (10/01/17 11:02:10)
- git-committer:
- Frederik Heber <frederik.heber@…> (06/22/18 07:26:30)
- Location:
- src/Graph
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Graph/BoostGraphCreator.cpp
rf5ea10 r99c705 118 118 atomids_nodeids.insert( std::make_pair(vertexname, vertexindex) ); 119 119 } 120 LOG(1, "INFO: Added " << reader.get_num_nodes() << " nodes."); 120 121 121 122 // add edges … … 128 129 boost::add_edge(leftnodeid, rightnodeid, graph); 129 130 } 131 LOG(1, "INFO: Added " << reader.get_edges().size() << " edges."); 130 132 } 131 133 -
src/Graph/Graph6Reader.cpp
rf5ea10 r99c705 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 } -
src/Graph/Graph6Reader.hpp
rf5ea10 r99c705 16 16 17 17 #include <istream> 18 #include <iterator> 18 19 #include <string> 19 20 #include <vector> … … 34 35 35 36 Graph6Reader() : 36 column(0), 37 row(0), 38 eos(0), 39 bit_pos(0), 40 cur_byte(0), 37 column(1), 38 row(-1), 39 eos(false), 40 bit_pos(-1), 41 41 num_nodes(0) 42 42 {} … … 59 59 int column; 60 60 int row; 61 inteos;61 bool eos; 62 62 int bit_pos; 63 int cur_byte;64 63 static const int packet_size; 65 64
Note:
See TracChangeset
for help on using the changeset viewer.