Answered step by step
Verified Expert Solution
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 Naive Gauss and Gaussin algorithm with sclaed partial pivoting: procedures Gauss and Solve
Apply the procedures to solve the matrix. Write a single test program for both procedures.
procedure Naive Gaussnai j bi xi integer i j k n; real sum, xmult
real array ai j :ntimes :n bi :n xi :n
for k to n do
for i k to n do xmult aikakk
aik xmult
for j k to n do
aij aij xmultakj end for
bi bi xmultbk end for
end for
xn bnann
fori nto stepdo
sum bi
for j i to n do
sum sum ai j x j end for
xi sumaii end for
end procedure Naive Gauss
procedure Gaussnai j li
integer i j k n; real r rmax, smax, xmult
real array ai j :ntimes :n li :n ; real array allocate si :n for i to n do
li i
smax
for j to n do
smax maxsmaxai j end for
si smax end for
for k to n do rmax
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 to n do
xmult ali k alk k ali,k xmult
for j k to n do
ali,j ali,j xmultalkj end for
end for end for
deallocate array si end procedure Gauss
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started