Skip to content

Conversation

@kenkangxgwe
Copy link
Contributor

In the previous version, the children and their properties are not copied correctly.

@anadon
Copy link
Contributor

anadon commented Oct 17, 2018

We recently had a PR, #80, which touched on something close to this you might want to look at. Before this gets accepted, please add a test case which illustrates the problem, doesn't work on the past incorrect behavior, and works with your PR.

@kenkangxgwe
Copy link
Contributor Author

I did not see the #80's relation with the copy ctor. Current copy ctor does not recursively copy the children and properties. I have added a test case in test/subgraph.cpp, you may check it.

@anadon
Copy link
Contributor

anadon commented Oct 17, 2018

It was a quick thought. I've been a little preoccupied.

@kenkangxgwe kenkangxgwe force-pushed the develop branch 3 times, most recently from e068b32 to f3f700a Compare October 18, 2018 00:49
{
m_graph = x.m_graph;
m_graph = x.m_graph;
m_edge_counter = x.m_edge_counter;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the subgraph is actually the entire graph keep count of its number of edges, else don't keep track of the member graph's number of edges? This seems like a change in function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the m_graph is a child of its parent, we manually add all the vertices from x.m_graph to m_graph. This will automatically increase the m_edge_counter instead of assign x.m_edge_counter to it.

// UNDER CONSTRUCTION


// This is a helper function to recusively compare two subgraphs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add more detail about what it is testing, and the motivation for testing it.

// This block generates a complete graph with 8 vertices,
// and puts the first and last four of the vertices into two children.
// Do these again to the children, so there are 4 grandchildren with 2 vertices for each.
// Use the copy constructor to generate a copy and compare with the original one.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about subgraph edges? Those also need testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only checked the numbers. How do I compare two edge descriptors from two different graphs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could load the structurally identical graphs with each node holding a unique ID in that graph identical to the equivalent edge in the other graph.

Copy link
Contributor Author

@kenkangxgwe kenkangxgwe Oct 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I just added a comparison of any two corresponding edge indices.

@kenkangxgwe kenkangxgwe force-pushed the develop branch 2 times, most recently from bfb7aac to a397894 Compare October 18, 2018 04:10
In the previous version, the children and their properties are not copied correctly.
Please see the test case.
@anadon
Copy link
Contributor

anadon commented Oct 18, 2018

I'm going to try to revisit this Wednesday. I'm overloaded with work right now and can't give a review due diligence.

@kenkangxgwe
Copy link
Contributor Author

Take your time and have a nice weekend

@anadon
Copy link
Contributor

anadon commented Nov 1, 2018

@jzmaddock This PR looks good to me. It timed out on one test which could be rerun.

@jzmaddock
Copy link
Contributor

I've pushed a fix for the timeout to develop .travis.yml - I suspect the PR will just timeout again if we re-run, so I'll go ahead and merge and we'll see.

@jzmaddock jzmaddock merged commit 023bca0 into boostorg:develop Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants