File: gnssProcessingStepComputeCovarianceMatrix.h

package info (click to toggle)
groops 0%2Bgit20240830%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: trixie
  • size: 11,052 kB
  • sloc: cpp: 134,939; fortran: 1,569; makefile: 20
file content (68 lines) | stat: -rw-r--r-- 2,430 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/***********************************************/
/**
* @file gnssProcessingStepComputeCovarianceMatrix.h
*
* @brief GNSS processing step: ComputeCovarianceMatrix.
*
* @author Torsten Mayer-Guerr
* @date 2021-09-05
*
*/
/***********************************************/

#ifndef __GROOPS_GNSSPROCESSINGSTEPCOMPUTECOVARIANCEMATRIX__
#define __GROOPS_GNSSPROCESSINGSTEPCOMPUTECOVARIANCEMATRIX__

// Latex documentation
#ifdef DOCSTRING_GnssProcessingStep
static const char *docstringGnssProcessingStepComputeCovarianceMatrix = R"(
\subsection{ComputeCovarianceMatrix}\label{gnssProcessingStepType:computeCovarianceMatrix}
Accumulates the normal equations and computes the covariance matrix as inverse of the normal matrix.
It is not the full inverse but only the elements which are set in the normal matrix
(see  \configClass{gnssProcessingStep:selectNormalsBlockStructure}{gnssProcessingStepType:selectNormalsBlockStructure})
are computed. The matrix is passed to the \configClass{parametrizations}{gnssParametrizationType}.
Only used in \configClass{parametrizations:kinematicPositions}{gnssParametrizationType:kinematicPositions}
to get the epoch wise covariance information at the moment.
)";
#endif

/***********************************************/

#include "config/config.h"
#include "gnss/gnssProcessingStep/gnssProcessingStep.h"

/***** CLASS ***********************************/

/** @brief GNSS processing step: ComputeCovarianceMatrix.
* @ingroup gnssProcessingStepGroup
* @see GnssProcessingStep */
class GnssProcessingStepComputeCovarianceMatrix : public GnssProcessingStepBase
{
public:
  GnssProcessingStepComputeCovarianceMatrix(Config &/*config*/) {}
  void process(GnssProcessingStep::State &state) override;
};

/***********************************************/

inline void GnssProcessingStepComputeCovarianceMatrix::process(GnssProcessingStep::State &state)
{
  try
  {
    logStatus<<"=== compute covariance matrix ==============================="<<Log::endl;
    state.buildNormals(FALSE/*constraintsOnly*/, FALSE/*solveEpochParameters*/);
    logStatus<<"cholesky"<<Log::endl;
    state.normals.cholesky(TRUE/*timing*/);
    logStatus<<"sparse inverse"<<Log::endl;
    state.normals.cholesky2SparseInverse();
    state.gnss->updateCovariance(state.normalEquationInfo, state.normals);
  }
  catch(std::exception &e)
  {
    GROOPS_RETHROW(e)
  }
}

/***********************************************/

#endif