casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dyscoweightcolumn.h
Go to the documentation of this file.
1 #ifndef DYSCO_WEIGHT_COLUMN_H
2 #define DYSCO_WEIGHT_COLUMN_H
3 
4 #include "stochasticencoder.h"
5 #include "threadeddyscocolumn.h"
6 #include "weightblockencoder.h"
7 
8 namespace dyscostman {
9 
10 class DyscoStMan;
11 
17 class DyscoWeightColumn final : public ThreadedDyscoColumn<float> {
18  public:
24  : ThreadedDyscoColumn(parent, dtype) {}
25 
26  DyscoWeightColumn(const DyscoWeightColumn &source) = delete;
27 
28  void operator=(const DyscoWeightColumn &source) = delete;
29 
31  virtual ~DyscoWeightColumn() { shutdown(); }
32 
33  virtual void Prepare(DyscoDistribution distribution,
34  Normalization normalization, double studentsTNu,
35  double distributionTruncation) override;
36 
37  protected:
38  virtual void initializeDecode(TimeBlockBuffer<data_t> *buffer,
39  const float *metaBuffer, size_t nRow,
40  size_t nAntennae) override;
41 
42  virtual void decode(TimeBlockBuffer<data_t> *buffer, const symbol_t *data,
43  size_t blockRow, size_t a1, size_t a2) override;
44 
45  virtual std::unique_ptr<ThreadDataBase> initializeEncodeThread() override {
46  return nullptr;
47  }
48 
49  virtual void encode(ThreadDataBase *threadData,
50  TimeBlockBuffer<data_t> *buffer, float *metaBuffer,
51  symbol_t *symbolBuffer, size_t nAntennae) override;
52 
53  virtual size_t metaDataFloatCount(size_t /*nRows*/, size_t /*nPolarizations*/,
54  size_t /*nChannels*/,
55  size_t /*nAntennae*/) const override {
56  return _encoder->MetaDataFloatCount();
57  }
58 
59  virtual size_t symbolCount(size_t nRowsInBlock, size_t /*nPolarizations*/,
60  size_t /*nChannels*/) const override {
61  return _encoder->SymbolCount(nRowsInBlock);
62  }
63 
64  private:
65  std::unique_ptr<WeightBlockEncoder> _encoder;
66 };
67 
68 } // namespace dyscostman
69 
70 #endif
virtual std::unique_ptr< ThreadDataBase > initializeEncodeThread() override
virtual void shutdown() overridefinal
To be called before destructing the class.
A column for storing compressed values in a threaded way, tailored for the data and weight columns th...
virtual void encode(ThreadDataBase *threadData, TimeBlockBuffer< data_t > *buffer, float *metaBuffer, symbol_t *symbolBuffer, size_t nAntennae) override
virtual ~DyscoWeightColumn()
Destructor.
virtual size_t metaDataFloatCount(size_t, size_t, size_t, size_t) const override
virtual void decode(TimeBlockBuffer< data_t > *buffer, const symbol_t *data, size_t blockRow, size_t a1, size_t a2) override
virtual size_t symbolCount(size_t nRowsInBlock, size_t, size_t) const override
DataType dtype() const
std::unique_ptr< WeightBlockEncoder > _encoder
DyscoWeightColumn(DyscoStMan *parent, int dtype)
Create a new column.
virtual void initializeDecode(TimeBlockBuffer< data_t > *buffer, const float *metaBuffer, size_t nRow, size_t nAntennae) override
TimeBlockBuffer< data_t >::symbol_t symbol_t
void operator=(const DyscoWeightColumn &source)=delete
virtual void Prepare(DyscoDistribution distribution, Normalization normalization, double studentsTNu, double distributionTruncation) override
A column for storing compressed complex values with an approximate Gaussian distribution.
The main class for the Dysco storage manager.
Definition: dyscostman.h:46