15 fUpper.emplace_back(fUpper.size()+1, 0);
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);
42 const std::vector<int>& idxs)
44 std::vector<double>
row;
45 row.reserve(idxs.size());
46 for(
int i: idxs) row.push_back(bigrow[i]);
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];
79 for(
const std::vector<double>&
row:
fUpper){
constexpr auto dot(Vector const &a, Vector const &b)
Return cross product of two vectors.
process_name opflash particleana ie x
void Extend()
Add one row and column of zeros.
process_name opflashCryoW ana
std::vector< std::vector< double > > fUpper
T sqr(T x)
More efficient square function than pow(x,2)
process_name opflash particleana ie ie y
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
process_name largeant stream1 can override from command line with o or output physics producers generator N
BEGIN_PROLOG could also be cout