Skip to content

Bug in BuildBPGraphFromCSRFormat #38

@pavanakumar

Description

@pavanakumar

I think there is a bug in the BuildBPGraphFromCSRFormat function.
I am getting RightVertices size one higher than what it should be. The
bug seems to be in this loop over columns.

949	  //put together the right vertices
950	  map< int,vector<int> >::iterator curr;
951	  m_vi_RightVertices.push_back(m_vi_Edges.size());
952	  for(int i=0; i <= i_ColumnCount; i++) {
953		  curr = colList.find(i);
954		  if(curr !=colList.end()) {
955			m_vi_Edges.insert(m_vi_Edges.end(),curr->second.begin(),curr->second.end());
956		  }//else  We have an empty column
957		  m_vi_RightVertices.push_back(m_vi_Edges.size());
958	  }

line 952 should look like

951	  m_vi_RightVertices.push_back(m_vi_Edges.size());
952	  for(int i=0; i < i_ColumnCount; i++) {
953		  curr = colList.find(i);

The loop should be between 0, i_ColumnCount - 1 and not 0, i_ColumnCount

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions