casacore
|
Representation of a statistics dataset used in statistics framework calculatations. More...
#include <StatisticsDataset.h>
Classes | |
struct | ChunkData |
holds information about a data chunk. More... | |
Public Member Functions | |
StatisticsDataset () | |
StatisticsDataset (const StatisticsDataset &other) | |
~StatisticsDataset () | |
StatisticsDataset< CASA_STATP > & | operator= (const StatisticsDataset< CASA_STATP > &other) |
use copy semantics, except for the data provider which uses reference semantics More... | |
void | addData (const DataIterator &first, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False) |
Add a dataset to an existing set of datasets on which statistics are to be calculated. More... | |
void | addData (const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False) |
void | addData (const DataIterator &first, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1) |
void | addData (const DataIterator &first, const MaskIterator &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1) |
void | addData (const DataIterator &first, const WeightsIterator &weightFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False) |
void | addData (const DataIterator &first, const WeightsIterator &weightFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False) |
void | addData (const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1) |
void | addData (const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1) |
Bool | empty () const |
returns ! dataProvider && _data.empty() More... | |
const std::vector< Int64 > & | getCounts () const |
get data counts associated with the underlying data sets More... | |
StatsDataProvider< CASA_STATP > * | getDataProvider () |
const StatsDataProvider < CASA_STATP > * | getDataProvider () const |
Int64 | iDataset () const |
Bool | increment (Bool includeIDataset) |
void | incrementThreadIters (DataIterator &dataIter, MaskIterator &maskIter, WeightsIterator &weightsIter, uInt64 &offset, uInt nthreads) const |
void | initIterators () |
void | initLoopVars (uInt64 &chunkCount, uInt &chunkStride, Bool &chunkHasRanges, DataRanges &chunkRanges, Bool &chunkIsIncludeRanges, Bool &chunkHasMask, uInt &chunkMaskStride, Bool &chunkHasWeights) |
used for threaded methods More... | |
void | initLoopVars (DataIterator &chunkData, uInt64 &chunkCount, uInt &chunkStride, Bool &chunkHasRanges, DataRanges &chunkRanges, Bool &chunkIsIncludeRanges, Bool &chunkHasMask, MaskIterator &chunkMask, uInt &chunkMaskStride, Bool &chunkHasWeights, WeightsIterator &chunkWeights) |
used for unthreaded methods More... | |
const ChunkData & | initLoopVars () |
void | initThreadVars (uInt &nBlocks, uInt64 &extra, uInt &nthreads, std::unique_ptr< DataIterator[]> &dataIter, std::unique_ptr< MaskIterator[]> &maskIter, std::unique_ptr< WeightsIterator[]> &weightsIter, std::unique_ptr< uInt64[]> &offset, uInt nThreadsMax) const |
void | reset () |
void | resetIDataset () |
void | setData (const DataIterator &first, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False) |
setdata() clears any current datasets or data provider and then adds the specified data set as the first dataset in the (possibly new) set of data sets for which statistics are to be calculated. More... | |
void | setData (const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False) |
void | setData (const DataIterator &first, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1) |
void | setData (const DataIterator &first, const MaskIterator &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1) |
void | setData (const DataIterator &first, const WeightsIterator &weightFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False) |
void | setData (const DataIterator &first, const WeightsIterator &weightFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False) |
void | setData (const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1) |
void | setData (const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1) |
void | setDataProvider (StatsDataProvider< CASA_STATP > *dataProvider) |
instead of setting and adding data "by hand", set the data provider that will provide all the data sets. More... | |
Private Member Functions | |
void | _throwIfDataProviderDefined () const |
Private Attributes | |
std::vector< DataIterator > | _data |
std::map< uInt, WeightsIterator > | _weights |
maps data to weights. More... | |
std::map< uInt, MaskIterator > | _masks |
maps data to masks More... | |
std::vector< Int64 > | _counts |
std::vector< uInt > | _dataStrides |
std::map< uInt, uInt > | _maskStrides |
std::map< uInt, Bool > | _isIncludeRanges |
std::map< uInt, DataRanges > | _dataRanges |
StatsDataProvider< CASA_STATP > * | _dataProvider |
Int64 | _idataset |
std::vector< DataIterator > ::const_iterator | _dend |
std::vector< DataIterator > ::const_iterator | _diter |
std::vector< Int64 > ::const_iterator | _citer |
std::vector< uInt >::const_iterator | _dsiter |
uInt | _dataCount |
ChunkData | _chunk |
Representation of a statistics dataset used in statistics framework calculatations.
This class is used internally by StatisticsAlgorithm and its derived classes. There should be no need for an API developer to make direct use of this class. It encapsulates the data-related portions of StatisticsAlgorithm and derived classes. To add and set data or to set a data provider, one should call the relevant methods in StatisticsAlgorithm which have been left unchanged for the convenience of the API developer. Those methods call the analogous methods in this class (and the methods in StatisticsAlgorithm also do necessary bookkeeping for the StatisticsAlgorithm and derived objects).
Definition at line 53 of file StatisticsDataset.h.
casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::StatisticsDataset | ( | ) |
casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::StatisticsDataset | ( | const StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator > & | other | ) |
casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::~StatisticsDataset | ( | ) |
|
private |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData | ( | const DataIterator & | first, |
uInt | nr, | ||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False |
||
) |
Add a dataset to an existing set of datasets on which statistics are to be calculated.
nr is the number of points to be considered. If dataStride
is greater than 1, when nrAccountsForStride
=True indicates that the stride has been taken into account in the value of nr
. Otherwise, it has not so that the actual number of points to include is nr/dataStride if nr % dataStride == 0 or (int)(nr/dataStride) + 1 otherwise. If one calls this method after a data provider has been set, an exception will be thrown. In this case, one should call setData(), rather than addData(), to indicate that the underlying data provider should be removed. dataRanges
provide the ranges of data to include if isInclude
is True, or ranges of data to exclude if isInclude
is False. If a datum equals the end point of a data range, it is considered good (included) if isInclude
is True, and it is considered bad (excluded) if isInclude
is False.
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData | ( | const DataIterator & | first, |
uInt | nr, | ||
const DataRanges & | dataRanges, | ||
Bool | isInclude = True , |
||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData | ( | const DataIterator & | first, |
const MaskIterator & | maskFirst, | ||
uInt | nr, | ||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False , |
||
uInt | maskStride = 1 |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData | ( | const DataIterator & | first, |
const MaskIterator & | maskFirst, | ||
uInt | nr, | ||
const DataRanges & | dataRanges, | ||
Bool | isInclude = True , |
||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False , |
||
uInt | maskStride = 1 |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData | ( | const DataIterator & | first, |
const WeightsIterator & | weightFirst, | ||
uInt | nr, | ||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData | ( | const DataIterator & | first, |
const WeightsIterator & | weightFirst, | ||
uInt | nr, | ||
const DataRanges & | dataRanges, | ||
Bool | isInclude = True , |
||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData | ( | const DataIterator & | first, |
const WeightsIterator & | weightFirst, | ||
const MaskIterator & | maskFirst, | ||
uInt | nr, | ||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False , |
||
uInt | maskStride = 1 |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData | ( | const DataIterator & | first, |
const WeightsIterator & | weightFirst, | ||
const MaskIterator & | maskFirst, | ||
uInt | nr, | ||
const DataRanges & | dataRanges, | ||
Bool | isInclude = True , |
||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False , |
||
uInt | maskStride = 1 |
||
) |
Bool casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::empty | ( | ) | const |
returns ! dataProvider && _data.empty()
|
inline |
get data counts associated with the underlying data sets
Definition at line 156 of file StatisticsDataset.h.
|
inline |
Definition at line 158 of file StatisticsDataset.h.
|
inline |
Definition at line 162 of file StatisticsDataset.h.
|
inline |
Definition at line 166 of file StatisticsDataset.h.
Bool casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::increment | ( | Bool | includeIDataset | ) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::incrementThreadIters | ( | DataIterator & | dataIter, |
MaskIterator & | maskIter, | ||
WeightsIterator & | weightsIter, | ||
uInt64 & | offset, | ||
uInt | nthreads | ||
) | const |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::initIterators | ( | ) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::initLoopVars | ( | uInt64 & | chunkCount, |
uInt & | chunkStride, | ||
Bool & | chunkHasRanges, | ||
DataRanges & | chunkRanges, | ||
Bool & | chunkIsIncludeRanges, | ||
Bool & | chunkHasMask, | ||
uInt & | chunkMaskStride, | ||
Bool & | chunkHasWeights | ||
) |
used for threaded methods
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::initLoopVars | ( | DataIterator & | chunkData, |
uInt64 & | chunkCount, | ||
uInt & | chunkStride, | ||
Bool & | chunkHasRanges, | ||
DataRanges & | chunkRanges, | ||
Bool & | chunkIsIncludeRanges, | ||
Bool & | chunkHasMask, | ||
MaskIterator & | chunkMask, | ||
uInt & | chunkMaskStride, | ||
Bool & | chunkHasWeights, | ||
WeightsIterator & | chunkWeights | ||
) |
used for unthreaded methods
const ChunkData& casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::initLoopVars | ( | ) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::initThreadVars | ( | uInt & | nBlocks, |
uInt64 & | extra, | ||
uInt & | nthreads, | ||
std::unique_ptr< DataIterator[]> & | dataIter, | ||
std::unique_ptr< MaskIterator[]> & | maskIter, | ||
std::unique_ptr< WeightsIterator[]> & | weightsIter, | ||
std::unique_ptr< uInt64[]> & | offset, | ||
uInt | nThreadsMax | ||
) | const |
StatisticsDataset<CASA_STATP>& casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::operator= | ( | const StatisticsDataset< CASA_STATP > & | other | ) |
use copy semantics, except for the data provider which uses reference semantics
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::reset | ( | ) |
|
inline |
Definition at line 204 of file StatisticsDataset.h.
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData | ( | const DataIterator & | first, |
uInt | nr, | ||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False |
||
) |
setdata() clears any current datasets or data provider and then adds the specified data set as the first dataset in the (possibly new) set of data sets for which statistics are to be calculated.
See addData() for parameter meanings.
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData | ( | const DataIterator & | first, |
uInt | nr, | ||
const DataRanges & | dataRanges, | ||
Bool | isInclude = True , |
||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData | ( | const DataIterator & | first, |
const MaskIterator & | maskFirst, | ||
uInt | nr, | ||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False , |
||
uInt | maskStride = 1 |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData | ( | const DataIterator & | first, |
const MaskIterator & | maskFirst, | ||
uInt | nr, | ||
const DataRanges & | dataRanges, | ||
Bool | isInclude = True , |
||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False , |
||
uInt | maskStride = 1 |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData | ( | const DataIterator & | first, |
const WeightsIterator & | weightFirst, | ||
uInt | nr, | ||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData | ( | const DataIterator & | first, |
const WeightsIterator & | weightFirst, | ||
uInt | nr, | ||
const DataRanges & | dataRanges, | ||
Bool | isInclude = True , |
||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData | ( | const DataIterator & | first, |
const WeightsIterator & | weightFirst, | ||
const MaskIterator & | maskFirst, | ||
uInt | nr, | ||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False , |
||
uInt | maskStride = 1 |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData | ( | const DataIterator & | first, |
const WeightsIterator & | weightFirst, | ||
const MaskIterator & | maskFirst, | ||
uInt | nr, | ||
const DataRanges & | dataRanges, | ||
Bool | isInclude = True , |
||
uInt | dataStride = 1 , |
||
Bool | nrAccountsForStride = False , |
||
uInt | maskStride = 1 |
||
) |
void casacore::StatisticsDataset< AccumType, DataIterator, MaskIterator, WeightsIterator >::setDataProvider | ( | StatsDataProvider< CASA_STATP > * | dataProvider | ) |
instead of setting and adding data "by hand", set the data provider that will provide all the data sets.
Calling this method will clear any other data sets that have previously been set or added.
|
private |
Definition at line 282 of file StatisticsDataset.h.
|
private |
Definition at line 279 of file StatisticsDataset.h.
|
private |
Definition at line 270 of file StatisticsDataset.h.
Referenced by casacore::StatisticsDataset< CASA_STATP >::getCounts().
|
private |
Definition at line 263 of file StatisticsDataset.h.
|
private |
Definition at line 281 of file StatisticsDataset.h.
|
private |
Definition at line 275 of file StatisticsDataset.h.
Referenced by casacore::StatisticsDataset< CASA_STATP >::getDataProvider().
|
private |
Definition at line 274 of file StatisticsDataset.h.
|
private |
Definition at line 271 of file StatisticsDataset.h.
|
private |
Definition at line 278 of file StatisticsDataset.h.
|
private |
Definition at line 278 of file StatisticsDataset.h.
|
private |
Definition at line 280 of file StatisticsDataset.h.
|
private |
Definition at line 277 of file StatisticsDataset.h.
Referenced by casacore::StatisticsDataset< CASA_STATP >::iDataset(), and casacore::StatisticsDataset< CASA_STATP >::resetIDataset().
|
private |
Definition at line 273 of file StatisticsDataset.h.
|
private |
maps data to masks
Definition at line 269 of file StatisticsDataset.h.
|
private |
Definition at line 272 of file StatisticsDataset.h.
|
private |
maps data to weights.
maps are used rather than vectors because only some (or none) of the data sets in the _data vector may have associated weights, masks, and/or ranges.
Definition at line 267 of file StatisticsDataset.h.