I write a program for solving tridiagonal linear system of equations and I want to modify it - to read input data from file. The content of the file is:
n u v w r
4 0 3 2 0.5
2 3 1 4.2
-2 5 -3 7
1 4 0 9
where n is the dimension of the system and the u, v, w, r are the input vectors. How to read first the "n" variable then each vector one by one?
n u v w r
4 0 3 2 0.5
2 3 1 4.2
-2 5 -3 7
1 4 0 9
where n is the dimension of the system and the u, v, w, r are the input vectors. How to read first the "n" variable then each vector one by one?