projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
90afc1f
)
sweep.c: Use gsl_matrix_memcpy instead of element by element copying.
author
John Darrington
<john@darrington.wattle.id.au>
Tue, 15 Nov 2011 14:47:10 +0000
(15:47 +0100)
committer
John Darrington
<john@darrington.wattle.id.au>
Tue, 15 Nov 2011 14:47:10 +0000
(15:47 +0100)
Although only the upper triangle needs to be copied, there is no
disadvantage copying the entire matrix (the lower triangle is never read)
and the expense of using two loops is likely to outweigh the saving achieved
by avoiding the other triangle.
lib/linreg/sweep.c
patch
|
blob
|
history
diff --git
a/lib/linreg/sweep.c
b/lib/linreg/sweep.c
index 7667e3a555db063502eae81dcdd8188921630872..1eb466e92105d80c323c18ca9263f54a568746fb 100644
(file)
--- a/
lib/linreg/sweep.c
+++ b/
lib/linreg/sweep.c
@@
-142,11
+142,7
@@
reg_sweep (gsl_matrix * A, int last_col)
}
}
}
}
}
}
- for (i = 0; i < A->size1; i++)
- for (j = i; j < A->size2; j++)
- {
- gsl_matrix_set (A, i, j, gsl_matrix_get (B, i, j));
- }
+ gsl_matrix_memcpy (A, B);
}
gsl_matrix_free (B);
}
gsl_matrix_free (B);