From: Andrey Miroshnikov Date: Thu, 9 Nov 2023 17:41:55 +0000 (+0000) Subject: reduce indent on for-loop code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=92151876263c1213f010c808057b7d1060afc75c;p=libreriscv.git reduce indent on for-loop code --- diff --git a/openpower/sv/cookbook/remap_matrix.mdwn b/openpower/sv/cookbook/remap_matrix.mdwn index 5feb65860..06cb85926 100644 --- a/openpower/sv/cookbook/remap_matrix.mdwn +++ b/openpower/sv/cookbook/remap_matrix.mdwn @@ -68,10 +68,10 @@ If there are no more rows left, result matrix has been fully computed. This for-loop uses the indices as shown above ``` - for i in range(0, mat_X_num_rows): - for k in range(0, mat_Y_num_cols): - for j in range(0, mat_X_num_cols): # or mat_Y_num_rows - mat_Z[i][k] += mat_X[i][j] * mat_Y[j][k] +for i in range(0, mat_X_num_rows): + for k in range(0, mat_Y_num_cols): + for j in range(0, mat_X_num_cols): # or mat_Y_num_rows + mat_Z[i][k] += mat_X[i][j] * mat_Y[j][k] ``` Calculations: @@ -141,10 +141,10 @@ element (and thus register) changes with every multiply-add operation. The code: ``` - for i in range(mat_X_num_rows): - for j in range(0, mat_X_num_cols): # or mat_Y_num_rows - for k in range(0, mat_Y_num_cols): - mat_Z[i][k] += mat_X[i][j] * mat_Y[j][k] +for i in range(mat_X_num_rows): + for j in range(0, mat_X_num_cols): # or mat_Y_num_rows + for k in range(0, mat_Y_num_cols): + mat_Z[i][k] += mat_X[i][j] * mat_Y[j][k] ``` Index list: