Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement this pseudo code with Java. n is the size of the matrix for an n x n matrix. k points to the pivot. i

Implement this pseudo code with Java.

n is the size of the matrix for an n x n matrix.

k points to the pivot.

i points to the equation being eliminated.

j points to the term you're working with.

Naive Gaussian Elimination

// Forward Elimination

function FwdElimination(coeff : array(n,n), const : vector(n)) for k = 1 to (n - 1) for i = k + 1 to n mult := coeff[i][k] / coeff[k][k] for j <- k + 1 to n coeff[i][j] := coeff[i][j] - mult * coeff[k][j] end for const[i] := const[i] - mult * const[k] end for end for end function

// Back Substitution

function BackSubst(coeff : array(n,n), const : vector(n), sol : vector(n)) sol[n] := const[n] / coeff[n][n] for i = n - 1 to 1 sum := const[i] for j <- i + 1 to n sum := sum - coeff[i][j] * sol[j] end for sol[i] := sum / coeff[i][i] end for end function

// Naive Gaussian algorithm

function NaiveGaussian(coeff : array(n,n), const : vector(n)) sol := new array(n,n) call FwdElimination(coeff,const) call BackSubst(coeff, const, sol) end function

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

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

ISBN: 1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

2. Write the following sets in roster notation

Answered: 1 week ago

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago