kaldi-utils.h File Reference
#include <unistd.h>
#include <limits>
#include <string>
Include dependency graph for kaldi-utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  KaldiCompileTimeAssert< B >
 
class  KaldiCompileTimeAssert< true >
 

Namespaces

 kaldi
 This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for mispronunciations detection tasks, the reference:
 

Macros

#define KALDI_MEMALIGN(align, size, pp_orig)   (!posix_memalign(pp_orig, align, size) ? *(pp_orig) : NULL)
 
#define KALDI_MEMALIGN_FREE(x)   free(x)
 
#define KALDI_SWAP8(a)
 
#define KALDI_SWAP4(a)
 
#define KALDI_SWAP2(a)
 
#define KALDI_DISALLOW_COPY_AND_ASSIGN(type)
 
#define KALDI_COMPILE_TIME_ASSERT(b)   KaldiCompileTimeAssert<(b)>::Check()
 
#define KALDI_ASSERT_IS_INTEGER_TYPE(I)
 
#define KALDI_ASSERT_IS_FLOATING_TYPE(F)
 
#define KALDI_STRCASECMP   strcasecmp
 
#define KALDI_STRTOLL(cur_cstr, end_cstr)   strtoll(cur_cstr, end_cstr, 10);
 

Functions

std::string CharToString (const char &c)
 
int MachineIsLittleEndian ()
 
void Sleep (float seconds)
 

Macro Definition Documentation

◆ KALDI_ASSERT_IS_FLOATING_TYPE

#define KALDI_ASSERT_IS_FLOATING_TYPE (   F)

◆ KALDI_ASSERT_IS_INTEGER_TYPE

◆ KALDI_COMPILE_TIME_ASSERT

◆ KALDI_DISALLOW_COPY_AND_ASSIGN

◆ KALDI_MEMALIGN

#define KALDI_MEMALIGN (   align,
  size,
  pp_orig 
)    (!posix_memalign(pp_orig, align, size) ? *(pp_orig) : NULL)

◆ KALDI_MEMALIGN_FREE

◆ KALDI_STRCASECMP

#define KALDI_STRCASECMP   strcasecmp

◆ KALDI_STRTOLL

#define KALDI_STRTOLL (   cur_cstr,
  end_cstr 
)    strtoll(cur_cstr, end_cstr, 10);

Definition at line 152 of file kaldi-utils.h.

Referenced by kaldi::ConvertStringToInteger(), and kaldi::SplitStringToIntegers().

◆ KALDI_SWAP2

#define KALDI_SWAP2 (   a)
Value:
{ \
int t = (reinterpret_cast<char*>(&a))[0];\
(reinterpret_cast<char*>(&a))[0]=(reinterpret_cast<char*>(&a))[1];\
(reinterpret_cast<char*>(&a))[1]=t;}

Definition at line 114 of file kaldi-utils.h.

Referenced by WaveData::Read(), kaldi::ReadHtk(), WaveHeaderReadGofer::ReadUint16(), WaveData::Write(), kaldi::WriteHtk(), and kaldi::WriteUint16().

◆ KALDI_SWAP4

#define KALDI_SWAP4 (   a)
Value:
{ \
int t = (reinterpret_cast<char*>(&a))[0];\
(reinterpret_cast<char*>(&a))[0]=(reinterpret_cast<char*>(&a))[3];\
(reinterpret_cast<char*>(&a))[3]=t;\
t = (reinterpret_cast<char*>(&a))[1];\
(reinterpret_cast<char*>(&a))[1]=(reinterpret_cast<char*>(&a))[2];\
(reinterpret_cast<char*>(&a))[2]=t;}

Definition at line 107 of file kaldi-utils.h.

Referenced by SphinxMatrixHolder< kFeatDim >::Read(), kaldi::ReadHtk(), WaveHeaderReadGofer::ReadUint32(), SphinxMatrixHolder< kFeatDim >::Write(), kaldi::WriteHtk(), kaldi::WriteSphinx(), and kaldi::WriteUint32().

◆ KALDI_SWAP8

#define KALDI_SWAP8 (   a)
Value:
{ \
int t = (reinterpret_cast<char*>(&a))[0];\
(reinterpret_cast<char*>(&a))[0]=(reinterpret_cast<char*>(&a))[7];\
(reinterpret_cast<char*>(&a))[7]=t;\
t = (reinterpret_cast<char*>(&a))[1];\
(reinterpret_cast<char*>(&a))[1]=(reinterpret_cast<char*>(&a))[6];\
(reinterpret_cast<char*>(&a))[6]=t;\
t = (reinterpret_cast<char*>(&a))[2];\
(reinterpret_cast<char*>(&a))[2]=(reinterpret_cast<char*>(&a))[5];\
(reinterpret_cast<char*>(&a))[5]=t;\
t = (reinterpret_cast<char*>(&a))[3];\
(reinterpret_cast<char*>(&a))[3]=(reinterpret_cast<char*>(&a))[4];\
(reinterpret_cast<char*>(&a))[4]=t;}

Definition at line 94 of file kaldi-utils.h.