diff --git a/qpms/lattices2d.c b/qpms/lattices2d.c index 4b94929..ee99d06 100644 --- a/qpms/lattices2d.c +++ b/qpms/lattices2d.c @@ -941,7 +941,7 @@ void qpms_emptylattice2_modes_nearest(double target[2], double *freqlist; size_t n = qpms_emptylattice2_modes_maxfreq(&freqlist, b1, b2, rtol, k, c, omega); - target[0] = freqlist[n-2]; + target[0] = (n > 1) ? freqlist[n-2] : NAN; target[1] = freqlist[n-1]; free(freqlist); } diff --git a/qpms/qpms_cdefs.pxd b/qpms/qpms_cdefs.pxd index 940c7f0..48b1a39 100644 --- a/qpms/qpms_cdefs.pxd +++ b/qpms/qpms_cdefs.pxd @@ -211,6 +211,11 @@ cdef extern from "lattices.h": double maxR, bint inc_maxR, PGen_1D_incrementDirection incdir) int qpms_reduce_lattice_basis(double *b, size_t bsize, size_t ndim, double delta) + size_t qpms_emptylattice2_modes_maxfreq(double **target_freqs, cart2_t b1_rec, cart2_t b2_rec, + double rtol, cart2_t k, double wave_speed, double maxomega) + size_t qpms_emptylattice2_modes_nearest(double *target_freqs, cart2_t b1_rec, cart2_t b2_rec, + double rtol, cart2_t k, double wave_speed, double omega) + cdef extern from "quaternions.h": qpms_quat_t qpms_quat_2c_from_4d(qpms_quat4d_t q)