26 #ifndef SCIMATH_STATISTICSDATASET_H
27 #define SCIMATH_STATISTICSDATASET_H
29 #include <casacore/casa/aips.h>
31 #include <casacore/scimath/StatsFramework/StatisticsTypes.h>
50 class AccumType,
class DataIterator,
class MaskIterator=
const Bool *,
51 class WeightsIterator=DataIterator
117 const DataIterator&
first,
const MaskIterator& maskFirst,
uInt nr,
122 const DataIterator&
first,
const MaskIterator& maskFirst,
uInt nr,
128 const DataIterator&
first,
const WeightsIterator& weightFirst,
133 const DataIterator&
first,
const WeightsIterator& weightFirst,
139 const DataIterator&
first,
const WeightsIterator& weightFirst,
140 const MaskIterator& maskFirst,
uInt nr,
uInt dataStride=1,
145 const DataIterator&
first,
const WeightsIterator& weightFirst,
146 const MaskIterator& maskFirst,
uInt nr,
const DataRanges& dataRanges,
171 DataIterator& dataIter, MaskIterator& maskIter,
172 WeightsIterator& weightsIter,
uInt64& offset,
uInt nthreads
181 Bool& chunkHasMask,
uInt& chunkMaskStride,
Bool& chunkHasWeights
186 DataIterator& chunkData,
uInt64& chunkCount,
uInt& chunkStride,
188 Bool& chunkIsIncludeRanges,
Bool& chunkHasMask, MaskIterator& chunkMask,
189 uInt& chunkMaskStride,
Bool& chunkHasWeights,
190 WeightsIterator& chunkWeights
197 std::unique_ptr<DataIterator[]>& dataIter, std::unique_ptr<MaskIterator[]>& maskIter,
198 std::unique_ptr<WeightsIterator[]>& weightsIter, std::unique_ptr<
uInt64[]>& offset,
222 const DataIterator&
first,
const MaskIterator& maskFirst,
uInt nr,
227 const DataIterator&
first,
const MaskIterator& maskFirst,
233 const DataIterator&
first,
const WeightsIterator& weightFirst,
238 const DataIterator&
first,
const WeightsIterator& weightFirst,
244 const DataIterator&
first,
const WeightsIterator& weightFirst,
245 const MaskIterator& maskFirst,
uInt nr,
uInt dataStride=1,
250 const DataIterator&
first,
const WeightsIterator& weightFirst,
251 const MaskIterator& maskFirst,
uInt nr,
const DataRanges& dataRanges,
278 typename std::vector<DataIterator>::const_iterator
_dend{},
_diter{};
279 std::vector<Int64>::const_iterator
_citer{};
289 #ifndef CASACORE_NO_AUTO_TEMPLATES
290 #include <casacore/scimath/StatsFramework/StatisticsDataset.tcc>
Representation of a statistics dataset used in statistics framework calculatations.
void initLoopVars(uInt64 &chunkCount, uInt &chunkStride, Bool &chunkHasRanges, DataRanges &chunkRanges, Bool &chunkIsIncludeRanges, Bool &chunkHasMask, uInt &chunkMaskStride, Bool &chunkHasWeights)
used for threaded methods
void addData(const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
void setDataProvider(StatsDataProvider< CASA_STATP > *dataProvider)
instead of setting and adding data "by hand", set the data provider that will provide all the data se...
void addData(const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
std::vector< uInt >::const_iterator _dsiter
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 addData(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, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
void addData(const DataIterator &first, const MaskIterator &maskFirst, uInt nr, 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)
std::map< uInt, Bool > _isIncludeRanges
const std::vector< Int64 > & getCounts() const
get data counts associated with the underlying data sets
std::vector< DataIterator > _data
void setData(const DataIterator &first, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
std::vector< DataIterator >::const_iterator _dend
StatsDataProvider< CASA_STATP > * getDataProvider()
std::vector< Int64 >::const_iterator _citer
std::map< uInt, uInt > _maskStrides
std::vector< uInt > _dataStrides
void incrementThreadIters(DataIterator &dataIter, MaskIterator &maskIter, WeightsIterator &weightsIter, uInt64 &offset, uInt nthreads) const
Bool increment(Bool includeIDataset)
const StatsDataProvider< CASA_STATP > * getDataProvider() const
Bool empty() const
returns ! dataProvider && _data.empty()
std::map< uInt, DataRanges > _dataRanges
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)
std::map< uInt, MaskIterator > _masks
maps data to masks
void setData(const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
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
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
StatsDataProvider< CASA_STATP > * _dataProvider
void setData(const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
void _throwIfDataProviderDefined() const
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 fi...
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)
std::vector< DataIterator >::const_iterator _diter
StatisticsDataset< CASA_STATP > & operator=(const StatisticsDataset< CASA_STATP > &other)
use copy semantics, except for the data provider which uses reference semantics
std::map< uInt, WeightsIterator > _weights
maps data to weights.
std::vector< Int64 > _counts
StatisticsDataset(const StatisticsDataset &other)
const ChunkData & initLoopVars()
void setData(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, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
Add a dataset to an existing set of datasets on which statistics are to be calculated.
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
bool Bool
Define the standard types used by Casacore.
PtrHolder(const PtrHolder< T > &other)
unsigned long long uInt64
holds information about a data chunk.
PtrHolder< std::pair< DataRanges, Bool > > ranges
associated ranges.
uInt dataStride
data stride
PtrHolder< WeightsIterator > weights
associated weights.
DataIterator data
start of data
uInt64 count
total number of points
PtrHolder< std::pair< MaskIterator, uInt > > mask
associated mask.