├── .gitattributes
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CMakeLists.txt
├── Doxyfile
├── Getting-Started.md
├── INSTALL.md
├── LICENSE.txt
├── README.md
├── examples
├── fnft_kdvv_example.c
├── fnft_manakovv_example.c
├── fnft_nsep_example.c
├── fnft_nsev_example.c
├── fnft_nsev_example_2.c
├── fnft_nsev_inverse_example.c
├── mex_fnft_kdvv_example.m
├── mex_fnft_kdvv_example_2.m
├── mex_fnft_kdvv_example_3.m
├── mex_fnft_kdvv_example_4.m
├── mex_fnft_manakovv_example.m
├── mex_fnft_nsep_example.m
├── mex_fnft_nsev_example.m
├── mex_fnft_nsev_example_2.m
├── mex_fnft_nsev_example_3.m
├── mex_fnft_nsev_example_4.m
├── mex_fnft_nsev_inverse_example_1.m
├── mex_fnft_nsev_inverse_example_2.m
├── mex_fnft_nsev_inverse_example_2_exact_solution.m
└── mex_fnft_nsev_inverse_example_3.m
├── include
├── 3rd_party
│ ├── eiscor
│ │ └── eiscor.h
│ └── kiss_fft
│ │ ├── _kiss_fft_guts.h
│ │ └── kiss_fft.h
├── fnft.h
├── fnft_config.h.in
├── fnft_errwarn.h
├── fnft_kdv_discretization_t.h
├── fnft_kdvv.h
├── fnft_manakov_discretization_t.h
├── fnft_manakovv.h
├── fnft_nse_discretization_t.h
├── fnft_nsep.h
├── fnft_nsev.h
├── fnft_nsev_inverse.h
├── fnft_numtypes.h
├── fnft_version.h
└── private
│ ├── fnft__akns_discretization.h
│ ├── fnft__akns_discretization_t.h
│ ├── fnft__akns_fscatter.h
│ ├── fnft__akns_scatter.h
│ ├── fnft__errwarn.h
│ ├── fnft__fft_wrapper.h
│ ├── fnft__fft_wrapper_plan_t.h
│ ├── fnft__kdv_discretization.h
│ ├── fnft__kdv_finvscatter.h
│ ├── fnft__kdv_fscatter.h
│ ├── fnft__kdv_scatter.h
│ ├── fnft__kdvv_testcases.h
│ ├── fnft__manakov_discretization.h
│ ├── fnft__manakov_fscatter.h
│ ├── fnft__manakov_scatter.h
│ ├── fnft__manakovv_testcases.h
│ ├── fnft__misc.h
│ ├── fnft__nse_discretization.h
│ ├── fnft__nse_finvscatter.h
│ ├── fnft__nse_fscatter.h
│ ├── fnft__nse_scatter.h
│ ├── fnft__nsep_testcases.h
│ ├── fnft__nsev_testcases.h
│ ├── fnft__poly_chirpz.h
│ ├── fnft__poly_eval.h
│ ├── fnft__poly_fmult.h
│ ├── fnft__poly_roots_fasteigen.h
│ ├── fnft__poly_roots_fftgridsearch.h
│ └── fnft__poly_specfact.h
├── joss-paper
├── paper.bib
└── paper.md
├── matlab
├── mex_fnft_kdvv.c
├── mex_fnft_kdvv.m
├── mex_fnft_manakovv.c
├── mex_fnft_manakovv.m
├── mex_fnft_nsep.c
├── mex_fnft_nsep.m
├── mex_fnft_nsev.c
├── mex_fnft_nsev.m
├── mex_fnft_nsev_inverse.c
├── mex_fnft_nsev_inverse.m
├── mex_fnft_nsev_inverse_XI.c
├── mex_fnft_nsev_inverse_XI.m
├── mex_fnft_version.c
└── mex_fnft_version.m
├── src
├── 3rd_party
│ ├── eiscor
│ │ ├── LICENSE.md
│ │ ├── d_1Darray_check.f90
│ │ ├── d_1Darray_random_normal.f90
│ │ ├── d_2Darray_check.f90
│ │ ├── d_2Darray_random_normal.f90
│ │ ├── d_2x2array_eig.f90
│ │ ├── d_orthfact_2x2deflation.f90
│ │ ├── d_orthfact_2x2diagblock.f90
│ │ ├── d_orthfact_buildbulge.f90
│ │ ├── d_orthfact_deflationcheck.f90
│ │ ├── d_orthfact_doublestep.f90
│ │ ├── d_orthfact_factorcheck.f90
│ │ ├── d_orthfact_mergebulge.f90
│ │ ├── d_orthfact_qr.f90
│ │ ├── d_orthfact_real2complex.f90
│ │ ├── d_orthhess_factor.f90
│ │ ├── d_orthhess_qr.f90
│ │ ├── d_orthhess_real2complex.f90
│ │ ├── d_rot2_check.f90
│ │ ├── d_rot2_fuse.f90
│ │ ├── d_rot2_swapdiag.f90
│ │ ├── d_rot2_turnover.f90
│ │ ├── d_rot2_unitvec2gen.f90
│ │ ├── d_rot2_vec2gen.f90
│ │ ├── d_rot2array_check.f90
│ │ ├── d_scalar_check.f90
│ │ ├── d_scalar_random_normal.f90
│ │ ├── d_symtrid_factor.f90
│ │ ├── d_symtrid_qr.f90
│ │ ├── d_symtrid_specint.f90
│ │ ├── l_upr1fact_cmv.f90
│ │ ├── l_upr1fact_hess.f90
│ │ ├── l_upr1fact_inversehess.f90
│ │ ├── l_upr1fact_random.f90
│ │ ├── u_benchmark_print.f90
│ │ ├── u_fixedseed_initialize.f90
│ │ ├── u_infocode_check.f90
│ │ ├── u_randomseed_initialize.f90
│ │ ├── u_test_banner.f90
│ │ ├── u_test_failed.f90
│ │ ├── u_test_passed.f90
│ │ ├── z_1Darray_check.f90
│ │ ├── z_1Darray_random_normal.f90
│ │ ├── z_2Darray_check.f90
│ │ ├── z_2Darray_random_normal.f90
│ │ ├── z_2x2array_eig.f90
│ │ ├── z_compmat_compress.f90
│ │ ├── z_comppen_compress.f90
│ │ ├── z_poly_residuals.f90
│ │ ├── z_poly_roots.f90
│ │ ├── z_poly_roots_modified.f90
│ │ ├── z_rfr3_turnover.f90
│ │ ├── z_rot3_check.f90
│ │ ├── z_rot3_fusion.f90
│ │ ├── z_rot3_swapdiag.f90
│ │ ├── z_rot3_turnover.f90
│ │ ├── z_rot3_unitvec3gen.f90
│ │ ├── z_rot3_vec3gen.f90
│ │ ├── z_rot3_vec4gen.f90
│ │ ├── z_rot3array_check.f90
│ │ ├── z_scalar_argument.f90
│ │ ├── z_scalar_check.f90
│ │ ├── z_scalar_random_normal.f90
│ │ ├── z_unifact_2x2deflation.f90
│ │ ├── z_unifact_2x2diagblock.f90
│ │ ├── z_unifact_buildbulge.f90
│ │ ├── z_unifact_deflationcheck.f90
│ │ ├── z_unifact_factorcheck.f90
│ │ ├── z_unifact_mergebulge.f90
│ │ ├── z_unifact_qr.f90
│ │ ├── z_unifact_singlestep.f90
│ │ ├── z_unihess_factor.f90
│ │ ├── z_unihess_qr.f90
│ │ ├── z_upr1fact_2x2diagblocks.f90
│ │ ├── z_upr1fact_buildbulge.f90
│ │ ├── z_upr1fact_chasedown.f90
│ │ ├── z_upr1fact_decompress.f90
│ │ ├── z_upr1fact_deflationcheck.f90
│ │ ├── z_upr1fact_endchase.f90
│ │ ├── z_upr1fact_factorcheck.f90
│ │ ├── z_upr1fact_qr.f90
│ │ ├── z_upr1fact_singleshift.f90
│ │ ├── z_upr1fact_singlestep.f90
│ │ ├── z_upr1fact_startchase.f90
│ │ ├── z_upr1fpen_buildbulge.f90
│ │ ├── z_upr1fpen_chasedown.f90
│ │ ├── z_upr1fpen_decompress.f90
│ │ ├── z_upr1fpen_deflationcheck.f90
│ │ ├── z_upr1fpen_endchase.f90
│ │ ├── z_upr1fpen_qz.f90
│ │ ├── z_upr1fpen_singleshift.f90
│ │ ├── z_upr1fpen_singlestep.f90
│ │ ├── z_upr1fpen_startchase.f90
│ │ ├── z_upr1utri_decompress.f90
│ │ ├── z_upr1utri_rot3swap.f90
│ │ ├── z_upr1utri_unimodscale.f90
│ │ ├── z_urffact_deflationcheck.f90
│ │ ├── z_urffact_qr.f90
│ │ └── z_urffact_singlestep.f90
│ └── kiss_fft
│ │ └── kiss_fft.c
├── fnft_errwarn.c
├── fnft_kdvv.c
├── fnft_manakovv.c
├── fnft_nsep.c
├── fnft_nsev.c
├── fnft_nsev_inverse.c
├── fnft_version.c
└── private
│ ├── fnft__akns_discretization.c
│ ├── fnft__akns_finvscatter_q_from_r.inc
│ ├── fnft__akns_fscatter.c
│ ├── fnft__akns_scatter.c
│ ├── fnft__errwarn.c
│ ├── fnft__kdv_discretization.c
│ ├── fnft__kdv_finvscatter.c
│ ├── fnft__kdv_fscatter.c
│ ├── fnft__kdv_scatter.c
│ ├── fnft__kdvv_testcases.c
│ ├── fnft__manakov_discretization.c
│ ├── fnft__manakov_fscatter.c
│ ├── fnft__manakov_scatter.c
│ ├── fnft__manakovv_testcases.c
│ ├── fnft__misc.c
│ ├── fnft__nse_discretization.c
│ ├── fnft__nse_finvscatter.c
│ ├── fnft__nse_fscatter.c
│ ├── fnft__nse_scatter.c
│ ├── fnft__nsep_testcases.c
│ ├── fnft__nsev_testcases.c
│ ├── fnft__poly_chirpz.c
│ ├── fnft__poly_eval.c
│ ├── fnft__poly_fmult.c
│ ├── fnft__poly_roots_fasteigen.c
│ ├── fnft__poly_roots_fftgridsearch.c
│ └── fnft__poly_specfact.c
└── test
├── fnft__akns_fscatter
├── fnft__akns_fscatter_test_2split1A.c
├── fnft__akns_fscatter_test_2split1B.c
├── fnft__akns_fscatter_test_2split2A.c
├── fnft__akns_fscatter_test_2split2B.c
├── fnft__akns_fscatter_test_2split2S.c
├── fnft__akns_fscatter_test_2split2_modal.c
├── fnft__akns_fscatter_test_2split3A.c
├── fnft__akns_fscatter_test_2split3B.c
├── fnft__akns_fscatter_test_2split3S.c
├── fnft__akns_fscatter_test_2split4A.c
├── fnft__akns_fscatter_test_2split4B.c
├── fnft__akns_fscatter_test_2split5A.c
├── fnft__akns_fscatter_test_2split5B.c
├── fnft__akns_fscatter_test_2split6A.c
├── fnft__akns_fscatter_test_2split6B.c
├── fnft__akns_fscatter_test_2split7A.c
├── fnft__akns_fscatter_test_2split7B.c
├── fnft__akns_fscatter_test_2split8A.c
└── fnft__akns_fscatter_test_2split8B.c
├── fnft__fft_wrapper
└── fnft__fft_wrapper_test.c
├── fnft__kdv_finvscatter
├── fnft__kdv_finvscatter_test.inc
├── fnft__kdv_finvscatter_test_2split2_modal.c
└── fnft__kdv_finvscatter_test_2split2a.c
├── fnft__kdv_scatter
├── fnft__kdv_scatter_bound_states_test_bo.c
└── fnft__kdv_scatter_matrix_test_bo.c
├── fnft__manakov_fscatter
├── fnft__manakov_fscatter_test_2split3A.c
├── fnft__manakov_fscatter_test_2split3A_defocusing.c
├── fnft__manakov_fscatter_test_2split3B.c
├── fnft__manakov_fscatter_test_2split4A.c
├── fnft__manakov_fscatter_test_2split4B.c
├── fnft__manakov_fscatter_test_2split6B.c
├── fnft__manakov_fscatter_test_FTES4_4A.c
└── fnft__manakov_fscatter_test_FTES4_suzuki.c
├── fnft__manakov_scatter
├── fnft__manakov_scatter_matrix_test_defocusing_CF4_2.c
├── fnft__manakov_scatter_matrix_test_defocusing_bo.c
├── fnft__manakov_scatter_matrix_test_focusing_CF4_2.c
└── fnft__manakov_scatter_matrix_test_focusing_bo.c
├── fnft__misc
└── fnft__misc_resample_test.c
├── fnft__nse_finvscatter
├── fnft__nse_finvscatter_test.inc
├── fnft__nse_finvscatter_test_defocusing_2split2A.c
├── fnft__nse_finvscatter_test_defocusing_2split2_modal.c
├── fnft__nse_finvscatter_test_focusing_2split2A.c
└── fnft__nse_finvscatter_test_focusing_2split2_modal.c
├── fnft__nse_scatter
├── fnft__nse_scatter_bound_states_test_bo.c
├── fnft__nse_scatter_matrix_test_defocusing_bo.c
└── fnft__nse_scatter_matrix_test_focusing_bo.c
├── fnft__poly
├── fnft__poly_chirpz_test.c
├── fnft__poly_eval_test.c
├── fnft__poly_fmult2x2_test_n_is_no_power_of_2.c
├── fnft__poly_fmult2x2_test_n_is_power_of_2.c
├── fnft__poly_fmult3x3_test_n_is_no_power_of_2.c
├── fnft__poly_fmult3x3_test_n_is_power_of_2.c
├── fnft__poly_fmult_test_n_is_no_power_of_2.c
├── fnft__poly_fmult_test_n_is_power_of_2.c
├── fnft__poly_roots_fasteigen_test.c
├── fnft__poly_roots_fftgridsearch_test_deg_even.c
├── fnft__poly_roots_fftgridsearch_test_deg_odd.c
├── fnft__poly_roots_fftgridsearch_test_paraherm.c
└── fnft__poly_specfact_test.c
├── fnft_kdvv
├── fnft_kdvv_test_2split1A.c
├── fnft_kdvv_test_2split1A_vanilla.c
├── fnft_kdvv_test_2split1B.c
├── fnft_kdvv_test_2split1B_vanilla.c
├── fnft_kdvv_test_2split2A.c
├── fnft_kdvv_test_2split2A_no_power_of_two.c
├── fnft_kdvv_test_2split2A_vanilla.c
├── fnft_kdvv_test_2split2B.c
├── fnft_kdvv_test_2split2B_vanilla.c
├── fnft_kdvv_test_2split2S.c
├── fnft_kdvv_test_2split2S_vanilla.c
├── fnft_kdvv_test_2split2_modal.c
├── fnft_kdvv_test_2split2_modal_vanilla.c
├── fnft_kdvv_test_2split3A.c
├── fnft_kdvv_test_2split3A_vanilla.c
├── fnft_kdvv_test_2split3B.c
├── fnft_kdvv_test_2split3B_vanilla.c
├── fnft_kdvv_test_2split3S.c
├── fnft_kdvv_test_2split3S_vanilla.c
├── fnft_kdvv_test_2split4A.c
├── fnft_kdvv_test_2split4A_vanilla.c
├── fnft_kdvv_test_2split4B.c
├── fnft_kdvv_test_2split4B_vanilla.c
├── fnft_kdvv_test_2split5A.c
├── fnft_kdvv_test_2split5A_vanilla.c
├── fnft_kdvv_test_2split5B.c
├── fnft_kdvv_test_2split5B_vanilla.c
├── fnft_kdvv_test_2split6A.c
├── fnft_kdvv_test_2split6A_vanilla.c
├── fnft_kdvv_test_2split6B.c
├── fnft_kdvv_test_2split6B_vanilla.c
├── fnft_kdvv_test_2split7A.c
├── fnft_kdvv_test_2split7A_vanilla.c
├── fnft_kdvv_test_2split7B.c
├── fnft_kdvv_test_2split7B_vanilla.c
├── fnft_kdvv_test_2split8A.c
├── fnft_kdvv_test_2split8A_vanilla.c
├── fnft_kdvv_test_2split8B.c
├── fnft_kdvv_test_2split8B_vanilla.c
├── fnft_kdvv_test_4split4A.c
├── fnft_kdvv_test_4split4A_vanilla.c
├── fnft_kdvv_test_4split4B.c
├── fnft_kdvv_test_4split4B_vanilla.c
├── fnft_kdvv_test_BO.c
├── fnft_kdvv_test_BO_vanilla.c
├── fnft_kdvv_test_CF4_2.c
├── fnft_kdvv_test_CF4_2_vanilla.c
├── fnft_kdvv_test_CF4_3.c
├── fnft_kdvv_test_CF4_3_vanilla.c
├── fnft_kdvv_test_CF5_3.c
├── fnft_kdvv_test_CF5_3_vanilla.c
├── fnft_kdvv_test_CF6_4.c
├── fnft_kdvv_test_CF6_4_vanilla.c
├── fnft_kdvv_test_ES4.c
├── fnft_kdvv_test_ES4_vanilla.c
├── fnft_kdvv_test_TES4.c
├── fnft_kdvv_test_TES4_vanilla.c
└── fnft_kdvv_test_grid_search_wo_refinement.c
├── fnft_manakovv
├── fnft_manakovv_test_manakov_testcases_test_fnft.c
├── fnft_manakovv_test_rectangle_focusing_2split4A.c
├── fnft_manakovv_test_sech_defocusing_2split3A.c
├── fnft_manakovv_test_sech_defocusing_2split3A_no_power_of_two.c
├── fnft_manakovv_test_sech_defocusing_2split3B.c
├── fnft_manakovv_test_sech_defocusing_2split4A.c
├── fnft_manakovv_test_sech_defocusing_2split4B.c
├── fnft_manakovv_test_sech_defocusing_2split6B.c
├── fnft_manakovv_test_sech_defocusing_4split4A.c
├── fnft_manakovv_test_sech_defocusing_4split4A_richardson.c
├── fnft_manakovv_test_sech_defocusing_4split4B.c
├── fnft_manakovv_test_sech_defocusing_4split6B.c
├── fnft_manakovv_test_sech_defocusing_FTES4_suzuki.c
├── fnft_manakovv_test_sech_focusing_2split3A.c
├── fnft_manakovv_test_sech_focusing_2split3A_no_power_of_two.c
├── fnft_manakovv_test_sech_focusing_2split3B.c
├── fnft_manakovv_test_sech_focusing_2split4A.c
├── fnft_manakovv_test_sech_focusing_2split4B.c
├── fnft_manakovv_test_sech_focusing_2split6B.c
├── fnft_manakovv_test_sech_focusing_4split4A.c
├── fnft_manakovv_test_sech_focusing_4split4A_richardson.c
├── fnft_manakovv_test_sech_focusing_4split4B.c
├── fnft_manakovv_test_sech_focusing_4split6B.c
├── fnft_manakovv_test_sech_focusing_BO.c
├── fnft_manakovv_test_sech_focusing_CF4_2.c
├── fnft_manakovv_test_sech_focusing_FTES4_4A.c
└── fnft_manakovv_test_sech_focusing_FTES4_suzuki.c
├── fnft_nsep
├── fnft_nsep_test_constant_defocusing_2split2A.c
├── fnft_nsep_test_constant_defocusing_2split2_modal.c
├── fnft_nsep_test_constant_defocusing_2split4A.c
├── fnft_nsep_test_constant_defocusing_2split4B.c
├── fnft_nsep_test_constant_defocusing_4split4A.c
├── fnft_nsep_test_nonregression_1.c
├── fnft_nsep_test_numerical_defocusing_1.c
├── fnft_nsep_test_numerical_focusing_1.c
├── fnft_nsep_test_numerical_focusing_1_newton.c
├── fnft_nsep_test_numerical_focusing_2.c
├── fnft_nsep_test_numerical_focusing_3.c
├── fnft_nsep_test_plane_wave_focusing_2split2A.c
├── fnft_nsep_test_plane_wave_focusing_2split2_modal.c
├── fnft_nsep_test_plane_wave_focusing_2split4A.c
├── fnft_nsep_test_plane_wave_focusing_2split4B.c
├── fnft_nsep_test_plane_wave_focusing_4split4B.c
└── fnft_nsep_test_plane_wave_focusing_subsample_and_refine.c
├── fnft_nsev
├── fnft_nsev_test_adaptable_subsampling_factor.c
├── fnft_nsev_test_nonregression_1.c
├── fnft_nsev_test_nonregression_2.c
├── fnft_nsev_test_sech_defocusing_2split2A.c
├── fnft_nsev_test_sech_defocusing_2split2A_no_power_of_two.c
├── fnft_nsev_test_sech_defocusing_2split2_modal.c
├── fnft_nsev_test_sech_defocusing_2split4A.c
├── fnft_nsev_test_sech_defocusing_2split4A_richardson.c
├── fnft_nsev_test_sech_defocusing_2split4B.c
├── fnft_nsev_test_sech_defocusing_4split4A.c
├── fnft_nsev_test_sech_defocusing_4split4A_richardson.c
├── fnft_nsev_test_sech_defocusing_4split4B.c
├── fnft_nsev_test_sech_defocusing_BO.c
├── fnft_nsev_test_sech_defocusing_CF4_2.c
├── fnft_nsev_test_sech_defocusing_CF4_3.c
├── fnft_nsev_test_sech_defocusing_CF5_3.c
├── fnft_nsev_test_sech_defocusing_CF6_4.c
├── fnft_nsev_test_sech_defocusing_ES4.c
├── fnft_nsev_test_sech_defocusing_TES4.c
├── fnft_nsev_test_sech_focusing_2split1A.c
├── fnft_nsev_test_sech_focusing_2split1B.c
├── fnft_nsev_test_sech_focusing_2split2A.c
├── fnft_nsev_test_sech_focusing_2split2A_no_power_of_two.c
├── fnft_nsev_test_sech_focusing_2split2B.c
├── fnft_nsev_test_sech_focusing_2split2S.c
├── fnft_nsev_test_sech_focusing_2split2_modal.c
├── fnft_nsev_test_sech_focusing_2split3A.c
├── fnft_nsev_test_sech_focusing_2split3B.c
├── fnft_nsev_test_sech_focusing_2split3S.c
├── fnft_nsev_test_sech_focusing_2split4A.c
├── fnft_nsev_test_sech_focusing_2split4A_richardson.c
├── fnft_nsev_test_sech_focusing_2split4B.c
├── fnft_nsev_test_sech_focusing_2split5A.c
├── fnft_nsev_test_sech_focusing_2split5B.c
├── fnft_nsev_test_sech_focusing_2split6A.c
├── fnft_nsev_test_sech_focusing_2split6B.c
├── fnft_nsev_test_sech_focusing_2split7A.c
├── fnft_nsev_test_sech_focusing_2split7B.c
├── fnft_nsev_test_sech_focusing_2split8A.c
├── fnft_nsev_test_sech_focusing_2split8B.c
├── fnft_nsev_test_sech_focusing_4split4A.c
├── fnft_nsev_test_sech_focusing_4split4A_richardson.c
├── fnft_nsev_test_sech_focusing_4split4B.c
├── fnft_nsev_test_sech_focusing_BO.c
├── fnft_nsev_test_sech_focusing_CF4_2.c
├── fnft_nsev_test_sech_focusing_CF4_3.c
├── fnft_nsev_test_sech_focusing_CF5_3.c
├── fnft_nsev_test_sech_focusing_CF6_4.c
├── fnft_nsev_test_sech_focusing_ES4.c
├── fnft_nsev_test_sech_focusing_TES4.c
├── fnft_nsev_test_truncated_soliton_2split2A.c
├── fnft_nsev_test_truncated_soliton_2split2_modal.c
├── fnft_nsev_test_truncated_soliton_2split4A.c
└── fnft_nsev_test_truncated_soliton_2split4B.c
├── fnft_nsev_inverse
├── fnft_nsev_inverse_test_B_of_tau_or_b_of_xi
│ ├── fnft_nsev_inverse_test_B_of_tau_2split2A.c
│ ├── fnft_nsev_inverse_test_B_of_tau_2split2_modal.c
│ ├── fnft_nsev_inverse_test_B_of_tau_or_b_of_xi.inc
│ ├── fnft_nsev_inverse_test_B_of_tau_or_b_of_xi_w_discrete.inc
│ ├── fnft_nsev_inverse_test_B_of_tau_w_discrete_2split2A.c
│ ├── fnft_nsev_inverse_test_B_of_tau_w_discrete_2split2_modal.c
│ ├── fnft_nsev_inverse_test_b_of_xi_2split2A.c
│ ├── fnft_nsev_inverse_test_b_of_xi_2split2_modal.c
│ ├── fnft_nsev_inverse_test_b_of_xi_w_discrete_2split2A.c
│ └── fnft_nsev_inverse_test_b_of_xi_w_discrete_2split2_modal.c
├── fnft_nsev_inverse_test_addsoliton_cdt.c
├── fnft_nsev_inverse_test_against_forward
│ ├── fnft_nsev_inverse_test_against_forward.inc
│ ├── fnft_nsev_inverse_test_against_forward_defocusing_2split2A.c
│ ├── fnft_nsev_inverse_test_against_forward_defocusing_2split2_modal.c
│ ├── fnft_nsev_inverse_test_against_forward_focusing_2split2A.c
│ ├── fnft_nsev_inverse_test_against_forward_focusing_2split2_modal.c
│ ├── fnft_nsev_inverse_test_against_forward_w_discrete.inc
│ ├── fnft_nsev_inverse_test_against_forward_w_discrete_2split2A.c
│ └── fnft_nsev_inverse_test_against_forward_w_discrete_2split2_modal.c
├── fnft_nsev_inverse_test_multisoliton_cdt.c
├── fnft_nsev_inverse_test_sech_defocusing
│ ├── fnft_nsev_inverse_test_sech_defocusing.inc
│ ├── fnft_nsev_inverse_test_sech_defocusing.m
│ ├── fnft_nsev_inverse_test_sech_defocusing_2split2A.c
│ ├── fnft_nsev_inverse_test_sech_defocusing_2split2_modal.c
│ ├── fnft_nsev_inverse_test_sech_defocusing_data_2048.inc
│ └── fnft_nsev_inverse_test_sech_defocusing_data_4096.inc
└── fnft_nsev_inverse_test_truncated_soliton
│ ├── fnft_nsev_inverse_test_truncated_soliton.inc
│ ├── fnft_nsev_inverse_test_truncated_soliton_2split2A.c
│ └── fnft_nsev_inverse_test_truncated_soliton_2split2_modal.c
└── fnft_version_test.c
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.inc linguist-language=C
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ingnore all
2 | *
3 |
4 | # Unignore in this directory
5 | !*.gitignore
6 | !Doxyfile
7 |
8 | # Unignore subdirectories
9 | !/examples/
10 | !/include/
11 | !/include/private/
12 | !/include/3rd_party/eiscor/
13 | !/include/3rd_party/kiss_fft/
14 | !/matlab/
15 | !/src/
16 | !/src/private/
17 | !/src/3rd_party/eiscor/
18 | !/src/3rd_party/kiss_fft/
19 | !/test/
20 | !/test/fnft__akns_fscatter/
21 | !/test/fnft__fft_wrapper/
22 | !/test/fnft__kdv_finvscatter/
23 | !/test/fnft__kdv_scatter/
24 | !/test/fnft_kdvv/
25 | !/test/fnft__manakov_fscatter/
26 | !/test/fnft__manakov_scatter/
27 | !/test/fnft_manakovv/
28 | !/test/fnft__misc/
29 | !/test/fnft__nse_finvscatter/
30 | !/test/fnft_nsep/
31 | !/test/fnft__nse_scatter/
32 | !/test/fnft_nsev/
33 | !/test/fnft_nsev_inverse/
34 | !/test/fnft__poly/
35 | !/test/fnft_version_test/
36 | !/test/fnft_version_test.c/
37 |
38 | # Ignore MacOS hidden files in subdirectories
39 | /**/*.DS_Store
40 |
41 | # Ignore mex and dSYM files in matlab subdirectory and deeper
42 | /matlab/**/*.mexmaci64
43 | /matlab/**/*.mexa64
44 | /matlab/**/*.mexw32
45 | /matlab/**/*.mexw64
46 | /matlab/**/*.dSYM
47 |
48 | # Unignore file types (including in subdirectories)
49 | !/**/*.c
50 | !/**/*.f90
51 | !/**/*.txt
52 | !/**/*.md
53 | !/**/*.h
54 | !/**/*.h.in
55 | !/**/*.m
56 | !/**/*.inc
57 |
58 | # Explicitly reignore fnft_config.h, which is generated by cmake
59 | /include/fnft_config.h
60 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: c
2 |
3 | install:
4 | - sudo apt-get remove -y cmake
5 | - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
6 | - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
7 |
8 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
9 | CMAKE_URL="https://cmake.org/files/v3.17/cmake-3.17.3-Linux-x86_64.tar.gz";
10 | mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake;
11 | export PATH=${DEPS_DIR}/cmake/bin:${PATH};
12 | else
13 | brew outdated cmake || brew upgrade cmake;
14 | fi
15 | - cmake --version
16 | - cd ..
17 |
18 | matrix:
19 | include:
20 | - os: linux
21 | addons:
22 | apt:
23 | sources:
24 | - ubuntu-toolchain-r-test
25 | packages:
26 | - gcc-5
27 | - gfortran-5
28 | - os: linux
29 | addons:
30 | apt:
31 | sources:
32 | - ubuntu-toolchain-r-test
33 | packages:
34 | - gcc-5
35 | - gfortran-5
36 | - libfftw3-dev
37 |
38 |
39 | before_script:
40 | - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100
41 | - sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-5 100
42 | - mkdir build
43 | - cd build
44 |
45 | script:
46 | - if dpkg -s libfftw3-dev; then cmake .. -DENABLE_FFTW=ON -DDEBUG=ON; else cmake .. -DDEBUG=ON; fi
47 | - make
48 | - make test CTEST_OUTPUT_ON_FAILURE=1
49 |
--------------------------------------------------------------------------------
/Getting-Started.md:
--------------------------------------------------------------------------------
1 | # Getting started
2 |
3 | ## Examples
4 |
5 | FNFT comes with several examples, both in C and MATLAB, which are
6 | located in the 'examples' directory. For example, run the following
7 | commands in a terminal.
8 |
9 | cd ~/FNFT/examples/
10 | ./fnft_nsev_example
11 | ./fnft_nsep_example
12 | ./fnft_kdvv_example
13 | ./fnft_nsev_inverse_example
14 | ./fnft_nsev_slow_example
15 |
16 | The sources for the examples can be found in the same directory. The example binaries have already been built together with the library. If you want to see the exact commands that were used to compile the examples, replace the 'make -j4' command in the build process with
17 |
18 | VERBOSE=1 make -j4
19 |
20 | If the MATLAB interface has been built, try the following in MATLAB
21 |
22 | addpath ~/FNFT/matlab/
23 | cd ~/FNFT/examples
24 | mex_fnft_nsev_example
25 | mex_fnft_nsep_example
26 | mex_fnft_kdvv_example
27 | mex_fnft_nsev_inverse_example_1
28 | mex_fnft_nsev_inverse_example_2
29 | mex_fnft_nsev_inverse_example_3
30 | mex_fnft_nsev_slow_example_1
31 | mex_fnft_nsev_slow_example_2
32 |
33 | ## Documentation
34 |
35 | The documentation of the C interface is available online at
36 |
37 | [https://fastnft.github.io/FNFT/](https://fastnft.github.io/FNFT/)
38 |
39 | The C interface is separated into a public part ('fnft_' prefix) and a private part ('fnft__' prefix). The public part corresponds to the header files directly inside the 'include' folder. The header files in the subdirectories of the 'include' folder are considered private. To build the documentation yourself, run doxygen in the main folder of the library. It can then be found in the doc folder. Simply open the file '~/FNFT/doc/html/index.html' in your web browser.
40 |
41 | The MATLAB interface is documented in the usual way. Run the commands
42 |
43 | help mex_fnft_nsev
44 | help mex_fnft_nsep
45 | help mex_fnft_kdvv
46 | help mex_fnft_nsev_inverse
47 | help mex_fnft_nsev_slow
48 |
49 | in MATLAB to get more information.
50 |
--------------------------------------------------------------------------------
/examples/mex_fnft_kdvv_example_4.m:
--------------------------------------------------------------------------------
1 | % This file is part of FNFT.
2 | %
3 | % FNFT is free software; you can redistribute it and/or
4 | % modify it under the terms of the version 2 of the GNU General
5 | % Public License as published by the Free Software Foundation.
6 | %
7 | % FNFT is distributed in the hope that it will be useful,
8 | % but WITHOUT ANY WARRANTY; without even the implied warranty of
9 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 | % GNU General Public License for more details.
11 | %
12 | % You should have received a copy of the GNU General Public License
13 | % along with this program. If not, see .
14 | %
15 | % Contributors:
16 | % Shrinivas Chimmalgi (TU Delft) 2020.
17 | % Sander Wahls (TU Delft) 2020.
18 | % Peter J. Prins (TU Delft) 2021.
19 |
20 | % This example shows the feature of computing bound states using the slow
21 | % algorithms.
22 |
23 | clear;
24 | close all;
25 | clc;
26 |
27 | %%% Setup parameters %%%
28 |
29 | T = [0,16]; % location of the 1st and last sample in the time domain
30 | XI = [0.5,23]; % location of the 1st and last sample in the xi-domain
31 | D = 2^10;
32 |
33 | %%% Setup the signal %%%
34 |
35 | A = sym(15);
36 | d = sym(0.5);
37 | exp_t0 = sym(3000);
38 | q_fun = @(t) A*sech((t-log(exp_t0))/d).^2; % signal function
39 |
40 | %%% Exact values of the bound states %%%
41 |
42 | bound_states_exact = [1i,3i];
43 | normconsts_exact = [-9e6, 729e18];
44 |
45 | %%% Compute the discrete part of the nonlinear Fourier transform %%%
46 |
47 | t = linspace(T(1),T(2),D);
48 | q = double(q_fun(t)); % signal samples
49 | dxi = sqrt(max(q)) / 1000; % use approximately 1000 grid points for the
50 | % bound state localization step
51 | [~,bound_states_computed,normconsts_computed]=mex_fnft_kdvv(q, T, XI,...
52 | 'discr_CF4_2','bsloc_gridsearch_refine', 'grid_spacing', dxi, ...
53 | 'skip_cs', 'bsloc_niter',20);
54 |
55 | %%% Plot results %%%
56 |
57 | plot(bound_states_exact,'o')
58 | hold on
59 | plot(bound_states_computed,'xk')
60 | ylim([0,4])
61 | xlabel('Real part');
62 | ylabel('Imaginary part');
63 | legend('Exact bound state','Computed bound state');
--------------------------------------------------------------------------------
/examples/mex_fnft_nsev_inverse_example_2_exact_solution.m:
--------------------------------------------------------------------------------
1 | % This file is part of FNFT.
2 | %
3 | % FNFT is free software; you can redistribute it and/or
4 | % modify it under the terms of the version 2 of the GNU General
5 | % Public License as published by the Free Software Foundation.
6 | %
7 | % FNFT is distributed in the hope that it will be useful,
8 | % but WITHOUT ANY WARRANTY; without even the implied warranty of
9 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 | % GNU General Public License for more details.
11 | %
12 | % You should have received a copy of the GNU General Public License
13 | % along with this program. If not, see .
14 | %
15 | % Contributors:
16 | % Sander Wahls (TU Delft) 2018.
17 |
18 | % The formulas used here are given in the paper
19 | % Frumin et al., J. Opt. Soc. Am. B 32(2), 2015.
20 |
21 | function [q_exact, contspec_exact] = ...
22 | mex_fnft_nsev_inverse_example_2_exact_solution(t, xi)
23 | try
24 | Q = 5;
25 | GAM = 1/25;
26 | F = 1.5;
27 |
28 | q_exact = -conj(Q/GAM*sech(t/GAM).^(1-2j*F));
29 |
30 | cgamma = @(z) double(gamma(sym(z)));
31 | d = 0.5 + 1i*(xi*GAM-F);
32 | fp = 0.5 - 1i*(xi*GAM+sqrt(F^2+Q^2));
33 | fm = 0.5 - 1i*(xi*GAM-sqrt(F^2+Q^2));
34 | gp = 1 - 1i*(F+sqrt(F^2+Q^2));
35 | gm = 1 - 1i*(F-sqrt(F^2+Q^2));
36 | contspec_exact = -2^(-2i*F)*Q*cgamma(d).*cgamma(fm).* ...
37 | cgamma(fp)./(cgamma(conj(d)).*cgamma(gm).*cgamma(gp));
38 | catch
39 | error('This function requires the Symbolic Math Toolbox in order to compute the complex gamma function.');
40 | end
41 | end
--------------------------------------------------------------------------------
/include/3rd_party/eiscor/eiscor.h:
--------------------------------------------------------------------------------
1 | /* define STDERR as 0 if undefined */
2 | #ifndef STDERR
3 | #define STDERR (0)
4 | #endif
5 |
6 | /* if DEBUG is defined, redefine as .TRUE. otherwise define as .FALSE. */
7 | #ifdef DEBUG
8 | #undef DEBUG
9 | #define DEBUG (.TRUE.)
10 | #else
11 | #define DEBUG (.FALSE.)
12 | #endif
13 |
14 | /* if VERBOSE is defined, redefine as .TRUE. otherwise define as .FALSE. */
15 | #ifdef VERBOSE
16 | #undef VERBOSE
17 | #define VERBOSE (.TRUE.)
18 | #else
19 | #define VERBOSE (.FALSE.)
20 | #endif
21 |
22 | /* define EISCOR_DBL_EPS as unit roundoff */
23 | #ifdef EISCOR_DBL_EPS
24 | #undef EISCOR_DBL_EPS
25 | #define EISCOR_DBL_EPS (epsilon(1d0))
26 | #else
27 | #define EISCOR_DBL_EPS (epsilon(1d0))
28 | #endif
29 |
30 | /* define EISCOR_DBL_INF as largest supported positive double precision number */
31 | #ifdef EISCOR_DBL_INF
32 | #undef EISCOR_DBL_INF
33 | #define EISCOR_DBL_INF (huge(1d0))
34 | #else
35 | #define EISCOR_DBL_INF (huge(1d0))
36 | #endif
37 |
38 | /* define EISCOR_DBL_PI as nearest double precision number to pi */
39 | #ifdef EISCOR_DBL_PI
40 | #undef EISCOR_DBL_PI
41 | #define EISCOR_DBL_PI (3.141592653589793239d0)
42 | #else
43 | #define EISCOR_DBL_PI (3.141592653589793239d0)
44 | #endif
45 |
46 |
--------------------------------------------------------------------------------
/include/fnft_config.h.in:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | */
19 |
20 | #ifndef FNFT_CONFIG_H
21 | #define FNFT_CONFIG_H
22 |
23 | #define FNFT_VERSION_MAJOR @FNFT_VERSION_MAJOR@
24 | #define FNFT_VERSION_MINOR @FNFT_VERSION_MINOR@
25 | #define FNFT_VERSION_PATCH @FNFT_VERSION_PATCH@
26 | #define FNFT_VERSION_SUFFIX "@FNFT_VERSION_SUFFIX@"
27 | // The suffix should not exceed the length defined below (not counting the NULL
28 | // termination symbol)
29 | #define FNFT_VERSION_SUFFIX_MAXLEN 8
30 |
31 | #cmakedefine HAVE__THREAD_LOCAL 1
32 | #cmakedefine HAVE___THREAD 1
33 | #cmakedefine DEBUG 1
34 | #cmakedefine HAVE_FFTW3 1
35 | #cmakedefine HAVE_PRAGMA_GCC_OPTIMIZE_OFAST 1
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/include/fnft_version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | /**
21 | * @file fnft_version.h
22 | * @brief Provides a function to query the version of the FNFT library.
23 | * @ingroup fnft
24 | */
25 |
26 | #ifndef FNFT_VERSION_H
27 | #define FNFT_VERSION_H
28 |
29 | #include "fnft.h"
30 |
31 | /**
32 | * Provides the version of the FNFT library.
33 | *
34 | * The version is of the form $major.$minor.$patch$suffix, e.g.,
35 | * "0.2.1-al". The function simply returns the corresponding values
36 | * defined fnft_config.h.
37 | *
38 | * @param[out] major *major is overwritten with the value of FNFT_VERSION_MAJOR
39 | * @param[out] minor *minor is overwritten with the value of FNFT_VERSION_MINOR
40 | * @param[out] patch *patch is overwritten with the value of FNFT_VERSION_PATCH
41 | * @param[out] suffix suffix is overwritten with the value of FNFT_VERSION_SUFFIX
42 | * @return \link FNFT_SUCCESS \endlink or one of the FNFT_EC_... error codes
43 | * defined in \link fnft_errwarn.h \endlink.
44 | *
45 | * @ingroup fnft
46 | */
47 | FNFT_INT fnft_version(FNFT_UINT * const major,
48 | FNFT_UINT * const minor,
49 | FNFT_UINT * const patch,
50 | char suffix[FNFT_VERSION_SUFFIX_MAXLEN+1]);
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/include/private/fnft__fft_wrapper_plan_t.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | /**
21 | * @file fnft__fft_wrapper_plan_t.h
22 | *
23 | * @ingroup fft_wrapper
24 | */
25 |
26 | #ifndef FNFT__FFT_WRAPPER_H
27 | #define FNFT__FFT_WRAPPER_H
28 |
29 | #include "fnft.h"
30 | #include "kiss_fft.h"
31 |
32 | /**
33 | * @brief Stores information needed by \link fnft__fft_wrapper_execute_plan
34 | * \endlink to perform a (inverse) FFT.
35 | * @ingroup fft_wrapper
36 | */
37 | #ifdef HAVE_FFTW3
38 | #include
39 | typedef fftw_plan fnft__fft_wrapper_plan_t;
40 | #else
41 | typedef kiss_fft_cfg fnft__fft_wrapper_plan_t;
42 | #endif
43 |
44 | #endif
45 |
46 | #ifdef FNFT_ENABLE_SHORT_NAMES
47 | #ifndef FNFT__FFT_WRAPPER_PLAN_T_SHORT_NAMES
48 | #define FNFT__FFT_WRAPPER_PLAN_T_SHORT_NAMES
49 | #define fft_wrapper_plan_t fnft__fft_wrapper_plan_t
50 | #endif
51 | #endif
52 |
--------------------------------------------------------------------------------
/include/private/fnft__kdv_finvscatter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018, 2020.
18 | */
19 |
20 | /**
21 | * \file fnft__kdv_finvscatter.h
22 | * @brief Recovers the signal from a scattering matrix.
23 | * @ingroup kdv
24 | */
25 |
26 | #ifndef FNFT__KDV_FINVSCATTER_H
27 | #define FNFT__KDV_FINVSCATTER_H
28 |
29 | #include "fnft__kdv_discretization.h"
30 |
31 | /**
32 | * @brief Recovers the samples that corresponding to a transfer matrix fast.
33 | *
34 | * @ingroup kdv
35 | * @param deg Degree of the polynomials in the transfer matrix.
36 | * @param [in] transfer_matrix A transfer matrix in the same format as used by
37 | * \link fnft__kdv_fscatter \endlink.
38 | * @param [out] q Array with D=deg/base_deg entries in which the samples are
39 | * stored, where base_deg is the output of
40 | * \link fnft__kdv_discretization_degree \endlink.
41 | * @param[in] eps_t See \link fnft__kdv_fscatter \endlink.
42 | * @param[in] discretization See \link fnft__kdv_fscatter \endlink. Currently,
43 | * only the 2SPLIT2_MODAL and 2SPLIT2A discretizations are supported.
44 | */
45 | FNFT_INT fnft__kdv_finvscatter(
46 | const FNFT_UINT deg,
47 | FNFT_COMPLEX * const transfer_matrix,
48 | FNFT_COMPLEX * const q,
49 | const FNFT_REAL eps_t,
50 | const fnft_kdv_discretization_t discretization);
51 |
52 | #ifdef FNFT_ENABLE_SHORT_NAMES
53 | #define kdv_finvscatter(...) fnft__kdv_finvscatter(__VA_ARGS__)
54 | #endif
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/include/private/fnft__poly_roots_fasteigen.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | */
19 |
20 | /**
21 | * @file fnft__poly_roots_fasteigen.h
22 | * @brief Fast root finding of polynomials.
23 | * @ingroup poly
24 | */
25 |
26 | #ifndef FNFT__POLY_ROOTS_FASTEIGEN_H
27 | #define FNFT__POLY_ROOTS_FASTEIGEN_H
28 |
29 | #include "fnft.h"
30 |
31 | /**
32 | * @brief Fast computation of polynomial roots.
33 | *
34 | * @ingroup poly
35 | * This routine compute the roots of a polynomial
36 | *
37 | * \f[ p(z)=p_0+p_1 z^1+p_2 z^2+...+p_{deg} z^{deg} \f]
38 | *
39 | * using only \f$ O\{ deg^2 \}\f$ floating point operations.
40 | *
41 | * @see https://arxiv.org/abs/1611.02435v2
42 | *
43 | * @param[in] deg Degree of the polynomial
44 | * @param[in] p Array containing the deg+1 coefficients of the polynomial in
45 | * descending order (i.e., \f$ p_{deg}, p_{deg-1}, \dots, p_1, p_0 \f$).
46 | * @param[out] roots Array of deg+1 points. Will be filled with the roots of
47 | * \f$ p(z) \f$.
48 | * @return \link FNFT_SUCCESS \endlink or one of the FNFT_EC_... error codes
49 | * defined in \link fnft_errwarn.h \endlink.
50 | */
51 | FNFT_INT fnft__poly_roots_fasteigen(const FNFT_UINT deg,
52 | FNFT_COMPLEX const * const p, FNFT_COMPLEX * const roots);
53 |
54 | #ifdef FNFT_ENABLE_SHORT_NAMES
55 | #define poly_roots_fasteigen(...) fnft__poly_roots_fasteigen(__VA_ARGS__)
56 | #endif
57 |
58 | #endif
59 |
--------------------------------------------------------------------------------
/matlab/mex_fnft_nsev_inverse_XI.m:
--------------------------------------------------------------------------------
1 | % MEX_FNFT_NSEV_INVERSE Provides the range in the nonlinear frequency
2 | % domain that has to be used with MEX_FNFT_NSEV_INVERSE.
3 | %
4 | % [XI xi] = MEX_FNFT_NSEV_XI(D, T, M);
5 | %
6 | % DESCRIPTION
7 | % Provides an interface to the function fnft_nsev_inverse_XI
8 | % in the C routine fnft_nsev_inverse.
9 | %
10 | % INPUTS
11 | % D Real scalar, must be a positive power of two
12 | % T Real 1x2 vector
13 | % M Real scalar, must be a positive power of two
14 | %
15 | % OUTPUTS
16 | % XI Real 1x2 vector
17 | % xi Real 1xM vector, a grid from XI(1) to XI(2)
18 |
19 | % This file is part of FNFT.
20 | %
21 | % FNFT is free software; you can redistribute it and/or
22 | % modify it under the terms of the version 2 of the GNU General
23 | % Public License as published by the Free Software Foundation.
24 | %
25 | % FNFT is distributed in the hope that it will be useful,
26 | % but WITHOUT ANY WARRANTY; without even the implied warranty of
27 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 | % GNU General Public License for more details.
29 | %
30 | % You should have received a copy of the GNU General Public License
31 | % along with this program. If not, see .
32 | %
33 | % Contributors:
34 | % Sander Wahls (TU Delft) 2017-2018.
35 |
--------------------------------------------------------------------------------
/matlab/mex_fnft_version.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "mex.h"
21 | #include "matrix.h"
22 | #include "fnft.h"
23 |
24 | void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
25 | {
26 | if (nrhs > 0)
27 | mexErrMsgTxt("No inputs expected.");
28 |
29 | if (nlhs == 0) {
30 | mexPrintf("%d.%d.%d%s\n", FNFT_VERSION_MAJOR, FNFT_VERSION_MINOR,
31 | FNFT_VERSION_PATCH, FNFT_VERSION_SUFFIX);
32 | return;
33 | }
34 |
35 | if (nlhs != 4)
36 | mexErrMsgTxt("Zero or four outputs expected.");
37 |
38 | plhs[0] = mxCreateDoubleScalar(FNFT_VERSION_MAJOR);
39 | plhs[1] = mxCreateDoubleScalar(FNFT_VERSION_MINOR);
40 | plhs[2] = mxCreateDoubleScalar(FNFT_VERSION_PATCH);
41 | plhs[3] = mxCreateString(FNFT_VERSION_SUFFIX);
42 |
43 | (void) prhs;
44 |
45 | return;
46 | }
47 |
--------------------------------------------------------------------------------
/matlab/mex_fnft_version.m:
--------------------------------------------------------------------------------
1 | % MEX_FNFT_VERSION Provides the version of the used FNFT C library.
2 | %
3 | % MEX_FNFT_VERSION();
4 | % [major, minor, patch, suffix] = MEX_FNFT_VERSION();
5 | %
6 | % DESCRIPTION
7 | % Provides the version of the underlying FNFT library. When called
8 | % without return value, the version is simply printed to the screen.
9 | % When called with four return values, it returns the constants
10 | % that are used to build the version string.
11 | %
12 | % OUTPUTS
13 | % major Value of the constant FNFT_VERSION_MAJOR
14 | % minor Value of the constant FNFT_VERSION_MINOR
15 | % patch Value of the constant FNFT_VERSION_PATCH
16 | % suffix Value of the constant FNFT_VERSION_SUFFIX
17 |
18 | % This file is part of FNFT.
19 | %
20 | % FNFT is free software; you can redistribute it and/or
21 | % modify it under the terms of the version 2 of the GNU General
22 | % Public License as published by the Free Software Foundation.
23 | %
24 | % FNFT is distributed in the hope that it will be useful,
25 | % but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | % GNU General Public License for more details.
28 | %
29 | % You should have received a copy of the GNU General Public License
30 | % along with this program. If not, see .
31 | %
32 | % Contributors:
33 | % Sander Wahls (TU Delft) 2018.
34 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014,
4 | Jared L. Aurentz,
5 | Thomas Mach,
6 | Raf Vandebril,
7 | David S. Watkins.
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining
10 | a copy of this software and associated documentation files (the
11 | "Software"), to deal in the Software without restriction, including
12 | without limitation the rights to use, copy, modify, merge, publish,
13 | distribute, sublicense, and/or sell copies of the Software, and to
14 | permit persons to whom the Software is furnished to do so, subject to
15 | the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be
18 | included in all copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/d_1Darray_check.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! d_1Darray_check
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine checks a one dimensional double array for INFs and NANs.
9 | !
10 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11 | !
12 | ! INPUT VARIABLES:
13 | !
14 | ! N INTEGER
15 | ! positive integer, dimension of A
16 | !
17 | ! A REAL(8) array of dimension (N)
18 | ! real array to be checked
19 | !
20 | ! OUTPUT VARIABLES:
21 | !
22 | ! FLAG LOGICAL
23 | ! .TRUE. implies A contains valid numbers
24 | ! .FALSE. implies N < 1 or A contains at least one invalid
25 | ! number
26 | !
27 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 | subroutine d_1Darray_check(N,A,FLAG)
29 |
30 | implicit none
31 |
32 | ! input variables
33 | integer, intent(in) :: N
34 | real(8), intent(in) :: A(N)
35 | logical, intent(inout) :: FLAG
36 |
37 | ! compute variables
38 | integer :: ii
39 |
40 | ! initialize FLAG
41 | FLAG = .FALSE.
42 |
43 | ! check N
44 | if (N < 1) then
45 | return
46 | end if
47 |
48 | ! check array
49 | do ii = 1,N
50 |
51 | ! check for INF or NAN
52 | call d_scalar_check(A(ii),FLAG)
53 | if (.NOT.FLAG) then
54 | return
55 | end if
56 |
57 | end do
58 |
59 | end subroutine d_1Darray_check
60 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/d_1Darray_random_normal.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! d_1Darray_random_normal
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine provides a vector of pseudo-random number independent, standard,
9 | ! normally distributed (expected value 0, standard deviation 1).
10 | ! Call u_randomseed_initialize(INFO) first to set the seed of the number
11 | ! generator.
12 | !
13 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14 | !
15 | ! INPUT VARIABLES:
16 | !
17 | ! N INTEGER
18 | ! positive integer, dimension of A
19 | !
20 | !
21 | ! OUTPUT VARIABLES:
22 | !
23 | ! A REAL(8) array of dimension (N)
24 | ! vector of real random numbers
25 | !
26 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 | subroutine d_1Darray_random_normal(N,A)
28 |
29 | implicit none
30 |
31 | ! input variables
32 | integer, intent(in) :: N
33 | real(8), intent(inout) :: A(N)
34 |
35 | ! compute variables
36 | integer :: ii
37 |
38 | ! check N
39 | if (N < 1) then
40 | return
41 | end if
42 |
43 | do ii = 1,N
44 |
45 | call d_scalar_random_normal(A(ii))
46 |
47 | end do
48 |
49 | end subroutine d_1Darray_random_normal
50 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/d_2Darray_check.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! d_2Darray_check
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine checks a one dimensional complex array for INFs and NANs.
9 | !
10 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11 | !
12 | ! INPUT VARIABLES:
13 | !
14 | ! M, N INTEGER
15 | ! positive integers, dimensions of A
16 | !
17 | ! A REAL(8) array of dimension (M,N)
18 | ! real array to be checked
19 | !
20 | ! OUTPUT VARIABLES:
21 | !
22 | ! FLAG LOGICAL
23 | ! .TRUE. implies A contains valid numbers
24 | ! .FALSE. implies M < 1, N < 1 or A contains at least one
25 | ! invalid number
26 | !
27 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 | subroutine d_2Darray_check(M,N,A,FLAG)
29 |
30 | implicit none
31 |
32 | ! input variables
33 | integer, intent(in) :: M, N
34 | real(8), intent(in) :: A(M,N)
35 | logical, intent(inout) :: FLAG
36 |
37 | ! compute variables
38 | integer :: ii, jj
39 |
40 | ! initialize FLAG
41 | FLAG = .FALSE.
42 |
43 | ! check M and N
44 | if ((N < 1).OR.(M < 1)) then
45 | return
46 | end if
47 |
48 | ! check array
49 | do ii = 1,M
50 | do jj = 1,N
51 |
52 | ! check for INF or NAN
53 | call d_scalar_check(A(ii,jj),FLAG)
54 | if (.NOT.FLAG) then
55 | return
56 | end if
57 |
58 | end do
59 | end do
60 |
61 | end subroutine d_2Darray_check
62 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/d_2Darray_random_normal.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! d_2Darray_random_normal
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine provides a matrix of pseudo-random number independent, standard,
9 | ! normally distributed (expected value 0, standard deviation 1).
10 | ! Call u_randomseed_initialize(INFO) first to set the seed of the number
11 | ! generator.
12 | !
13 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14 | !
15 | ! INPUT VARIABLES:
16 | !
17 | ! M, N INTEGER
18 | ! positive integers, dimension of A
19 | !
20 | !
21 | ! OUTPUT VARIABLES:
22 | !
23 | ! A REAL(8) array of dimension (M,N)
24 | ! matrix of real random numbers
25 | !
26 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 | subroutine d_2Darray_random_normal(M,N,A)
28 |
29 | implicit none
30 |
31 | ! input variables
32 | integer, intent(in) :: M, N
33 | real(8), intent(inout) :: A(M,N)
34 |
35 | ! compute variables
36 | integer :: ii, jj
37 |
38 | ! check N
39 | if ((N .LT. 1).OR.(M .LT. 1)) then
40 | return
41 | end if
42 |
43 | do jj = 1,M
44 | do ii = 1,N
45 |
46 | call d_scalar_random_normal(A(jj,ii))
47 |
48 | end do
49 | end do
50 |
51 | end subroutine d_2Darray_random_normal
52 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/d_orthfact_2x2diagblock.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! d_orthfact_2x2diagblock
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine computes either the top or bottom 2x2 diagonal block
9 | ! of an orthogonal upper-hessenberg matrix that is stored as a product
10 | ! of givens rotations and a diagonal matrix.
11 | !
12 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13 | !
14 | ! INPUT VARIABLES:
15 | !
16 | ! TOP LOGICAL
17 | ! .TRUE.: top block is computed
18 | ! .FALSE.: bottom block is computed
19 | !
20 | ! Q REAL(8) array of dimension (4)
21 | ! array of generators for givens rotations
22 | ! generators must be orthogonal to working precision
23 | !
24 | ! D REAL(8) array of dimension (2)
25 | ! array of generators for diagonal matrix
26 | ! entries must be +/-1
27 | !
28 | ! OUTPUT VARIABLES:
29 | !
30 | ! H REAL(8) array of dimension (2,2)
31 | ! on exit contains the desired 2x2 block
32 | !
33 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34 | subroutine d_orthfact_2x2diagblock(TOP,Q,D,H)
35 |
36 | implicit none
37 |
38 | ! input variables
39 | logical, intent(in) :: TOP
40 | real(8), intent(in) :: Q(4), D(2)
41 | real(8), intent(inout) :: H(2,2)
42 |
43 | ! TOP == .TRUE.
44 | if (TOP) then
45 |
46 | ! initialize H
47 | H(1,1) = Q(1)*D(1)
48 | H(2,1) = Q(2)*D(1)
49 | H(1,2) = -Q(2)*Q(3)*D(2)
50 | H(2,2) = Q(1)*Q(3)*D(2)
51 |
52 | ! TOP == .FALSE.
53 | else
54 |
55 | ! initialize H
56 | H(1,1) = Q(3)*Q(1)*D(1)
57 | H(2,1) = Q(4)*D(1)
58 | H(1,2) = -Q(4)*Q(1)*D(2)
59 | H(2,2) = Q(3)*D(2)
60 |
61 | end if
62 |
63 | end subroutine d_orthfact_2x2diagblock
64 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/d_orthfact_mergebulge.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! d_orthfact_mergebulge
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine computes the product of two real Given's rotations and
9 | ! and stores the output in one of the input arrays.
10 | !
11 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12 | !
13 | ! INPUT VARIABLES:
14 | !
15 | ! TOP LOGICAL
16 | ! .TRUE.: merge bulge at top
17 | ! .FALSE.: merge bulge at bottom
18 | !
19 | ! Q REAL(8) array of dimension (2)
20 | ! generator unitary matrix
21 | !
22 | ! B REAL(8) array of dimension (2)
23 | ! generator for bulge
24 | !
25 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26 | subroutine d_orthfact_mergebulge(TOP,Q,B)
27 |
28 | implicit none
29 |
30 | ! input variables
31 | logical, intent(in) :: TOP
32 | real(8), intent(inout) :: Q(2), B(2)
33 |
34 | ! compute variables
35 | real(8) :: c, s, nrm
36 |
37 | ! merge at top
38 | if(TOP)then
39 |
40 | ! compute new generators
41 | c = B(1)*Q(1)-B(2)*Q(2)
42 | s = B(2)*Q(1)+B(1)*Q(2)
43 |
44 | ! compute new generators
45 | call d_rot2_vec2gen(c,s,Q(1),Q(2),nrm)
46 |
47 | ! merge at bottom
48 | else
49 |
50 | ! compute new generators
51 | c = Q(1)*B(1)-Q(2)*B(2)
52 | s = Q(2)*B(1)+Q(1)*B(2)
53 |
54 | ! compute new generators
55 | call d_rot2_vec2gen(c,s,Q(1),Q(2),nrm)
56 |
57 | end if
58 |
59 | end subroutine d_orthfact_mergebulge
60 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/d_rot2_check.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! d_rot2_check
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine checks the generators for a real rotation represented
9 | ! by 2 real numbers: a real cosine, C, and a real sine, S.
10 | !
11 | ! To check that it is valid, a new rotation X, Y is computed. If
12 | ! |C-X|, |S-Y|, |NRM-1| < 2*EISCOR_DBL_EPS the generators are
13 | ! considered valid. Otherwise they are invalid.
14 | !
15 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16 | !
17 | ! INPUT VARIABLES:
18 | !
19 | ! C REAL(8)
20 | ! generators for cosine
21 | !
22 | ! S REAL(8)
23 | ! generator for sine
24 | !
25 | ! OUTPUT VARIABLES:
26 | !
27 | ! FLAG LOGICAL
28 | ! .TRUE. implies valid generators
29 | ! .FALSE. implies invalid generators
30 | !
31 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
32 | subroutine d_rot2_check(C,S,FLAG)
33 |
34 | implicit none
35 |
36 | ! input variables
37 | real(8), intent(in) :: C, S
38 | logical, intent(inout) :: FLAG
39 |
40 | ! compute variables
41 | real(8), parameter :: tol = 2d0*EISCOR_DBL_EPS
42 | real(8) :: X, Y, NRM
43 |
44 | ! initialize FLAG to .FALSE.
45 | FLAG = .FALSE.
46 |
47 | ! compute new rotation from input one
48 | call d_rot2_vec2gen(C,S,X,Y,NRM)
49 |
50 | ! check for equality
51 | if ((abs(C-X)EISCOR_DBL_INF) then
37 | return
38 | end if
39 |
40 | ! check for NAN
41 | if (NUM.NE.NUM) then
42 | return
43 | end if
44 |
45 | ! set FLAG to .TRUE.
46 | FLAG = .TRUE.
47 |
48 | end subroutine d_scalar_check
49 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/d_scalar_random_normal.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! d_scalar_random_normal
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine provides a pseudo-random number independent, standard,
9 | ! normally distributed (expected value 0, standard deviation 1). The routine
10 | ! generates two uniformly distributed random numbers using Fortran's built-in
11 | ! routine and then uses the Box-Muller transform.
12 | !
13 | ! Call u_randomseed_initialize(INFO) first to set the seed of the number
14 | ! generator.
15 | !
16 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17 | !
18 | ! OUTPUT VARIABLES:
19 | !
20 | ! NUM REAL(8)
21 | ! random numbers
22 | !
23 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 | subroutine d_scalar_random_normal(NUM)
25 |
26 | implicit none
27 |
28 | ! input variables
29 | real(8), intent(inout) :: NUM
30 |
31 | ! compute variables
32 | double precision :: u,v,s,pi = EISCOR_DBL_PI
33 | integer :: ii
34 |
35 | do ii = 1, 100
36 | call random_number(u)
37 | call random_number(v)
38 | s = u**2 + v**2
39 |
40 | ! Box-Muller transform
41 | if ((s > 0d0) .AND. (s < 1d0)) then
42 | NUM = dcos(2.d0*pi*u)*dsqrt(-2.d0*dlog(v))
43 | exit
44 | end if
45 | end do
46 |
47 | end subroutine d_scalar_random_normal
48 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/l_upr1fact_cmv.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! l_upr1fact_cmv
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This function returns the new position flag for a single shift
9 | ! iteration on a twisted upr1 pencil based on the position flags from
10 | ! the current factorization. The returned flag is .NOT.P(N-2)
11 | !
12 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13 | !
14 | ! INPUT VARIABLES:
15 | !
16 | ! N INTEGER
17 | ! dimension of matrix
18 | !
19 | ! P LOGICAL array of dimension (N-2)
20 | ! array of position flags for Q
21 | !
22 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23 | function l_upr1fact_cmv(N,P)
24 |
25 | implicit none
26 |
27 | ! return type
28 | logical :: l_upr1fact_cmv
29 |
30 | ! input variables
31 | integer, intent(in) :: N
32 | logical, intent(in) :: P(N-2)
33 |
34 | ! set output
35 | l_upr1fact_cmv = .NOT.P(N-2)
36 |
37 | end function l_upr1fact_cmv
38 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/l_upr1fact_hess.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! l_upr1fact_hess
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This function returns the new position flag for a single shift
9 | ! iteration on a twisted upr1 pencil based on the position flags from
10 | ! the current factorization. The returned flag is always .FALSE.
11 | !
12 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13 | !
14 | ! INPUT VARIABLES:
15 | !
16 | ! N INTEGER
17 | ! dimension of matrix
18 | !
19 | ! P LOGICAL array of dimension (N-2)
20 | ! array of position flags for Q
21 | !
22 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23 | function l_upr1fact_hess(N,P)
24 |
25 | implicit none
26 |
27 | ! return type
28 | logical :: l_upr1fact_hess
29 |
30 | ! input variables
31 | integer, intent(in) :: N
32 | logical, intent(in) :: P(N-2)
33 |
34 | ! set output
35 | l_upr1fact_hess = .FALSE.
36 |
37 | end function l_upr1fact_hess
38 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/l_upr1fact_inversehess.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! l_upr1fact_inversehess
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This function returns the new position flag for a single shift
9 | ! iteration on a twisted upr1 pencil based on the position flags from
10 | ! the current factorization. The returned flag is always .TRUE.
11 | !
12 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13 | !
14 | ! INPUT VARIABLES:
15 | !
16 | ! N INTEGER
17 | ! dimension of matrix
18 | !
19 | ! P LOGICAL array of dimension (N-2)
20 | ! array of position flags for Q
21 | !
22 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23 | function l_upr1fact_inversehess(N,P)
24 |
25 | implicit none
26 |
27 | ! return type
28 | logical :: l_upr1fact_inversehess
29 |
30 | ! input variables
31 | integer, intent(in) :: N
32 | logical, intent(in) :: P(N-2)
33 |
34 | ! set output
35 | l_upr1fact_inversehess = .TRUE.
36 |
37 | end function l_upr1fact_inversehess
38 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/l_upr1fact_random.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! l_upr1fact_random
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This function returns the new position flag for a single shift
9 | ! iteration on a twisted upr1 pencil based on the position flags from
10 | ! the current factorization. The returned flag is chosen randomly.
11 | !
12 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13 | !
14 | ! INPUT VARIABLES:
15 | !
16 | ! N INTEGER
17 | ! dimension of matrix
18 | !
19 | ! P LOGICAL array of dimension (N-2)
20 | ! array of position flags for Q
21 | !
22 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23 | function l_upr1fact_random(N,P)
24 |
25 | implicit none
26 |
27 | ! return type
28 | logical :: l_upr1fact_random
29 |
30 | ! input variables
31 | integer, intent(in) :: N
32 | logical, intent(in) :: P(N-2)
33 |
34 | ! compute variables
35 | real(8) :: num
36 |
37 | ! call random number
38 | call random_number(num)
39 |
40 | ! set output
41 | if (num < 5d-1) then
42 | l_upr1fact_random = .FALSE.
43 | else
44 | l_upr1fact_random = .TRUE.
45 | end if
46 |
47 | end function l_upr1fact_random
48 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/u_benchmark_print.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | subroutine u_benchmark_print(TIME,ACC)
3 |
4 | implicit none
5 |
6 | ! input variables
7 | real(8), intent(in) :: TIME, ACC
8 |
9 | ! print failure
10 | write(STDERR,'(a,E13.5,a,E13.5,a)') 'TIME ',TIME,' secs, ACC ',ACC, ' points'
11 |
12 | end subroutine u_benchmark_print
13 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/u_infocode_check.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | subroutine u_infocode_check(FILENAME,LINENUM,MESSAGE,INFO,NEWINFO)
3 |
4 | implicit none
5 |
6 | ! input variables
7 | character(*), intent(in) :: FILENAME, MESSAGE
8 | integer, intent(inout) :: INFO
9 | integer, intent(in) :: NEWINFO, LINENUM
10 |
11 | ! check INFO
12 | if (INFO.NE.0) then
13 | write(STDERR,*) ""
14 | write(STDERR,*) "Error in "//FILENAME//" line:",LINENUM
15 | write(STDERR,*) MESSAGE
16 | write(STDERR,*) "INFO:",INFO
17 | write(STDERR,*) ""
18 | INFO = NEWINFO
19 | return
20 | end if
21 |
22 | end subroutine u_infocode_check
23 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/u_randomseed_initialize.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! u_randomseed_initialize
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine initializes the random number generator using the cpu
9 | ! clock.
10 | !
11 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12 | !
13 | ! INPUT VARIABLES:
14 | !
15 | ! OUTPUT VARIABLES:
16 | !
17 | ! INFO INTEGER
18 | ! INFO = 1 implies array allocation failed
19 | ! INFO = 0 implies successful computation
20 | !
21 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22 | subroutine u_randomseed_initialize(INFO)
23 |
24 | implicit none
25 |
26 | ! input variables
27 | integer, intent(inout) :: INFO
28 |
29 | ! compute variables
30 | integer :: ii, n, clock
31 | integer, allocatable :: seed(:)
32 |
33 | ! initialize INFO
34 | INFO = 0
35 |
36 | ! get size of see
37 | call random_seed(size = n)
38 |
39 | ! allocate memory for seed
40 | allocate(seed(n))
41 |
42 | ! check allocation
43 | if (allocated(seed).EQV..FALSE.) then
44 | INFO = 1
45 |
46 | ! print error in debug mode
47 | if (DEBUG) then
48 | call u_infocode_check(__FILE__,__LINE__,"Array allocation failed",INFO,INFO)
49 | end if
50 |
51 | return
52 | end if
53 |
54 | ! get current clock time
55 | call system_clock(count=clock)
56 |
57 | ! store seeds
58 | seed = n + clock + 37 * (/ (ii - 1, ii = 1, n) /)
59 |
60 | ! set the generator
61 | call random_seed(put = seed)
62 |
63 | ! free memory
64 | deallocate(seed)
65 |
66 | end subroutine u_randomseed_initialize
67 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/u_test_banner.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | subroutine u_test_banner(FILENAME)
3 |
4 | implicit none
5 |
6 | ! input variables
7 | character(*), intent(in) :: FILENAME
8 |
9 | ! compute variables
10 | integer :: length
11 |
12 | ! compute length
13 | length = len(FILENAME)
14 | length = length-4
15 |
16 | ! print banner
17 | write(STDERR,'(a,a,a)',advance='no') FILENAME(1:length),REPEAT(' ',36-length),' ... '
18 |
19 | end subroutine u_test_banner
20 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/u_test_failed.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | subroutine u_test_failed(LINENUM)
3 |
4 | implicit none
5 |
6 | ! input variables
7 | integer, intent(in) :: LINENUM
8 |
9 | ! print failure
10 | write(STDERR,'(a,I4)') 'FAILED on line: ',LINENUM
11 | stop
12 |
13 | end subroutine u_test_failed
14 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/u_test_passed.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | subroutine u_test_passed(TIME)
3 |
4 | implicit none
5 |
6 | ! input variables
7 | real(8), intent(in) :: TIME
8 |
9 | ! print failure
10 | write(STDERR,'(a,F10.5,a)') 'PASSED in ',TIME,' secs'
11 |
12 | end subroutine u_test_passed
13 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/z_1Darray_check.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! z_1Darray_check
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine checks a one dimensional complex array for INFs and NANs.
9 | !
10 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11 | !
12 | ! INPUT VARIABLES:
13 | !
14 | ! N INTEGER
15 | ! positive integer, dimension of A
16 | !
17 | ! A COMPLEX(8) array of dimension (N)
18 | ! complex array to be checked
19 | !
20 | ! OUTPUT VARIABLES:
21 | !
22 | ! FLAG LOGICAL
23 | ! .TRUE. implies A contains valid numbers
24 | ! .FALSE. implies N < 1 or A contains at least one invalid
25 | ! number
26 | !
27 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 | subroutine z_1Darray_check(N,A,FLAG)
29 |
30 | implicit none
31 |
32 | ! input variables
33 | integer, intent(in) :: N
34 | complex(8), intent(in) :: A(N)
35 | logical, intent(inout) :: FLAG
36 |
37 | ! compute variables
38 | integer :: ii
39 |
40 | ! initialize FLAG
41 | FLAG = .FALSE.
42 |
43 | ! check N
44 | if (N < 1) then
45 | return
46 | end if
47 |
48 | ! check array
49 | do ii = 1,N
50 |
51 | ! check for INF or NAN
52 | call z_scalar_check(A(ii),FLAG)
53 | if (.NOT.FLAG) then
54 | return
55 | end if
56 |
57 | end do
58 |
59 | end subroutine z_1Darray_check
60 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/z_1Darray_random_normal.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! z_1Darray_random_normal
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine provides a vector of pseudo-random complex numbers independent,
9 | ! standard, normally distributed (expected value 0, standard deviation 1).
10 | ! Call u_randomseed_initialize(INFO) first to set the seed of the number
11 | ! generator.
12 | !
13 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14 | !
15 | ! INPUT VARIABLES:
16 | !
17 | ! N INTEGER
18 | ! positive integers, dimension of A
19 | !
20 | !
21 | ! OUTPUT VARIABLES:
22 | !
23 | ! A COMPLEX(8) array of dimension (N)
24 | ! vector of complex random numbers
25 | !
26 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 | subroutine z_1Darray_random_normal(N,A)
28 |
29 | implicit none
30 |
31 | ! input variables
32 | integer, intent(in) :: N
33 | complex(8), intent(inout) :: A(N)
34 |
35 | ! compute variables
36 | integer :: ii
37 | real(8) :: u, v
38 |
39 | ! check N
40 | if (N .LT. 1) then
41 | return
42 | end if
43 |
44 | do ii = 1,N
45 |
46 | call z_scalar_random_normal(u,v)
47 | A(ii) = cmplx(u,v,kind=8)
48 |
49 | end do
50 |
51 | end subroutine z_1Darray_random_normal
52 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/z_2Darray_check.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! z_2Darray_check
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine checks a two dimensional complex array for INFs and NANs.
9 | !
10 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11 | !
12 | ! INPUT VARIABLES:
13 | !
14 | ! M, N INTEGER
15 | ! positive integers, dimensions of A
16 | !
17 | ! A COMPLEX(8) array of dimension (M,N)
18 | ! complex array to be checked
19 | !
20 | ! OUTPUT VARIABLES:
21 | !
22 | ! FLAG LOGICAL
23 | ! .TRUE. implies A contains valid numbers
24 | ! .FALSE. implies M < 1, N < 1 or A contains at least one
25 | ! invalid number
26 | !
27 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 | subroutine z_2Darray_check(M,N,A,FLAG)
29 |
30 | implicit none
31 |
32 | ! input variables
33 | integer, intent(in) :: M, N
34 | complex(8), intent(in) :: A(M,N)
35 | logical, intent(inout) :: FLAG
36 |
37 | ! compute variables
38 | integer :: ii, jj
39 |
40 | ! initialize FLAG
41 | FLAG = .FALSE.
42 |
43 | ! check M and N
44 | if ((N < 1).OR.(M < 1)) then
45 | return
46 | end if
47 |
48 | ! check array
49 | do ii = 1,M
50 | do jj = 1,N
51 |
52 | ! check for NAN
53 | call z_scalar_check(A(ii,jj),FLAG)
54 | if (.NOT.FLAG) then
55 | return
56 | end if
57 |
58 | end do
59 | end do
60 |
61 | end subroutine z_2Darray_check
62 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/z_2Darray_random_normal.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! z_2Darray_random_normal
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine provides a matrix of pseudo-random complex numbers independent,
9 | ! standard, normally distributed (expected value 0, standard deviation 1).
10 | ! Call u_randomseed_initialize(INFO) first to set the seed of the number
11 | ! generator.
12 | !
13 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14 | !
15 | ! INPUT VARIABLES:
16 | !
17 | ! M, N INTEGER
18 | ! positive integers, dimension of A
19 | !
20 | !
21 | ! OUTPUT VARIABLES:
22 | !
23 | ! A COMPLEX(8) array of dimension (M,N)
24 | ! matrix of complex random numbers
25 | !
26 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 | subroutine z_2Darray_random_normal(M,N,A)
28 |
29 | implicit none
30 |
31 | ! input variables
32 | integer, intent(in) :: M, N
33 | complex(8), intent(inout) :: A(M,N)
34 |
35 | ! compute variables
36 | integer :: ii, jj
37 | real(8) :: u, v
38 |
39 | ! check N
40 | if ((N .LT. 1).OR.(M .LT. 1)) then
41 | return
42 | end if
43 |
44 | do jj = 1,M
45 | do ii = 1,N
46 |
47 | call z_scalar_random_normal(u,v)
48 | A(jj,ii) = cmplx(u,v,kind=8)
49 |
50 | end do
51 | end do
52 |
53 | end subroutine z_2Darray_random_normal
54 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/z_rot3_check.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! z_rot3_check
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine checks the generators for a complex rotation represented
9 | ! by 3 real numbers: the real and imaginary parts of a complex cosine,
10 | ! CR and CI, and a scrictly real sine, S.
11 | !
12 | ! To check that it is valid, a new rotation XR, XI, Y is computed. If
13 | ! |CR-XR|, |CI-XI|, |S-Y|, |NRM-1| < 3*EISCOR_DBL_EPS the generators are
14 | ! considered valid. Otherwise they are invalid.
15 | !
16 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17 | !
18 | ! INPUT VARIABLES:
19 | !
20 | ! CR, CI REAL(8)
21 | ! generators for complex cosine CR + iCI
22 | !
23 | ! S REAL(8)
24 | ! generator for real sine S
25 | !
26 | ! OUTPUT VARIABLES:
27 | !
28 | ! FLAG LOGICAL
29 | ! .TRUE. implies valid generators
30 | ! .FALSE. implies invalid generators
31 | !
32 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33 | subroutine z_rot3_check(CR,CI,S,FLAG)
34 |
35 | implicit none
36 |
37 | ! input variables
38 | real(8), intent(in) :: CR, CI, S
39 | logical, intent(inout) :: FLAG
40 |
41 | ! compute variables
42 | real(8), parameter :: tol = 3d0*EISCOR_DBL_EPS
43 | real(8) :: XR, XI, Y, NRM
44 |
45 | ! initialize FLAG to .FALSE.
46 | FLAG = .FALSE.
47 |
48 | ! compute new rotation from input one
49 | call z_rot3_vec3gen(CR,CI,S,XR,XI,Y,NRM)
50 |
51 | ! check for equality
52 | if ((abs(CR-XR) 0d0) .AND. (s < 1d0)) then
44 | RE = dcos(2.d0*pi*u)*dsqrt(-2.d0*dlog(v))
45 | CO = dsin(2.d0*pi*u)*dsqrt(-2.d0*dlog(v))
46 | exit
47 | end if
48 | end do
49 |
50 | end subroutine z_scalar_random_normal
51 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/z_unifact_buildbulge.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! z_unifact_buildbulge
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine computes the first transformation in a single shift
9 | ! iteration for a unitary upper hessenberg matix.
10 | !
11 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12 | !
13 | ! INPUT VARIABLES:
14 | !
15 | ! Q REAL(8) array of dimension (6)
16 | ! array of generators for givens rotations
17 | ! generators must be orthogonal to working precision
18 | !
19 | ! D REAL(8) array of dimension (4)
20 | ! array of generators for complex diagonal matrix
21 | ! on output contains the eigenvalues
22 | !
23 | ! SHFT COMPLEX(8)
24 | ! contains the shift need for the first transformation
25 | !
26 | ! OUTPUT VARIABLES:
27 | !
28 | ! B REAL(8) array of dimension (3)
29 | ! on exit contains the generators for the first
30 | ! transformation
31 | !
32 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33 | subroutine z_unifact_buildbulge(Q,D,SHFT,B)
34 |
35 | implicit none
36 |
37 | ! input variables
38 | real(8), intent(in) :: Q(6), D(4)
39 | complex(8), intent(in) :: SHFT
40 | real(8), intent(inout) :: B(3)
41 |
42 | ! compute variables
43 | real(8) :: nrm
44 | complex(8) :: block(2,2)
45 |
46 | ! get top block
47 | call z_unifact_2x2diagblock(.TRUE.,Q,D,block)
48 |
49 | ! shift first entry
50 | block(1,1) = block(1,1) - SHFT
51 |
52 | ! bulge
53 | call z_rot3_vec4gen(dble(block(1,1)),aimag(block(1,1)),dble(block(2,1)), &
54 | aimag(block(2,1)),B(1),B(2),B(3),nrm)
55 |
56 | end subroutine z_unifact_buildbulge
57 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/z_upr1fpen_decompress.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! z_upr1fpen_decompress
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine decompresses a factored unitary plus rank one
9 | ! (upr1fpen) matrix pencil.
10 | !
11 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12 | !
13 | ! INPUT VARIABLES:
14 | !
15 | ! N INTEGER
16 | ! dimension of matrix
17 | !
18 | ! P LOGICAL array of dimension (N-2)
19 | ! array of position flags for Q
20 | !
21 | ! Q REAL(8) array of dimension (3*(N-1))
22 | ! array of generators for first sequence of rotations
23 | !
24 | ! D1,D2 REAL(8) arrays of dimension (2*N)
25 | ! arrays of generators for complex diagonal matrices
26 | ! in the upper-triangular factors
27 | !
28 | ! C1,C2,B1,B2 REAL(8) arrays of dimension (3*N)
29 | ! arrays of generators for unitary plus rank one
30 | ! upper-trinagular matrices
31 | !
32 | ! OUTPUT VARIABLES:
33 | !
34 | ! H,T COMPLEX(8) arrays of dimension (N,N)
35 | ! extended hessenberg, triangular pencil
36 | !
37 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38 | subroutine z_upr1fpen_decompress(N,P,Q,D1,C1,B1,D2,C2,B2,H,T)
39 |
40 | implicit none
41 |
42 | ! input variables
43 | integer, intent(in) :: N
44 | logical, intent(in) :: P(N-2)
45 | real(8), intent(in) :: Q(3*(N-1)), D1(2*N), C1(3*N), B1(3*N)
46 | real(8), intent(in) :: D2(2*N), C2(3*N), B2(3*N)
47 | complex(8), intent(inout) :: H(N,N), T(N,N)
48 |
49 | ! decompress H
50 | call z_upr1fact_decompress(N,P,Q,D1,C1,B1,H)
51 |
52 | ! decompress T
53 | call z_upr1utri_decompress(.FALSE.,N,D2,C2,B2,T)
54 |
55 | end subroutine z_upr1fpen_decompress
56 |
--------------------------------------------------------------------------------
/src/3rd_party/eiscor/z_upr1utri_unimodscale.f90:
--------------------------------------------------------------------------------
1 | #include "eiscor.h"
2 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 | !
4 | ! z_upr1utri_unimodscale
5 | !
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 | !
8 | ! This routine scales either a row or column of a unitary plus rank
9 | ! one upper-triangular matrix (upr1utri) by a complex unimodular scalar.
10 | !
11 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12 | !
13 | ! INPUT VARIABLES:
14 | !
15 | ! ROW LOGICAL
16 | ! .TRUE.: scale row
17 | ! .FALSE.: scale column
18 | !
19 | ! D REAL(8) array of dimension (2)
20 | ! array of generators for complex diagonal matrix
21 | ! in the upper-triangular factor
22 | !
23 | ! C REAL(8) array of dimension (3)
24 | ! first array of generators for upper-triangular part
25 | !
26 | ! B REAL(8) array of dimension (3)
27 | ! second array of generators for upper-triangular part
28 | !
29 | ! SCL COMPLEX(8)
30 | ! scalar, assumed unimodular
31 | !
32 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33 | subroutine z_upr1utri_unimodscale(ROW,D,C,B,SCL)
34 |
35 | implicit none
36 |
37 | ! input variables
38 | logical, intent(in) :: ROW
39 | real(8), intent(inout) :: D(2), C(3), B(3)
40 | complex(8), intent(in) :: SCL
41 |
42 | ! compute variables
43 | real(8) :: nrm
44 | complex(8) :: temp
45 |
46 | ! update D regardless of row or column
47 | temp = SCL*cmplx(D(1),D(2),kind=8)
48 | call d_rot2_vec2gen(dble(temp),aimag(temp),D(1),D(2),nrm)
49 |
50 | ! update B and C
51 | if (.NOT.ROW) then
52 |
53 | ! update B
54 | temp = SCL*cmplx(B(1),B(2),kind=8)
55 | call z_rot3_vec3gen(dble(temp),aimag(temp),B(3),B(1),B(2),B(3),nrm)
56 |
57 | ! update C
58 | temp = conjg(SCL)*cmplx(C(1),C(2),kind=8)
59 | call z_rot3_vec3gen(dble(temp),aimag(temp),C(3),C(1),C(2),C(3),nrm)
60 |
61 | end if
62 |
63 | end subroutine z_upr1utri_unimodscale
64 |
--------------------------------------------------------------------------------
/src/fnft_errwarn.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include
23 | #include
24 | #include "fnft_errwarn.h"
25 | #include "fnft_config.h"
26 |
27 | // Default printf function, prints to stderr
28 | INT fnft__default_printf(const char * format, ...)
29 | {
30 | INT ret_code;
31 |
32 | va_list args;
33 | va_start(args, format);
34 | ret_code = vfprintf(stderr, format, args);
35 | va_end(args);
36 |
37 | return ret_code;
38 | }
39 |
40 | // Pointer to printf functions used for error messages and warnings. Set to
41 | // NULL to disable those. Make thread local if possible.
42 | static
43 | #ifdef HAVE__THREAD_LOCAL
44 | _Thread_local
45 | #else
46 | #ifdef HAVE___THREAD
47 | __thread
48 | #endif
49 | #endif
50 | fnft_printf_ptr_t fnft__printf_ptr = fnft__default_printf;
51 |
52 | void fnft_errwarn_setprintf(fnft_printf_ptr_t printf_ptr)
53 | {
54 | fnft__printf_ptr = printf_ptr;
55 | }
56 |
57 | fnft_printf_ptr_t fnft_errwarn_getprintf()
58 | {
59 | return fnft__printf_ptr;
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/src/fnft_version.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft_version.h"
23 | #include "fnft__errwarn.h"
24 | #include
25 |
26 | INT fnft_version(UINT * const major,
27 | UINT * const minor,
28 | UINT * const patch,
29 | char suffix[FNFT_VERSION_SUFFIX_MAXLEN+1])
30 | {
31 | if (major == NULL || minor == NULL || patch == NULL)
32 | return E_INVALID_ARGUMENT(NULL pointer passed.);
33 | *major = FNFT_VERSION_MAJOR;
34 | *minor = FNFT_VERSION_MINOR;
35 | *patch = FNFT_VERSION_PATCH;
36 | #pragma GCC diagnostic push
37 | #pragma GCC diagnostic ignored "-Wformat-zero-length"
38 | int rc = snprintf(suffix, FNFT_VERSION_SUFFIX_MAXLEN+1,FNFT_VERSION_SUFFIX);
39 | #pragma GCC diagnostic pop
40 | if (rc < 0)
41 | return E_ASSERTION_FAILED; // snprintf encoding error
42 | if (rc > FNFT_VERSION_SUFFIX_MAXLEN)
43 | return E_ASSERTION_FAILED; // suffix in fnft_config.h is too long!
44 | return SUCCESS;
45 | }
46 |
--------------------------------------------------------------------------------
/src/private/fnft__errwarn.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include
23 | #include
24 | #include "fnft_errwarn.h"
25 | #include "fnft__errwarn.h"
26 | #include "fnft_config.h"
27 |
28 | INT fnft__errmsg_aux(const INT ec, const char *func, const INT line,
29 | const char *msg)
30 | {
31 | fnft_printf_ptr_t printf_ptr = fnft_errwarn_getprintf();
32 | if (printf_ptr != NULL)
33 | printf_ptr("FNFT Error: %s\n in %s(%i)-%d.%d.%d%s\n", msg, func, line,
34 | FNFT_VERSION_MAJOR, FNFT_VERSION_MINOR, FNFT_VERSION_PATCH,
35 | FNFT_VERSION_SUFFIX);
36 | return ec;
37 | }
38 |
39 | void fnft__warn_aux(const char *func, const INT line, const char *msg)
40 | {
41 | fnft_printf_ptr_t printf_ptr = fnft_errwarn_getprintf();
42 | if (printf_ptr != NULL)
43 | printf_ptr("FNFT Warning: %s\n in %s(%i)-%d.%d.%d%s\n", msg, func, line,
44 | FNFT_VERSION_MAJOR, FNFT_VERSION_MINOR, FNFT_VERSION_PATCH,
45 | FNFT_VERSION_SUFFIX);
46 | }
47 |
--------------------------------------------------------------------------------
/src/private/fnft__kdv_finvscatter.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2020.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 | #include "fnft__kdv_finvscatter.h"
22 |
23 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R(R) (-eps_t)
24 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R_PREFIX(s) fnft_kdv_##s
25 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R__PREFIX(s) fnft__kdv_##s
26 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R_RETURN_R_INSTEAD_OF_Q
27 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R_TRANSPOSE_TF_MATRIX
28 |
29 | #include "fnft__akns_finvscatter_q_from_r.inc"
30 |
31 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R
32 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R_PREFIX
33 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R__PREFIX
34 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R_RETURN_R_INSTEAD_OF_Q
35 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R_TRANSPOSE_TF_MATRIX
36 |
--------------------------------------------------------------------------------
/src/private/fnft__nse_finvscatter.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2020.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 | #include "fnft__nse_finvscatter.h"
22 |
23 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R(R) (-kappa*CONJ(R))
24 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R_PREFIX(s) fnft_nse_##s
25 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R__PREFIX(s) fnft__nse_##s
26 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R_HAS_KAPPA
27 | #define FNFT__AKNS_FINVSCATTER_Q_FROM_R_HAS_MODAL
28 |
29 | #include "fnft__akns_finvscatter_q_from_r.inc"
30 |
31 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R
32 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R_PREFIX
33 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R__PREFIX
34 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R_HAS_KAPPA
35 | #undef FNFT__AKNS_FINVSCATTER_Q_FROM_R_HAS_MODAL
36 |
--------------------------------------------------------------------------------
/src/private/fnft__poly_roots_fasteigen.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2020.
18 | */
19 | #define FNFT_ENABLE_SHORT_NAMES
20 |
21 | #include "fnft__errwarn.h"
22 | #include "fnft__poly_roots_fasteigen.h"
23 |
24 | // Interface to the EISCOR root finding routine
25 | extern INT z_poly_roots_modified_(INT *N, double complex const * const coeffs,
26 | double complex * const roots, INT *info);
27 |
28 | // Fast computation of polynomial roots. See the header file for details.
29 | INT poly_roots_fasteigen(const UINT deg,
30 | COMPLEX const * const p, COMPLEX * const roots)
31 | {
32 | INT int_deg, info;
33 |
34 | // Check inputs
35 | if (p == NULL)
36 | return E_INVALID_ARGUMENT(p);
37 | if (roots == NULL)
38 | return E_INVALID_ARGUMENT(roots);
39 |
40 | // Call Fortran root finding routine
41 | int_deg = (int)deg;
42 | z_poly_roots_modified_(&int_deg, p, roots, &info);
43 |
44 | if (info == 0)
45 | return SUCCESS;
46 | else
47 | return E_SUBROUTINE(FNFT_EC_OTHER);
48 | }
49 |
--------------------------------------------------------------------------------
/test/fnft__kdv_finvscatter/fnft__kdv_finvscatter_test_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018, 2020.
18 | */
19 |
20 | #include "fnft__kdv_finvscatter_test.inc"
21 |
22 | int main(void) {
23 | const kdv_discretization_t discretization = kdv_discretization_2SPLIT2_MODAL;
24 |
25 | UINT D = 8;
26 | REAL error_bound = 5.0*FNFT_EPSILON;
27 | printf("error bound = %e\n",error_bound);
28 | if (kdv_finvscatter_test(D, error_bound, discretization) != SUCCESS)
29 | return EXIT_FAILURE;
30 |
31 | D = 16384;
32 | error_bound =
33 | #ifdef HAVE_FFTW3
34 | 5.8e6*FNFT_EPSILON; // Was 5.6, error slightly higher on some machines
35 | #else
36 | 1.1e7*FNFT_EPSILON; // Was 9.1e6, error slightly higher on some machines
37 | #endif
38 | printf("error bound = %e\n",error_bound);
39 | if (kdv_finvscatter_test(D, error_bound, discretization) != SUCCESS)
40 | return EXIT_FAILURE;
41 |
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/test/fnft__kdv_finvscatter/fnft__kdv_finvscatter_test_2split2a.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018, 2020.
18 | */
19 |
20 | #include "fnft__kdv_finvscatter_test.inc"
21 |
22 | int main(void) {
23 | const kdv_discretization_t discretization = kdv_discretization_2SPLIT2A;
24 |
25 | UINT D = 8;
26 | REAL error_bound = 1.8e12*FNFT_EPSILON;
27 | if (kdv_finvscatter_test(D, error_bound, discretization) != SUCCESS)
28 | return EXIT_FAILURE;
29 |
30 | D = 16384;
31 | error_bound = 4e9*FNFT_EPSILON;
32 | if (kdv_finvscatter_test(D, error_bound, discretization) != SUCCESS)
33 | return EXIT_FAILURE;
34 |
35 | return EXIT_SUCCESS;
36 | }
37 |
--------------------------------------------------------------------------------
/test/fnft__nse_finvscatter/fnft__nse_finvscatter_test_defocusing_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018, 2020.
18 | */
19 |
20 | #include "fnft__nse_finvscatter_test.inc"
21 |
22 | int main()
23 | {
24 | const INT kappa = -1;
25 | const nse_discretization_t discretization
26 | = fnft_nse_discretization_2SPLIT2A;
27 |
28 | UINT D = 8;
29 | REAL error_bound = 4e11*FNFT_EPSILON;
30 |
31 | if (nse_finvscatter_test(D, kappa, error_bound, discretization) != SUCCESS)
32 | return EXIT_FAILURE;
33 |
34 | D = 16384;
35 | error_bound = 81065.0*FNFT_EPSILON;
36 |
37 | if (nse_finvscatter_test(D, kappa, error_bound, discretization) != SUCCESS)
38 | return EXIT_FAILURE;
39 |
40 | return EXIT_SUCCESS;
41 | }
42 |
--------------------------------------------------------------------------------
/test/fnft__nse_finvscatter/fnft__nse_finvscatter_test_defocusing_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018, 2020, 2022.
18 | */
19 |
20 | #include "fnft__nse_finvscatter_test.inc"
21 |
22 | int main()
23 | {
24 | const INT kappa = -1;
25 | const nse_discretization_t discretization
26 | = fnft_nse_discretization_2SPLIT2_MODAL;
27 |
28 | UINT D = 8;
29 | REAL error_bound = 5.0*FNFT_EPSILON;
30 | if (nse_finvscatter_test(D, kappa, error_bound, discretization) != SUCCESS)
31 | return EXIT_FAILURE;
32 |
33 | D = 16384;
34 | error_bound
35 | #ifdef HAVE_FFTW3
36 | = 520.0*FNFT_EPSILON;
37 | #else
38 | = 1253.0*FNFT_EPSILON;
39 | #endif
40 | if (nse_finvscatter_test(D, kappa, error_bound, discretization) != SUCCESS)
41 | return EXIT_FAILURE;
42 |
43 | return EXIT_SUCCESS;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft__nse_finvscatter/fnft__nse_finvscatter_test_focusing_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018, 2020.
18 | */
19 |
20 | #include "fnft__nse_finvscatter_test.inc"
21 |
22 | int main()
23 | {
24 | const INT kappa = +1;
25 | const nse_discretization_t discretization
26 | = fnft_nse_discretization_2SPLIT2A;
27 |
28 | UINT D = 8;
29 | REAL error_bound = 10*FNFT_EPSILON;
30 | if (nse_finvscatter_test(D, kappa, error_bound, discretization) != SUCCESS)
31 | return EXIT_FAILURE;
32 |
33 | D = 16384;
34 | error_bound
35 | #ifdef HAVE_FFTW3
36 | = 200.0*FNFT_EPSILON;
37 | #else
38 | = 1262.0*FNFT_EPSILON;
39 | #endif
40 | if (nse_finvscatter_test(D, kappa, error_bound, discretization) != SUCCESS)
41 | return EXIT_FAILURE;
42 |
43 | return EXIT_SUCCESS;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft__nse_finvscatter/fnft__nse_finvscatter_test_focusing_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018, 2020, 2022.
18 | */
19 |
20 | #include "fnft__nse_finvscatter_test.inc"
21 |
22 | int main()
23 | {
24 | const INT kappa = +1;
25 | const nse_discretization_t discretization
26 | = fnft_nse_discretization_2SPLIT2_MODAL;
27 |
28 | UINT D = 4;
29 | REAL error_bound = 2.0*FNFT_EPSILON;
30 | if (nse_finvscatter_test(D, kappa, error_bound, discretization) != SUCCESS)
31 | return EXIT_FAILURE;
32 |
33 | D = 16384;
34 | error_bound
35 | #ifdef HAVE_FFTW3
36 | = 177.0*FNFT_EPSILON;
37 | #else
38 | = 1150.0*FNFT_EPSILON;
39 | #endif
40 | if (nse_finvscatter_test(D, kappa, error_bound, discretization) != SUCCESS)
41 | return EXIT_FAILURE;
42 |
43 | return EXIT_SUCCESS;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft__poly/fnft__poly_roots_fasteigen_test.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | */
19 | #define FNFT_ENABLE_SHORT_NAMES
20 |
21 | #include "fnft__poly_roots_fasteigen.h"
22 | #include "fnft__misc.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT poly_roots_fasteigen_test()
26 | {
27 | const UINT deg = 3;
28 | COMPLEX p[4] = { 1.0-2.0*I, 0.3+0.4*I, -2.0-2.0*I, -3.0+4.0*I };
29 | COMPLEX roots[3];
30 | COMPLEX roots_exact[3] = { \
31 | -0.767344914566607 - 1.47758771489852*I, \
32 | 1.26733490516498 + 0.334189743482641*I, \
33 | -0.399989990598367 + 0.943397971415882*I };
34 | INT ret_code;
35 |
36 | ret_code = poly_roots_fasteigen(deg, p, roots);
37 | if (ret_code != SUCCESS)
38 | return E_SUBROUTINE(ret_code);
39 | if (!(misc_hausdorff_dist(deg, roots, deg, roots_exact) <= 100*EPSILON))
40 | return E_TEST_FAILED;
41 |
42 | return SUCCESS;
43 | }
44 |
45 | INT main()
46 | {
47 | if ( poly_roots_fasteigen_test() != SUCCESS )
48 | return EXIT_FAILURE;
49 |
50 | return EXIT_SUCCESS;
51 | }
52 |
--------------------------------------------------------------------------------
/test/fnft_kdvv/fnft_kdvv_test_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Peter J Prins (TU Delft) 2020.
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__kdvv_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_kdvv_opts_t opts = fnft_kdvv_default_opts();
29 | opts.grid_spacing = 0.01;
30 | opts.discretization = kdv_discretization_2SPLIT2_MODAL;
31 |
32 | // Test smooth potential
33 | kdvv_testcases_t tc = kdvv_testcases_SECH_SQUARED;
34 | UINT D = 256;
35 | REAL eb[6] = { // error bounds
36 | 4.2e-2, // continuous spectrum
37 | 1.5e-1, // a(xi)
38 | 2.3e-3, // b(xi)
39 | 1.3e-3, // bound states
40 | 2.1e-2, // norming constants
41 | 2.0e-2 // residues
42 | };
43 |
44 | ret_code = kdvv_testcases_test_fnft(tc, D, eb, &opts);
45 | CHECK_RETCODE(ret_code, leave_fun);
46 |
47 | // check for quadratic error decay
48 | for (UINT n=0; n<3; n++){
49 | D *= 2;
50 | for (UINT i=0; i<6; i++)
51 | eb[i] /= 4.0;
52 | ret_code = kdvv_testcases_test_fnft(tc, D, eb, &opts);
53 | CHECK_RETCODE(ret_code, leave_fun);
54 | }
55 |
56 | leave_fun:
57 | if (ret_code != SUCCESS)
58 | return EXIT_FAILURE;
59 | else
60 | return EXIT_SUCCESS;
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/test/fnft_kdvv/fnft_kdvv_test_2split2_modal_vanilla.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Peter J Prins (TU Delft) 2020.
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__kdvv_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_kdvv_opts_t opts = fnft_kdvv_default_opts();
29 | opts.grid_spacing = 0.01;
30 | const kdvv_testcases_t tc = kdvv_testcases_SECH_SQUARED_LOW_BANDWIDTH;
31 | opts.discretization = kdv_discretization_2SPLIT2_MODAL_VANILLA;
32 | UINT D = 1024;
33 | REAL eb[6] = { // error bounds
34 | 3.8e-2, // continuous spectrum
35 | 4.6e-3, // a(xi)
36 | 9.6e-3, // b(xi)
37 | 7.8e-5, // bound states
38 | 1.3e-3, // norming constants
39 | 1.3e-3 // residues
40 | };
41 |
42 | ret_code = kdvv_testcases_test_fnft(tc, D, eb, &opts);
43 | CHECK_RETCODE(ret_code, leave_fun);
44 |
45 | leave_fun:
46 | if (ret_code != SUCCESS)
47 | return EXIT_FAILURE;
48 | else
49 | return EXIT_SUCCESS;
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/test/fnft_kdvv/fnft_kdvv_test_4split4A_vanilla.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | * Peter J Prins (TU Delft) 2020.
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__kdvv_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_kdvv_opts_t opts = fnft_kdvv_default_opts();
29 | opts.grid_spacing = 0.01;
30 | const kdvv_testcases_t tc = kdvv_testcases_SECH_SQUARED_LOW_BANDWIDTH;
31 | opts.discretization = kdv_discretization_4SPLIT4A_VANILLA;
32 | UINT D = 256;
33 | REAL eb[6] = { // error bounds
34 | 3.8e-4, // continuous spectrum
35 | 5.7e-5, // a(xi)
36 | 1.1e-4, // b(xi)
37 | 1.5e-6, // bound states
38 | 6.5e-6, // norming constants
39 | 5.9e-6 // residues
40 | };
41 |
42 | ret_code = kdvv_testcases_test_fnft(tc, D, eb, &opts);
43 | CHECK_RETCODE(ret_code, leave_fun);
44 |
45 | ret_code = kdvv_testcases_test_fnft(tc, D+1, eb, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 |
48 | ret_code = kdvv_testcases_test_fnft(tc, D-1, eb, &opts);
49 | CHECK_RETCODE(ret_code, leave_fun);
50 |
51 | leave_fun:
52 | if (ret_code != SUCCESS)
53 | return EXIT_FAILURE;
54 | else
55 | return EXIT_SUCCESS;
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/test/fnft_kdvv/fnft_kdvv_test_4split4B_vanilla.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | * Peter J Prins (TU Delft) 2020.
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__kdvv_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_kdvv_opts_t opts = fnft_kdvv_default_opts();
29 | opts.grid_spacing = 0.01;
30 | const kdvv_testcases_t tc = kdvv_testcases_SECH_SQUARED_LOW_BANDWIDTH;
31 | opts.discretization = kdv_discretization_4SPLIT4B_VANILLA;
32 | UINT D = 256;
33 | REAL eb[6] = { // error bounds
34 | 4.3e-4, // continuous spectrum
35 | 1.3e-4, // a(xi)
36 | 1.3e-4, // b(xi)
37 | 1.5e-6, // bound states
38 | 6.5e-6, // norming constants
39 | 5.9e-6 // residues
40 | };
41 |
42 | ret_code = kdvv_testcases_test_fnft(tc, D, eb, &opts);
43 | CHECK_RETCODE(ret_code, leave_fun);
44 |
45 | ret_code = kdvv_testcases_test_fnft(tc, D+1, eb, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 |
48 | ret_code = kdvv_testcases_test_fnft(tc, D-1, eb, &opts);
49 | CHECK_RETCODE(ret_code, leave_fun);
50 |
51 | leave_fun:
52 | if (ret_code != SUCCESS)
53 | return EXIT_FAILURE;
54 | else
55 | return EXIT_SUCCESS;
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_manakov_testcases_test_fnft.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include
24 | #include "fnft__manakovv_testcases.h"
25 | #include "fnft_manakovv.h"
26 |
27 | INT main(){
28 |
29 | manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
30 | UINT D = 16;
31 | REAL error_bounds[7] = {200, 200, 200, 200, 200, 200, 200};
32 | fnft_manakovv_opts_t opts = fnft_manakovv_default_opts();
33 | INT ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
34 | if (ret_code == SUCCESS)
35 | return EXIT_SUCCESS;
36 | else
37 | return EXIT_FAILURE;
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_rectangle_focusing_2split4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 1024;
31 | const manakovv_testcases_t tc = manakovv_testcases_RECTANGLE_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 1.1e-1, // reflection coefficient 1
34 | 1.1e-1, // reflection coefficient 2
35 | 4.7e-2, // a
36 | 1.4e-2, // b1
37 | 1.4e-2 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT4A;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_2split3A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 6.5e-4, // reflection coefficient 1
34 | 6.5e-4, // reflection coefficient 2
35 | 7.0e-4, // a
36 | 6.3e-4, // b1
37 | 6.3e-4 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT3A;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_2split3A_no_power_of_two.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 6.5e-4, // reflection coefficient 1
34 | 6.5e-4, // reflection coefficient 2
35 | 7.0e-4, // a
36 | 6.3e-4, // b1
37 | 6.3e-4 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT3A;
42 |
43 | // Check the case where D is not a power of two. The error bounds have to
44 | // be tight but not too tight for this to make sense!
45 | ret_code = manakovv_testcases_test_fnft(tc, D+1, error_bounds, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 | ret_code = manakovv_testcases_test_fnft(tc, D-1, error_bounds, &opts);
48 | CHECK_RETCODE(ret_code, leave_fun);
49 |
50 | leave_fun:
51 | if (ret_code != SUCCESS)
52 | return EXIT_FAILURE;
53 | else
54 | return EXIT_SUCCESS;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_2split3B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 8.1e-4, // reflection coefficient 1
34 | 8.1e-4, // reflection coefficient 2
35 | 7.0e-4, // a
36 | 6.2e-4, // b1
37 | 6.2e-4 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT3B;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_2split4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 7.5e-4, // reflection coefficient 1
34 | 7.5e-4, // reflection coefficient 2
35 | 3.1e-4, // a
36 | 1.3e-4, // b1
37 | 1.3e-4 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT4A;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_2split6B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 7.4e-4, // reflection coefficient 1
34 | 7.4e-4, // reflection coefficient 2
35 | 2.9e-4, // a
36 | 5.9e-5, // b1
37 | 5.9e-5 // b2 TODO: determine suitable bound
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT6B;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_4split4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 7.1e-7, // reflection coefficient 1
34 | 7.1e-7, // reflection coefficient 2
35 | 4.6e-6, // a
36 | 4.6e-6, // b1
37 | 4.6e-6 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_4SPLIT4A;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_4split4A_richardson.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 7.1e-7, // reflection coefficient 1
34 | 7.1e-7, // reflection coefficient 2
35 | 4.6e-6, // a
36 | 4.6e-6, // b1
37 | 4.6e-6 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_4SPLIT4A;
42 |
43 | // to make sure that Richardson actually helps, the bounds
44 | // are from the no Richardson case
45 | for (INT i=0; i<5; i++)
46 | error_bounds[i] /= 2;
47 |
48 | // with Richardson extrapolation
49 | opts.richardson_extrapolation_flag = 1;
50 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
51 | CHECK_RETCODE(ret_code, leave_fun);
52 |
53 | leave_fun:
54 | if (ret_code != SUCCESS)
55 | return EXIT_FAILURE;
56 | else
57 | return EXIT_SUCCESS;
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_4split4B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 8.6e-7, // reflection coefficient 1
34 | 8.6e-7, // reflection coefficient 2
35 | 1.6e-6, // a
36 | 1.6e-6, // b1
37 | 1.6e-6 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_4SPLIT4B;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_defocusing_4split6B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[5] = {
33 | 1.9e-5, // reflection coefficient 1
34 | 1.9e-5, // reflection coefficient 2
35 | 1.0e-6, // a
36 | 2.0e-6, // b1
37 | 2.0e-6 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_4SPLIT6B;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 |
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_2split3A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 3.5e-4, // reflection coefficient 1
34 | 3.5e-4, // reflection coefficient 2
35 | 4.4e-3, // a
36 | 5.9e-4, // b1
37 | 5.9e-4 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT3A;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_2split3A_no_power_of_two.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 3.5e-4, // reflection coefficient 1
34 | 3.5e-4, // reflection coefficient 2
35 | 4.4e-3, // a
36 | 5.9e-4, // b1
37 | 5.9e-4 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT3A;
42 |
43 | // Check the case where D is not a power of two. The error bounds have to
44 | // be tight but not too tight for this to make sense!
45 | ret_code = manakovv_testcases_test_fnft(tc, D+1, error_bounds, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 | ret_code = manakovv_testcases_test_fnft(tc, D-1, error_bounds, &opts);
48 | CHECK_RETCODE(ret_code, leave_fun);
49 |
50 | leave_fun:
51 | if (ret_code != SUCCESS)
52 | return EXIT_FAILURE;
53 | else
54 | return EXIT_SUCCESS;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_2split3B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 3.8e-4, // reflection coefficient 1
34 | 3.8e-4, // reflection coefficient 2
35 | 4.4e-3, // a
36 | 5.9e-4, // b1
37 | 5.9e-4 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT3B;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_2split4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 2.2e-4, // reflection coefficient 1
34 | 2.2e-4, // reflection coefficient 2
35 | 3.2e-4, // a
36 | 1.7e-4, // b1
37 | 1.7e-4 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT4A;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_2split4B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 2.3e-4, // reflection coefficient 1
34 | 2.3e-4, // reflection coefficient 2
35 | 3.7e-4, // a
36 | 9.7e-5, // b1
37 | 9.7e-5 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT4B;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_2split6B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 2.4e-4, // reflection coefficient 1
34 | 2.4e-4, // reflection coefficient 2
35 | 5.8e-4, // a
36 | 5.4e-5, // b1
37 | 5.4e-5 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_2SPLIT6B;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_4split4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 6.2e-6, // reflection coefficient 1
34 | 6.2e-6, // reflection coefficient 2
35 | 3.2e-5, // a
36 | 5.7e-6, // b1
37 | 5.7e-6 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_4SPLIT4A;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_4split4A_richardson.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 6.2e-6, // reflection coefficient 1
34 | 6.2e-6, // reflection coefficient 2
35 | 3.2e-5, // a
36 | 5.7e-6, // b1
37 | 5.7e-6 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_4SPLIT4A;
42 |
43 | // To ensure that Richardson actually helps, the bounds above are
44 | // from the no Richardson case.
45 | for (INT i=0; i<5; i++)
46 | error_bounds[i] /= 2;
47 |
48 | // with Richardson extrapolation
49 | opts.richardson_extrapolation_flag = 1;
50 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
51 | CHECK_RETCODE(ret_code, leave_fun);
52 |
53 | leave_fun:
54 | if (ret_code != SUCCESS)
55 | return EXIT_FAILURE;
56 | else
57 | return EXIT_SUCCESS;
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_4split4B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 2.8e-6, // reflection coefficient 1
34 | 2.8e-6, // reflection coefficient 2
35 | 1.7e-5, // a
36 | 2.5e-6, // b1
37 | 2.5e-6 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_4SPLIT4B;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_4split6B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__manakovv_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_manakovv_opts_t opts;
29 | UINT D = 512;
30 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
31 | REAL error_bounds[5] = {
32 | 3.9e-4, // reflection coefficient 1
33 | 3.9e-4, // reflection coefficient 2
34 | 6.7e-4, // a
35 | 2.4e-4, // b1
36 | 2.4e-4 // b2
37 | };
38 |
39 | opts = fnft_manakovv_default_opts();
40 | opts.discretization = manakov_discretization_4SPLIT6B;
41 |
42 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
43 | CHECK_RETCODE(ret_code, leave_fun);
44 |
45 | leave_fun:
46 | if (ret_code != SUCCESS)
47 | return EXIT_FAILURE;
48 | else
49 | return EXIT_SUCCESS;
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_BO.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021.
18 | */
19 | #define FNFT_ENABLE_SHORT_NAMES
20 |
21 | #include "fnft__manakovv_testcases.h"
22 | #include "fnft__errwarn.h"
23 |
24 | INT main()
25 | {
26 | INT ret_code;
27 | fnft_manakovv_opts_t opts;
28 | UINT D = 512;
29 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
30 | REAL error_bounds[5] = {
31 | 2.3e-4, // reflection coefficient 1
32 | 2.3e-4, // reflection coefficient 2
33 | 5.7e-4, // a
34 | 5.4e-5, // b1
35 | 5.4e-5 // b2
36 | };
37 |
38 | opts = fnft_manakovv_default_opts();
39 | opts.discretization = manakov_discretization_BO;
40 |
41 |
42 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
43 | CHECK_RETCODE(ret_code, leave_fun);
44 |
45 | // Check the case where D is not a power of two. The error bounds have to
46 | // be tight but not too tight for this to make sense!
47 | ret_code = manakovv_testcases_test_fnft(tc, D+1, error_bounds, &opts);
48 | CHECK_RETCODE(ret_code, leave_fun);
49 | ret_code = manakovv_testcases_test_fnft(tc, D-1, error_bounds, &opts);
50 | CHECK_RETCODE(ret_code, leave_fun);
51 |
52 | leave_fun:
53 | if (ret_code != SUCCESS)
54 | return EXIT_FAILURE;
55 | else
56 | return EXIT_SUCCESS;
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_FTES4_4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__manakovv_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_manakovv_opts_t opts;
29 | UINT D = 1024;
30 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
31 | REAL error_bounds[5] = {
32 | 2.2e-4, // reflection coefficient 1
33 | 2.2e-4, // reflection coefficient 2
34 | 3.2e-4, // a
35 | 1.7e-4, // b1
36 | 1.7e-4 // b2
37 | };
38 |
39 | opts = fnft_manakovv_default_opts();
40 | opts.discretization = manakov_discretization_FTES4_4A;
41 |
42 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
43 | CHECK_RETCODE(ret_code, leave_fun);
44 |
45 | leave_fun:
46 | if (ret_code != SUCCESS)
47 | return EXIT_FAILURE;
48 | else
49 | return EXIT_SUCCESS;
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/test/fnft_manakovv/fnft_manakovv_test_sech_focusing_FTES4_suzuki.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributor:
17 | * Lianne de Vries (TU Delft student) 2021
18 | * Sander Wahls (TU Delft) 2021
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__manakovv_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code;
29 | fnft_manakovv_opts_t opts;
30 | UINT D = 512;
31 | const manakovv_testcases_t tc = manakovv_testcases_SECH_FOCUSING;
32 | REAL error_bounds[5] = {
33 | 6.2e-6, // reflection coefficient 1
34 | 6.2e-6, // reflection coefficient 2
35 | 3.2e-5, // a
36 | 5.7e-6, // b1
37 | 5.7e-6 // b2
38 | };
39 |
40 | opts = fnft_manakovv_default_opts();
41 | opts.discretization = manakov_discretization_FTES4_suzuki;
42 |
43 | ret_code = manakovv_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | leave_fun:
47 | if (ret_code != SUCCESS)
48 | return EXIT_FAILURE;
49 | else
50 | return EXIT_SUCCESS;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_adaptable_subsampling_factor.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_nsev_opts_t opts;
29 | UINT D = 2048;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_FOCUSING;
31 | REAL error_bounds[6] = {
32 | FNFT_INF, // reflection coefficient
33 | FNFT_INF, // a
34 | FNFT_INF, // b
35 | 4.01e-2, // bound states
36 | FNFT_INF, // norming constants
37 | FNFT_INF // residues
38 | };
39 |
40 | opts = fnft_nsev_default_opts();
41 | opts.discretization = nse_discretization_2SPLIT2A;
42 | opts.Dsub = D/4;
43 | opts.niter = 0; // no refinement
44 |
45 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 |
48 | // Check for quadratic error decay
49 | opts.Dsub = D/2;
50 | error_bounds[3] /= 4.0;
51 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
52 | CHECK_RETCODE(ret_code, leave_fun);
53 |
54 | leave_fun:
55 | if (ret_code != SUCCESS)
56 | return EXIT_FAILURE;
57 | else
58 | return EXIT_SUCCESS;
59 | }
60 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_nonregression_1.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | * Shrinivas Chimmalgi (TU Delft) 2017-2018.
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_nsev_opts_t opts;
29 | UINT D = 126;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_FOCUSING;
31 | // The error bounds do not matter. This code used to segfault due to a bug
32 | // in line 426 of fnft_nsev.c ("<=" should have been ">=").
33 | REAL error_bounds[6] = {
34 | INFINITY, // reflection coefficient
35 | INFINITY, // a
36 | INFINITY, // b
37 | INFINITY, // bound states
38 | INFINITY, // norming constants
39 | INFINITY // residues
40 | };
41 |
42 | opts = fnft_nsev_default_opts();
43 | opts.discretization = nse_discretization_2SPLIT4B;
44 |
45 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 |
48 | leave_fun:
49 | if (ret_code != SUCCESS)
50 | return EXIT_FAILURE;
51 | else
52 | return EXIT_SUCCESS;
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_nonregression_2.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Shrinivas Chimmalgi (TU Delft) 2020.
18 | */
19 | #define FNFT_ENABLE_SHORT_NAMES
20 |
21 | #include "fnft__nsev_testcases.h"
22 | #include "fnft__errwarn.h"
23 |
24 | INT main()
25 | {
26 | INT ret_code;
27 | fnft_nsev_opts_t opts;
28 | UINT D = 126;
29 | const nsev_testcases_t tc = nsev_testcases_SECH_FOCUSING_CONTSPEC;
30 | // The error bounds do not matter. This code used to throw
31 | // "Invalid argument opts->bound_state_localization, in fnft_nsev(214)-0.4.1."
32 | // error for FNFT 0.4.1
33 | REAL error_bounds[6] = {
34 | INFINITY, // reflection coefficient
35 | INFINITY, // a
36 | INFINITY, // b
37 | INFINITY, // bound states
38 | INFINITY, // norming constants
39 | INFINITY // residues
40 | };
41 |
42 | opts = fnft_nsev_default_opts();
43 | opts.discretization = nse_discretization_BO;
44 |
45 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 |
48 | leave_fun:
49 | if (ret_code != SUCCESS)
50 | return EXIT_FAILURE;
51 | else
52 | return EXIT_SUCCESS;
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_defocusing_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code, i;
28 | fnft_nsev_opts_t opts;
29 | const nsev_testcases_t tc = nsev_testcases_SECH_DEFOCUSING;
30 | UINT D = 4096;
31 | REAL error_bounds[6] = {
32 | 2.2e-4, // reflection coefficient
33 | INFINITY, // a
34 | INFINITY, // b
35 | 0.0, // bound states
36 | 0.0, // norming constants
37 | 0.0 // residues
38 | };
39 |
40 | opts = fnft_nsev_default_opts();
41 | opts.discretization = nse_discretization_2SPLIT2A;
42 |
43 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | // Check for quadratic error decay
47 | D *= 2;
48 | for (i=0; i<6; i++)
49 | error_bounds[i] /= 4.0;
50 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
51 | CHECK_RETCODE(ret_code, leave_fun);
52 |
53 | leave_fun:
54 | if (ret_code != SUCCESS)
55 | return EXIT_FAILURE;
56 | else
57 | return EXIT_SUCCESS;
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_defocusing_2split2A_no_power_of_two.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_nsev_opts_t opts;
29 | const nsev_testcases_t tc = nsev_testcases_SECH_DEFOCUSING;
30 | UINT D = 4096;
31 | REAL error_bounds[6] = {
32 | 2.2e-4, // reflection coefficient
33 | INFINITY, // a
34 | INFINITY, // b
35 | 0.0, // bound states
36 | 0.0, // norming constants
37 | 0.0 // residues
38 | };
39 |
40 | opts = fnft_nsev_default_opts();
41 | opts.discretization = nse_discretization_2SPLIT2A;
42 |
43 | // Check the case where D is not a power of two. The error bounds have to
44 | // be tight but not too tight for this to make sense!
45 | ret_code = nsev_testcases_test_fnft(tc, D+1, error_bounds, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 | ret_code = nsev_testcases_test_fnft(tc, D-1, error_bounds, &opts);
48 | CHECK_RETCODE(ret_code, leave_fun);
49 |
50 | leave_fun:
51 | if (ret_code != SUCCESS)
52 | return EXIT_FAILURE;
53 | else
54 | return EXIT_SUCCESS;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_defocusing_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code, i;
28 | fnft_nsev_opts_t opts;
29 | const nsev_testcases_t tc = nsev_testcases_SECH_DEFOCUSING;
30 | UINT D = 4096;
31 | REAL error_bounds[6] = {
32 | 1.2e-4, // reflection coefficient
33 | INFINITY, // a
34 | INFINITY, // b
35 | 0.0, // bound states
36 | 0.0, // norming constants
37 | 0.0 // residues
38 | };
39 |
40 |
41 | opts = fnft_nsev_default_opts();
42 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
43 |
44 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
45 | CHECK_RETCODE(ret_code, leave_fun);
46 |
47 | // Check for quadratic error decay
48 | D *= 2;
49 | for (i=0; i<6; i++)
50 | error_bounds[i] /= 4.0;
51 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
52 | CHECK_RETCODE(ret_code, leave_fun);
53 |
54 | leave_fun:
55 | if (ret_code != SUCCESS)
56 | return EXIT_FAILURE;
57 | else
58 | return EXIT_SUCCESS;
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_defocusing_2split4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Shrinivas Chimmalgi (TU Delft) 2017-2018.
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__nsev_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code, i;
29 | fnft_nsev_opts_t opts;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_DEFOCUSING;
31 | UINT D = 4096;
32 | REAL error_bounds[6] = {
33 | 1.3e-4, // reflection coefficient
34 | INFINITY, // a
35 | INFINITY, // b
36 | 0.0, // bound states
37 | 0.0, // norming constants
38 | 0.0 // residues
39 | };
40 |
41 | opts = fnft_nsev_default_opts();
42 | opts.discretization = nse_discretization_2SPLIT4A;
43 |
44 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
45 | CHECK_RETCODE(ret_code, leave_fun);
46 |
47 | // Check for quadratic error decay
48 | D *= 2;
49 | for (i=0; i<6; i++)
50 | error_bounds[i] /= 4.0;
51 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
52 | CHECK_RETCODE(ret_code, leave_fun);
53 |
54 | leave_fun:
55 | if (ret_code != SUCCESS)
56 | return EXIT_FAILURE;
57 | else
58 | return EXIT_SUCCESS;
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_defocusing_2split4A_richardson.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Shrinivas Chimmalgi (TU Delft) 2017-2018.
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__nsev_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code, i;
29 | fnft_nsev_opts_t opts;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_DEFOCUSING;
31 | UINT D = 4096;
32 |
33 | opts = fnft_nsev_default_opts();
34 | opts.discretization = nse_discretization_2SPLIT4A;
35 |
36 | // Check for at least 3rd-order error decay on resulting from application
37 | // of Richardson extrapolation to 2nd-order method.
38 | REAL error_bounds_RE[6] = {
39 | 6.7e-8, // reflection coefficient
40 | INFINITY, // a
41 | INFINITY, // b
42 | 0.0, // bound states
43 | 0.0, // norming constants
44 | 0.0 // residues
45 | };
46 | opts.richardson_extrapolation_flag = 1;
47 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds_RE, &opts);
48 | CHECK_RETCODE(ret_code, leave_fun);
49 |
50 | D *= 2;
51 | for (i=0; i<6; i++)
52 | error_bounds_RE[i] /= 8.0;
53 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds_RE, &opts);
54 | CHECK_RETCODE(ret_code, leave_fun);
55 |
56 | leave_fun:
57 | if (ret_code != SUCCESS)
58 | return EXIT_FAILURE;
59 | else
60 | return EXIT_SUCCESS;
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_defocusing_2split4B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Shrinivas Chimmalgi (TU Delft) 2017-2018.
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__nsev_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code, i;
29 | fnft_nsev_opts_t opts;
30 | UINT D = 4096;
31 | const nsev_testcases_t tc = nsev_testcases_SECH_DEFOCUSING;
32 | REAL error_bounds[6] = {
33 | 1.3e-4, // reflection coefficient
34 | INFINITY, // a
35 | INFINITY, // b
36 | 0.0, // bound states
37 | 0.0, // norming constants
38 | 0.0 // residues
39 | };
40 |
41 | opts = fnft_nsev_default_opts();
42 | opts.discretization = nse_discretization_2SPLIT4B;
43 |
44 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
45 | CHECK_RETCODE(ret_code, leave_fun);
46 |
47 | // Check for quadratic error decay
48 | D *= 2;
49 | for (i=0; i<6; i++)
50 | error_bounds[i] /= 4.0;
51 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
52 | CHECK_RETCODE(ret_code, leave_fun);
53 |
54 | leave_fun:
55 | if (ret_code != SUCCESS)
56 | return EXIT_FAILURE;
57 | else
58 | return EXIT_SUCCESS;
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_defocusing_4split4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Shrnivas Chimmalgi (TU Delft) 2019-2020.
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__nsev_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code, i;
29 | fnft_nsev_opts_t opts;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_DEFOCUSING;
31 | UINT D = 1024;
32 | REAL error_bounds[6] = {
33 | 1.8e-6, // reflection coefficient
34 | INFINITY, // a
35 | INFINITY, // b
36 | 0.0, // bound states
37 | 0.0, // norming constants
38 | 0.0 // residues
39 | };
40 |
41 | opts = fnft_nsev_default_opts();
42 | opts.discretization = nse_discretization_4SPLIT4A;
43 |
44 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
45 | CHECK_RETCODE(ret_code, leave_fun);
46 |
47 | // Check for 4th order error decay
48 | D *= 2;
49 | for (i=0; i<6; i++)
50 | error_bounds[i] /= 16.0;
51 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
52 | CHECK_RETCODE(ret_code, leave_fun);
53 |
54 | leave_fun:
55 | if (ret_code != SUCCESS)
56 | return EXIT_FAILURE;
57 | else
58 | return EXIT_SUCCESS;
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_defocusing_4split4B.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Shrnivas Chimmalgi (TU Delft) 2019.
19 | */
20 |
21 | #define FNFT_ENABLE_SHORT_NAMES
22 |
23 | #include "fnft__nsev_testcases.h"
24 | #include "fnft__errwarn.h"
25 |
26 | INT main()
27 | {
28 | INT ret_code, i;
29 | fnft_nsev_opts_t opts;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_DEFOCUSING;
31 | UINT D = 1024;
32 | REAL error_bounds[6] = {
33 | 1.5e-6, // reflection coefficient
34 | INFINITY, // a
35 | INFINITY, // b
36 | 0.0, // bound states
37 | 0.0, // norming constants
38 | 0.0 // residues
39 | };
40 |
41 | opts = fnft_nsev_default_opts();
42 | opts.discretization = nse_discretization_4SPLIT4B;
43 |
44 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
45 | CHECK_RETCODE(ret_code, leave_fun);
46 |
47 | // Check for 4th order error decay
48 | D *= 2;
49 | for (i=0; i<6; i++)
50 | error_bounds[i] /= 16.0;
51 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
52 | CHECK_RETCODE(ret_code, leave_fun);
53 |
54 | leave_fun:
55 | if (ret_code != SUCCESS)
56 | return EXIT_FAILURE;
57 | else
58 | return EXIT_SUCCESS;
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_focusing_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code, i;
28 | fnft_nsev_opts_t opts;
29 | UINT D = 4096;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_FOCUSING;
31 | REAL error_bounds[6] = {
32 | 8.5e-5, // reflection coefficient
33 | 1.7e-4, // a
34 | 7.9e-5, // b
35 | 1.6e-5, // bound states
36 | 5e-14, // norming constants
37 | 2.1e-6 // residues
38 | };
39 |
40 | opts = fnft_nsev_default_opts();
41 | opts.discretization = nse_discretization_2SPLIT2A;
42 |
43 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | // Check for quadratic error decay (error_bounds[4] stays as it is
47 | // already close to machine precision)
48 | D *= 2;
49 | for (i=0; i<6; i++)
50 | error_bounds[i] /= 4.0;
51 | error_bounds[4] *= 4.0;
52 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
53 | CHECK_RETCODE(ret_code, leave_fun);
54 |
55 | leave_fun:
56 | if (ret_code != SUCCESS)
57 | return EXIT_FAILURE;
58 | else
59 | return EXIT_SUCCESS;
60 | }
61 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_focusing_2split2A_no_power_of_two.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code;
28 | fnft_nsev_opts_t opts;
29 | UINT D = 4096;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_FOCUSING;
31 | REAL error_bounds[6] = {
32 | 8.5e-5, // reflection coefficient
33 | 1.7e-4, // a
34 | 7.9e-5, // b
35 | 1.6e-5, // bound states
36 | 5e-14, // norming constants
37 | 2.1e-6 // residues
38 | };
39 |
40 | opts = fnft_nsev_default_opts();
41 | opts.discretization = nse_discretization_2SPLIT2A;
42 |
43 | // Check the case where D is not a power of two. The error bounds have to
44 | // be tight but not too tight for this to make sense!
45 | ret_code = nsev_testcases_test_fnft(tc, D+1, error_bounds, &opts);
46 | CHECK_RETCODE(ret_code, leave_fun);
47 | ret_code = nsev_testcases_test_fnft(tc, D-1, error_bounds, &opts);
48 | CHECK_RETCODE(ret_code, leave_fun);
49 |
50 | leave_fun:
51 | if (ret_code != SUCCESS)
52 | return EXIT_FAILURE;
53 | else
54 | return EXIT_SUCCESS;
55 | }
56 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_focusing_2split4A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Shrinivas Chimmalgi (TU Delft) 2017.
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code, i;
28 | fnft_nsev_opts_t opts;
29 | UINT D = 4096;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_FOCUSING;
31 | REAL error_bounds[6] = {
32 | 3.9e-6, // reflection coefficient
33 | 6.3e-6, // a
34 | 2.0e-6, // b
35 | 1.6e-5, // bound states
36 | 5e-14, // norming constants
37 | 2.1e-6 // residues
38 | };
39 |
40 | opts = fnft_nsev_default_opts();
41 | opts.discretization = nse_discretization_2SPLIT4A;
42 |
43 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
44 | CHECK_RETCODE(ret_code, leave_fun);
45 |
46 | // Check for quadratic error decay (error_bounds[4] stays as it is because it is
47 | // already close to machine precision)
48 | D *= 2;
49 | for (i=0; i<6; i++)
50 | error_bounds[i] /= 4.0;
51 | error_bounds[4] *= 4.0;
52 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds, &opts);
53 | CHECK_RETCODE(ret_code, leave_fun);
54 |
55 | leave_fun:
56 | if (ret_code != SUCCESS)
57 | return EXIT_FAILURE;
58 | else
59 | return EXIT_SUCCESS;
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/test/fnft_nsev/fnft_nsev_test_sech_focusing_2split4A_richardson.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018, 2021.
18 | * Shrinivas Chimmalgi (TU Delft) 2017.
19 | */
20 | #define FNFT_ENABLE_SHORT_NAMES
21 |
22 | #include "fnft__nsev_testcases.h"
23 | #include "fnft__errwarn.h"
24 |
25 | INT main()
26 | {
27 | INT ret_code, i;
28 | fnft_nsev_opts_t opts;
29 | UINT D = 4096;
30 | const nsev_testcases_t tc = nsev_testcases_SECH_FOCUSING;
31 |
32 | opts = fnft_nsev_default_opts();
33 | opts.discretization = nse_discretization_2SPLIT4A;
34 |
35 | // Check for Richardson
36 | REAL error_bounds_RE[6] = {
37 | 2.7e-8, // reflection coefficient
38 | 6.7e-8, // a
39 | 2.4e-8, // b
40 | 1.2e-9, // bound states
41 | 5e-14, // norming constants
42 | 4.5e-9 // residues
43 | };
44 |
45 | opts.richardson_extrapolation_flag = 1;
46 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds_RE, &opts);
47 | CHECK_RETCODE(ret_code, leave_fun);
48 |
49 | D *= 2;
50 | for (i=0; i<6; i++)
51 | error_bounds_RE[i] /= 16.0;
52 | error_bounds_RE[4] *= 16.0;
53 | ret_code = nsev_testcases_test_fnft(tc, D, error_bounds_RE, &opts);
54 | CHECK_RETCODE(ret_code, leave_fun);
55 |
56 | leave_fun:
57 | if (ret_code != SUCCESS)
58 | return EXIT_FAILURE;
59 | else
60 | return EXIT_SUCCESS;
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_B_of_tau_or_b_of_xi/fnft_nsev_inverse_test_B_of_tau_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_B_of_tau_or_b_of_xi.inc"
21 |
22 | int main()
23 | {
24 | INT ret_code = SUCCESS;
25 |
26 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
27 | opts.discretization = nse_discretization_2SPLIT2A;
28 | opts.contspec_type = fnft_nsev_inverse_cstype_B_OF_TAU;
29 |
30 | UINT D = 256;
31 | REAL error_bound = 0.0009;
32 | for (UINT i=0; i<4; i++) {
33 | ret_code = fnft_nsev_inverse_test(D, D, error_bound, &opts);
34 | CHECK_RETCODE(ret_code, leave_fun);
35 | D *= 2;
36 | error_bound /= 4;
37 | }
38 |
39 | leave_fun:
40 | if (ret_code == SUCCESS)
41 | return EXIT_SUCCESS;
42 | else
43 | return EXIT_FAILURE;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_B_of_tau_or_b_of_xi/fnft_nsev_inverse_test_B_of_tau_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_B_of_tau_or_b_of_xi.inc"
21 |
22 | int main()
23 | {
24 | INT ret_code = SUCCESS;
25 |
26 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
27 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
28 | opts.contspec_type = fnft_nsev_inverse_cstype_B_OF_TAU;
29 |
30 | UINT D = 256;
31 | REAL error_bound = 0.0013;
32 | for (UINT i=0; i<4; i++) {
33 | ret_code = fnft_nsev_inverse_test(D, D, error_bound, &opts);
34 | CHECK_RETCODE(ret_code, leave_fun);
35 | D *= 2;
36 | error_bound /= 4;
37 | }
38 |
39 | leave_fun:
40 | if (ret_code == SUCCESS)
41 | return EXIT_SUCCESS;
42 | else
43 | return EXIT_FAILURE;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_B_of_tau_or_b_of_xi/fnft_nsev_inverse_test_B_of_tau_w_discrete_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_B_of_tau_or_b_of_xi_w_discrete.inc"
21 |
22 | int main()
23 | {
24 | INT ret_code = SUCCESS;
25 |
26 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
27 | opts.discretization = nse_discretization_2SPLIT2A;
28 | opts.contspec_type = fnft_nsev_inverse_cstype_B_OF_TAU;
29 |
30 | UINT D = 512;
31 | REAL error_bound = 0.00063;
32 | for (UINT i=0; i<4; i++) {
33 | ret_code = fnft_nsev_inverse_test(D, D, error_bound, &opts);
34 | CHECK_RETCODE(ret_code, leave_fun);
35 | D *= 2;
36 | error_bound /= 4;
37 | }
38 |
39 | leave_fun:
40 | if (ret_code == SUCCESS)
41 | return EXIT_SUCCESS;
42 | else
43 | return EXIT_FAILURE;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_B_of_tau_or_b_of_xi/fnft_nsev_inverse_test_B_of_tau_w_discrete_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_B_of_tau_or_b_of_xi_w_discrete.inc"
21 |
22 | int main()
23 | {
24 | INT ret_code = SUCCESS;
25 |
26 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
27 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
28 | opts.contspec_type = fnft_nsev_inverse_cstype_B_OF_TAU;
29 |
30 | UINT D = 512;
31 | REAL error_bound = 0.00057;
32 | for (UINT i=0; i<4; i++) {
33 | ret_code = fnft_nsev_inverse_test(D, D, error_bound, &opts);
34 | CHECK_RETCODE(ret_code, leave_fun);
35 | D *= 2;
36 | error_bound /= 4;
37 | }
38 |
39 | leave_fun:
40 | if (ret_code == SUCCESS)
41 | return EXIT_SUCCESS;
42 | else
43 | return EXIT_FAILURE;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_B_of_tau_or_b_of_xi/fnft_nsev_inverse_test_b_of_xi_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_B_of_tau_or_b_of_xi.inc"
21 |
22 | int main()
23 | {
24 | INT ret_code = SUCCESS;
25 |
26 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
27 | opts.discretization = nse_discretization_2SPLIT2A;
28 | opts.contspec_type = fnft_nsev_inverse_cstype_B_OF_XI;
29 |
30 | UINT D = 256;
31 | REAL error_bound = 0.0009;
32 | for (UINT i=0; i<4; i++) {
33 | ret_code = fnft_nsev_inverse_test(D, D, error_bound, &opts);
34 | CHECK_RETCODE(ret_code, leave_fun);
35 | ret_code = fnft_nsev_inverse_test(D, D+2, error_bound, &opts);
36 | CHECK_RETCODE(ret_code, leave_fun);
37 | D *= 2;
38 | error_bound /= 4;
39 | }
40 |
41 | leave_fun:
42 | if (ret_code == SUCCESS)
43 | return EXIT_SUCCESS;
44 | else
45 | return EXIT_FAILURE;
46 | }
47 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_B_of_tau_or_b_of_xi/fnft_nsev_inverse_test_b_of_xi_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_B_of_tau_or_b_of_xi.inc"
21 |
22 | int main()
23 | {
24 | INT ret_code = SUCCESS;
25 |
26 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
27 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
28 | opts.contspec_type = fnft_nsev_inverse_cstype_B_OF_XI;
29 |
30 | UINT D = 256;
31 | REAL error_bound = 0.0013;
32 | for (UINT i=0; i<4; i++) {
33 | ret_code = fnft_nsev_inverse_test(D, D, error_bound, &opts);
34 | CHECK_RETCODE(ret_code, leave_fun);
35 | ret_code = fnft_nsev_inverse_test(D, D+2, error_bound, &opts);
36 | CHECK_RETCODE(ret_code, leave_fun);
37 | D *= 2;
38 | error_bound /= 4;
39 | }
40 |
41 | leave_fun:
42 | if (ret_code == SUCCESS)
43 | return EXIT_SUCCESS;
44 | else
45 | return EXIT_FAILURE;
46 | }
47 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_B_of_tau_or_b_of_xi/fnft_nsev_inverse_test_b_of_xi_w_discrete_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_B_of_tau_or_b_of_xi_w_discrete.inc"
21 |
22 | int main()
23 | {
24 | INT ret_code = SUCCESS;
25 |
26 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
27 | opts.discretization = nse_discretization_2SPLIT2A;
28 | opts.contspec_type = fnft_nsev_inverse_cstype_B_OF_XI;
29 |
30 | UINT D = 512;
31 | REAL error_bound = 0.00063;
32 | for (UINT i=0; i<4; i++) {
33 | ret_code = fnft_nsev_inverse_test(D, D, error_bound, &opts);
34 | CHECK_RETCODE(ret_code, leave_fun);
35 | D *= 2;
36 | error_bound /= 4;
37 | }
38 |
39 | leave_fun:
40 | if (ret_code == SUCCESS)
41 | return EXIT_SUCCESS;
42 | else
43 | return EXIT_FAILURE;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_B_of_tau_or_b_of_xi/fnft_nsev_inverse_test_b_of_xi_w_discrete_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_B_of_tau_or_b_of_xi_w_discrete.inc"
21 |
22 | int main()
23 | {
24 | INT ret_code = SUCCESS;
25 |
26 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
27 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
28 | opts.contspec_type = fnft_nsev_inverse_cstype_B_OF_XI;
29 |
30 | UINT D = 512;
31 | REAL error_bound = 0.00058;
32 | for (UINT i=0; i<4; i++) {
33 | ret_code = fnft_nsev_inverse_test(D, D, error_bound, &opts);
34 | CHECK_RETCODE(ret_code, leave_fun);
35 | D *= 2;
36 | error_bound /= 4;
37 | }
38 |
39 | leave_fun:
40 | if (ret_code == SUCCESS)
41 | return EXIT_SUCCESS;
42 | else
43 | return EXIT_FAILURE;
44 | }
45 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_against_forward/fnft_nsev_inverse_test_against_forward_defocusing_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_against_forward.inc"
21 |
22 | int main()
23 | {
24 | const INT kappa = -1;
25 | UINT M;
26 | REAL error_bound;
27 | INT ret_code = SUCCESS;
28 |
29 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
30 | opts.discretization = nse_discretization_2SPLIT2A;
31 | opts.contspec_inversion_method
32 | = fnft_nsev_inverse_csmethod_TFMATRIX_CONTAINS_REFL_COEFF;
33 |
34 | M = 10;
35 | error_bound = 0.03;
36 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
37 | CHECK_RETCODE(ret_code, leave_fun);
38 |
39 | M = 32;
40 | error_bound = 0.016;
41 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
42 | CHECK_RETCODE(ret_code, leave_fun);
43 |
44 | opts.contspec_inversion_method
45 | = fnft_nsev_inverse_csmethod_TFMATRIX_CONTAINS_AB_FROM_ITER;
46 |
47 | M = 8;
48 | error_bound = 0.016;
49 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
50 | CHECK_RETCODE(ret_code, leave_fun);
51 |
52 | leave_fun:
53 | if (ret_code == SUCCESS)
54 | return EXIT_SUCCESS;
55 | else
56 | return EXIT_FAILURE;
57 | }
58 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_against_forward/fnft_nsev_inverse_test_against_forward_defocusing_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_against_forward.inc"
21 |
22 | int main()
23 | {
24 | const INT kappa = -1;
25 | UINT M;
26 | REAL error_bound;
27 | INT ret_code = SUCCESS;
28 |
29 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
30 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
31 | opts.contspec_inversion_method
32 | = fnft_nsev_inverse_csmethod_TFMATRIX_CONTAINS_REFL_COEFF;
33 |
34 | M = 10;
35 | error_bound = 0.017;
36 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
37 | CHECK_RETCODE(ret_code, leave_fun);
38 |
39 | M = 32;
40 | error_bound = 7.5e-9;
41 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
42 | CHECK_RETCODE(ret_code, leave_fun);
43 |
44 | opts.contspec_inversion_method
45 | = fnft_nsev_inverse_csmethod_TFMATRIX_CONTAINS_AB_FROM_ITER;
46 |
47 | M = 8;
48 | error_bound = 1.1e-14;
49 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
50 | CHECK_RETCODE(ret_code, leave_fun);
51 |
52 | leave_fun:
53 | if (ret_code == SUCCESS)
54 | return EXIT_SUCCESS;
55 | else
56 | return EXIT_FAILURE;
57 | }
58 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_against_forward/fnft_nsev_inverse_test_against_forward_focusing_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_against_forward.inc"
21 |
22 | int main()
23 | {
24 | const INT kappa = +1;
25 | UINT M;
26 | REAL error_bound;
27 | INT ret_code = SUCCESS;
28 |
29 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
30 | opts.discretization = nse_discretization_2SPLIT2A;
31 | opts.contspec_inversion_method
32 | = fnft_nsev_inverse_csmethod_TFMATRIX_CONTAINS_REFL_COEFF;
33 |
34 | M = 10;
35 | error_bound = 0.022;
36 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
37 | CHECK_RETCODE(ret_code, leave_fun);
38 |
39 | M = 32;
40 | error_bound = 5.3e-8;
41 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
42 | CHECK_RETCODE(ret_code, leave_fun);
43 |
44 | leave_fun:
45 | if (ret_code == SUCCESS)
46 | return EXIT_SUCCESS;
47 | else
48 | return EXIT_FAILURE;
49 | }
50 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_against_forward/fnft_nsev_inverse_test_against_forward_focusing_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_against_forward.inc"
21 |
22 | int main()
23 | {
24 | const INT kappa = +1;
25 | UINT M;
26 | REAL error_bound;
27 | INT ret_code = SUCCESS;
28 |
29 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
30 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
31 | opts.contspec_inversion_method
32 | = fnft_nsev_inverse_csmethod_TFMATRIX_CONTAINS_REFL_COEFF;
33 |
34 | M = 10;
35 | error_bound = 0.021;
36 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
37 | CHECK_RETCODE(ret_code, leave_fun);
38 |
39 | M = 32;
40 | error_bound = 5.1e-8;
41 | ret_code = fnft_nsev_inverse_test(M, error_bound, kappa, &opts);
42 | CHECK_RETCODE(ret_code, leave_fun);
43 |
44 | leave_fun:
45 | if (ret_code == SUCCESS)
46 | return EXIT_SUCCESS;
47 | else
48 | return EXIT_FAILURE;
49 | }
50 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_sech_defocusing/fnft_nsev_inverse_test_sech_defocusing.m:
--------------------------------------------------------------------------------
1 | % This Matlab script generates the files
2 | % fnft_nsev_inverse_test_sech_defocusing_....inc
3 |
4 | clear all;
5 |
6 | for D=[2048 4096]
7 | fnft_nsev_inverse_test_sech_defocusing_aux(D);
8 | end
9 |
10 | function fnft_nsev_inverse_test_sech_defocusing_aux(D, filename)
11 | T = 2.0*[-1 1.1];
12 | M = 2*D;
13 | XI = mex_fnft_nsev_inverse_XI(D, T, M);
14 |
15 | kappa = -1;
16 | Q = 1;
17 | GAM = 1/25;
18 | F = 1.5;
19 | eps_xi = (XI(2) - XI(1))/(M - 1);
20 | xi = XI(1) + (0:(M-1))*eps_xi;
21 | cgamma = @(z) double(gamma(sym(z)));
22 | d = 0.5 + 1i*(xi*GAM-F);
23 | fp = 0.5 - 1i*(xi*GAM+sqrt(F^2+Q^2));
24 | fm = 0.5 - 1i*(xi*GAM-sqrt(F^2+Q^2));
25 | gp = 1 - 1i*(F+sqrt(F^2+Q^2));
26 | gm = 1 - 1i*(F-sqrt(F^2+Q^2));
27 | contspec_exact = -2^(-2i*F)*Q*cgamma(d).*cgamma(fm).* ...
28 | cgamma(fp)./(cgamma(conj(d)).*cgamma(gm).*cgamma(gp));
29 |
30 | eps_t = (T(2) - T(1))/(D - 1);
31 | t = T(1) + (0:D-1)*eps_t;
32 | q_exact = -conj(Q/GAM*sech(t/GAM).^(1-2j*F));
33 |
34 | filename = sprintf('fnft_nsev_inverse_test_sech_defocusing_data_%d.inc',D);
35 | fileID = fopen(filename, 'w');
36 | fprintf(fileID, 'const UINT M_%d = %d;\n', D, M);
37 | fprintf(fileID, 'const REAL T_%d[2] = {%.17g, %.17g};\n', D, T(1), T(2));
38 | fprintf(fileID, 'const REAL XI_%d[2] = {%.17g, %.17g};\n', D, XI(1), XI(2));
39 | fprintf(fileID, 'const COMPLEX q_exact_%d[%d] = {\n', D, D);
40 | for n = 1:D
41 | fprintf(fileID, ' %.17g + %.17g*I', real(q_exact(n)), imag(q_exact(n)));
42 | if n.
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_sech_defocusing.inc"
21 |
22 | int main()
23 | {
24 | REAL error_bound;
25 | INT ret_code;
26 |
27 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
28 | opts.discretization = nse_discretization_2SPLIT2A;
29 |
30 | opts.contspec_inversion_method
31 | = fnft_nsev_inverse_csmethod_TFMATRIX_CONTAINS_REFL_COEFF;
32 |
33 | error_bound = 0.0015;
34 | ret_code = fnft_nsev_inverse_test(error_bound, &opts);
35 | CHECK_RETCODE(ret_code, leave_fun);
36 |
37 | leave_fun:
38 | if (ret_code == SUCCESS)
39 | return EXIT_SUCCESS;
40 | else
41 | return EXIT_FAILURE;
42 | }
43 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_sech_defocusing/fnft_nsev_inverse_test_sech_defocusing_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_sech_defocusing.inc"
21 |
22 | int main()
23 | {
24 | REAL error_bound;
25 | INT ret_code;
26 |
27 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
28 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
29 |
30 | opts.contspec_inversion_method
31 | = fnft_nsev_inverse_csmethod_TFMATRIX_CONTAINS_REFL_COEFF;
32 |
33 | error_bound = 0.0011;
34 | ret_code = fnft_nsev_inverse_test(error_bound, &opts);
35 | CHECK_RETCODE(ret_code, leave_fun);
36 |
37 | leave_fun:
38 | if (ret_code == SUCCESS)
39 | return EXIT_SUCCESS;
40 | else
41 | return EXIT_FAILURE;
42 | }
43 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_truncated_soliton/fnft_nsev_inverse_test_truncated_soliton_2split2A.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Shrinivas Chimmalgi (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_truncated_soliton.inc"
21 |
22 |
23 | int main()
24 | {
25 | UINT M;
26 | UINT D;
27 | REAL error_bound;
28 | INT ret_code = SUCCESS;
29 |
30 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
31 | opts.discretization = nse_discretization_2SPLIT2A;
32 | opts.discspec_type = fnft_nsev_inverse_dstype_NORMING_CONSTANTS;
33 |
34 |
35 | D = 512;
36 | M = 4*D;
37 | error_bound = 0.0033;
38 | ret_code = fnft_nsev_inverse_test(D, M, error_bound, &opts);
39 | CHECK_RETCODE(ret_code, leave_fun);
40 |
41 | D = D*2;
42 | M = 4*D;
43 | error_bound = error_bound/2;
44 | ret_code = fnft_nsev_inverse_test(D, M, error_bound, &opts);
45 | CHECK_RETCODE(ret_code, leave_fun);
46 |
47 |
48 |
49 | leave_fun:
50 | if (ret_code == SUCCESS)
51 | return EXIT_SUCCESS;
52 | else
53 | return EXIT_FAILURE;
54 | }
55 |
--------------------------------------------------------------------------------
/test/fnft_nsev_inverse/fnft_nsev_inverse_test_truncated_soliton/fnft_nsev_inverse_test_truncated_soliton_2split2_modal.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Shrinivas Chimmalgi (TU Delft) 2018.
18 | */
19 |
20 | #include "fnft_nsev_inverse_test_truncated_soliton.inc"
21 |
22 |
23 | int main()
24 | {
25 | UINT M;
26 | UINT D;
27 | REAL error_bound;
28 | INT ret_code = SUCCESS;
29 |
30 | fnft_nsev_inverse_opts_t opts = fnft_nsev_inverse_default_opts();
31 | opts.discretization = nse_discretization_2SPLIT2_MODAL;
32 | opts.discspec_type = fnft_nsev_inverse_dstype_NORMING_CONSTANTS;
33 |
34 |
35 | D = 512;
36 | M = 4*D;
37 | error_bound = 0.0033;
38 | ret_code = fnft_nsev_inverse_test(D, M, error_bound, &opts);
39 | CHECK_RETCODE(ret_code, leave_fun);
40 |
41 | D = D*2;
42 | M =4*D;
43 | error_bound = error_bound/2;
44 | ret_code = fnft_nsev_inverse_test(D, M, error_bound, &opts);
45 | CHECK_RETCODE(ret_code, leave_fun);
46 |
47 |
48 |
49 | leave_fun:
50 | if (ret_code == SUCCESS)
51 | return EXIT_SUCCESS;
52 | else
53 | return EXIT_FAILURE;
54 | }
55 |
--------------------------------------------------------------------------------
/test/fnft_version_test.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FNFT.
3 | *
4 | * FNFT is free software; you can redistribute it and/or
5 | * modify it under the terms of the version 2 of the GNU General
6 | * Public License as published by the Free Software Foundation.
7 | *
8 | * FNFT is distributed in the hope that it will be useful,
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | * GNU General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | * Contributors:
17 | * Sander Wahls (TU Delft) 2017-2018.
18 | */
19 |
20 | #define FNFT_ENABLE_SHORT_NAMES
21 | #include "fnft_version.h"
22 | #include "fnft__errwarn.h"
23 | #include
24 |
25 | int main()
26 | {
27 | UINT major, minor, patch;
28 | char suffix[FNFT_VERSION_SUFFIX_MAXLEN+1];
29 |
30 | INT ret_code = fnft_version(&major, &minor, &patch, suffix);
31 | if (ret_code != SUCCESS) {
32 | ret_code = E_SUBROUTINE(ret_code);
33 | return EXIT_FAILURE;
34 | }
35 |
36 | printf("%u.%u.%u%s\n",
37 | (unsigned int)major,
38 | (unsigned int)minor,
39 | (unsigned int)patch,
40 | suffix);
41 | return EXIT_SUCCESS;
42 | }
43 |
--------------------------------------------------------------------------------