aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/btl/libs/STL
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-07-27 11:39:47 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-07-27 11:39:47 +0000
commit93115619c23bb41fd24b0090cb6adec501edaced (patch)
tree60ae0887b0705b8a994f8ef9baa5324c87883861 /bench/btl/libs/STL
parente9e5261664cc77049f8b77a2c36c535fbd44889c (diff)
* updated benchmark files according to recent renamings
* various improvements in BTL including trisolver and cholesky bench
Diffstat (limited to 'bench/btl/libs/STL')
-rw-r--r--bench/btl/libs/STL/STL_interface.hh16
-rw-r--r--bench/btl/libs/STL/main.cpp9
2 files changed, 18 insertions, 7 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();
diff --git a/bench/btl/libs/STL/main.cpp b/bench/btl/libs/STL/main.cpp
index 4cb846633..35f186402 100644
--- a/bench/btl/libs/STL/main.cpp
+++ b/bench/btl/libs/STL/main.cpp
@@ -20,19 +20,14 @@
#include "utilities.h"
#include "STL_interface.hh"
#include "bench.hh"
-#include "action_matrix_vector_product.hh"
-#include "action_matrix_matrix_product.hh"
-#include "action_axpy.hh"
-#include "action_lu_solve.hh"
-#include "action_ata_product.hh"
-#include "action_aat_product.hh"
-#include "action_atv_product.hh"
+#include "basic_actions.hh"
BTL_MAIN;
int main()
{
bench<Action_axpy<STL_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
+ bench<Action_axpby<STL_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
bench<Action_matrix_vector_product<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
bench<Action_atv_product<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
bench<Action_matrix_matrix_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);