#13566: Simplicial complex examples as singletons
--------------------------------------+-------------------------------------
       Reporter:  tscrim              |         Owner:  tscrim      
           Type:  enhancement         |        Status:  needs_review
       Priority:  minor               |     Milestone:  sage-5.5    
      Component:  algebraic topology  |    Resolution:              
       Keywords:  simplicial          |   Work issues:              
Report Upstream:  N/A                 |     Reviewers:              
        Authors:                      |     Merged in:              
   Dependencies:  #13244, #12587      |      Stopgaps:              
--------------------------------------+-------------------------------------
Description changed by jhpalmieri:

Old description:

> Since each of the examples are unique, there should only be one
> (immutable) instance of each. In other words, we do not recreate the
> example each time it is called. For example
> {{{
> sage: S1 = simplicial_complexes.KleinBottle()
> sage: S2 = simplicial_complexes.KleinBottle()
> sage: S1 == S2
> True
> sage: S1 is S2
> False
> }}}
> where the last should return `true`. Possibly do this by something like
> {{{
> def KlienBottle(self):
>     if not hasattr(self, "_klien_bottle_output"):
>         self._klien_bottle_output = SimplicialComplex(facets)
>     return self._klien_bottle_output
> }}}
> This is an expansion on the concept in #13244 and the dependency on
> #12587 is in making simplicial complexes immutable.

New description:

 Since each of the examples are unique, there should only be one
 (immutable) instance of each. In other words, we do not recreate the
 example each time it is called. For example
 {{{
 sage: S1 = simplicial_complexes.KleinBottle()
 sage: S2 = simplicial_complexes.KleinBottle()
 sage: S1 == S2
 True
 sage: S1 is S2
 False
 }}}
 where the last should return `true`. Possibly do this by something like
 {{{
 def KlienBottle(self):
     if not hasattr(self, "_klien_bottle_output"):
         self._klien_bottle_output = SimplicialComplex(facets)
     return self._klien_bottle_output
 }}}
 This is an expansion on the concept in #13244 and the dependency on #12587
 is in making simplicial complexes immutable.

 ----------

 Apply [attachment:trac_13566cna.patch].

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13566#comment:10>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to