MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Gauss seidel iteration



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




  • Prev by Date: OpenMath, formula standards and conversion tools
  • Next by Date: Sqrt problem - restated
  • Prev by thread: Gauss seidel iteration
  • Next by thread: General Ellipsoid Symbolic Expression