#include <histogram.h>
Definition at line 68 of file histogram.h.
Public Member Functions | |
Histogram () | |
template<class DType> | |
void | calcHist (DType *data, int len) |
This function calculates the histogram for the given dataset. | |
vector< Hash > | getHist () |
Get the histogram that was calculated with calcHist. | |
double | getMin () |
Get the minimum value of the calculated dataset. | |
double | getMax () |
Get the maximum value of the calculated dataset. | |
int | getLen () |
Get the length of the calculated dataset. | |
int | getMaxCnt () |
Get the maximum count in the histogram. | |
Private Member Functions | |
void | insert (double val) |
Add a new value to the histogram. | |
Hash * | find (double val) |
Find a Hash with "val" value. | |
Hash * | findGt (double val) |
Find the first Hash with mVal greater than val. | |
Private Attributes | |
int | mLen |
int | mMaxCnt |
double | mMin |
double | mMax |
vector< Hash > | mHist |
Histogram::Histogram | ( | ) | [inline] |
void Histogram::insert | ( | double | val | ) | [inline, private] |
Add a new value to the histogram.
find( double val ) would be called first to make sure the value is not allready present.
Definition at line 82 of file histogram.h.
References findGt(), and mHist.
Referenced by calcHist().
Hash* Histogram::find | ( | double | val | ) | [inline, private] |
Find a Hash with "val" value.
Non-linear search.
Definition at line 90 of file histogram.h.
References mHist.
Referenced by calcHist().
Hash* Histogram::findGt | ( | double | val | ) | [inline, private] |
Find the first Hash with mVal greater than val.
Non-linear search.
Definition at line 135 of file histogram.h.
References mHist.
Referenced by insert().
void Histogram::calcHist | ( | DType * | data, | |
int | len | |||
) | [inline] |
This function calculates the histogram for the given dataset.
The dataset should be a numeric array. This will loop through every value in the dataset and store it's count in a Hash. When the routine ends, the member hash will be an array of value count mappings, or the histogram of this dataset.
Definition at line 194 of file histogram.h.
References find(), Hash::incCnt(), insert(), mHist, mLen, mMax, mMaxCnt, and mMin.
Referenced by HistogramSet::setData().
vector<Hash> Histogram::getHist | ( | ) | [inline] |
Get the histogram that was calculated with calcHist.
Definition at line 229 of file histogram.h.
References mHist.
Referenced by HistogramDlg::createDataPnts().
double Histogram::getMin | ( | ) | [inline] |
Get the minimum value of the calculated dataset.
Definition at line 237 of file histogram.h.
References mMin.
Referenced by HistogramDlg::alertUser(), HistogramDlg::createDataPnts(), and HistogramDlg::paintEvent().
double Histogram::getMax | ( | ) | [inline] |
Get the maximum value of the calculated dataset.
Definition at line 245 of file histogram.h.
References mMax.
Referenced by HistogramDlg::alertUser(), HistogramDlg::createDataPnts(), and HistogramDlg::paintEvent().
int Histogram::getLen | ( | ) | [inline] |
Get the length of the calculated dataset.
Definition at line 255 of file histogram.h.
References mLen.
int Histogram::getMaxCnt | ( | ) | [inline] |
Get the maximum count in the histogram.
Definition at line 263 of file histogram.h.
References mMaxCnt.
Referenced by HistogramDlg::createDataPnts().
int Histogram::mLen [private] |
int Histogram::mMaxCnt [private] |
double Histogram::mMin [private] |
double Histogram::mMax [private] |
vector<Hash> Histogram::mHist [private] |
Definition at line 75 of file histogram.h.
Referenced by calcHist(), find(), findGt(), getHist(), and insert().
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |