SIS
Symmetric Index Structures
/Users/dbr/ma/src/bas/lml/typical.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define bFALSE   ( ( boolean )( 0 == 1 ) )
#define bTRUE   ( ( boolean )( 1 == 1 ) )
#define NO   ((UINT)(-1))
#define mSwapVariables(var1, var2, temp)
#define mABS(x)   ( ((x) < 0) ? -(x) : (x) )
#define mMAX(a, b)   ( ((a) < (b)) ? (b) : (a) )
#define mMIN(a, b)   ( ((a) > (b)) ? (b) : (a) )
#define MAX_INPUT_STRING_SIZE   (1024)
#define mGETS(str)
#define log2(x)   ( (1.4426950408889634073599246810019)*log( x ) )
#define exp2(x)   ( exp( (0.69314718055994530941723212145818)*(x) ) )
#define LOG_OF_ZERO   (-1.0E300)
#define PI   ((double)(3.1415926535897932384626433832795))
#define mSymbolAndVariables(name)
#define mSymbolAssignValue(name, value, symbolSize)
#define mValidateBitsPerSymbol(bitsPerSymbol)
#define ENDIANNESS_BIG   (0)
#define ENDIANNESS_LITTLE   (1)
#define ENDIANNESS_DETERMINER   (0xFFFE)
#define ENDIANNESS_MORE_SIGNIFICANT   (0xFF)
#define ENDIANNESS_LESS_SIGNIFICANT   (0xFE)
#define mSetEndianness()
#define mWriteEndianness(fp, endianness)
#define mReadEndianness(fp, endianness)
#define mReverseBytes(element, numberOfBytes)

Typedefs

typedef int boolean
typedef unsigned char U8
typedef unsigned short int U16
typedef unsigned int U32
typedef unsigned long long U64
typedef char S8
typedef short int S16
typedef int S32
typedef long long S64
typedef U32 UINT
typedef S32 SINT
typedef float FLOAT

Functions

UINT SymbolToUINT (const void *symbol, UINT symbolSize)
void UINTToSymbol (UINT number, void *symbol, UINT symbolSize)
SINT CmpSymbols (const void *symbol1, const void *symbol2, UINT symbolSize)
void SwapSymbols (void *symbol1, void *symbol2, UINT symbolSize)

Variables

UINT endiannessOfThisMachine
UINT endiannessOnWrite

Define Documentation

#define bFALSE   ( ( boolean )( 0 == 1 ) )

Definition at line 5 of file typical.h.

Referenced by SCDAWGDumpGV().

#define ENDIANNESS_BIG   (0)

Definition at line 95 of file typical.h.

#define ENDIANNESS_DETERMINER   (0xFFFE)

Definition at line 97 of file typical.h.

#define ENDIANNESS_LESS_SIGNIFICANT   (0xFE)

Definition at line 99 of file typical.h.

#define ENDIANNESS_LITTLE   (1)

Definition at line 96 of file typical.h.

#define ENDIANNESS_MORE_SIGNIFICANT   (0xFF)

Definition at line 98 of file typical.h.

#define exp2 (   x)    ( exp( (0.69314718055994530941723212145818)*(x) ) )

Definition at line 46 of file typical.h.

#define log2 (   x)    ( (1.4426950408889634073599246810019)*log( x ) )

Definition at line 45 of file typical.h.

#define LOG_OF_ZERO   (-1.0E300)

Definition at line 47 of file typical.h.

#define mABS (   x)    ( ((x) < 0) ? -(x) : (x) )

Definition at line 32 of file typical.h.

#define mGETS (   str)
Value:
{\
    fgets( (str), MAX_INPUT_STRING_SIZE, stdin );\
    (str)[strlen((str)) - 1] = 0;\
}

Definition at line 39 of file typical.h.

Referenced by main().

#define mMAX (   a,
 
)    ( ((a) < (b)) ? (b) : (a) )

Definition at line 34 of file typical.h.

Referenced by CompressedAutomatonAddTransition().

#define mMIN (   a,
 
)    ( ((a) > (b)) ? (b) : (a) )

Definition at line 36 of file typical.h.

#define mReadEndianness (   fp,
  endianness 
)
Value:
{\
    U8 u8;\
    Fread( &u8, sizeof(U8), 1, (fp) );\
    if( u8 == ENDIANNESS_MORE_SIGNIFICANT ){\
        (endianness) = ENDIANNESS_BIG;\
    }\
    else{\
        (endianness) = ENDIANNESS_LITTLE;\
    }\
}

Definition at line 133 of file typical.h.

Referenced by AlphabetRead(), BitSequenceRead(), CompressedAutomatonRead(), and VoidSequenceRead().

#define mReverseBytes (   element,
  numberOfBytes 
)
Value:
{\
    UINT i, m;\
    U8 tmp;\
    m = (numberOfBytes)/2;\
    for( i = 0; i < m; i++ ){\
        mSwapVariables( (element)[i], (element)[(numberOfBytes)-1-i], tmp );\
    }\
}

Definition at line 144 of file typical.h.

Referenced by AlphabetRead(), AlphabetWrite(), BitSequenceRead(), BitSequenceWrite(), CompressedAutomatonRead(), CompressedAutomatonWrite(), VoidSequenceRead(), and VoidSequenceWrite().

#define mSetEndianness ( )
Value:
{\
    if( endiannessOfThisMachine == NO ){\
        U16 u16 = ENDIANNESS_DETERMINER;\
        U8 * ptr;\
        ptr = (U8 *)(&u16);\
        if( (*ptr) == ENDIANNESS_MORE_SIGNIFICANT ){\
            endiannessOfThisMachine = ENDIANNESS_BIG;\
        }\
        else if( (*ptr) == ENDIANNESS_LESS_SIGNIFICANT ){\
            endiannessOfThisMachine = ENDIANNESS_LITTLE;\
        }\
        else{\
            Throw( "Error occured while trying to detect the endianness of this machine." );\
        }\
        if( endiannessOnWrite == NO ){\
            endiannessOnWrite = endiannessOfThisMachine;\
        }\
    }\
}

Definition at line 101 of file typical.h.

Referenced by main().

#define mSwapVariables (   var1,
  var2,
  temp 
)
Value:
{\
    temp = var1;\
    var1 = var2;\
    var2 = temp;\
}

Definition at line 25 of file typical.h.

Referenced by SwapSymbols().

#define mSymbolAndVariables (   name)
#define mSymbolAssignValue (   name,
  value,
  symbolSize 
)
Value:
{\
    switch( symbolSize ){\
        case 1:\
            u8##name = (value);\
            name = &u8##name;\
            break;\
        case 2:\
            u16##name = (value);\
            name = &u16##name;\
            break;\
        case 4:\
            u32##name = (value);\
            name = &u32##name;\
            break;\
        case 8:\
            u64##name = (value);\
            name = &u64##name;\
            break;\
    }\
}

Definition at line 64 of file typical.h.

Referenced by lmu::cis::sis::SCDAWGAdapter::BuildSCDAWG(), CmdBuildCDAWG(), CmdBuildSCDAWG(), CmdBuildSuffixTree(), CmdGenerateSuffixes(), lmu::cis::sis::VoidSequenceAdapter::dollarize(), DumpLabel(), DumpSCDAWGLabel(), lmu::cis::sis::DocumentIndexingAutomatonFindResults::lr_context(), PrintString(), and VoidSequenceReadLine().

#define mValidateBitsPerSymbol (   bitsPerSymbol)
Value:
{\
    if( (bitsPerSymbol) != 8 && (bitsPerSymbol) != 16 && (bitsPerSymbol) != 32 && (bitsPerSymbol) != 64 ){\
        Throw( "Unsupported number of bits per symbol." );\
    }\
}

Definition at line 86 of file typical.h.

Referenced by lmu::cis::sis::SCDAWGAdapter::BuildSCDAWG(), CmdBuildCDAWG(), CmdBuildSCDAWG(), CmdBuildSuffixTree(), CmdGenerateSuffixes(), CmdReverseAndSort(), and lmu::cis::sis::VoidSequenceAdapter::dollarize().

#define mWriteEndianness (   fp,
  endianness 
)
Value:
{\
    U8 u8;\
    if( (endianness) == ENDIANNESS_BIG ){\
        u8 = ENDIANNESS_MORE_SIGNIFICANT;\
        Fwrite( &u8, sizeof(U8), 1, (fp) );\
    }\
    else{\
        u8 = ENDIANNESS_LESS_SIGNIFICANT;\
        Fwrite( &u8, sizeof(U8), 1, (fp) );\
    }\
}

Definition at line 121 of file typical.h.

Referenced by AlphabetWrite(), BitSequenceWrite(), CompressedAutomatonWrite(), and VoidSequenceWrite().

#define PI   ((double)(3.1415926535897932384626433832795))

Definition at line 48 of file typical.h.


Typedef Documentation

typedef int boolean

Definition at line 4 of file typical.h.

typedef float FLOAT

Definition at line 21 of file typical.h.

typedef short int S16

Definition at line 14 of file typical.h.

typedef int S32

Definition at line 15 of file typical.h.

typedef long long S64

Definition at line 16 of file typical.h.

typedef char S8

Definition at line 13 of file typical.h.

typedef S32 SINT

Definition at line 19 of file typical.h.

typedef unsigned short int U16

Definition at line 9 of file typical.h.

typedef unsigned int U32

Definition at line 10 of file typical.h.

typedef unsigned long long U64

Definition at line 11 of file typical.h.

typedef unsigned char U8

Definition at line 8 of file typical.h.

typedef U32 UINT

Definition at line 18 of file typical.h.


Function Documentation

SINT CmpSymbols ( const void *  symbol1,
const void *  symbol2,
UINT  symbolSize 
)

Definition at line 62 of file typical.c.

Referenced by CompressedAutomatonDelta(), and Delta().

void SwapSymbols ( void *  symbol1,
void *  symbol2,
UINT  symbolSize 
)

Definition at line 76 of file typical.c.

void UINTToSymbol ( UINT  number,
void *  symbol,
UINT  symbolSize 
)

Definition at line 25 of file typical.c.


Variable Documentation