Start modifying the tests structure.

Former-commit-id: 2e95b72fb3258fddd75a3b9c2ab23aa53b0a9d9a
This commit is contained in:
Marek Nečada 2019-08-17 13:57:24 +03:00
parent 5820de30ef
commit 0b0ebf2bce
60 changed files with 42 additions and 36 deletions

View File

@ -29,4 +29,7 @@ cmake_add_fortran_subdirectory (amos
LIBRARIES amos
NO_EXTERNAL_INSTALL)
add_subdirectory (qpms)
add_subdirectory (tests)
#add_subdirectory (apps/transop-ewald)

8
tests/CMakeLists.txt Normal file
View File

@ -0,0 +1,8 @@
add_executable( test_vswf_translations_array test_vswf_translations_array.c )
target_link_libraries( test_vswf_translations_array qpms gsl blas lapacke amos m )
target_include_directories ( test_vswf_translations_array PRIVATE .. )
add_executable( test_vswf_translations test_vswf_translations.c )
target_link_libraries( test_vswf_translations qpms gsl blas lapacke amos m )
target_include_directories ( test_vswf_translations PRIVATE .. )

View File

@ -1,14 +1,14 @@
//c99 -o test_vswf_translations -ggdb -I ../../amos -I .. test_vswf_translations.c ../translations.c ../gaunt.c -lgsl -lm -lblas ../vecprint.c ../vswf.c ../legendre.c ../error.c ../bessel.c ../../amos/libamos.a -lgfortran
#include "translations.h"
#include "vswf.h"
//c99 -o test_vswf_translations -ggdb -I .. test_vswf_translations.c -lqpms -lgsl -lm -lblas
#include <qpms/translations.h>
#include <qpms/vswf.h>
#include <stdio.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_randist.h>
#include <assert.h>
#include "vectors.h"
#include "string.h"
#include "indexing.h"
#include <qpms/vectors.h>
#include <string.h>
#include <qpms/indexing.h>
char *normstr(qpms_normalisation_t norm) {
//int csphase = qpms_normalisation_t_csphase(norm);

View File

@ -1,29 +1,25 @@
//c99 -o test_vswf_translations_array -ggdb -I .. test_vswf_translations_array.c ../translations.c ../gaunt.c -lgsl -lm -lblas ../vecprint.c ../vswf.c ../legendre.c
#include "translations.h"
#include "vswf.h"
//c99 -o test_vswf_translations_array -ggdb -I .. test_vswf_translations_array.c -lqpms -lgsl -lm -lblas
#include <qpms/translations.h>
#include <qpms/vswf.h>
#include <stdio.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_randist.h>
#include <assert.h>
#include "vectors.h"
#include "string.h"
#include "indexing.h"
#include <qpms/vectors.h>
#include <string.h>
#include <qpms/indexing.h>
char *normstr(qpms_normalisation_t norm) {
//int csphase = qpms_normalisation_t_csphase(norm);
norm = qpms_normalisation_t_normonly(norm);
norm = norm & QPMS_NORMALISATION_NORM_BITS;
switch (norm) {
case QPMS_NORMALISATION_NONE:
case QPMS_NORMALISATION_NORM_NONE:
return "none";
case QPMS_NORMALISATION_SPHARM:
case QPMS_NORMALISATION_NORM_SPHARM:
return "spharm";
case QPMS_NORMALISATION_POWER:
case QPMS_NORMALISATION_NORM_POWER:
return "power";
#ifdef USE_XU_ANTINORMALISATION
case QPMS_NORMALISATION_XU:
return "xu";
#endif
default:
return "!!!undef!!!";
}
@ -60,23 +56,22 @@ int main() {
w->y = gsl_ran_gaussian(rng, sigma);
w->z = gsl_ran_gaussian(rng, sigma);
}
for(int use_csbit = 0; use_csbit <= 1; ++use_csbit) {
for(int i = 1;
#ifdef USE_XU_ANTINORMALISATION
i <= 4;
#else
i <= 3;
#endif
++i){
qpms_normalisation_t norm = i | (use_csbit ? QPMS_NORMALISATION_T_CSBIT : 0);
qpms_trans_calculator *c = qpms_trans_calculator_init(lMax, norm);
for(int J = 1; J <= 4; ++J)
test_sphwave_translation(c, J, o2minuso1, npoints, points);
qpms_trans_calculator_free(c);
}
}
for(int use_csbit = 0; use_csbit <= 1; ++use_csbit) {
for(int i = 0; i < 3; ++i){
qpms_normalisation_t norm = ((qpms_normalisation_t[])
{ QPMS_NORMALISATION_NORM_SPHARM,
QPMS_NORMALISATION_NORM_POWER,
QPMS_NORMALISATION_NORM_NONE
})[i]
| (use_csbit ? QPMS_NORMALISATION_CSPHASE : 0);
qpms_trans_calculator *c = qpms_trans_calculator_init(lMax, norm);
for(int J = 1; J <= 4; ++J)
test_sphwave_translation(c, J, o2minuso1, npoints, points);
qpms_trans_calculator_free(c);
}
}
gsl_rng_free(rng);
}