Changes between Initial Version and Version 1 of Ticket #11187, comment 213


Ignore:
Timestamp:
04/13/16 13:25:22 (3 years ago)
Author:
tscrim
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11187, comment 213

    initial v1  
    11Replying to [comment:211 stumpc5]:
    22> Travis: Also, you introduced {{{_reduced_word}}} to be a lazy attribute. This has a few drawbacks: {{{not self._reduced_word is None}}} in the length function in {{{reflection_group_real.py}}} is never triggered, and {{{_reduced_word}}} is now either a word in the index set (if the lazy attribute is triggered in the real case), or a word in {{{range(n)}}} if one has gotten it through the iterator. This way, the method {{{reduced_word}}} in the real case is always executed, even though the reduced word is already known.
     3Doing this simplified the code and probably got us a small speedup. Yet, this is a bug in my implementation.  However, I'm not sure how much it is worth it to compute the length of an arbitrary element without computing its reduced word. If it becomes that time critical for someone, we can get them an `algorithm` option for `length()`.
    34
    4 Trac is being stupid. Message to be edited...
     5> This way, the method {{{reduced_word}}} in the real case is always executed, even though the reduced word is already known.
     6
     7This doesn't make sense. If anything `reduced_word()` will throw an error if `_reduced_word` was done by the `lazy_attribute`. The iterator overwrites (the lazy attribute) `_reduced_word` if the word comes from there, so it does not get computed twice. Otherwise it was a user created word and will never be identical (not just equals) to an element created from the iterator.
     8
     9> Two solutions are:
     10> * write the lazy attribute in the real case so that it gives a word in {{{range(n)}}}
     11
     12This is what I would do. Although we might be better off just doing our own implementation using a list (which we mutate) and starting with `self.domain()`.
     13
     14