All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IncrementalCholeskyDecomp.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 
5 namespace ana
6 {
7  // Based on https://en.wikipedia.org/wiki/Cholesky_decomposition#Adding_and_removing_rows_and_columns
9  {
10  public:
11  /// Initialize for a 0x0 matrix
13 
14  /// Add one row and column of zeros
15  void Extend();
16 
17  /// This is of course also the right-most column...
18  void SetLastRow(const std::vector<double>& row);
19 
20  void SetLastRow(const std::vector<double>& bigrow,
21  const std::vector<int>& idxs);
22 
23  void AddRow(const std::vector<double>& row)
24  {
25  Extend();
26  SetLastRow(row);
27  }
28 
29  void AddRow(const std::vector<double>& row,
30  const std::vector<int>& idxs)
31  {
32  Extend();
33  SetLastRow(row, idxs);
34  }
35 
36  std::vector<double> Solve(const std::vector<double>& b) const;
37 
38  void Print() const;
39 
40  protected:
41  std::vector<std::vector<double>> fUpper;
42  };
43 }
void AddRow(const std::vector< double > &row, const std::vector< int > &idxs)
void Extend()
Add one row and column of zeros.
void AddRow(const std::vector< double > &row)
process_name opflashCryoW ana
std::vector< std::vector< double > > fUpper
void SetLastRow(const std::vector< double > &row)
This is of course also the right-most column...
std::vector< double > Solve(const std::vector< double > &b) const
IncrementalCholeskyDecomp()
Initialize for a 0x0 matrix.