sweep.c: Move repeated call out of if ... else
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 15 Nov 2011 14:20:59 +0000 (15:20 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 15 Nov 2011 14:20:59 +0000 (15:20 +0100)
This line is identical for all cases, so it only needs to appear once.

lib/linreg/sweep.c

index c218456418c75ccc450d452eeba21f1fcbbf5cda..7667e3a555db063502eae81dcdd8188921630872 100644 (file)
@@ -106,20 +106,18 @@ reg_sweep (gsl_matrix * A, int last_col)
                      tmp = gsl_matrix_get (A, i, j) -
                        gsl_matrix_get (A, i, k)
                        * gsl_matrix_get (A, j, k) / sweep_element;
-                     gsl_matrix_set (B, i, j, tmp);
                    }
                  else if (j > k)
                    {
                      tmp = gsl_matrix_get (A, i, j) -
                        gsl_matrix_get (A, i, k)
                        * gsl_matrix_get (A, k, j) / sweep_element;
-                     gsl_matrix_set (B, i, j, tmp);
                    }
                  else
                    {
                      tmp = gsl_matrix_get (A, i, k) / sweep_element;
-                     gsl_matrix_set (B, i, j, tmp);
                    }
+                 gsl_matrix_set (B, i, j, tmp);
                }
            }
          /*