diff options
author | Pjotr Prins | 2017-10-13 12:28:26 +0000 |
---|---|---|
committer | Pjotr Prins | 2017-10-13 15:27:24 +0000 |
commit | a610dd723a233aed1abe31aa32e3137b23b5f983 (patch) | |
tree | 66172cf10d0d85f5a61219c1b7b074cbadb45575 /src/eigenlib.cpp | |
parent | 25ad9756ebecfdb2f01b6f87c35bd731e3a3186d (diff) | |
download | pangemma-a610dd723a233aed1abe31aa32e3137b23b5f983.tar.gz |
OpenBlas: preparing for dgemm use
Diffstat (limited to 'src/eigenlib.cpp')
-rw-r--r-- | src/eigenlib.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/eigenlib.cpp b/src/eigenlib.cpp index a8c545c..4d6aacc 100644 --- a/src/eigenlib.cpp +++ b/src/eigenlib.cpp @@ -17,16 +17,18 @@ */ #include "Eigen/Dense" -#include "gsl/gsl_linalg.h" +// #include "gsl/gsl_linalg.h" #include "gsl/gsl_matrix.h" -#include "gsl/gsl_vector.h" +// #include "gsl/gsl_vector.h" #include <cmath> #include <iostream> #include <vector> +#include <cblas.h> using namespace std; using namespace Eigen; + // On two different clusters, compare eigen vs lapack/gsl: // // dgemm, 5x or 0.5x faster or slower than lapack, 5x or 4x faster than gsl @@ -57,8 +59,6 @@ void eigenlib_dgemm(const char *TransA, const char *TransB, const double alpha, C_mat = alpha * A_mat.transpose() * B_mat.transpose() + beta * C_mat; } } - - return; } void eigenlib_dgemv(const char *TransA, const double alpha, const gsl_matrix *A, @@ -75,15 +75,12 @@ void eigenlib_dgemv(const char *TransA, const double alpha, const gsl_matrix *A, } else { y_vec = alpha * A_mat.transpose() * x_vec + beta * y_vec; } - - return; } void eigenlib_invert(gsl_matrix *A) { Map<Matrix<double, Dynamic, Dynamic, RowMajor>> A_mat(A->data, A->size1, A->size2); A_mat = A_mat.inverse(); - return; } void eigenlib_dsyr(const double alpha, const gsl_vector *b, gsl_matrix *A) { @@ -92,7 +89,6 @@ void eigenlib_dsyr(const double alpha, const gsl_vector *b, gsl_matrix *A) { Map<Matrix<double, Dynamic, 1>, 0, OuterStride<Dynamic>> b_vec( b->data, b->size, OuterStride<Dynamic>(b->stride)); A_mat = alpha * b_vec * b_vec.transpose() + A_mat; - return; } void eigenlib_eigensymm(const gsl_matrix *G, gsl_matrix *U, gsl_vector *eval) { @@ -108,5 +104,4 @@ void eigenlib_eigensymm(const gsl_matrix *G, gsl_matrix *U, gsl_vector *eval) { abort(); eval_vec = es.eigenvalues(); U_mat = es.eigenvectors(); - return; } |