diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-08-04 11:30:33 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-08-04 11:30:33 +0200 |
commit | c2a92e92a6e5aa0bcbb465220a8beb0687c1449a (patch) | |
tree | b3d615aa6875c0d2bdc3778babd42f9e9b1456aa /bench/btl/generic_bench/init/init_matrix.hh | |
parent | 4bec101470091aae27e7469025c80e31b889f566 (diff) |
add ger and lu with partial pivoting in BTL
Diffstat (limited to 'bench/btl/generic_bench/init/init_matrix.hh')
-rw-r--r-- | bench/btl/generic_bench/init/init_matrix.hh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/bench/btl/generic_bench/init/init_matrix.hh b/bench/btl/generic_bench/init/init_matrix.hh index 6b57504c0..67cbd2073 100644 --- a/bench/btl/generic_bench/init/init_matrix.hh +++ b/bench/btl/generic_bench/init/init_matrix.hh @@ -41,13 +41,24 @@ BTL_DONT_INLINE void init_row(Vector & X, int size, int row){ // [] operator for setting rows template<double init_function(int,int),class Vector> BTL_DONT_INLINE void init_matrix(Vector & A, int size){ - A.resize(size); for (int row=0; row<A.size() ; row++){ init_row<init_function>(A[row],size,row); } +} - +template<double init_function(int,int),class Matrix> +BTL_DONT_INLINE void init_matrix_symm(Matrix& A, int size){ + A.resize(size); + for (int row=0; row<A.size() ; row++) + A[row].resize(size); + for (int row=0; row<A.size() ; row++){ + A[row][row] = init_function(row,row); + for (int col=0; col<row ; col++){ + double x = init_function(row,col); + A[row][col] = A[col][row] = x; + } + } } #endif |