From 92151876263c1213f010c808057b7d1060afc75c Mon Sep 17 00:00:00 2001 From: Andrey Miroshnikov Date: Thu, 9 Nov 2023 17:41:55 +0000 Subject: [PATCH] reduce indent on for-loop code --- openpower/sv/cookbook/remap_matrix.mdwn | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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: -- 2.30.2