Interval data storage. More...
#include <Bpp/Numeric/IntervalData.h>

Public Member Functions | |
| IntervalData (const Domain &domain, const std::string &name="") | |
| virtual | ~IntervalData () |
| virtual const Domain & | getDomain () const |
| virtual double | getDomainValue (double x) const |
| virtual void | setName (const std::string &name) |
| Set the name of this data. | |
| virtual const std::string & | getName () const |
| virtual unsigned int | getFreq (unsigned int i) const |
| virtual double | getDensity (unsigned int i) const |
| virtual const std::vector < unsigned int > & | getFrequencies () const |
| virtual Vdouble | getDensities () const |
| virtual void | addValue (double value) throw (OutOfRangeException) |
| Add a value to this data set. | |
| virtual unsigned int | getSize () const |
| virtual double | getMinValue () const |
| virtual double | getMaxValue () const |
| virtual double | getMean () const |
| virtual double | getSD () const |
| virtual double | getSDP () const |
| virtual void | reset () |
| Reset the container. | |
| virtual void | print (std::ostream &out) const |
| Print a summary of this data. | |
Private Attributes | |
| const Domain | _domain |
| std::vector< unsigned int > | _freqs |
| std::string | _name |
| double | _sum |
| double | _sumsquare |
| double | _min |
| double | _max |
| unsigned int | _n |
Interval data storage.
This class uses a Domain object for bounds and midpoints storage. the number of points in each interval/class is also stored.
Several statistical computations can be performed.
Adapted from the Java PSOL library.
Definition at line 62 of file IntervalData.h.
| IntervalData::IntervalData | ( | const Domain & | domain, | |
| const std::string & | name = "" | |||
| ) |
Definition at line 46 of file IntervalData.cpp.
References reset().
| virtual bpp::IntervalData::~IntervalData | ( | ) | [inline, virtual] |
Definition at line 74 of file IntervalData.h.
| void IntervalData::addValue | ( | double | value | ) | throw (OutOfRangeException) [virtual] |
Add a value to this data set.
Check for the interval this value belongs to, and update inner data (counts, sums, etc.).
| value | The value to add. |
| OutOfRangeException | If the value does not belong to the domain of this data set. |
Definition at line 59 of file IntervalData.cpp.
| Vdouble IntervalData::getDensities | ( | ) | const [virtual] |
Definition at line 52 of file IntervalData.cpp.
References _freqs, and getDensity().
| virtual double bpp::IntervalData::getDensity | ( | unsigned int | i | ) | const [inline, virtual] |
i. | i | the index of the interval. |
Definition at line 109 of file IntervalData.h.
Referenced by getDensities(), and print().
| virtual const Domain& bpp::IntervalData::getDomain | ( | ) | const [inline, virtual] |
Definition at line 81 of file IntervalData.h.
References _domain.
| virtual double bpp::IntervalData::getDomainValue | ( | double | x | ) | const [inline, virtual] |
Definition at line 86 of file IntervalData.h.
References _domain, and bpp::Domain::getNearestValue().
| virtual unsigned int bpp::IntervalData::getFreq | ( | unsigned int | i | ) | const [inline, virtual] |
i. | i | The index of the interval. |
Definition at line 103 of file IntervalData.h.
References _freqs.
| virtual const std::vector<unsigned int>& bpp::IntervalData::getFrequencies | ( | ) | const [inline, virtual] |
Definition at line 114 of file IntervalData.h.
References _freqs.
| virtual double bpp::IntervalData::getMaxValue | ( | ) | const [inline, virtual] |
Definition at line 144 of file IntervalData.h.
References _max.
| virtual double bpp::IntervalData::getMean | ( | ) | const [inline, virtual] |
Definition at line 149 of file IntervalData.h.
| virtual double bpp::IntervalData::getMinValue | ( | ) | const [inline, virtual] |
Definition at line 139 of file IntervalData.h.
References _min.
| virtual const std::string& bpp::IntervalData::getName | ( | ) | const [inline, virtual] |
| virtual double bpp::IntervalData::getSD | ( | ) | const [inline, virtual] |
where
is the number of points). Definition at line 155 of file IntervalData.h.
| virtual double bpp::IntervalData::getSDP | ( | ) | const [inline, virtual] |
rather than
). Definition at line 161 of file IntervalData.h.
References _n, _sum, and _sumsquare.
Referenced by getSD().
| virtual unsigned int bpp::IntervalData::getSize | ( | ) | const [inline, virtual] |
Definition at line 134 of file IntervalData.h.
References _n.
| void IntervalData::print | ( | std::ostream & | out | ) | const [virtual] |
Print a summary of this data.
| out | The stream where to print the summary. |
Definition at line 81 of file IntervalData.cpp.
References _domain, _freqs, bpp::Domain::getBound(), getDensity(), bpp::Domain::getSize(), and bpp::Domain::getValue().
| void IntervalData::reset | ( | ) | [virtual] |
Reset the container.
Remove all data and reinitialize all values (counts, sum, etc.).
Definition at line 71 of file IntervalData.cpp.
References _domain, _freqs, _max, _min, _n, _sum, _sumsquare, and bpp::Domain::getSize().
Referenced by IntervalData().
| virtual void bpp::IntervalData::setName | ( | const std::string & | name | ) | [inline, virtual] |
Set the name of this data.
| name | A name. |
Definition at line 93 of file IntervalData.h.
References _name.
const Domain bpp::IntervalData::_domain [private] |
Definition at line 65 of file IntervalData.h.
Referenced by getDomain(), getDomainValue(), print(), and reset().
std::vector<unsigned int> bpp::IntervalData::_freqs [private] |
Definition at line 66 of file IntervalData.h.
Referenced by getDensities(), getDensity(), getFreq(), getFrequencies(), print(), and reset().
double bpp::IntervalData::_max [private] |
Definition at line 68 of file IntervalData.h.
Referenced by getMaxValue(), and reset().
double bpp::IntervalData::_min [private] |
Definition at line 68 of file IntervalData.h.
Referenced by getMinValue(), and reset().
unsigned int bpp::IntervalData::_n [private] |
Definition at line 69 of file IntervalData.h.
Referenced by getDensity(), getMean(), getSD(), getSDP(), getSize(), and reset().
std::string bpp::IntervalData::_name [private] |
Definition at line 67 of file IntervalData.h.
double bpp::IntervalData::_sum [private] |
Definition at line 68 of file IntervalData.h.
double bpp::IntervalData::_sumsquare [private] |
Definition at line 68 of file IntervalData.h.
1.6.3