MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_lambda.c File Reference
#include "mrtklib/mrtk_lambda.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_mat.h"
Include dependency graph for mrtk_lambda.c:

Go to the source code of this file.

Macros

#define LOOPMAX   10000 /* maximum count of search loop */
#define SGN(x)
#define ROUND(x)
#define SWAP(x, y)

Functions

static int LD (int n, const double *Q, double *L, double *D)
static void gauss (int n, double *L, double *Z, int i, int j)
static void perm (int n, double *L, double *D, int j, double del, double *Z)
static void reduction (int n, double *L, double *D, double *Z)
static int search (int n, int m, const double *L, const double *D, const double *zs, double *zn, double *s)
int lambda (int n, int m, const double *a, const double *Q, double *F, double *s)
 Integer least-square estimation (LAMBDA/MLAMBDA).
int lambda_reduction (int n, const double *Q, double *Z)
 LAMBDA reduction for integer least-squares.
int lambda_search (int n, int m, const double *a, const double *Q, double *F, double *s)
 MLAMBDA search for integer least-squares.
static double cdf_norm (double x)

Variables

static const float inv_ratio_tbl_1 []
static const float inv_ratio_tbl_10 []

Macro Definition Documentation

◆ LOOPMAX

#define LOOPMAX   10000 /* maximum count of search loop */

Definition at line 27 of file mrtk_lambda.c.

Referenced by search().

◆ ROUND

#define ROUND ( x)
Value:
(floor((x) + 0.5))

Definition at line 30 of file mrtk_lambda.c.

Referenced by gauss(), and search().

◆ SGN

#define SGN ( x)
Value:
((x) <= 0.0 ? -1.0 : 1.0)

Definition at line 29 of file mrtk_lambda.c.

Referenced by search().

◆ SWAP

#define SWAP ( x,
y )
Value:
do { \
double tmp_; \
tmp_ = x; \
x = y; \
y = tmp_; \
} while (0)

Definition at line 31 of file mrtk_lambda.c.

Referenced by perm(), and search().

Function Documentation

◆ cdf_norm()

double cdf_norm ( double x)
static

Definition at line 565 of file mrtk_lambda.c.

◆ gauss()

void gauss ( int n,
double * L,
double * Z,
int i,
int j )
static

Definition at line 70 of file mrtk_lambda.c.

References ROUND.

Referenced by reduction().

Here is the caller graph for this function:

◆ lambda()

int lambda ( int n,
int m,
const double * a,
const double * Q,
double * F,
double * s )
extern

Integer least-square estimation (LAMBDA/MLAMBDA).

Reduction is performed by LAMBDA (ref.[1]), and search by MLAMBDA (ref.[2]).

Parameters
[in]nNumber of float parameters
[in]mNumber of fixed solutions
[in]aFloat parameters (n x 1)
[in]QCovariance matrix of float parameters (n x n)
[out]FFixed solutions (n x m)
[out]sSum of squared residuals of fixed solutions (1 x m)
Returns
Status (0: ok, other: error)
Note
Matrix stored by column-major order (Fortran convention).

Definition at line 225 of file mrtk_lambda.c.

References eye(), free, LD(), mat(), matmul(), reduction(), search(), solve(), and zeros().

Referenced by gen_msm_sig(), resamb_LAMBDA(), resamb_LAMBDA(), resamb_LAMBDA(), and search_amb_lambda().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lambda_reduction()

int lambda_reduction ( int n,
const double * Q,
double * Z )
extern

LAMBDA reduction for integer least-squares.

Performs decorrelation reduction on the covariance matrix using the LAMBDA method (ref.[1]).

Parameters
[in]nNumber of float parameters
[in]QCovariance matrix of float parameters (n x n)
[out]ZLAMBDA reduction matrix (n x n)
Returns
Status (0: ok, other: error)

Definition at line 263 of file mrtk_lambda.c.

References free, LD(), mat(), reduction(), and zeros().

Here is the call graph for this function:

◆ lambda_search()

int lambda_search ( int n,
int m,
const double * a,
const double * Q,
double * F,
double * s )
extern

MLAMBDA search for integer least-squares.

Performs the modified LAMBDA search algorithm (ref.[2]) for integer least-squares estimation.

Parameters
[in]nNumber of float parameters
[in]mNumber of fixed solutions
[in]aFloat parameters (n x 1)
[in]QCovariance matrix of float parameters (n x n)
[out]FFixed solutions (n x m)
[out]sSum of squared residuals of fixed solutions (1 x m)
Returns
Status (0: ok, other: error)

Definition at line 302 of file mrtk_lambda.c.

References free, LD(), mat(), search(), and zeros().

Here is the call graph for this function:

◆ LD()

int LD ( int n,
const double * Q,
double * L,
double * D )
static

Definition at line 40 of file mrtk_lambda.c.

References free, and mat().

Referenced by lambda(), lambda_reduction(), and lambda_search().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ perm()

void perm ( int n,
double * L,
double * D,
int j,
double del,
double * Z )
static

Definition at line 83 of file mrtk_lambda.c.

References SWAP.

Referenced by reduction().

Here is the caller graph for this function:

◆ reduction()

void reduction ( int n,
double * L,
double * D,
double * Z )
static

Definition at line 106 of file mrtk_lambda.c.

References gauss(), and perm().

Referenced by lambda(), and lambda_reduction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ search()

int search ( int n,
int m,
const double * L,
const double * D,
const double * zs,
double * zn,
double * s )
static

Definition at line 129 of file mrtk_lambda.c.

References free, LOOPMAX, mat(), ROUND, SGN, SWAP, and zeros().

Referenced by get_close_clock(), get_close_orbit(), lambda(), and lambda_search().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ inv_ratio_tbl_1

const float inv_ratio_tbl_1[]
static

Definition at line 327 of file mrtk_lambda.c.

◆ inv_ratio_tbl_10

const float inv_ratio_tbl_10[]
static

Definition at line 471 of file mrtk_lambda.c.