#include <IncrementalCholeskyDecomp.h>
|
| IncrementalCholeskyDecomp () |
| Initialize for a 0x0 matrix. More...
|
|
void | Extend () |
| Add one row and column of zeros. More...
|
|
void | SetLastRow (const std::vector< double > &row) |
| This is of course also the right-most column... More...
|
|
void | SetLastRow (const std::vector< double > &bigrow, const std::vector< int > &idxs) |
|
void | AddRow (const std::vector< double > &row) |
|
void | AddRow (const std::vector< double > &row, const std::vector< int > &idxs) |
|
std::vector< double > | Solve (const std::vector< double > &b) const |
|
void | Print () const |
|
|
std::vector< std::vector
< double > > | fUpper |
|
Definition at line 8 of file IncrementalCholeskyDecomp.h.
ana::IncrementalCholeskyDecomp::IncrementalCholeskyDecomp |
( |
| ) |
|
|
inline |
void ana::IncrementalCholeskyDecomp::AddRow |
( |
const std::vector< double > & |
row | ) |
|
|
inline |
Definition at line 23 of file IncrementalCholeskyDecomp.h.
void Extend()
Add one row and column of zeros.
void SetLastRow(const std::vector< double > &row)
This is of course also the right-most column...
void ana::IncrementalCholeskyDecomp::AddRow |
( |
const std::vector< double > & |
row, |
|
|
const std::vector< int > & |
idxs |
|
) |
| |
|
inline |
Definition at line 29 of file IncrementalCholeskyDecomp.h.
void Extend()
Add one row and column of zeros.
void SetLastRow(const std::vector< double > &row)
This is of course also the right-most column...
void ana::IncrementalCholeskyDecomp::Extend |
( |
| ) |
|
Add one row and column of zeros.
Definition at line 11 of file IncrementalCholeskyDecomp.cxx.
15 fUpper.emplace_back(fUpper.size()+1, 0);
std::vector< std::vector< double > > fUpper
void ana::IncrementalCholeskyDecomp::Print |
( |
| ) |
const |
void ana::IncrementalCholeskyDecomp::SetLastRow |
( |
const std::vector< double > & |
row | ) |
|
This is of course also the right-most column...
Definition at line 19 of file IncrementalCholeskyDecomp.cxx.
23 const unsigned int N =
fUpper.size();
28 for(
unsigned int i = 0; i+1 <
N; ++i){
30 for(
unsigned int j = 0; j < i; ++j) res -=
fUpper[j][i] *
fUpper[j][N-1];
37 fUpper[N-1][N-1] = sqrt(row[N-1] - dot);
constexpr auto dot(Vector const &a, Vector const &b)
Return cross product of two vectors.
std::vector< std::vector< double > > fUpper
T sqr(T x)
More efficient square function than pow(x,2)
process_name largeant stream1 can override from command line with o or output physics producers generator N
void ana::IncrementalCholeskyDecomp::SetLastRow |
( |
const std::vector< double > & |
bigrow, |
|
|
const std::vector< int > & |
idxs |
|
) |
| |
Definition at line 41 of file IncrementalCholeskyDecomp.cxx.
44 std::vector<double>
row;
45 row.reserve(idxs.size());
46 for(
int i: idxs) row.push_back(bigrow[i]);
void SetLastRow(const std::vector< double > &row)
This is of course also the right-most column...
std::vector< double > ana::IncrementalCholeskyDecomp::Solve |
( |
const std::vector< double > & |
b | ) |
const |
Definition at line 51 of file IncrementalCholeskyDecomp.cxx.
53 const unsigned int N =
fUpper.size();
56 std::vector<double>
y(N);
58 for(
unsigned int i = 0; i <
N; ++i){
60 for(
unsigned int j = 0; j < i; ++j) res -=
fUpper[j][i] *
y[j];
61 if(res != 0)
y[i] = res/
fUpper[i][i];
65 std::vector<double>
x(N);
67 for(
int i = N-1; i >= 0; --i){
69 for(
unsigned int j = i+1; j <
N; ++j) res -=
fUpper[i][j] *
x[j];
70 if(res != 0)
x[i] = res/
fUpper[i][i];
process_name opflash particleana ie x
std::vector< std::vector< double > > fUpper
process_name opflash particleana ie ie y
process_name largeant stream1 can override from command line with o or output physics producers generator N
std::vector<std::vector<double> > ana::IncrementalCholeskyDecomp::fUpper |
|
protected |
The documentation for this class was generated from the following files: