FastNFT / FNFT

Fast numerical computation of (inverse) nonlinear Fourier transforms
https://fastnft.github.io/FNFT/
GNU General Public License v2.0
42 stars 12 forks source link

Improvements #44

Closed marbre closed 7 months ago

marbre commented 5 years ago

Mainly added some more const keywords + modified a division (for style purposes, won't change results at least not with gcc). Hopes this makes FNFT even more robust.

wahls commented 5 years ago

There seems to be a problem:

[ 0%] Building C object CMakeFiles/fnft.dir/src/fnft_errwarn.c.o /home/sander/git/FNFT-mabre-improvements/src/fnft_nsev.c: In function ‘tf2contspec’: /home/sander/git/FNFT-mabre-improvements/src/fnft_nsev.c:343:9: error: a label can only be part of a statement and a declaration is not a statement 343 | const REAL scale = POW(2.0, W); // needed since the transfer matrix might | ^~~~~ make[2]: [CMakeFiles/fnft.dir/build.make:102: CMakeFiles/fnft.dir/src/fnft_nsev.c.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [CMakeFiles/Makefile2:4732: CMakeFiles/fnft.dir/all] Error 2 make: [Makefile:141: all] Error 2

marbre commented 5 years ago

Indeed, probably missed to compile with commit 5677815. As the commit adds transforms the statement to a declaration, which cannot follow directly to labels, one possibility would be to add an empty statement, e.g. change case nsev_cstype_AB: to case nsev_cstype_AB: ;. A cleaner looking approach would be to introduce a scope { .. }. However, I did not check yet if this would work out here. Of course, commit 5677815 can also be skipped for now.