Changeset e27299 in git for modules


Ignore:
Timestamp:
Jun 17, 2006, 6:51:03 PM (18 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
f150c1f822d2fc1b923639e902a1506649215a06
Parents:
d5245dab5e822b080f9ee9d2d2decfb0e29585f9
Message:
*bricken: register variables


git-svn-id: file:///usr/local/Singular/svn/trunk@9231 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
modules/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/python/polytester

    rd5245da re27299  
    3636r.set()
    3737z2=Polynomial('z')
     38r=util.create_ring(char=0,nvars=3, varNames=['u','v','w'], ordering='lp', register=locals())
     39print u+v*w
    3840#the following should fail
    3941#print z+z2
  • modules/python/util.py

    rd5245da re27299  
    33singular=SingularGlobalsProxy()
    44
    5 def create_ring(char=0, nvars=1, varNames=None, ordering="dp", degvec=None):
     5def create_ring(char=0, nvars=1, varNames=None, ordering="dp", degvec=None, register=None):
    66  if not varNames:
    77    varNames=["x("+str(i)+")" for i in xrange(1,nvars+1)]
     
    1515  modulweights.append(0)
    1616  l=[char,varNames,[[ordering,degvec],["C",modulweights]], Ideal()]
    17   return singular.ring(l)
     17  res=singular.ring(l)
     18  if register is None:
     19    return res
     20  else:
     21    old_ring=Ring()
     22    res.set()
     23    for i in range(nvars):
     24        v=singular.var(i+1)
     25        register[str(v)]=v
     26       
     27    old_ring.set()
     28    return res
    1829
    1930
Note: See TracChangeset for help on using the changeset viewer.