- tmp = gsl_matrix_get (A, i, j) -
- gsl_matrix_get (A, k, i)
- * gsl_matrix_get (A, k, j) / sweep_element;
- gsl_matrix_set (B, i, j, tmp);
+ row_j = ordered_cols[j];
+ tmp = gsl_matrix_get (A, row_i, row_j) -
+ gsl_matrix_get (A, row_k, row_i)
+ * gsl_matrix_get (A, row_k, row_j) / sweep_element;
+ gsl_matrix_set (B, row_i, row_j, tmp);