Advanced Course in Computational Algorithms: Report Assignment 2
29 October 2021
Deadline: 12:00, 12 November 2021
Language: English or Japanese
Please submit your report in PDF format through manaba.
Answer the following problems. Source codes and their execution results should be included
in your report.
1. Write Scilab programs of the Conjugate Gradient (CG) method and the preconditioned
CG method with IC(0) preconditioner for solving a linear system Ax = b with a
symmetric matrix A. The diagonal part AD and the lower triangular part AL of A must
be stored in a one-dimensional array and CRS format, respectively.
2. Download the linear system generator and generate linear systems (see below). The
input parameter N of the generator is N = 11, 21, . . . , 101, and !TOL = 10!12. Solve
linear systems by the CG method and the preconditioned CG method with IC(0). Then,
compare the number of iterations of two methods by drawing a graph.
[Usage of linear system generator]
1) Download the linear system generator (GenLS.zip) from
https://manaba.tsukuba.ac.jp/ct/course_1910607_report_2249213
and unzip the file.
2) By executing the following commands, you can generate a symmetric coe!cient ma-
trix A in CRS format and a right-hand side vector b. In the following example, you
can generate the 100 ” 100 symmetrix matrix A and the 100-dimensional vector b.
Example! ”
exec(’GenLS.sci’);
N = 11;
[AD, AL, col_ind, row_ptr, b] = GenLS(N);# $
– AD : The elements of the diagonal matrix AD.
– AL : The values of the nonzero elements of the lower triangular matrix AL.
– col_ind : The column indices of the nonzero elements of AL.
– row_ptr : The pointer array of AL.
– b : The right-hand side vector.
N is a parameter related to the size of the matrix. For input parameter N +1, the matrix
of order N2 is outputted.