Ignore:
Timestamp:
Jun 21, 2018, 9:12:49 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
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)
Message:

ChemicalSpaceEvaluator working for graph with 2 nodes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/Graph6Reader.cpp

    ra951f3 r7f17c7  
    3636//#include "CodePatterns/MemDebug.hpp"
    3737
    38 #include <iterator>
    39 
    4038#include "CodePatterns/Assert.hpp"
     39#include "CodePatterns/Log.hpp"
    4140
    4241#include "Graph6Reader.hpp"
     
    5352void Graph6Reader::scan_num_nodes(std::istream_iterator<unsigned char> &_it)
    5453{
    55   int packets;
    56   int num_nodes;
    5754        //now we're one past the optional header
    5855        //parse the number of nodes
    59         ASSERT(*_it >= 63, "The number of nodes is not properly encoded");
     56        ASSERT(*_it >= 64, "The number of nodes is not properly encoded");
    6057        if (*_it <126) {
    6158                //6-bit encoding
    62                 num_nodes = *_it-63;
     59                num_nodes = *_it-64;
    6360        } else if (*_it++ == 126) {
    6461                unsigned int packets = 3;
     
    6966                }
    7067                for(unsigned int i =0; i<packets*packet_size; ++i) {
    71                         unsigned char packet = (*_it++) - 63;
     68                        unsigned char packet = (*_it++) - 64;
    7269                        ASSERT(packet<=(1<<(packet_size+1)),
    7370                                        "The input is malformed. "
     
    8784void Graph6Reader::next_edge(std::istream_iterator<unsigned char> &_it) {
    8885  unsigned int bit = 0;
     86  int cur_byte = 0;
    8987  while(!bit && !eos) {
    9088    if (++row==column) {
     
    112110  while(!eos) {
    113111    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    }
    115116  }
    116117}
Note: See TracChangeset for help on using the changeset viewer.