Here's another aspect of this I don't understand.  The following
version gives the error: "NameError: name 'a4' is not defined", which
doesn't make much sense since I print a4 right before that, which
works.

for c in srange(1,5000):
    for i in prime_range(2,100):
        c2=1
        c1=1
        while c1<30:
            a4=c1*i
            c1+=1
            while c2<30:
                a7=c2*i
                c2+=1
                a1=Integer(randint(3,100))
                a2=Integer(randint(3,100))
                a3=Integer(randint(3,100))
                a5=Integer(randint(3,100))
                a6=Integer(randint(3,100))
                a8=Integer(randint(3,100))
                a9=Integer(randint(3,100))
                A = matrix(QQ,[[a1,a2,a3], [a4,a5,a6],[a7,a8,a9]])
                f = A.charpoly()
                if mod(totalloops,1000)==0: print totalloops
                if f.is_irreducible() == True:
                    K=NumberField(f,'t',cache = False);
                    if K.is_galois()==True:
                        if f.discriminant()%i !=  0:
                            print A, f
                            print "disc = ",factor(f.discriminant())
                            print "prime=",i
                            L = FiniteField(i,'q');
                            P.<w>=L[]
                            f.factor_mod(i)
                            print "(2,1) is in prime:",0==a4%i
                            print "(3,1) is in prime:",0==a7%i
                            print "(3,2) is in prime:",0==a8%i
                    del K
                del A
                del f
                print a4, type(a4)
                del a4

On Mar 4, 1:59 pm, Marshall Hampton <hampto...@gmail.com> wrote:
> This seems like some sort of Integer memory leak.  If the
> randint(3,100) calls are replaced by constants, there is no memory
> problem.
>
> -Marshall

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to