First time here? Check out the FAQ!

Ask Your Question
0

Count GF(q) arithmetics

asked 4 years ago

Taylor Huang gravatar image

Hi, I was trying to count the number of basic arithmetics happened in a GF(q)[x] or GF(q)[x].quo(irr) operation. I turned to define a wrapper class

Fq = GF(q)
class probeFq(Fq):
  def __init__(self,*p,**kw):
    self._cnt = 0
    super(probeFq,self).__init__(*p,**kw)
  def __add__(self, *p,**kw):
    self._cnt += 1
    return super(probeFq,self).__add__(*p,**kw)

However, I turns out that GF(q) in sage is not a class. Instead it is some sort of factory object. Is there any way to count the number of arithmetics happened to an element?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 4 years ago

slelievre gravatar image

The profiling tools available in Sage might be what you are after.

See the

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 259 times

Last updated: Jun 15 '20