Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the procedure 1 Naive Gauss and Gaussin algorithm with sclaed partial pivoting: procedures 2 Gauss and Solve Apply the procedures to solve the matrix.

Implement the procedure 1 Naive Gauss and Gaussin algorithm with sclaed partial pivoting: procedures 2 Gauss and Solve
Apply the procedures to solve the matrix. Write a single test program for both procedures.
procedure Naive Gauss(n,(ai j ),(bi ),(xi )) integer i, j, k, n; real sum, xmult
real array (ai j )1:n\times 1:n ,(bi )1:n ,(xi )1:n
for k =1 to n 1 do
for i = k +1 to n do xmult aik/akk
aik xmult
for j = k +1 to n do
aij aij (xmult)akj end for
bi bi (xmult)bk end for
end for
xn bn/ann
fori =n1to1 step1do
sum bi
for j = i +1 to n do
sum sum ai j x j end for
xi sum/aii end for
end procedure Naive Gauss
procedure Gauss(n,(ai j ),(li ))
integer i, j, k, n; real r, rmax, smax, xmult
real array (ai j )1:n\times 1:n ,(li )1:n ; real array allocate (si )1:n for i =1 to n do
li i
smax 0
for j =1 to n do
smax max(smax,|ai j |) end for
si smax end for
for k =1 to n 1 do rmax 0
for i = k to n do
r |ali ,k /sli |
if (r > rmax) then rmax r
ji end if
end for
lj lk
for i = k +1 to n do
xmult ali ,k /alk ,k ali,k xmult
for j = k +1 to n do
ali,j ali,j (xmult)alk,j end for
end for end for
deallocate array (si ) end procedure Gauss
[23-411-10-233434104]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Identify the cause of a performance problem. page 363

Answered: 1 week ago