GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
rtklib_lambda.h
Go to the documentation of this file.
1 /*!
2  * \file rtklib_lambda.h
3  * \brief Integer ambiguity resolution
4  * \authors <ul>
5  * <li> 2007-2008, T. Takasu
6  * <li> 2017, Javier Arribas
7  * <li> 2017, Carles Fernandez
8  * </ul>
9  *
10  * This is a derived work from RTKLIB http://www.rtklib.com/
11  * The original source code at https://github.com/tomojitakasu/RTKLIB is
12  * released under the BSD 2-clause license with an additional exclusive clause
13  * that does not apply here. This additional clause is reproduced below:
14  *
15  * " The software package includes some companion executive binaries or shared
16  * libraries necessary to execute APs on Windows. These licenses succeed to the
17  * original ones of these software. "
18  *
19  * Neither the executive binaries nor the shared libraries are required by, used
20  * or included in GNSS-SDR.
21  *
22  * -----------------------------------------------------------------------------
23  * Copyright (C) 2007-2008, T. Takasu
24  * Copyright (C) 2017, Javier Arribas
25  * Copyright (C) 2017, Carles Fernandez
26  * All rights reserved.
27  *
28  * SPDX-License-Identifier: BSD-2-Clause
29  *
30  * References:
31  * [1] P.J.G.Teunissen, The least-square ambiguity decorrelation adjustment:
32  * a method for fast GPS ambiguity estimation, J.Geodesy, Vol.70, 65-82,
33  * 1995
34  * [2] X.-W.Chang, X.Yang, T.Zhou, MLAMBDA: A modified LAMBDA method for
35  * integer least-squares estimation, J.Geodesy, Vol.79, 552-565, 2005
36  *
37  * -----------------------------------------------------------------------------
38  */
39 
40 #ifndef GNSS_SDR_RTKLIB_LAMBDA_H
41 #define GNSS_SDR_RTKLIB_LAMBDA_H
42 
43 
44 #include "rtklib.h"
45 
46 /* constants/macros ----------------------------------------------------------*/
47 const int LOOPMAX = 10000; /* maximum count of search loop */
48 #define SGN_LAMBDA(x) ((x) <= 0.0 ? -1.0 : 1.0)
49 #define ROUND_LAMBDA(x) (floor((x) + 0.5))
50 #define SWAP_LAMBDA(x, y) \
51  do \
52  { \
53  double tmp_; \
54  tmp_ = x; \
55  x = y; \
56  y = tmp_; \
57  } \
58  while (0)
59 
60 int LD(int n, const double *Q, double *L, double *D);
61 void gauss(int n, double *L, double *Z, int i, int j);
62 void perm(int n, double *L, double *D, int j, double del, double *Z);
63 void reduction(int n, double *L, double *D, double *Z);
64 int search(int n, int m, const double *L, const double *D,
65  const double *zs, double *zn, double *s);
66 
67 int lambda(int n, int m, const double *a, const double *Q, double *F, double *s);
68 
69 int lambda_reduction(int n, const double *Q, double *Z);
70 
71 int lambda_search(int n, int m, const double *a, const double *Q,
72  double *F, double *s);
73 
74 
75 #endif
main header file for the rtklib library