21 #ifndef KALDI_UTIL_CONST_INTEGER_SET_INL_H_ 22 #define KALDI_UTIL_CONST_INTEGER_SET_INL_H_ 33 if (slow_set_.size() == 0) {
35 highest_member_=(I) 0;
39 lowest_member_ = slow_set_.front();
40 highest_member_ = slow_set_.back();
41 size_t range = highest_member_ + 1 - lowest_member_;
42 if (range == slow_set_.size()) {
48 if (range < slow_set_.size() * 8 *
sizeof(I)) {
50 quick_set_.resize(range,
false);
51 for (
size_t i = 0;
i < slow_set_.size();
i++)
52 quick_set_[slow_set_[
i] - lowest_member_] =
true;
63 if (i < lowest_member_ || i > highest_member_) {
66 if (contiguous_)
return true;
68 return (quick_set_[i-lowest_member_] ? 1 : 0);
70 bool ans = std::binary_search(slow_set_.begin(), slow_set_.end(),
i);
91 #endif // KALDI_UTIL_CONST_INTEGER_SET_INL_H_ This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
#define KALDI_ASSERT_IS_INTEGER_TYPE(I)
void ReadIntegerVector(std::istream &is, bool binary, std::vector< T > *v)
Function for reading STL vector of integer types.
void Write(std::ostream &os, bool binary) const
void Read(std::istream &is, bool binary)
void WriteIntegerVector(std::ostream &os, bool binary, const std::vector< T > &v)
Function for writing STL vectors of integer types.