All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ExampleMergingConfig::IntSet Struct Reference
Collaboration diagram for ExampleMergingConfig::IntSet:

Public Member Functions

int32 LargestValueInRange (int32 max_value) const
 

Public Attributes

int32 largest_size
 
std::vector< std::pair< int32,
int32 > > 
ranges
 

Detailed Description

Definition at line 390 of file nnet-example-utils.h.

Member Function Documentation

int32 LargestValueInRange ( int32  max_value) const

Definition at line 900 of file nnet-example-utils.cc.

References rnnlm::i, KALDI_ASSERT, and ExampleMergingConfig::IntSet::ranges.

900  {
901  KALDI_ASSERT(!ranges.empty());
902  int32 ans = 0, num_ranges = ranges.size();
903  for (int32 i = 0; i < num_ranges; i++) {
904  int32 possible_ans = 0;
905  if (max_value >= ranges[i].first) {
906  if (max_value >= ranges[i].second)
907  possible_ans = ranges[i].second;
908  else
909  possible_ans = max_value;
910  }
911  if (possible_ans > ans)
912  ans = possible_ans;
913  }
914  return ans;
915 }
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:169
std::vector< std::pair< int32, int32 > > ranges

Member Data Documentation

int32 largest_size

Definition at line 393 of file nnet-example-utils.h.

Referenced by ExampleMergingConfig::ParseIntSet().

std::vector<std::pair<int32, int32> > ranges

The documentation for this struct was generated from the following files: