To implement a Successive Over Relaxation scheme to iteratively solve Ax = b,
I want to statically store the sparse square matrix A which has dimensions
1000 X 1000.
The diagonal element of A is 2, and the next higher and lower off-diagonals
are both -1. All other elements are zero. Of course, in the first row, there
is no next lower off-diagonal, and no next higher off-diagonal in the last
row.
Obviously, there is no point storing all those zeros. I know that one can
use three arrays to start the elements. ARRAY_1 will store the non-zeros,
ARRAY_2 will store the columns to which the values in ARRAY_1 correspond,
and ARRAY_3 stores where each row begins in ARRAY_1.
I have no idea how I go about implementing these three arrays. How can I
create them? I know Octave has some nice functions for dealing with sparse
matrices - are there functions that I can use for this purpose?
As always, thanks for all the help, you geniuses!! :