1 //                                               -*- C++ -*-
2 /**
3  *  @brief TestResult implements the result of a statistical test
4  *
5  *  Copyright 2005-2021 Airbus-EDF-IMACS-ONERA-Phimeca
6  *
7  *  This library is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU Lesser General Public License as published by
9  *  the Free Software Foundation, either version 3 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with this library.  If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 #ifndef OPENTURNS_TESTRESULT_HXX
22 #define OPENTURNS_TESTRESULT_HXX
23 
24 #include "openturns/PersistentObject.hxx"
25 #include "openturns/StorageManager.hxx"
26 #include "openturns/Description.hxx"
27 
28 BEGIN_NAMESPACE_OPENTURNS
29 
30 
31 
32 /**
33  * @class TestResult
34  *
35  * TestResult implements the result of a statistical test
36  */
37 
38 class OT_API TestResult :
39   public PersistentObject
40 {
41   CLASSNAME
42 
43 public:
44 
45 
46   /** Default constructor */
47   TestResult();
48 
49   /** Parameters constructor */
50   TestResult(const String & type,
51              const Bool binMeasure,
52              const Scalar pVal,
53              const Scalar pThreshold,
54              const Scalar statistic);
55 
56 
57   /** Virtual constructor */
58   TestResult * clone() const override;
59 
60   /** Description Accessor */
61   void setDescription(const Description & description);
62   Description getDescription() const;
63 
64   /** String converter */
65   String __repr__() const override;
66 
67   /** Elements accessors */
68   Bool getBinaryQualityMeasure() const;
69   Scalar getPValue() const;
70   Scalar getThreshold() const;
71   String getTestType() const;
72   Scalar getStatistic() const;
73 
74   /** Comparison operator */
75   Bool operator ==(const TestResult & other) const;
76 
77   /** Method save() stores the object through the StorageManager */
78   void save(Advocate & adv) const override;
79 
80   /** Method load() reloads the object from the StorageManager */
81   void load(Advocate & adv) override;
82 
83 protected:
84 
85   String testType_;
86   Bool binaryQualityMeasure_ ;
87   Scalar pValueThreshold_ ;
88   Scalar pValue_ ;
89   Scalar statistic_;
90   Description description_;
91 
92 }
93 ; /* class TestResult */
94 
95 END_NAMESPACE_OPENTURNS
96 
97 #endif /* OPENTURNS_TESTRESULT_HXX */
98