read('s15odr8Eq'):
read('InitialCs'):
read('Newton'):
readlib(write):

#                                        Ren-Cang Li, June 1, 1996
#                                        na.rcli@na-net.ornl.gov

# the number of initial guesses to be tried on.

NumIG:=rowdim(InitialCs): 
print(`the number of initial guesses to be tried on:`): print(NumIG):

# working vectors and matrix.

x0:=vector(7): 
x0out:=matrix(NumIG,7): 
x0tmp:=vector(7):

# Set working precision and how many Digits to be Dumped for each
# computed solutions

Digits:=100: DumpDigits:=20:
eps:=10^(-Digits+25):
#
print(1):
for j from 1 to 7 do
    x0[j]:=InitialCs[1,j]:
od:
err:=NewtonItern(x0):
if err >=eps then
   print(`Warning: Possible inaccurate solution!`):
   print(`Please Interrupt`):
   print(err):
else
   numpts:=1:
   for j from 1 to 7 do
       x0out[numpts,j]:=x0[j]:
   od:
fi:
#
for ii from 2 to NumIG do
    ichk:=1:
    print(ii):
    for j from 1 to 7 do
	x0[j]:=InitialCs[ii,j]:
    od:
    err:=NewtonItern(x0):
    if err >=eps then
       print(`Warning: Possible inaccurate solution!`):
    else
       for i from 1 to numpts do
	   if ichk=1 then
	      for j from 1 to 7 do
	          x0tmp[j]:=x0out[i,j]-x0[j]:
	      od:
	      if norm(x0tmp)<=eps*norm(x0) then
		 ichk:=0:
	      fi: 
	   fi:
       od:
       if ichk=1 then
	  numpts:=numpts+1:
          for j from 1 to 7 do
              x0out[numpts,j]:=x0[j]:
          od:
       fi:
    fi:
od:

print(`The number of distict solutions found:`): print(numpts):

# Dumping all solutions found.

for ii from 1 to numpts do
    appendto(s15odr8_All):
    writeln():
    write(`Scheme`): write(ii): write(`:`): writeln():
    write(`==============`): writeln():
    for i from 1 to 7 do x0[i]:=x0out[ii,i]: od:
    read('WriteItOut'):
    writeln():
    close():
od:
