diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-05-17 23:01:47 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-05-17 23:01:47 +0200 |
| commit | 72ec1bace3354aa2a47054aef613baf5f7069d75 (patch) | |
| tree | 79083e891ad5555e641be948b5b32b4e7609df58 /src | |
| parent | free kernelparam if necessary (diff) | |
| download | gensvm-72ec1bace3354aa2a47054aef613baf5f7069d75.tar.gz gensvm-72ec1bace3354aa2a47054aef613baf5f7069d75.zip | |
make blas and lapack calls more compact
Diffstat (limited to 'src')
| -rw-r--r-- | src/gensvm_kernel.c | 61 |
1 files changed, 6 insertions, 55 deletions
diff --git a/src/gensvm_kernel.c b/src/gensvm_kernel.c index a4f2277..9dc5e29 100644 --- a/src/gensvm_kernel.c +++ b/src/gensvm_kernel.c @@ -149,50 +149,14 @@ long gensvm_make_eigen(double *K, long n, double **P, double **Sigma) // first perform a workspace query to determine optimal size of the // WORK array. WORK = Malloc(double, 1); - status = dsyevx( - 'V', - 'A', - 'U', - n, - K, - n, - 0, - 0, - 0, - 0, - abstol, - &M, - tempSigma, - tempP, - n, - WORK, - -1, - IWORK, - IFAIL); + status = dsyevx('V', 'A', 'U', n, K, n, 0, 0, 0, 0, abstol, &M, + tempSigma, tempP, n, WORK, -1, IWORK, IFAIL); LWORK = WORK[0]; // allocate the requested memory for the eigendecomposition WORK = (double *)realloc(WORK, LWORK*sizeof(double)); - status = dsyevx( - 'V', - 'A', - 'U', - n, - K, - n, - 0, - 0, - 0, - 0, - abstol, - &M, - tempSigma, - tempP, - n, - WORK, - LWORK, - IWORK, - IFAIL); + status = dsyevx('V', 'A', 'U', n, K, n, 0, 0, 0, 0, abstol, &M, + tempSigma, tempP, n, WORK, LWORK, IWORK, IFAIL); if (status != 0) { fprintf(stderr, "Nonzero exit status from dsyevx. Exiting..."); @@ -321,21 +285,8 @@ void gensvm_make_testfactor(struct GenData *testdata, matrix_get(traindata->Z, r+1, i, j+1)); // Multiply K2 with M and store in N - cblas_dgemm( - CblasRowMajor, - CblasNoTrans, - CblasNoTrans, - n2, - r, - n1, - 1.0, - K2, - n1, - M, - r, - 0.0, - N, - r); + cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, n2, r, n1, 1.0, + K2, n1, M, r, 0.0, N, r); // Multiply N with Sigma^{-2} for (j=0; j<r; j++) { |
