All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
 Relabels neural network egs with the read pdf-id alignments.
 

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);
 
#define KALDI_STRTOD(cur_cstr, end_cstr)   strtod(cur_cstr, end_cstr)
 
#define KALDI_STRTOF(cur_cstr, end_cstr)   strtof(cur_cstr, end_cstr);
 

Functions

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

Macro Definition Documentation

#define KALDI_ASSERT_IS_FLOATING_TYPE (   F)
#define KALDI_DISALLOW_COPY_AND_ASSIGN (   type)
Value:
type(const type&); \
void operator = (const type&)

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

#define KALDI_MEMALIGN (   align,
  size,
  pp_orig 
)    (!posix_memalign(pp_orig, align, size) ? *(pp_orig) : NULL)
#define KALDI_STRCASECMP   strcasecmp
#define KALDI_STRTOD (   cur_cstr,
  end_cstr 
)    strtod(cur_cstr, end_cstr)

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

Referenced by kaldi::ConvertStringToReal().

#define KALDI_STRTOF (   cur_cstr,
  end_cstr 
)    strtof(cur_cstr, end_cstr);

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

Referenced by kaldi::ConvertStringToReal().

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

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

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

#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 110 of file kaldi-utils.h.

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

#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 103 of file kaldi-utils.h.

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

#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 90 of file kaldi-utils.h.