#12141: Implement finite algebras
-------------------------------------+-------------------------------------
       Reporter:  johanbosman        |        Owner:  AlexGhitza
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.2
      Component:  algebra            |   Resolution:
       Keywords:  sd51               |    Merged in:
        Authors:  Johan Bosman,      |    Reviewers:
  Peter Bruin, Michiel Kosters       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  42e2f4ef1a2a86864c0e5f08e7c247763842a553
  public/algebras/finite_algebras-12141|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Hey Peter,

 Replying to [comment:25 pbruin]:
 > I haven't had the time to review your changes in detail, but here are a
 few things I noticed:
 > - you changed "EXAMPLE::" to "EXAMPLES::" in many places where there is
 only one example; do you have a reason for this?

 As I understand it, `EXAMPLES::` (and `TESTS::`) is the standard idiom,
 not the singular version even if there is only one such example. Although
 I seem to have missed some that I should also change to be consistent,
 unless you feel that I should change them back (I don't hold a strong
 opinion on this).

 > - I think it should be "finite-dimensional algebra", not "finite
 dimensional algebra", since "finite-dimensional" is used as a single
 adjective.

 Will change.

 > - Are you sure that the inverse of an element should be cached?  This
 looks like it could waste a lot of memory.  My impression is that in
 general only properties of parents should be cached.  If any inverse
 should be cached at all, why not just that of the underlying matrix?

 It depends. Things that are very memory/computationally intensive to
 compute but not to store are candidates for a cache, especially when it's
 likely to be a bottleneck.

 Also it's not using much more memory by caching the element as opposed to
 the matrix (nor does it generate a memory leak). So let's say `x^-1 = y`,
 then `x` has `y` stored in its cache. So once you delete `x`, you also
 delete the cache containing `y`. Perhaps what we should do is have a
 `@lazy_attribute` called `_inverse` which will point to `y`, and then if
 we construct `x^-1`, we can set `y._inverse = x`.

 The other option if you're worried about memory usage is to make it a
 `@weak_cached_function`, which allows it to be garbage collected if there
 is no strong reference to `x^-1` and memory is needed elsewhere.

--
Ticket URL: <http://trac.sagemath.org/ticket/12141#comment:26>
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/groups/opt_out.

Reply via email to