#18185: Clean the Graph/DiGraph constructors
-------------------------+-------------------------------------------------
Reporter: | Owner:
ncohen | Status: needs_review
Type: | Milestone: sage-6.6
defect | Resolution:
Priority: major | Merged in:
Component: graph | Reviewers:
theory | Work issues:
Keywords: | Commit:
Authors: | f8c9f8ef8662324dee8f1bc403968fa5b2d168aa
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
public/18185 |
Dependencies: |
#18067 |
-------------------------+-------------------------------------------------
Description changed by ncohen:
Old description:
> The Graph and DiGraph constructor are rather long, and rather messy, as
> they are meant to accept a LOT of different inputs.
>
> The point of this branch is to simplify its logic, in order to be able to
> split it into subfunctions later.
>
> Here is the current logic:
> 1) Detect and set the 'format' if it was not specified
> 2) For every possible format, define whether the graph should allow
> loops/multiedges
> 3) Pick a data structure (i.e. backend) and create it
> 4) For every possible format, add vertices and edges
>
> Besides local fixes and modifications, this branch moves '3' right after
> '1'. Then, '3' and '4' are merged so that we only enumerate all possible
> formats once.
>
> I tried to split commits to make it easier to review. I know that it will
> not be very easy to read. It was not exactly easy to write either.
New description:
The Graph and DiGraph constructor are rather long, and rather messy, as
they are meant to accept a LOT of different inputs.
The point of this branch is to simplify its logic, in order to be able to
split it into subfunctions later.
Here is the current logic:
1) Detect and set the 'format' if it was not specified
2) For every possible format, define whether the graph should allow
loops/multiedges
3) Pick a data structure (i.e. backend) and create it
4) For every possible format, add vertices and edges
Besides local fixes and modifications, this branch moves '3' right after
'1'. Then, '2' and '4' are merged so that we only enumerate all possible
formats once.
I tried to split commits to make it easier to review. I know that it will
not be very easy to read. It was not exactly easy to write either.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/18185#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.