Improvement in Jacobi
Matrix Transforms
Since the Jacobi matrix is mostly zero, we can save
some computer time by avoiding fetching the elements that are zero and
multiplying them. The following
documents how to do that. First we look
at multiplication from the left in a 3x3 matrix.
|
|
(1.1)
|
Note that only two rows are modified even for an nxn
matrix. So we just compute those two
rows and add them to A.
If c and s are in the 1st and 3rd rows, then, for
the 1st row, we multiply the
first row by (c-1) and multiply the third row by s and add these two
colums, For the third row we multiply
the third row by (c-1) and the first row by s and add
these two rows.
Translating this to a larger matrix when c,s are in the i,j
rows, for the ith row, we multiply the ith row by (c-1) and the jth row by s
and add. For the jth row, we multiply
the jth row by (c-1) and the ith row by s and then
add these two rows.
Then we add the resulting two rows to the ith and jth rows
of A and that becomes the result for this matrix multiplication.
Next consider the multiplication of matrix A times the right
side Jacobi matrix.
|
|
(1.2)
|
Note that only 2 columns are modified even for an nxn
matrix.
If c and s are in the 1st and 3rd rows, then, for
the 1st column, we multiply
the first column by (c-1) and multiply the third column by s and add these two
colums, For the third column we multiply
the third column by (c-1) and the first column by s and add
these two columns.
Translating this to a larger matrix when c,s are in the i,j
rows, for the ith column, we multiply the ith column by (c-1) and the jth
column by s and add. For the jth column,
we multiply the jth column by (c-1) and the ith column by s and then
add these two columns.
Then we add the resulting two columns to the ith and jth
columns of A and that becomes the result for this matrix multiplication.
Just to convince the reader we do the left multiplication
for rows 2 and 3 in a 4x4 matrix.
(1.3)
Note that only rows 2 and 3 are changed.