casacore
|
Encoder for visibility weights. More...
#include <weightencoder.h>
Public Types | |
typedef T | value_t |
Value type of the original weights (a floating point value). More... | |
typedef unsigned | symbol_t |
Value type of the symbols to which the weights are encoded. More... | |
Public Member Functions | |
WeightEncoder (unsigned quantCount) | |
Construct a new encoder with the given quantization count. More... | |
void | Encode (value_t &scaleVal, std::vector< symbol_t > &dest, const std::vector< value_t > &input) const |
Encodes a vector of values. More... | |
void | Decode (std::vector< value_t > &dest, value_t scaleVal, const std::vector< symbol_t > &input) const |
Decode a previously encoded value. More... | |
Private Attributes | |
unsigned | _quantCount |
Encoder for visibility weights.
It's a linear quantizer for non-negative values, with a single scaling factor. The scaling factor will be such that the max value will still fit.
Definition at line 16 of file weightencoder.h.
typedef unsigned dyscostman::WeightEncoder< T >::symbol_t |
Value type of the symbols to which the weights are encoded.
Definition at line 21 of file weightencoder.h.
typedef T dyscostman::WeightEncoder< T >::value_t |
Value type of the original weights (a floating point value).
Definition at line 19 of file weightencoder.h.
|
inlineexplicit |
Construct a new encoder with the given quantization count.
quantCount | The number of quantization levels. |
Definition at line 26 of file weightencoder.h.
|
inline |
Decode a previously encoded value.
dest | The destination for the decoded weight values. |
scaleVal | The scale value for the vector of values. |
input | The input symbols to be decoded. |
Definition at line 66 of file weightencoder.h.
References dyscostman::WeightEncoder< T >::_quantCount.
|
inline |
Encodes a vector of values.
Will return a vector of symbols and a scaling value. Together, these can be used to get the original values back (with some loss due to quantization), by using Decode().
scaleVal | Will receive the scale value for the vector of values |
dest | The destinal vector with symbols. It is assumed that it is already of the right size, i.e., equal to input.size(). |
input | The input array of values to be encoded. |
Find max value (implicit assumption input is not empty)
Definition at line 37 of file weightencoder.h.
References dyscostman::WeightEncoder< T >::_quantCount.
|
private |
Definition at line 80 of file weightencoder.h.
Referenced by dyscostman::WeightEncoder< T >::Decode(), and dyscostman::WeightEncoder< T >::Encode().