|
kaldi-native-fbank C++ API
Kaldi-compatible feature extraction C++ API
|
This class serves as a storage for feature vectors with an option to limit the memory usage by removing old elements. More...
#include <online-feature.h>
Public Member Functions | |
| RecyclingVector (int32_t items_to_hold=-1) | |
| By default it does not remove any elements. | |
| ~RecyclingVector ()=default | |
| Destructor. | |
| RecyclingVector (const RecyclingVector &)=delete | |
| Copy construction is not allowed. | |
| RecyclingVector & | operator= (const RecyclingVector &)=delete |
| Assignment is not allowed. | |
| const float * | At (int32_t index) const |
| Return a pointer to the feature vector at the given index. | |
| void | PushBack (std::vector< float > item) |
| Append one feature vector to the end. | |
| int32_t | Size () const |
| This method returns the size as if no "recycling" had happened, i.e. | |
| void | Pop (int32_t n) |
| Discard the first n frames. | |
This class serves as a storage for feature vectors with an option to limit the memory usage by removing old elements.
The deleted frames indices are "remembered" so that regardless of the MAX_ITEMS setting, the user always provides the indices as if no deletion was being performed. This is useful when processing very long recordings which would otherwise cause the memory to eventually blow up when the features are not being removed.
|
explicit |
By default it does not remove any elements.
|
default |
Destructor.
|
delete |
Copy construction is not allowed.
| const float * knf::RecyclingVector::At | ( | int32_t | index | ) | const |
Return a pointer to the feature vector at the given index.
The pointer is owned by RecyclingVector; users should not free it.
|
delete |
Assignment is not allowed.
| void knf::RecyclingVector::Pop | ( | int32_t | n | ) |
Discard the first n frames.
| void knf::RecyclingVector::PushBack | ( | std::vector< float > | item | ) |
Append one feature vector to the end.
If items_to_hold_ is exceeded, the oldest vector is deleted.
| int32_t knf::RecyclingVector::Size | ( | ) | const |
This method returns the size as if no "recycling" had happened, i.e.
equivalent to the number of times the PushBack method has been called.