Brief description of class still missing. More...
#include <Histogram.h>
Public Member Functions | |
| void | addValue (double v) |
| QVector< Rect > | boxes () const |
| void | clear () |
| Histogram () | |
| Rect | limits () const |
| RealStatisticalValue | mean () const |
| RealStatisticalValue | median () const |
| RealStatisticalValue | mode () const |
| void | normalize () |
| SamplingOptions | sampling () const |
| void | setSampling (int n, double min, double max, SamplingOptions sampling) |
| ~Histogram () | |
Brief description of class still missing.
Full description of class still missing
| void QGpCoreTools::Histogram::addValue | ( | double | v | ) |
References QGpCoreTools::Curve< Point2D >::count(), QGpCoreTools::Curve< Point2D >::indexAfter(), QGpCoreTools::Point2D::setY(), TRACE, and QGpCoreTools::Point2D::y().
Referenced by Acquisition::apparentResistivityHistogram(), Acquisition::currentHistogram(), Acquisition::variabilityHistogram(), and Acquisition::voltageHistogram().
{
TRACE;
int i=indexAfter(v);
if(i<count()) {
Point2D& p=(*this)[i];
p.setY(p.y()+1.0);
} else {
_lastClass++;
}
}
| QVector< Rect > QGpCoreTools::Histogram::boxes | ( | ) | const |
References QGpCoreTools::Curve< Point2D >::at(), QGpCoreTools::Curve< Point2D >::count(), QGpCoreTools::Point2D::setX(), TRACE, and QGpCoreTools::Point2D::x().
Referenced by SciFigs::HistogramLayer::paintData().
{
TRACE;
QVector<Rect> rects;
int n=count();
Point2D lastp(-1e99,0.0);
for(int i=0; i<n; i++) {
const Point2D& p=at(i);
rects.append(Rect(lastp, p));
lastp.setX(p.x());
}
rects.append(Rect(Point2D(lastp.x(), _lastClass), Point2D(1e99, 0.0)));
return rects;
}
| void QGpCoreTools::Histogram::clear | ( | ) |
Reimplemented from QGpCoreTools::Curve< Point2D >.
References QGpCoreTools::Curve< Point2D >::count(), QGpCoreTools::Curve< Point2D >::first(), QGpCoreTools::Curve< Point2D >::last(), setSampling(), and TRACE.
{
TRACE;
if(count()>1) {
setSampling(count(), first().x(), last().x(), _sampling);
} else {
Curve<Point2D>::clear();
_lastClass=0.0;
}
}
| Rect QGpCoreTools::Histogram::limits | ( | ) | const |
{
}
{
}
{
}
| void QGpCoreTools::Histogram::normalize | ( | ) |
The two ending classes are not considered: infinite width with eventually a an infinite area. In fact, it assumes that these classes are null.
References QGpCoreTools::Rect::area(), QGpCoreTools::Curve< Point2D >::at(), QGpCoreTools::Curve< Point2D >::count(), QGpCoreTools::Curve< Point2D >::first(), QGpCoreTools::Point2D::setX(), QGpCoreTools::Point2D::setY(), TRACE, QGpCoreTools::Point2D::x(), and QGpCoreTools::Point2D::y().
{
TRACE;
int n=count();
Point2D lastp(first().x(),0.0);
double area=0.0;
for(int i=1; i<n; i++) {
const Point2D& p=at(i);
Rect r(lastp, p);
area+=r.area();
lastp.setX(p.x());
}
double factor=1.0/area;
for(int i=1; i<n; i++) {
Point2D& p=(*this)[i];
Rect r(lastp, p);
p.setY(p.y()*r.area()*factor);
lastp.setX(p.x());
}
}
| SamplingOptions QGpCoreTools::Histogram::sampling | ( | ) | const [inline] |
Referenced by setSampling().
{return _sampling;}
| void QGpCoreTools::Histogram::setSampling | ( | int | n, |
| double | min, | ||
| double | max, | ||
| SamplingOptions | sampling | ||
| ) |
References QGpCoreTools::Function, QGpCoreTools::Curve< Point2D >::line(), QGpCoreTools::Curve< Point2D >::resample(), sampling(), and TRACE.
Referenced by Acquisition::apparentResistivityHistogram(), clear(), Acquisition::currentHistogram(), Acquisition::variabilityHistogram(), and Acquisition::voltageHistogram().