uwhpsc-2016 / homework2

Homework #2
0 stars 3 forks source link

Lower and Upper Triangular Matrix definition #34

Open nishalad95 opened 8 years ago

nishalad95 commented 8 years ago

Hello!

I was wondering whether the actual definitions of Lower and Upper triangular matrices contain the leading diagonal elements. I have done some research online (http://mathworld.wolfram.com/LowerTriangularMatrix.html) and it says that they do, however in the homework1 pdf it states that L and U don't contain the leading diagonal.

At the moment, I am implementing in my solve_lower_triangular and solve_upper_triangular to have L containing the leading diagonal elements and everything below it, and U to contain the leading diagonal and everything above it. Is this correct?

This means that the equation "Dx = b 􀀀 (L + U)x" from the homework1 pdf where this L+U does not contain the leading diagonal, going from the definitions of L and U in the pdf.

Thank you!

alyfarahat commented 8 years ago

At the moment, I am implementing in my solve_lower_triangular and solve_upper_triangular to have L containing the leading diagonal elements and everything below it, and U to contain the leading diagonal and everything above it. Is this correct?

Yes, this is correct. Otherwise, the determinant of L or U will be zero and solve_triangular() will have to generate a linear vector subspace of solutions whose dimension is non-zero. I guess this is not the case. In homework 1, we could not have used L and U as they were defined for directly solving the triangular system. In fact, we had to include the principal diagonal for the case of gauss_seidel(); (D + L) or (D + U).

nishalad95 commented 8 years ago

Ah great! Thank you!