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

◆ LargestValueInRange()

int32 LargestValueInRange ( int32  max_value) const

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

References rnnlm::i, and KALDI_ASSERT.

918  {
919  KALDI_ASSERT(!ranges.empty());
920  int32 ans = 0, num_ranges = ranges.size();
921  for (int32 i = 0; i < num_ranges; i++) {
922  int32 possible_ans = 0;
923  if (max_value >= ranges[i].first) {
924  if (max_value >= ranges[i].second)
925  possible_ans = ranges[i].second;
926  else
927  possible_ans = max_value;
928  }
929  if (possible_ans > ans)
930  ans = possible_ans;
931  }
932  return ans;
933 }
kaldi::int32 int32
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185
std::vector< std::pair< int32, int32 > > ranges

Member Data Documentation

◆ largest_size

int32 largest_size

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

Referenced by ExampleMergingConfig::ParseIntSet().

◆ ranges

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

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

Referenced by ExampleMergingConfig::ParseIntSet().


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