Oop got it working. Thanks for the references. Haven't tried notebook
yet save to create an admin password. I never liked zork (adventure)
this is like that but I managed this time. Now I just have to discover
how to control the argument types, Tableau matrix in QQ, pr and pc
integers. Thanks.

def nx(Tableau,pr,pc):
  newtab=Tableau
  nr=newtab.nrows()
  nc=newtab.ncols()
  if not pr in range(nr):
    print('invalid pivot row in function nx')
    return 'invalid pivot row in function nx'
  if not  pc in range(nc):
    print('invalid pivot column in function nx')
    return 'invalid pivot column in function nx'
  pivot=newtab[pr,pc]
  if pivot==0:
    print('invalid pivot is 0')
    return 'invalid pivot is 0'
  else:
    cellar=range(nc)
    for j in range(nc):
      if j==pc:
        cellar[j]=0 #had this set to null in VB
      else:
        cellar[j]=-1*newtab[pr,j]/pivot
    for i in range(nr):
      for j in range(nc):
        if i<>pr and j<>pc:
          newtab[i,j]=newtab[i,j]+cellar[j]*newtab[i,pc]
        elif i==pr and j<>pc:
          newtab[i,j]=cellar[j]
        elif i<>pr and j==pc:
          newtab[i,j]=newtab[i,j]/pivot
  return newtab

#Steve
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to