Skip to content

Commit bcd8767

Browse files
authored
Merge pull request #41 from FastNFT/release-0.2
Release 0.2.2
2 parents d7881c2 + 5aa83e9 commit bcd8767

8 files changed

Lines changed: 48 additions & 27 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.inc linguist-language=C

CHANGELOG.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## [0.2.2] -- 2018-12-13
4+
5+
### Added
6+
7+
- The routine fnft_nsev_inverse_XI now raises an error if D<2 to avoid division by zero
8+
- A .gitattribute file to correct incorrect language detection on GitHub
9+
10+
### Fixed
11+
12+
- CMake failed under Windows due to an incomplete install command in CMakeLists.txt
13+
- Removed incorrect "-SHELL=cmd" parameter for CMake from Windows build instructions
14+
- Documentation for fnft_nsev_inverse now states that D should be a positive power of two
15+
- Documentation for fnft_nsev and fnft_nsep now states that passing *K_ptr==0 and *M_ptr==0 is not sufficient in order to completely skip the computation of the corresponding spectra
16+
- Reformatted changelog for 0.1.1
17+
318
## [0.2.1] -- 2018-09-28
419

520
### Fixed
@@ -37,14 +52,11 @@
3752

3853
## [0.1.1] -- 2018-05-14
3954

40-
### Added
55+
### Fixed
4156

4257
- Mex files now compile also with Matlab R2018a
43-
44-
### Changed
45-
46-
- Fixed: Several potential memory violations in fnft_nsev, poly_chirpz and nsev_testcases
47-
- Fixed: Some return codes in fnft_nsep had not been checked
48-
- Fixed: misc_merge did not work correctly for empty input vectors
49-
- Fixed: The continuous spectrum in mex_fnft_nsev_example.m was plotted over t, not xi
50-
- Fixed: A superfluous parameter kappa was given in the documentation of mex_fnft_kdvv
58+
- Several potential memory violations in fnft_nsev, poly_chirpz and nsev_testcases
59+
- Some return codes in fnft_nsep had not been checked
60+
- misc_merge did not work correctly for empty input vectors
61+
- The continuous spectrum in mex_fnft_nsev_example.m was plotted over t, not xi
62+
- A superfluous parameter kappa was given in the documentation of mex_fnft_kdvv

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ project(fnft C)
2121

2222
set(FNFT_VERSION_MAJOR 0)
2323
set(FNFT_VERSION_MINOR 2)
24-
set(FNFT_VERSION_PATCH 1)
24+
set(FNFT_VERSION_PATCH 2)
2525
set(FNFT_VERSION_SUFFIX "") # should not be longer than FNFT_SUFFIX_MAXLEN
2626
set(FNFT_VERSION ${FNFT_VERSION_MAJOR}.${FNFT_VERSION_MINOR}.${FNFT_VERSION_PATCH}${FNFT_VERSION_SUFFIX})
2727

@@ -172,8 +172,8 @@ target_link_libraries(fnft ${FFTW3_LIB})
172172
file(GLOB PUBLIC_HEADERS "include/*.h")
173173
set_target_properties(fnft PROPERTIES VERSION ${FNFT_VERSION} SOVERSION ${FNFT_VERSION_MAJOR} LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" PUBLIC_HEADER "${PUBLIC_HEADERS}")
174174

175-
# installation under Linux
176-
install(TARGETS fnft LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
175+
# installation (under Windows, DLL's are considered runtime, while DLL import libraries are considered ARCHIVE)
176+
install(TARGETS fnft LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include RUNTIME DESTINATION lib ARCHIVE DESTINATION lib)
177177

178178
# generate examples
179179
foreach (srcfile ${EXAMPLE_SOURCES})

INSTALL.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ To uninstall FNFT, run the commands
6666

6767
## Building under Windows
6868

69-
The following instructions have been tested under Windows 7/8/10. A simple way to build FNFT is via the [Scoop](http://scoop.sh/) packet manager. Make sure that [PowerShell 3](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell?view=powershell-6) is available. Run the command
69+
The following instructions have been tested under Windows 7/8/10. A simple way to build FNFT is via the [Scoop](http://scoop.sh/) packet manager. Make sure that [PowerShell 3](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell?view=powershell-6) is available. (We recommend _not_ to run the 32 bit version "PowerShell (x86)" on a 64 bit machine unless there are specific reasons for it.) Run the command
7070

7171
powershell.exe -ExecutionPolicy RemoteSigned
7272

@@ -90,7 +90,7 @@ Create a build directory and run cmake there
9090

9191
mkdir build
9292
cd build
93-
cmake .. -SHELL=cmd -G"MinGW Makefiles"
93+
cmake .. -G"MinGW Makefiles"
9494

9595
Build the library:
9696

@@ -100,8 +100,7 @@ Run the tests:
100100

101101
mingw32-make -j4 test
102102

103-
_Note:_ If MATLAB is installed, the MATLAB interface should have been built
104-
automatically. It can be found in the 'matlab' folder. Please copy the libfnft... dll file and the mex_... mexw... files manually from the 'build' into the 'matlab' folder.
103+
_Note:_ If MATLAB is installed, the MATLAB interface should have been built automatically. It can be found in the 'matlab' folder. Please copy the libfnft... dll file and the mex_... mexw... files manually from the 'build' into the 'matlab' folder.
105104

106105
## Building under MacOS
107106

include/fnft_nsep.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ fnft_nsep_opts_t fnft_nsep_default_opts();
161161
* points in the main spectrum. If the length of the array main_spec was not
162162
* sufficient to store all of the detected points in the main spectrum, a
163163
* warning is printed and as many points as possible are returned instead.
164+
* Note that in order to skip the computation of the main spectrum completely,
165+
* it is not sufficient to pass *K_ptr==NULL. Instead, pass main_spec==NULL.
164166
* @param[out] main_spec Array. Upon return, the routine has stored the detected
165167
* main specrum points (i.e., the points for which the trace of the monodromy
166168
* matrix is either +2 or -2) in the first *K_ptr entries of this array.
@@ -172,7 +174,9 @@ fnft_nsep_opts_t fnft_nsep_default_opts();
172174
* points in the auxiliary spectrum. If the length of the array aux_spec was
173175
* not sufficient to store all of the detected points in the auxiliary
174176
* spectrum, a warning is printed and as many points as possible are returned
175-
* instead.
177+
* instead. Note that in order to skip the computation of the auxiliary
178+
* spectrum completely, it is not sufficient to pass *M_ptr==NULL. Instead,
179+
* pass aux_spec==NULL.
176180
* @param[out] aux_spec Array. Upon return, the routine has stored the detected
177181
* auxiliary specrum points (i.e., the points for which the upper right
178182
* element of the monodromy matrix is zero) in the first *M_ptr entries of

include/fnft_nsev.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ FNFT_UINT fnft_nsev_max_K(const FNFT_UINT D,
261261
* bound_states. Upon return, *K_ptr contains the number of actually detected
262262
* bound states. If the length of the array bound_states was not sufficient
263263
* to store all of the detected bound states, a warning is printed and as many
264-
* bound states as possible are returned instead.
264+
* bound states as possible are returned instead. Note that in order to skip
265+
* the computation of the bound states completely, it is not sufficient to pass
266+
* *K_ptr==0. Instead, one needs to pass bound_states==NULL.
265267
* @param[out] bound_states Array. Upon return, the routine has stored the detected
266268
* bound states (aka eigenvalues) in the first *K_ptr entries of this array.
267269
* If NULL is passed instead, the discrete spectrum will not be computed.

include/fnft_nsev_inverse.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ typedef enum {
9191
* The maximum number of iterations can be controlled using the max_iter
9292
* field in \link fnft_nsev_inverse_opts_t \endlink. Requires M=D. Defocusing
9393
* case only.\n\n
94-
* fnft_nsev_inverse_csmethod_USE_SEED_POTENTIAL_INSTEAD: This algorithm
95-
* adds discrete spectrum over the given seed potential. It uses Boffetta and Osborne
94+
* fnft_nsev_inverse_csmethod_USE_SEED_POTENTIAL_INSTEAD: This algorithm
95+
* adds discrete spectrum over the given seed potential. It uses Boffetta and Osborne
9696
* (<a href="http://dx.doi.org/10.1016/0021-9991(92)90370-E">J. Comput. Physics 1992 </a>)
9797
* method to compute the intermediate eigenfunctions and then uses the classical
98-
* Darboux transform in <a href="https://doi.org/10.1007/BF02015338">[Lin,
98+
* Darboux transform in <a href="https://doi.org/10.1007/BF02015338">[Lin,
9999
* J. Acta Mathematicae Applicatae Sinica (1990) 6: 308]</a> to add the discrete spectrum.
100100
*/
101101
typedef enum {
@@ -176,7 +176,7 @@ fnft_nsev_inverse_opts_t fnft_nsev_inverse_default_opts();
176176
* the grid that has to be used when providing a continuous spectrum
177177
* to \link fnft_nsev_inverse \endlink.
178178
*
179-
* @param[in] D Number of samples of the to be generated signal q.
179+
* @param[in] D Number of samples of the to be generated signal q. Should be >=2.
180180
* @param[in] T Array of length two. Contains the desired location
181181
* of the first and last sample of the signal q.
182182
* @param[in] M Number of samples in the nonlinear frequency domain.
@@ -238,11 +238,12 @@ FNFT_INT fnft_nsev_inverse_XI(
238238
* whether the user adheres to this requirement.
239239
* @param[in] K Number of discrete spectrum points.
240240
* @param[in] bound_states Complex array of length K. Complex roots of
241-
* \f$ a(\xi) \f$ in the upper half of the complex-plane.
241+
* \f$ a(\xi) \f$ in the upper half of the complex-plane.
242242
* @param[in] normconsts_or_residues Complex array of length K. Values of
243-
* either the norming constants \f$ b(\xi) \f$ or the residues
244-
* \f$ \frac{b(\xi)}{\partial{a(\xi)}/\partial{\xi}}\f$ at the values bound_states.
245-
* @param[in] D Number of samples of the to be generated signal q.
243+
* either the norming constants \f$ b(\xi) \f$ or the residues
244+
* \f$ \frac{b(\xi)}{\partial{a(\xi)}/\partial{\xi}}\f$ at the values bound_states.
245+
* @param[in] D Number of samples of the to be generated signal q. Should be a
246+
* positive power of two.
246247
* @param[out] q Array of length D. Is filled with samples
247248
* \f$ q(t_n) \f$, where \f$ t_n = T[0] + n(T[1]-T[0])/(D-1) \f$
248249
* and \f$n=0,1,\dots,D-1\f$, of the to-be-generated signal in ascending order

src/fnft_nsev_inverse.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ INT fnft_nsev_inverse_XI(const UINT D, REAL const * const T,
5050
const UINT M, REAL * const XI,
5151
const nse_discretization_t discretization)
5252
{
53+
if (D<2)
54+
return E_INVALID_ARGUMENT(D);
5355
if (M == 0)
5456
return E_INVALID_ARGUMENT(M);
5557
if (XI == NULL)
@@ -794,7 +796,7 @@ static INT add_discrete_spectrum(
794796
}
795797
}
796798
norm_consts[i]=(norm_consts[i]/bnd_states_diff[i])*tmp;
797-
}
799+
}
798800
}
799801

800802
// In absence of contspec some tricks can be used to

0 commit comments

Comments
 (0)