uwhpsc-2016 / homework2

Homework #2
0 stars 3 forks source link

Solve Lower and Upper Triangular #11

Open rachka opened 8 years ago

rachka commented 8 years ago

With these solvers, is it safe to assume that the arguments L and U both contain the main diagonal with the test suites used for grading?

cswiercz commented 8 years ago

Yes. A lower (resp. upper) triangular matrix contains non-zero element at and below (resp. above) the main diagonal.

rachka commented 8 years ago

Thanks for the clarification. I figured that's how it generally is but wanted to be extra sure.

bplilley commented 8 years ago

Just want to make sure I have this correct: in L (and U) from HW#1 the main diagonal contains all zeros but in L (and U) from HW#2 (I'm looking at solve_lower_triangular and solve_upper_triangular) the main diagonal is non-zero?

rachka commented 8 years ago

Yeah the back and forward substitution algorithms rely on the diagonals being non zero. That is the default definition of lower and upper triangular. HW 1 had it differently because Jacobi and Gauss Seidel use special cases of U and L to solve Ax = b iteratively.

cswiercz commented 8 years ago

@rachka is correct.

The matrix names L and U are overloaded in numerical analysis and scientific computing. Here is a partial list of their uses: