diff options
Diffstat (limited to 'bench/btl/libs/C_BLAS/C_BLAS_interface.hh')
-rw-r--r-- | bench/btl/libs/C_BLAS/C_BLAS_interface.hh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh index a3ea73740..21d9bde1a 100644 --- a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh +++ b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh @@ -50,6 +50,11 @@ void scopy_(const int *n, const float *x, const int *incx, float *y, const int * void dpotrf_(const char* uplo, const int* n, double *a, const int* ld, int* info); void ssytrd_(char *uplo, const int *n, float *a, const int *lda, float *d, float *e, float *tau, float *work, int *lwork, int *info ); void sgehrd_( const int *n, int *ilo, int *ihi, float *a, const int *lda, float *tau, float *work, int *lwork, int *info ); + + // LU row pivoting + void sgetrf_(const int* m, const int* n, float *a, const int* ld, int* ipivot, int* info); + // LU full pivoting + void sgetc2_(const int* n, float *a, const int *lda, int *ipiv, int *jpiv, int*info ); #ifdef HAS_LAPACK #endif } @@ -193,7 +198,8 @@ public : } static inline void cholesky(const gene_vector & X, gene_vector & C, int N){ - cblas_scopy(N*N, X, 1, C, 1); + int N2 = N*N; + scopy_(&N2, X, &intone, C, &intone); char uplo = 'L'; int info = 0; spotrf_(&uplo, &N, C, &N, &info); @@ -201,6 +207,16 @@ public : #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); + 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){ cblas_scopy(N*N, X, 1, C, 1); int info = 0; |