PandaRoot
Tools.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2008-2010, Technische Universitaet Muenchen,
14  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30 */
31 
36 #ifndef genfit_Tools_h
37 #define genfit_Tools_h
38 
39 #include <TVectorD.h>
40 #include <TMatrixD.h>
41 #include <TMatrixDSym.h>
42 
46 namespace genfit {
47 namespace tools {
48 
52 void invertMatrix(const TMatrixDSym &mat, TMatrixDSym &inv, double *determinant = nullptr);
55 void invertMatrix(TMatrixDSym &mat, double *determinant = nullptr);
56 
60 bool transposedForwardSubstitution(const TMatrixD &R, TVectorD &b);
62 bool transposedForwardSubstitution(const TMatrixD &R, TMatrixD &b, int nCol);
64 bool transposedInvert(const TMatrixD &R, TMatrixD &inv);
65 
70 void QR(TMatrixD &A);
71 
77 void QR(TMatrixD &A, TVectorD &b);
78 
83 void safeAverage(const TMatrixDSym &C1, const TMatrixDSym &C2, TMatrixDSym &result);
84 
85 } /* End of namespace tools */
86 } /* End of namespace genfit */
89 #endif // genfit_Tools_h
void QR(TMatrixD &A)
Replaces A with an upper right matrix connected to A by an orthongonal transformation. I.e., it computes R from a QR decomposition of A = QR, replacing A.
bool transposedForwardSubstitution(const TMatrixD &R, TVectorD &b)
Solves R^t x = b, replacing b with the solution for x. R is assumed to be upper diagonal.
void safeAverage(const TMatrixDSym &C1, const TMatrixDSym &C2, TMatrixDSym &result)
This averages the covariance matrices C1, C2 in a numerically stable way by using matrix square roots...
bool transposedInvert(const TMatrixD &R, TMatrixD &inv)
Inverts the transpose of the upper right matrix R into inv.
void invertMatrix(const TMatrixDSym &mat, TMatrixDSym &inv, double *determinant=nullptr)
Invert a matrix, throwing an Exception when inversion fails. Optional calculation of determinant...
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:64
Matrix inversion tools.
Definition: AbsBField.h:40