add symv bench

This commit is contained in:
Gael Guennebaud
2009-02-20 21:05:19 +00:00
parent 22b9de1849
commit 7485aa6d57
11 changed files with 914 additions and 37 deletions

View File

@@ -130,6 +130,23 @@ public :
}
}
static inline void symv(gene_matrix & A, gene_vector & B, gene_vector & X, int N)
{
for (int j=0; j<N; ++j)
X[j] = 0;
for (int j=0; j<N; ++j)
{
real t1 = B[j];
real t2 = 0;
X[j] += t1 * A[j][j];
for (int i=j+1; i<N; ++i) {
X[i] += t1 * A[j][i];
t2 += A[j][i] * B[i];
}
X[j] += t2;
}
}
static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N)
{
real somme;

View File

@@ -30,6 +30,7 @@ int main()
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_symv<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);
bench<Action_ata_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_aat_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);