Skip to content

Iterative methods only work for diagonally dominant matrices #1

@Weiming-Hu

Description

@Weiming-Hu

Describe the bug
Both the Jacobi and the Gauss-Seidel iterative methods only work for diagonally dominant matrices. Although being diagonally dominant is one of the assumptions for the iterative methods, is there still an iterative solution to them?

To Reproduce
Steps to reproduce the behavior:

  1. git clone the repository
  2. Compile the program
mkdir build && cd build
cmake ..
make
  1. Go to the binary output folder
cd ../output/bin
  1. Run the successful test with Jacobi method for 100 iterations
./iterativeSolver J ../../data/A_5.csv ../../data/b_5.csv 100 1 2
  1. Print out the correct result
cat ../../data/x_5.csv # they should be the same with the above
  1. Run the failing test with Jacobi method for 100 iterations
./iterativeSolver J ../../data/A_failed.csv ../../data/b_failed.csv 100 1 2
# the residual is diverging
  1. Print out the correct result
cat ../../data/x_failed.csv
# they are different from the above

Expected behavior
Jacobi method should be converging but it is not. The residual gradually diverges rather than becoming a tremendously large number suddenly suggesting that this is less of a numerical precision problem, but more of a systematic bug issue.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.1 LTS (Bionic Beaver)
  • Browser Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions