Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Iterating over finite fields
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rob Beezer  
View profile  
 More options Oct 31 2009, 4:47 pm
From: Rob Beezer <goo...@beezer.cotse.net>
Date: Sat, 31 Oct 2009 13:47:27 -0700 (PDT)
Local: Sat, Oct 31 2009 4:47 pm
Subject: Iterating over finite fields
The list() method does not seem to work properly for (givaro) finite
fields:

sage: K.<a>=GF(4)
sage: [x for x in K]
[0, a, a + 1, 1]
sage: hasattr(K, '__iter__')
True
sage: K.list()
...
TypeError:
'sage.rings.finite_field_givaro.FiniteField_givaro_iterator' object is
not iterable

The culprit looks to me to be in  sage/rings/finite_field_givaro.pyx
starting at:

cdef class FiniteField_givaro_iterator:

With some guidance I can probably fix this.  Does the iterator need to
inherit from some more general iterator object?  Should it be a Python
generator (ie w/ a yield) and then not cdef'ed?    Or?

For example, the iterator for a ring of integers mod n seems to be off
in its own pure Python file with a true Python generator.

Suggestions on the nature of a fix (ie the "right" way to do this)
would be appreciated.

Thanks,
Rob


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Albrecht  
View profile  
 More options Oct 31 2009, 8:11 pm
From: Martin Albrecht <m...@informatik.uni-bremen.de>
Date: Sun, 1 Nov 2009 00:11:59 +0000
Local: Sat, Oct 31 2009 8:11 pm
Subject: Re: [sage-devel] Iterating over finite fields
FiniteField_givaro_iterator should have an __iter__() function which just
returns itself:

def __iter__(self):
   return self

This fixes the problem, see:

   http://trac.sagemath.org/sage_trac/ticket/7366

Cheers,
Martin

--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinralbre...@jabber.ccc.de


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Beezer  
View profile  
 More options Oct 31 2009, 8:23 pm
From: Rob Beezer <goo...@beezer.cotse.net>
Date: Sat, 31 Oct 2009 17:23:25 -0700 (PDT)
Local: Sat, Oct 31 2009 8:23 pm
Subject: Re: Iterating over finite fields
Thanks, Martin!  That was simple.  ;-)

I'll give the patch a review later this evening.

Rob

On Oct 31, 5:11 pm, Martin Albrecht <m...@informatik.uni-bremen.de>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
YannLC  
View profile  
 More options Nov 1 2009, 10:10 am
From: YannLC <yannlaiglecha...@gmail.com>
Date: Sun, 1 Nov 2009 07:10:01 -0800 (PST)
Local: Sun, Nov 1 2009 10:10 am
Subject: Re: Iterating over finite fields
Nice, but I think Givaro fields were not the only ones broken:

K = Loading Sage library. Current Mercurial branch is: minpoly
sage: K.<a> = GF(17^5)
sage: K.list()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)
...
TypeError: 'sage.rings.ring.FiniteFieldIterator' object is not
iterable


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Beezer  
View profile  
 More options Nov 1 2009, 7:08 pm
From: Rob Beezer <goo...@beezer.cotse.net>
Date: Sun, 1 Nov 2009 16:08:23 -0800 (PST)
Local: Sun, Nov 1 2009 7:08 pm
Subject: Re: Iterating over finite fields
 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »