From 3cf5bb31f6b6e3b6b8f229ed1658cb867fe6e8f5 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 3 Aug 2009 16:05:15 +0200 Subject: * Bye bye MultiplierBase, extend a bit AnyMatrixBase to allow =, +=, and -= * This probably makes ReturnByValue needless --- bench/btl/libs/C_BLAS/C_BLAS_interface.hh | 16 +++++++++------- bench/btl/libs/C_BLAS/main.cpp | 4 ++-- bench/btl/libs/eigen2/eigen2_interface.hh | 8 ++++---- bench/btl/libs/eigen2/main_adv.cpp | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) (limited to 'bench/btl/libs') diff --git a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh index e08c4aedc..c8b69883e 100644 --- a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh +++ b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh @@ -237,27 +237,29 @@ public : spotrf_(&uplo, &N, C, &N, &info); } - #ifdef HAS_LAPACK - - static inline void lu_decomp(const gene_matrix & X, gene_matrix & C, int N){ + static inline void partial_lu_decomp(const gene_matrix & X, gene_matrix & C, int N){ int N2 = N*N; scopy_(&N2, X, &intone, C, &intone); char uplo = 'L'; int info = 0; int * ipiv = (int*)alloca(sizeof(int)*N); - int * jpiv = (int*)alloca(sizeof(int)*N); - sgetc2_(&N, C, &N, ipiv, jpiv, &info); + sgetrf_(&N, &N, C, &N, ipiv, &info); } - static inline void partial_lu_decomp(const gene_matrix & X, gene_matrix & C, int N){ + #ifdef HAS_LAPACK + + static inline void lu_decomp(const gene_matrix & X, gene_matrix & C, int N){ int N2 = N*N; scopy_(&N2, X, &intone, C, &intone); char uplo = 'L'; int info = 0; int * ipiv = (int*)alloca(sizeof(int)*N); - sgetrf_(&N, &N, C, &N, ipiv, &info); + int * jpiv = (int*)alloca(sizeof(int)*N); + sgetc2_(&N, C, &N, ipiv, jpiv, &info); } + + static inline void hessenberg(const gene_matrix & X, gene_matrix & C, int N){ #ifdef PUREBLAS { diff --git a/bench/btl/libs/C_BLAS/main.cpp b/bench/btl/libs/C_BLAS/main.cpp index 5c2f8a377..bb3022d3f 100644 --- a/bench/btl/libs/C_BLAS/main.cpp +++ b/bench/btl/libs/C_BLAS/main.cpp @@ -24,7 +24,7 @@ #include "action_cholesky.hh" #include "action_lu_decomp.hh" -// #include "action_partial_lu_decomp.hh" +#include "action_partial_lu.hh" #include "action_trisolve_matrix.hh" #ifdef HAS_LAPACK @@ -52,10 +52,10 @@ int main() bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); + bench > >(MIN_MM,MAX_MM,NB_POINT); #ifdef HAS_LAPACK bench > >(MIN_MM,MAX_MM,NB_POINT); -// bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); #endif diff --git a/bench/btl/libs/eigen2/eigen2_interface.hh b/bench/btl/libs/eigen2/eigen2_interface.hh index ffc800a8d..7a014723f 100644 --- a/bench/btl/libs/eigen2/eigen2_interface.hh +++ b/bench/btl/libs/eigen2/eigen2_interface.hh @@ -190,10 +190,10 @@ public : } static inline void trisolve_lower_matrix(const gene_matrix & L, const gene_matrix& B, gene_matrix& X, int N){ -// X = L.template triangularView().solve(B); - X = B; - ei_triangular_solve_matrix - ::run(L.cols(), X.cols(), L.data(), L.stride(), X.data(), X.stride()); + X = L.template triangularView().solve(B); +// +// ei_triangular_solve_matrix +// ::run(L.cols(), X.cols(), L.data(), L.stride(), X.data(), X.stride()); } static inline void cholesky(const gene_matrix & X, gene_matrix & C, int N){ diff --git a/bench/btl/libs/eigen2/main_adv.cpp b/bench/btl/libs/eigen2/main_adv.cpp index c3e5fac30..d98c0cd39 100644 --- a/bench/btl/libs/eigen2/main_adv.cpp +++ b/bench/btl/libs/eigen2/main_adv.cpp @@ -23,7 +23,7 @@ #include "action_cholesky.hh" #include "action_hessenberg.hh" #include "action_lu_decomp.hh" -// #include "action_partial_lu_decomp.hh" +#include "action_partial_lu.hh" BTL_MAIN; @@ -33,7 +33,7 @@ int main() bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); -// bench > >(MIN_MM,MAX_MM,NB_POINT); + bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); -- cgit v1.2.3