Skip to main content
Best answer by LucMeekes

The (j<i) and (j>i) serve to exclude the item in the sum where j=i,

What you need to understand is that (j<i) is a boolean construct that results in 1 if j indeed is smaller than i. As soon as j=i, or is larger, the value of (j<i) becomes 0, so effectively the summand is zero'd for this indices. Likewise for the second sum uses (j>i) to set all summands to zero when j=i, or less.

There's another way to simplify the program:

LucMeekes_0-1644441787980.png

 

Success!

Luc

1 reply

23-Emerald IV
January 28, 2022

Here are some first comments:

LucMeekes_0-1643382659459.png

Success!
Luc

12-Amethyst
January 28, 2022

The number of iterations was just random. Correct me if I am wrong. The ai,j is having a hard time because it has a big number of range. Am i right? 

 

My i represents the number of rows and the j represents number of columns (including the augmented matrix). 

 

If I lower my matrix number n=3, it still has the same issues. I fixed some of the values from my file earlier.

 

Kindly enlighten me on my program. Thank you.

23-Emerald IV
January 28, 2022

Nope. The a[i,j is having a hard time because even with n=3 you're trying to address elements out of a's range. Note that you're running j up to n+1, which is 4.

 

"including the augmented matrix" I don't see you augment the matrix.

 

And finally, you are raising elements of the array x to powers N and N+1. I don't think that the Gauss Seidel method needs that...

 

Success!
Luc