npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
unitMatrixDeviations.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_UNITMATRIXDEVIATIONS_HH_
2 #define NPSTAT_UNITMATRIXDEVIATIONS_HH_
3 
4 /*!
5 // \file unitMatrixDeviations.hh
6 //
7 // \brief Routines for finding deviations from unit matrix behavior
8 // as a function of submatrix size
9 //
10 // Author: I. Volobouev
11 //
12 // June 2023
13 */
14 
15 #include "npstat/nm/Matrix.hh"
16 
17 namespace npstat {
18  //@{
19  /**
20  // The following function returns the size of the maximum absolute
21  // deviation as a function of leading principal submatrix size.
22  // result[0] will contain the deviation for 1 x 1 submatrix,
23  // result[1] will contain the deviation for 2 x 2 submatrix, etc.
24  */
25  template<typename Numeric, unsigned Len, typename T>
27  std::vector<T>* result);
28  template<typename Numeric, unsigned Len, typename T>
29  void unitMatrixDeviationsFrobenius(const Matrix<Numeric,Len>& mat,
30  std::vector<T>* result);
31  //@}
32 
33  //@{
34  /**
35  // The following function returns the size of the leading principal
36  // submatrix whose absolute deviations from the unit matrix do not
37  // exceeed the requested tolerance.
38  */
39  template<typename Numeric, unsigned Len>
41  double tolerance);
42  template<typename Numeric, unsigned Len>
43  unsigned deviationsRestrictedSizeFrobenius(const Matrix<Numeric,Len>& mat,
44  double tolerance);
45  //@}
46 }
47 
48 #include "npstat/nm/unitMatrixDeviations.icc"
49 
50 #endif // NPSTAT_UNITMATRIXDEVIATIONS_HH_
Template matrix class.
Definition: Matrix.hh:49
Definition: AbsArrayProjector.hh:14
void unitMatrixDeviations(const Matrix< Numeric, Len > &mat, std::vector< T > *result)
unsigned deviationsRestrictedSize(const Matrix< Numeric, Len > &mat, double tolerance)