Jsoi Spherical space Generator (Gaussian elimination element)

Source: Internet
Author: User

According to the simple column equation, we can list n+1 of n-element 2-th equation.

By subtracting the adjacent two equations, we can get N-n-ary 1-th equation, and the Gaussian elimination element can be done.

1 varB:Array[0.. -,0.. -] ofextended;2Temp,ans:Array[0.. -] ofextended;3 I,j,k,n:longint;4 cnt:extended;5 begin6 READLN (n);7      fori:=1  ton+1  Do8          forj:=1  toN Do9 read (b[i,j]);Ten      fori:=1  toN Do One          forj:=1  toN Do A         begin -a[i,j]:=2* (b[i+1, j]-b[i,j]); -a[i,n+1]:=a[i,n+1]+b[i+1, j]*b[i+1, j]-b[i,j]*B[i,j]; the         End; ---------------------------------rpcardinal Orz-------------------------------------- -      fori:=1  toN-1  Do -     begin +          forj:=i+1  toN Do -             ifA[j,i]>a[i,i] Then +             begin Atemp:=A[i]; ata[i]:=A[j]; -a[j]:=temp; -             End; -          forj:=i+1  toN Do -         begin -Cnt:=a[j,i]/a[i,i]; a[j,i]:=0; in              fork:=i+1  ton+1  Do -a[j,k]:=a[i,k]*cnt-A[j,k]; to         End; +     End; -ans[n]:=a[n,n+1]/A[n,n]; the      fori:=n-1 Downto 1  Do *     begin $          forj:=i+1  toN Doa[i,n+1]:=a[i,n+1]-ans[j]*A[i,j];Panax Notoginsengans[i]:=a[i,n+1]/A[i,i]; -     End; the      fori:=1  toN DoWrite (Ans[i]:0:3,' '); + End.

Jsoi Spherical space Generator (Gaussian elimination element)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.