Interval Class Reference

#include <kws-functions.h>

Collaboration diagram for Interval:

Public Member Functions

 Interval ()
 
 Interval (int32 start, int32 end)
 
 Interval (const Interval &interval)
 
int32 Overlap (Interval interval)
 
int32 Start () const
 
int32 End () const
 
 ~Interval ()
 

Private Attributes

int32 start_
 
int32 end_
 

Detailed Description

Definition at line 35 of file kws-functions.h.

Constructor & Destructor Documentation

◆ Interval() [1/3]

Interval ( )
inline

Definition at line 37 of file kws-functions.h.

37 {}

◆ Interval() [2/3]

Interval ( int32  start,
int32  end 
)
inline

Definition at line 38 of file kws-functions.h.

38 : start_(start), end_(end) {}

◆ Interval() [3/3]

Interval ( const Interval interval)
inline

Definition at line 39 of file kws-functions.h.

39 : start_(interval.Start()), end_(interval.End()) {}

◆ ~Interval()

~Interval ( )
inline

Definition at line 46 of file kws-functions.h.

46 {}

Member Function Documentation

◆ End()

int32 End ( ) const
inline

Definition at line 45 of file kws-functions.h.

References Interval::end_.

Referenced by kaldi::CompareInterval().

45 {return end_;}

◆ Overlap()

int32 Overlap ( Interval  interval)
inline

Definition at line 40 of file kws-functions.h.

References Interval::end_, and Interval::start_.

Referenced by kaldi::ClusterLattice().

40  {
41  return std::max<int32>(0, std::min(end_, interval.end_) -
42  std::max(start_, interval.start_));
43  }

◆ Start()

int32 Start ( ) const
inline

Definition at line 44 of file kws-functions.h.

References Interval::start_.

Referenced by kaldi::CompareInterval().

44 {return start_;}

Member Data Documentation

◆ end_

int32 end_
private

Definition at line 50 of file kws-functions.h.

Referenced by Interval::End(), and Interval::Overlap().

◆ start_

int32 start_
private

Definition at line 49 of file kws-functions.h.

Referenced by Interval::Overlap(), and Interval::Start().


The documentation for this class was generated from the following file: