Loading [MathJax]/jax/output/NativeMML/config.js
Isis Developer Reference
StatCumProbDistDynCalc.h
Go to the documentation of this file.
1 #ifndef StatCumProbDistDynCalc_h
2 #define StatCumProbDistDynCalc_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <QList>
11 #include <QObject>
12 #include <QVector>
13 
14 #include "XmlStackedHandler.h"
15 
16 class QDataStream;
17 class QUuid;
18 class QXmlStreamWriter;
19 
20 namespace Isis {
21  class Project;// ??? does xml stuff need project???
22  class XmlStackedHandlerReader;
23 
66  Q_OBJECT
67  // class uses the P^2 Algorithim to calculate equiprobability cell histograms from a stream of
68  // data without storing the data
69  // see "The p^2 Algorithim for Dynamic Calculations of Quantiles and Histograms Without Storing
70  // Observations"
71  public:
72  StatCumProbDistDynCalc(unsigned int nodes=20, QObject *parent = 0); //individual qunatile value to be calculated
74  QObject *parent = 0); // TODO: does xml stuff need project???
78 
79  void initialize(); // clears the member lists and initializes the rest of the member data to 0
80  void setQuantiles(unsigned int nodes); // initializes/resets the class to start new calculation
81 
82  void validate();
83  void addObs(double obs);
84 
85  double cumProb(double value); //given a value return the cumulative probility
86  double value(double cumProb); //given a cumulative probibility return a value
87  double max(); //return the largest value so far
88  double min(); //return the smallest values so far
89 
90  void save(QXmlStreamWriter &stream, const Project *project) const; // TODO: does xml stuff need project???
91 
92  QDataStream &write(QDataStream &stream) const;
93  QDataStream &read(QDataStream &stream);
94 
95  private:
102  class XmlHandler : public XmlStackedHandler {
103  public:
104  XmlHandler(StatCumProbDistDynCalc *probabilityCalc, Project *project); // TODO: does xml stuff need project???
105  ~XmlHandler();
106 
107  virtual bool startElement(const QString &namespaceURI, const QString &localName,
108  const QString &qName, const QXmlAttributes &atts);
109  virtual bool characters(const QString &ch);
110  virtual bool endElement(const QString &namespaceURI, const QString &localName,
111  const QString &qName);
112 
113  private:
114  Q_DISABLE_COPY(XmlHandler);
115 
116  StatCumProbDistDynCalc *m_xmlHandlerCumProbCalc;
117  Project *m_xmlHandlerProject; // TODO: does xml stuff need project???
118  QString m_xmlHandlerCharacters;
119  };
120 
121  unsigned int m_numberCells;
124  unsigned int m_numberQuantiles;
128  unsigned int m_numberObservations;
131  QList<double> m_quantiles;
133  QList<double> m_observationValues;
136  QList<double> m_idealNumObsBelowQuantile;
141  QList<int> m_numObsBelowQuantile;
145  };
146 
147  // operators to read/write StatCumProbDistDynCalc to/from binary data
148  QDataStream &operator<<(QDataStream &stream, const StatCumProbDistDynCalc &scpddc);
149  QDataStream &operator>>(QDataStream &stream, StatCumProbDistDynCalc &scpddc);
150 
151 } //end namespace Isis
152 
153 #endif
Isis::StatCumProbDistDynCalc::validate
void validate()
Definition: StatCumProbDistDynCalc.cpp:633
Isis::operator<<
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Definition: Hillshade.cpp:314
Isis::StatCumProbDistDynCalc::initialize
void initialize()
Inializer, resets the class to start its dynamic calculation anew.
Definition: StatCumProbDistDynCalc.cpp:97
Isis::StatCumProbDistDynCalc::min
double min()
Returns the maximum observation so far included in the dynamic calculation.
Definition: StatCumProbDistDynCalc.cpp:160
QList< double >
Project.h
Isis::StatCumProbDistDynCalc::~StatCumProbDistDynCalc
~StatCumProbDistDynCalc()
Destroys StatCumProbDistDynCalc object.
Definition: StatCumProbDistDynCalc.cpp:69
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
Isis::StatCumProbDistDynCalc::read
QDataStream & read(QDataStream &stream)
Definition: StatCumProbDistDynCalc.cpp:604
Isis::StatCumProbDistDynCalc::setQuantiles
void setQuantiles(unsigned int nodes)
Definition: StatCumProbDistDynCalc.cpp:107
Isis::StatCumProbDistDynCalc::operator=
StatCumProbDistDynCalc & operator=(const StatCumProbDistDynCalc &other)
Definition: StatCumProbDistDynCalc.cpp:74
Isis::XmlStackedHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Definition: XmlStackedHandler.cpp:44
Isis::StatCumProbDistDynCalc::max
double max()
Returns the maximum observation so far included in the dynamic calculation.
Definition: StatCumProbDistDynCalc.cpp:143
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
IString.h
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::StatCumProbDistDynCalc
This class is used to approximate cumulative probibility distributions of a stream of observations wi...
Definition: StatCumProbDistDynCalc.h:65
Pvl.h
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
StatCumProbDistDynCalc.h
Isis::XmlStackedHandler::endElement
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Definition: XmlStackedHandler.cpp:55
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::StatCumProbDistDynCalc::value
double value(double cumProb)
Provides the value of the variable that has the given cumulative probility (according the current est...
Definition: StatCumProbDistDynCalc.cpp:182
IException.h
Isis::toDouble
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::XmlStackedHandler
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:118
Isis::StatCumProbDistDynCalc::addObs
void addObs(double obs)
Values for the estimated quantile positions are update as observations are added.
Definition: StatCumProbDistDynCalc.cpp:394
Isis::StatCumProbDistDynCalc::StatCumProbDistDynCalc
StatCumProbDistDynCalc(unsigned int nodes=20, QObject *parent=0)
Construtor sets up the class to start recieving data.
Definition: StatCumProbDistDynCalc.cpp:37
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
QObject
Isis::StatCumProbDistDynCalc::save
void save(QXmlStreamWriter &stream, const Project *project) const
Definition: StatCumProbDistDynCalc.cpp:491
Isis::operator>>
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:447
XmlStackedHandlerReader.h
XmlStackedHandler.h
Isis::StatCumProbDistDynCalc::write
QDataStream & write(QDataStream &stream) const
Definition: StatCumProbDistDynCalc.cpp:591
Isis::StatCumProbDistDynCalc::cumProb
double cumProb(double value)
Provides the cumulative probility, that is, the proportion of the distribution that is less than or e...
Definition: StatCumProbDistDynCalc.cpp:299
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 03/21/2022 06:51:24