casacore
|
Public Types | |
typedef value_t * | iterator |
typedef const value_t * | const_iterator |
Public Member Functions | |
Dictionary () | |
Dictionary (size_t size) | |
void | reserve (size_t size) |
void | resize (size_t size) |
const_iterator | lower_bound (value_t val) const |
Returns an iterator pointing to the first element in the dictionary that is not less than (i.e. More... | |
const_iterator | lower_bound_fast (value_t val) const |
Returns an iterator pointing to the first element in the dictionary that is not less than (i.e. More... | |
const_iterator | lower_bound_slow (value_t val) const |
Below is the first failed result of an attempt to beat the STL in performance. More... | |
iterator | begin () |
const_iterator | begin () const |
const_iterator | end () const |
symbol_t | symbol (const_iterator iter) const |
symbol_t | largest_symbol () const |
value_t | value (const_iterator iter) const |
value_t | value (symbol_t sym) const |
value_t | largest_value () const |
value_t | smallest_value () const |
size_t | size () const |
size_t | capacity (size_t) const |
Private Attributes | |
ao::uvector< value_t > | _values |
Definition at line 161 of file stochasticencoder.h.
typedef const value_t* dyscostman::StochasticEncoder< ValueType >::Dictionary::const_iterator |
Definition at line 164 of file stochasticencoder.h.
typedef value_t* dyscostman::StochasticEncoder< ValueType >::Dictionary::iterator |
Definition at line 163 of file stochasticencoder.h.
|
inline |
Definition at line 166 of file stochasticencoder.h.
|
inlineexplicit |
Definition at line 168 of file stochasticencoder.h.
|
inline |
Definition at line 241 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::begin().
Referenced by dyscostman::StochasticEncoder< ValueType >::EncodeWithDithering(), and dyscostman::StochasticEncoder< ValueType >::Dictionary::symbol().
|
inline |
Definition at line 242 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::begin().
|
inline |
Definition at line 251 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::capacity().
|
inline |
Definition at line 243 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::end().
Referenced by dyscostman::StochasticEncoder< ValueType >::EncodeWithDithering().
|
inline |
Definition at line 245 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::size().
|
inline |
Definition at line 248 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::back().
Referenced by dyscostman::StochasticEncoder< ValueType >::MaxQuantity().
|
inline |
Returns an iterator pointing to the first element in the dictionary that is not less than (i.e.
greater or equal to) value.
This implementation is like lower_bound_fast(), but additionally assumes the dictionary has at least two elements, avoiding one comparison.
Definition at line 182 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::size().
Referenced by dyscostman::StochasticEncoder< ValueType >::Encode(), and dyscostman::StochasticEncoder< ValueType >::EncodeWithDithering().
|
inline |
Returns an iterator pointing to the first element in the dictionary that is not less than (i.e.
greater or equal to) value.
This implementation turns out to be slightly faster than the STL implementation. It performs 10.7 MB/s, vs. 9.0 MB/s for the STL. 18% faster. Using "unsigned" instead of "size_t" is 5% slower. (It's not a fair STL comparison, because this implementation does not check for empty vector).
Definition at line 209 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::size().
|
inline |
Below is the first failed result of an attempt to beat the STL in performance.
It turns out to be 13% slower for larger dictionaries, compared to the STL implementation that is used in the class above. It performs 7.9 MB/s. 26% compared to the 'fastest' lower_bound.
This is a bit inefficient, but (p + q)/2 was not allowed, because operator+(ptr,ptr) is not allowed.
Definition at line 227 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, ao::uvector< Tp, Alloc >::begin(), and ao::uvector< Tp, Alloc >::size().
|
inline |
Definition at line 170 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::reserve().
|
inline |
Definition at line 172 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::resize().
|
inline |
Definition at line 250 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::size().
Referenced by dyscostman::StochasticEncoder< ValueType >::EncodeWithDithering(), dyscostman::StochasticEncoder< ValueType >::QuantizationCount(), and dyscostman::StochasticEncoder< ValueType >::RightBoundary().
|
inline |
Definition at line 249 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values, and ao::uvector< Tp, Alloc >::front().
Referenced by dyscostman::StochasticEncoder< ValueType >::MinQuantity().
|
inline |
Definition at line 244 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::begin().
Referenced by dyscostman::StochasticEncoder< ValueType >::Encode(), and dyscostman::StochasticEncoder< ValueType >::EncodeWithDithering().
|
inline |
Definition at line 246 of file stochasticencoder.h.
Referenced by dyscostman::StochasticEncoder< ValueType >::Decode(), dyscostman::StochasticEncoder< ValueType >::EncodeWithDithering(), and dyscostman::StochasticEncoder< ValueType >::RightBoundary().
|
inline |
Definition at line 247 of file stochasticencoder.h.
References dyscostman::StochasticEncoder< ValueType >::Dictionary::_values.
|
private |
Definition at line 254 of file stochasticencoder.h.
Referenced by dyscostman::StochasticEncoder< ValueType >::Dictionary::begin(), dyscostman::StochasticEncoder< ValueType >::Dictionary::capacity(), dyscostman::StochasticEncoder< ValueType >::Dictionary::end(), dyscostman::StochasticEncoder< ValueType >::Dictionary::largest_symbol(), dyscostman::StochasticEncoder< ValueType >::Dictionary::largest_value(), dyscostman::StochasticEncoder< ValueType >::Dictionary::lower_bound(), dyscostman::StochasticEncoder< ValueType >::Dictionary::lower_bound_fast(), dyscostman::StochasticEncoder< ValueType >::Dictionary::lower_bound_slow(), dyscostman::StochasticEncoder< ValueType >::Dictionary::reserve(), dyscostman::StochasticEncoder< ValueType >::Dictionary::resize(), dyscostman::StochasticEncoder< ValueType >::Dictionary::size(), dyscostman::StochasticEncoder< ValueType >::Dictionary::smallest_value(), and dyscostman::StochasticEncoder< ValueType >::Dictionary::value().