npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
modifiedGramSchmidt.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_MODIFIEDGRAMSCHMIDT_HH_
2 #define NPSTAT_MODIFIEDGRAMSCHMIDT_HH_
3 
4 /*!
5 // \file modifiedGramSchmidt.hh
6 //
7 // \brief Numerically stable modified Gram-Schmidt procedure
8 //
9 // Author: I. Volobouev
10 //
11 // February 2023
12 */
13 
14 namespace npstat {
15  /**
16  // Numerically stable modified Gram-Schmidt procedure.
17  // Builds the orthogonal vectors in-place. All rows
18  // will be orthonormal on exit.
19  //
20  // The input data should represent a collection of input
21  // vectors, row-by-row. If this is treated as a matrix,
22  // input parameter "nVectors" is the number of rows, and
23  // "dim" is the number of columns. Normally, we must have
24  // nVectors <= dim.
25  //
26  // SprodFunctor is a functor which should have a method
27  // with the signature that looks something like
28  // Real operator()(const Real*, const Real*, unsigned long) const
29  //
30  // The parameter "vector0AlreadyNormalized" should normally
31  // be set to "true" if we are creating an orthogonal polynomial
32  // system. For OPSs, the first vector should consist of 1s, while
33  // the normalization is performed instead on the weight function.
34  */
35  template<typename Real, class SprodFunctor>
36  void modifiedGramSchmidt(Real* data, unsigned nVectors, unsigned dim,
37  const SprodFunctor& sprodCalc,
38  bool vector0AlreadyNormalized=false);
39 }
40 
41 #include "npstat/nm/modifiedGramSchmidt.icc"
42 
43 #endif // NPSTAT_MODIFIEDGRAMSCHMIDT_HH_
Definition: AbsArrayProjector.hh:14
void modifiedGramSchmidt(Real *data, unsigned nVectors, unsigned dim, const SprodFunctor &sprodCalc, bool vector0AlreadyNormalized=false)