Data provider which allows stats framework to iterate through an unmasked lattice. More...
#include <LatticeStatsDataProvider.h>
Public Member Functions | |
LatticeStatsDataProvider () | |
default constructor, must set lattice after construction but before using the object | |
LatticeStatsDataProvider (const Lattice< T > &lattice, uInt iteratorLimitBytes=4096 *4096) | |
iteratorLimitBytes is related to the size of the lattice. | |
~LatticeStatsDataProvider () | |
void | operator++ () |
increment the data provider to the next dataset, mask, range set, and weights. | |
uInt | estimatedSteps () const |
estimated number of steps to iterate through the the lattice | |
Bool | atEnd () const |
Are there any data sets left to provide? | |
void | finalize () |
Take any actions necessary to finalize the provider. | |
uInt64 | getCount () |
get the count of elements in the current data set. | |
const T * | getData () |
get the current data set | |
const Bool * | getMask () |
Get the associated mask of the current dataset. | |
Bool | hasMask () const |
Does the current data set have an associated mask? | |
void | reset () |
reset the provider to point to the first data set it manages. | |
void | setLattice (const Lattice< T > &lattice, uInt iteratorLimitBytes=4096 *4096) |
set the lattice. | |
void | updateMaxPos (const std::pair< Int64, Int64 > &maxpos) |
see base class documentation. | |
void | updateMinPos (const std::pair< Int64, Int64 > &minpos) |
Private Member Functions | |
void | _freeStorage () |
Private Attributes | |
CountedPtr< RO_LatticeIterator < T > > | _iter |
Array< T > | _currentSlice |
const T * | _currentPtr |
Bool | _delData |
Bool | _atEnd |
Data provider which allows stats framework to iterate through an unmasked lattice.
Definition at line 39 of file LatticeStatsDataProvider.h.
casacore::LatticeStatsDataProvider< T >::LatticeStatsDataProvider | ( | ) |
default constructor, must set lattice after construction but before using the object
casacore::LatticeStatsDataProvider< T >::LatticeStatsDataProvider | ( | const Lattice< T > & | lattice, | |
uInt | iteratorLimitBytes = 4096 *4096 | |||
) |
iteratorLimitBytes
is related to the size of the lattice.
If the lattice is greater than this size, then a lattice iterator will be used to step through the lattice. If less, then all the data in the values in the lattice are retrieved in a single chunk. The advantage of the iterator is that less memory is used. The disadvantage is there is a significant performace cost, so if the lattice is small, it is better to get all its values in a single chunk and forgo the iterator. This is particularly true when looping for a large number of iterations and creating a LatticeStatsDataProvider each loop (in that case, you probably will want to create a single object before the loop and use setLattice() to update its lattice).
casacore::LatticeStatsDataProvider< T >::~LatticeStatsDataProvider | ( | ) |
void casacore::LatticeStatsDataProvider< T >::_freeStorage | ( | ) | [private] |
Bool casacore::LatticeStatsDataProvider< T >::atEnd | ( | ) | const [virtual] |
Are there any data sets left to provide?
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
uInt casacore::LatticeStatsDataProvider< T >::estimatedSteps | ( | ) | const [virtual] |
estimated number of steps to iterate through the the lattice
Implements casacore::LatticeStatsDataProviderBase< T >.
void casacore::LatticeStatsDataProvider< T >::finalize | ( | ) | [virtual] |
Take any actions necessary to finalize the provider.
This will be called when atEnd() returns True.
Reimplemented from casacore::LatticeStatsDataProviderBase< T >.
uInt64 casacore::LatticeStatsDataProvider< T >::getCount | ( | ) | [virtual] |
get the count of elements in the current data set.
When implementing this method, be certain to take stride into account; ie for a data set with nominally 100 elements that is to have a stride of two, this method should return 50.
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
const T* casacore::LatticeStatsDataProvider< T >::getData | ( | ) | [virtual] |
get the current data set
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
const Bool* casacore::LatticeStatsDataProvider< T >::getMask | ( | ) | [virtual] |
Get the associated mask of the current dataset.
Only called if hasMask() returns True;
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
Bool casacore::LatticeStatsDataProvider< T >::hasMask | ( | ) | const [virtual] |
Does the current data set have an associated mask?
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
void casacore::LatticeStatsDataProvider< T >::operator++ | ( | ) | [virtual] |
increment the data provider to the next dataset, mask, range set, and weights.
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
void casacore::LatticeStatsDataProvider< T >::reset | ( | ) | [virtual] |
reset the provider to point to the first data set it manages.
Reimplemented from casacore::LatticeStatsDataProviderBase< T >.
void casacore::LatticeStatsDataProvider< T >::setLattice | ( | const Lattice< T > & | lattice, | |
uInt | iteratorLimitBytes = 4096 *4096 | |||
) |
set the lattice.
Automatically resets the lattice iterator iteratorLimitBytes
is related to the size of the lattice. If the lattice is greater than this size, then a lattice iterator will be used to step through the lattice. If less, then all the data in the values in the lattice are retrieved in a single chunk. The advantage of the iterator is that less memory is used. The disadvantage is there is a significant performace cost, so if the lattice is small, it is better to get all its values in a single chunk and forgo the iterator. This is particularly true when looping for a large number of iterations and creating a LatticeStatsDataProvider each loop (in that case, you probably will want to create a single object before the loop and use setLattice() to update its lattice).
void casacore::LatticeStatsDataProvider< T >::updateMaxPos | ( | const std::pair< Int64, Int64 > & | maxpos | ) | [virtual] |
see base class documentation.
Reimplemented from casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
void casacore::LatticeStatsDataProvider< T >::updateMinPos | ( | const std::pair< Int64, Int64 > & | minpos | ) | [virtual] |
Bool casacore::LatticeStatsDataProvider< T >::_atEnd [private] |
Definition at line 121 of file LatticeStatsDataProvider.h.
const T* casacore::LatticeStatsDataProvider< T >::_currentPtr [private] |
Definition at line 120 of file LatticeStatsDataProvider.h.
Array<T> casacore::LatticeStatsDataProvider< T >::_currentSlice [private] |
Definition at line 119 of file LatticeStatsDataProvider.h.
Bool casacore::LatticeStatsDataProvider< T >::_delData [private] |
Definition at line 121 of file LatticeStatsDataProvider.h.
CountedPtr<RO_LatticeIterator<T> > casacore::LatticeStatsDataProvider< T >::_iter [private] |
Definition at line 118 of file LatticeStatsDataProvider.h.