npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
LOrPE1DCVResult.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_LORPE1DCVRESULT_HH_
2 #define NPSTAT_LORPE1DCVRESULT_HH_
3 
4 /*!
5 // \file LOrPE1DCVResult.hh
6 //
7 // \brief An object representing the result of the 1-d LOrPE
8 // cross-validation procedure
9 //
10 // Author: I. Volobouev
11 //
12 // August 2022
13 */
14 
15 #include <cassert>
16 
17 namespace npstat {
19  {
20  public:
21  // Default constructor creates an invalid result
22  inline LOrPE1DCVResult()
23  : filterDegree_(-1.0), bwFactor_(0.0), cvFunction_(0.0),
24  onDegreeBoundary_(true), onBwBoundary_(true) {}
25 
26  // This constructor must create a valid result
27  inline LOrPE1DCVResult(const double i_filterDegree,
28  const double i_bwFactor,
29  const double i_cvFunction,
30  const bool i_onDegreeBoundary,
31  const bool i_onBandwidthBoundary)
32  : filterDegree_(i_filterDegree),
33  bwFactor_(i_bwFactor),
34  cvFunction_(i_cvFunction),
35  onDegreeBoundary_(i_onDegreeBoundary),
36  onBwBoundary_(i_onBandwidthBoundary)
37  {
38  assert(this->isValid());
39  }
40 
41  inline void setDegreeBoundaryFlag(const bool b) {onDegreeBoundary_ = b;}
42 
43  inline double filterDegree() const {return filterDegree_;}
44  inline double bwFactor() const {return bwFactor_;}
45  inline double cvFunction() const {return cvFunction_;}
46  inline bool isOnDegreeBoundary() const {return onDegreeBoundary_;}
47  inline bool isOnBandwidthBoundary() const {return onBwBoundary_;}
48 
49  inline bool isValid() const {return filterDegree_ >= 0.0 && bwFactor_ > 0.0;}
50 
51  private:
52  double filterDegree_;
53  double bwFactor_;
54  double cvFunction_;
55  bool onDegreeBoundary_;
56  bool onBwBoundary_;
57  };
58 }
59 
60 #endif // NPSTAT_LORPE1DCVRESULT_HH_
Definition: LOrPE1DCVResult.hh:19
Definition: AbsArrayProjector.hh:14