*To*: mathgroup@smc.vnet.net*Subject*: [mg12139] Re: Gauss seidel iteration*From*: "Clifford J. Nelson" <nelsoncj@gte.net>*Date*: Mon, 27 Apr 1998 01:46:21 -0400*Organization*: gte.net

On Thu, Apr 23, 1998 10:32 PM, Jules Dahlberg <mailto:julied@winternet.com> wrote: >Does anyone understand how to do Gauss Seidel Iteration? > > > gsv = Compile[{{x,_Real,1}}, an = x/(x.x);n = Length[x]; ian = x; While[Max[Abs[ian-an]] >10^(-7),ian = an; Do[an[[i]] = (x[[i]]-Sum[poz[i-1,j-1]an[[j]],{j,1,i-1}]- Sum[poz[i-1,j-1]ian[[j]],{j,i+1,n}])/poz[i-1,i-1],{i,1, Length[x]}]];an] poz[0,0] := 1 poz[x_,y_] := x^y -------------- I got this from a book on the APL programming language, but, I can't find the book now. poz[i,j] is the ith,jth entry of the matrix and x is the known vector. So, poz is a Vandermonde matrix. It zeroes in on the solution to poz.y == x for y. Change poz to the matrix in question (with zero index origin). Cliff Nelson