#16553: Clean IncidenceStructure
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.3
Component: combinatorial | Resolution:
designs | Merged in:
Keywords: | Reviewers:
Authors: Nathann Cohen, | Work issues:
Vincent Delecroix | Commit:
Report Upstream: N/A | 428113c0bef095a97189239435c6fb4a92dbe099
Branch: public/16553 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Replying to [comment:39 ncohen]:
> Yo !
>
> > done. But it is not clear to me:
> > - are we allowed to modify the output of `blocks`?
> > - are we allowed to modify the output of `__iter__`?
> >
> > If both answers are yes, then there are copy anyway (I did not
implement the copy=False idea).
>
> The point is that we cannot cache any answer unless the design is
immutable. Then, if it is immutable we can do things like store the blocks
internally as tuples. This way we can write `__iter__` by returning the
blocks directly, and they will not be modified by the user.
>
> For `.blocks()`, we can (by default) return a copy of them or (if the
user asks) return the thing directly.
>
> Ideally, we could have `copy=True/False` arguments in the constructor
and in `blocks()`. This way, if the user (=us, the developpers) say
`copy=False` it means that we know that we are doing and that no copy
occurs.
>
> We can also do this when we compute a design without this class
wrapping, then return the design. We can set `copy=False` and return the
new design as we know that nobody else will modify the lists afterwards.
Easiest way: store everything as tuple of tuples. Is it ok for you?
Replying to [comment:41 ncohen]:
> About `_degree_iterator(self):` : I have no idea of what this function
does, there is absolutely no documentation.
>
> About `_t_design_parameters` and `is_t_design` : if I want to know
whether my design is a 2-design, I sure as hell don't want Sage to beging
enumerating 5-tuples, even if my design is a 5-design.
agreed. I will modify that.
Replying to [comment:42 ncohen]:
> By the way I do not get what you want to do with this "degrees"
function. The work was already done in the previous version of this
function. Why did you break it into a "degrees" function ?
I thought it might be useful to have degrees. But on the other hand, you
are right, it is not very nice within this datastructure.
> That's why it is good to explain what you do in the commits. I mean.
Yeah, why did you break this function ? What was wrong with it ?
It was badly implemented. You can cut the last loop on `t` quickly most of
the time.
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/16553#comment:43>
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.