diff options
author | 2008-07-27 11:39:47 +0000 | |
---|---|---|
committer | 2008-07-27 11:39:47 +0000 | |
commit | 93115619c23bb41fd24b0090cb6adec501edaced (patch) | |
tree | 60ae0887b0705b8a994f8ef9baa5324c87883861 /bench/btl/libs/STL/STL_interface.hh | |
parent | e9e5261664cc77049f8b77a2c36c535fbd44889c (diff) |
* updated benchmark files according to recent renamings
* various improvements in BTL including trisolver and cholesky bench
Diffstat (limited to 'bench/btl/libs/STL/STL_interface.hh')
-rw-r--r-- | bench/btl/libs/STL/STL_interface.hh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bench/btl/libs/STL/STL_interface.hh b/bench/btl/libs/STL/STL_interface.hh index 5b1a384af..d7ef9a215 100644 --- a/bench/btl/libs/STL/STL_interface.hh +++ b/bench/btl/libs/STL/STL_interface.hh @@ -146,6 +146,22 @@ public : Y[i]+=coef*X[i]; } + static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){ + for (int i=0;i<N;i++) + Y[i] = a*X[i] + b*Y[i]; + } + + static inline void trisolve_lower(const gene_matrix & L, const gene_vector & B, gene_vector & X, int N){ + copy_vector(B,X,N); + for(int i=0; i<N; ++i) + { + X[i] /= L[i][i]; + real tmp = X[i]; + for (int j=i+1; j<N; ++j) + X[j] -= tmp * L[i][j]; + } + } + static inline real norm_diff(const stl_vector & A, const stl_vector & B) { int N=A.size(); |