From 2be35213335824ff7eabcb94f28c9b00ef358ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Thu, 10 Jun 2021 22:25:56 +0300 Subject: [PATCH] beyn pure BLAS: fix indices and strides Also fix amos reference in CMakeLists --- qpms/beyn.c | 6 +++--- tests/CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qpms/beyn.c b/qpms/beyn.c index e69b96d..6d59d1c 100644 --- a/qpms/beyn.c +++ b/qpms/beyn.c @@ -412,8 +412,8 @@ static int beyn_process_matrices(BeynSolver *solver, beyn_function_M_t M_functio MAT(V0, m, K, i, k) = MAT(V0_full, m, l, i, k); //tmp = gsl_matrix_complex_row(W0T_full, k); //gsl_matrix_complex_set_row(W0T, k, &(tmp.vector)); - for(int j = 0; j < K; ++j) - MAT(W0T, K, l, k, j) = MAT(W0T_full, m, l, k, j); + for(int j = 0; j < l; ++j) + MAT(W0T, K, l, k, j) = MAT(W0T_full, l, l, k, j); } //gsl_matrix_complex_free(V0_full); free(V0_full); @@ -535,7 +535,7 @@ static int beyn_process_matrices(BeynSolver *solver, beyn_function_M_t M_functio //QPMS_ENSURE_SUCCESS(gsl_blas_zgemv(CblasNoTrans, one, Mmat, &(Vk.vector), zero, MVk)); // Vk[i] == V0S[i, k]; dims: Mmat[m,m], Vk[m] (V0S[m, K]), MVk[m] cblas_zgemv(CblasRowMajor, CblasNoTrans, m, m, - &one, Mmat, m, &MAT(V0S, m, K, 0, k), m /* stride of Vk in V0S */, + &one, Mmat, m, &MAT(V0S, m, K, 0, k), K /* stride of Vk in V0S */, &zero, MVk, 1); //residual = gsl_blas_dznrm2(MVk); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1aacccd..ccd5fea 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -73,11 +73,11 @@ target_include_directories( tbeyn3f PRIVATE .. ) target_compile_definitions( tbeyn3f PRIVATE VARIANTF ) #add_executable( tbeyn_gsl tbeyn_gsl.c ) -#target_link_libraries( tbeyn_gsl qpms gsl lapacke amos m ) +#target_link_libraries( tbeyn_gsl qpms gsl lapacke ${QPMS_AMOSLIB} m ) #target_include_directories( tbeyn_gsl PRIVATE .. ) #add_executable( tbeyn_gsl2 tbeyn_gsl2.c ) -#target_link_libraries( tbeyn_gsl2 qpms gsl lapacke amos m ) +#target_link_libraries( tbeyn_gsl2 qpms gsl lapacke ${QPMS_AMOSLIB} m ) #target_include_directories( tbeyn_gsl2 PRIVATE .. ) add_custom_target( mytests DEPENDS test_single_translations_vs_calc test_vswf_translations test_vswf_translations_array tbeyn )