File: normalEquationFile.h

package info (click to toggle)
groops 0%2Bgit20250907%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 11,140 kB
  • sloc: cpp: 135,607; fortran: 1,603; makefile: 20
file content (62 lines) | stat: -rw-r--r-- 1,992 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
/***********************************************/
/**
* @file normalEquationFile.h
*
* @brief Read normals from file.
* @see NormalEquation
*
* @author Torsten Mayer-Guerr
* @date 2004-12-10
*
*/
/***********************************************/

#ifndef __GROOPS_NORMALEQUATIONFILE__
#define __GROOPS_NORMALEQUATIONFILE__

// Latex documentation
#ifdef DOCSTRING_NormalEquation
static const char *docstringNormalEquationFile = R"(
\subsection{File}\label{normalEquationType:file}
Reads a system of normal equations from file \configFile{inputfileNormalEquation}{normalEquation}
as generated by e.g. \program{NormalsBuild}.
)";
#endif

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

#include "classes/normalEquation/normalEquation.h"
#include "files/fileNormalEquation.h"

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

/** @brief Read normals from file.
* @ingroup normalEquationGroup
* @see NormalEquation */
class NormalEquationFile : public NormalEquationBase
{
  FileName           fileName;
  UInt               startIndex;
  UInt               paraCount, rhsCount, obsCount;
  std::vector<ParameterName> names;
  MatrixDistributed  normals;
  Matrix             n;
  Vector             lPl;
  Double             sigma2;

public:
  NormalEquationFile(Config &config);

  UInt   rightHandSideCount() const override {return lPl.size();}
  UInt   parameterCount()     const override {return paraCount + startIndex;}
  void   parameterNames(std::vector<ParameterName> &names) const override;
  void   init(MatrixDistributed &normals, UInt rhsCount) override;
  Bool   addNormalEquation(UInt rhsNo, const const_MatrixSlice &x, const const_MatrixSlice &Wz,
                           MatrixDistributed &normals, Matrix &n, Vector &lPl, UInt &obsCount) override;
  Vector contribution(MatrixDistributed &Cov) override;
  std::vector<Double> varianceComponentFactors() const override {return std::vector<Double>({sigma2});}
};

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

#endif