Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 3b0fb35

Browse files
committed
RTKLIB routines use Fortran storage order.
1 parent 7159b25 commit 3b0fb35

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

python/swiftnav/lambda_.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def lambda_reduction_(Q):
2828
"""
2929
assert len(Q.shape) == 2 and Q.shape[0] == Q.shape[1], "Q matrix must have shape (n, n)"
3030
n = Q.shape[0]
31-
cdef np.ndarray[np.double_t, ndim=2, mode="c"] Q_ = np.array(Q, dtype=np.double)
32-
cdef np.ndarray[np.double_t, ndim=2, mode="c"] Z = np.empty((n, n), dtype=np.double)
31+
cdef np.ndarray[np.double_t, ndim=2, mode="fortran"] Q_ = np.array(Q, dtype=np.double)
32+
cdef np.ndarray[np.double_t, ndim=2, mode="fortran"] Z = np.empty((n, n), dtype=np.double)
3333
assert lambda_reduction(n, &Q_[0,0], &Z[0,0]) == 0, "lambda error!"
3434
return Z
3535

@@ -51,9 +51,9 @@ def lambda_solution_(x, sigma, m):
5151
assert len(sigma.shape) == 2 and sigma.shape[0] == sigma.shape[1], "Q matrix must have shape (n, n)"
5252
assert len(x.shape) == 1 and x.shape[0] == sigma.shape[1], "x vector must have length to match sigma matrix"
5353
num_dds = x.shape[0]
54-
cdef np.ndarray[np.double_t, ndim=1, mode="c"] x_ = np.array(x, dtype=np.double)
55-
cdef np.ndarray[np.double_t, ndim=2, mode="c"] sigma_ = np.array(sigma, dtype=np.double)
56-
cdef np.ndarray[np.double_t, ndim=2, mode="c"] F_ = np.empty((num_dds,m), dtype=np.double)
57-
cdef np.ndarray[np.double_t, ndim=1, mode="c"] s_ = np.empty((m), dtype=np.double)
54+
cdef np.ndarray[np.double_t, ndim=1, mode="fortran"] x_ = np.array(x, dtype=np.double)
55+
cdef np.ndarray[np.double_t, ndim=2, mode="fortran"] sigma_ = np.array(sigma, dtype=np.double)
56+
cdef np.ndarray[np.double_t, ndim=2, mode="fortran"] F_ = np.empty((num_dds,m), dtype=np.double, order='F')
57+
cdef np.ndarray[np.double_t, ndim=1, mode="fortran"] s_ = np.empty((m), dtype=np.double, order='F')
5858
assert lambda_solution(num_dds, m, &x_[0], &sigma_[0,0], &F_[0,0], &s_[0]) == 0,"lambda error!"
5959
return (F_.T, s_.T)

0 commit comments

Comments
 (0)