|
TRF Language Model
|
define all the code written by Bin Wang. More...
Namespaces | |
| iter | |
Classes | |
| class | _wb_HEAP_UNIT_ |
| heap unit More... | |
| class | Array |
| Dynamic array. More... | |
| class | CirQueue |
| Circular queue. More... | |
| class | Clock |
| clock - used to record the time More... | |
| class | DArray |
| 2-dimension array. More... | |
| class | File |
| file class. More... | |
| class | Func |
| the objective function, used to derive More... | |
| class | Heap |
| heap More... | |
| class | IO_Obj |
| base class used to derive. It providing the vritual function of write and read More... | |
| class | LBFGS |
| class | LHash |
| a linear hash table More... | |
| class | LHashIter |
| the iter of LHash More... | |
| class | Log |
| this class can output to the cmd window and log files simultaneously. In wb-log.cpp, there are a Log variable "lout", which can be directly used just like "cout". For example: More... | |
| class | Mat |
| class | Mat3d |
| class | Mat3dShell |
| class | MatShell |
| class | ObjFile |
| used to read more than one objects More... | |
| struct | Opt_Struct |
| structure of the value More... | |
| class | Option |
| Get the option from command line or command files. More... | |
| class | Path |
| Analize the path including "*" and "?" and "+" symbols. More... | |
| class | ProgressBar |
| a progress bar class More... | |
| class | Queue |
| A queue based the dynamic memory mangement. More... | |
| class | Solve |
| the base class of all the solve classes, and provide a gradient descent algorithm. More... | |
| class | Stack |
| A dynamic stack. More... | |
| class | String |
| a dynamic string class More... | |
| class | Title |
| title class - output to the title More... | |
| class | Trie |
| trie structure More... | |
| class | TrieIter |
| iter all the sub-tries More... | |
| class | TrieIter2 |
| Get all the values whose indexes are of a fixed length. The returned tries may not contain a legal values. More... | |
| class | Vec |
| class | VecShell |
| class | Vector |
| this is the basic class of Array/Stack/Queue. Realize the dynamic memory management More... | |
| class | vIter |
| class | WordCluster |
| class | WordCluster_t |
Typedefs | |
| typedef unsigned short | _wb_HEAP_MODE_ |
Enumerations | |
| enum | ValueType { wbOPT_TRUE, wbOPT_FALSE, wbOPT_INT, wbOPT_STRING, wbOPT_FLOAT } |
| define the value type More... | |
Functions | |
| template<class KeyT > | |
| KeyT | Map_copyKey (KeyT key) |
| Copy a key. More... | |
| const char * | Map_copyKey (const char *key) |
| Copy a string key. More... | |
| template<class KeyT > | |
| void | Map_freeKey (KeyT key) |
| Free a key. More... | |
| void | Map_freeKey (const char *key) |
| Free a key, if the key is string. More... | |
| template<class T > | |
| bool | VecEqual (VecShell< T > &v1, VecShell< T > &v2) |
| calculate V==V More... | |
| template<class T > | |
| void | VecAdd (VecShell< T > &res, VecShell< T > &v1, VecShell< T > &v2) |
| calculate V + V More... | |
| template<class T > | |
| T | VecDot (VecShell< T > &v1, VecShell< T > &v2) |
| calculate V*V More... | |
| template<class T > | |
| T | MatVec2 (MatShell< T > &m, VecShell< T > &v1, VecShell< T > &v2) |
| calculate V1*M*V2 More... | |
| template<typename T > | |
| double | VecNorm (T *pVec, int len) |
| [Vec-function] sqrt(v*v^T); More... | |
| template<typename T > | |
| double | VecDot (T *pVec1, T *pVec2, int len) |
| [Vec-function] v1*v2^T More... | |
| template<typename T > | |
| double | VecDiff (T *pVec1, T *pVec2, int len) |
| [Vec-function] |v1-v2| More... | |
| template<typename T > | |
| double | VecAngle (T *pVec1, T *pVec2, int len) |
| [Vec-function] the cos of the angle of v1 and v2 More... | |
| template<typename T > | |
| void | VecUnfold (const char *pStr, Array< T > &a) |
| [Vec-function] transform the matlab-style vector to a array, such as [1,3:1:7,9] => 1,3,4,5,6,7,9 More... | |
| template<typename T > | |
| int | Compar_Inc (const T &a, const T &b) |
| comparing function for increase sort. More... | |
| template<typename T > | |
| int | Compar_Dec (const T &a, const T &b) |
| comparing function for decrease sort More... | |
| template<typename T > | |
| void | Qsort (T *p, int low, int high, int(*compar)(const T &, const T &)=Compar_Inc) |
| Quick sork. More... | |
| template<typename T > | |
| void | Qsort (Array< T > &a, int(*compar)(const T &, const T &)=Compar_Inc) |
| Quick sork, redefine for class Array. More... | |
| void | Pause () |
| pause More... | |
| void | outPrecent (long long n, bool bNew=false, long long nTotal=100, const char *title="Process") |
| print precent in the cmd window More... | |
| void | outPrecent (ifstream &ifile, bool bNew=false, const char *title="Process") |
| print precent in the cmd window More... | |
| void | outPrecent (FILE *fp, bool bNew=false, const char *title="Process") |
| print precent in the cmd window More... | |
set key to no-key | |
| template<class KeyT > | |
| void | Map_noKey (KeyT *&key) |
| void | Map_noKey (int &key) |
| void | Map_noKey (short int &key) |
| void | Map_noKey (long int &key) |
| void | Map_noKey (long long &key) |
| void | Map_noKey (unsigned &key) |
| void | Map_noKey (short unsigned &key) |
| void | Map_noKey (long unsigned &key) |
| void | Map_noKey (float &key) |
| void | Map_noKey (double &key) |
no-key detection | |
detect if the key is no-key | |
| template<class KeyT > | |
| bool | Map_noKeyP (KeyT *key) |
| bool | Map_noKeyP (int key) |
| bool | Map_noKeyP (short int key) |
| bool | Map_noKeyP (long int key) |
| bool | Map_noKeyP (long long key) |
| bool | Map_noKeyP (unsigned key) |
| bool | Map_noKeyP (short unsigned key) |
| bool | Map_noKeyP (long unsigned key) |
| bool | Map_noKeyP (float key) |
| bool | Map_noKeyP (double &key) |
Compare two Keys | |
Return if the input keys are equal. | |
| template<class KeyT > | |
| bool | Map_equalKey (KeyT key1, KeyT key2) |
| bool | Map_equalKey (float key1, float key2) |
| bool | Map_equalKey (double key1, double key2) |
| bool | Map_equalKey (const char *pStr1, const char *pStr2) |
HashKey | |
Hashing functions. (We provide versions for integral types and char strings; user has to add more specialized definitions.) | |
| unsigned long | LHash_hashKey (unsigned long key, unsigned maxBits) |
| template<class KeyT > | |
| unsigned long | LHash_hashKey (KeyT *key, unsigned maxBits) |
| hash for pointer More... | |
| unsigned long | LHash_hashKey (int key, unsigned maxBits) |
| hash for integral More... | |
| unsigned long | LHash_hashKey (float key, unsigned maxBits) |
| hash for float More... | |
| unsigned long | LHash_hashKey (double key, unsigned maxBits) |
| hash for double More... | |
| unsigned long | LHash_hashKey (const char *key, unsigned maxBits) |
| hash for string More... | |
SortFunction | |
sort function for LHashIter | |
| template<class KeyT > | |
| bool | LHash_IncSort (KeyT k1, KeyT k2) |
| bool | LHash_IncSort (const char *p1, const char *p2) |
Variables | |
| const int | cn_MinLHashBits = 3 |
| if the bits of hash less than this value, using linear table More... | |
| const int | cn_MaxLHashBits = 31 |
| the maximum bits number support by hast More... | |
| const float | cf_HashRatio = 0.8f |
| fill-rate of the hash. More... | |
| Log | lout |
| the defination is in wb-log.cpp More... | |
| const int | cn_default_str_len = 10 |
| default length of string More... | |
| const int | cn_default_max_len = 32 * 1024 |
| default maximum length More... | |
| const int | cn_title_max_len = 500 |
no-key values | |
| |
| const short | c_ShortNokeyValue = (short)(1u << (sizeof(short) * 8 - 1)) |
| nokey value for short More... | |
| const int | c_IntNokeyValue = (int)(1u << (sizeof(int) * 8 - 1)) |
| nokey value for int More... | |
| const long | c_LongNokeyValue = (long)(1uL << (sizeof(long) * 8 - 1)) |
| nokey value for long More... | |
| const long long | c_LLongNokeyValue = (long long)(1LL << (sizeof(long long) * 8 - 1)) |
| nokey value for longlong More... | |
| const short unsigned | c_UShortNokeyValue = ~(short unsigned)0 |
| nokey value for unsigned short More... | |
| const unsigned | c_UIntNokeyValue = ~(unsigned)0 |
| nokey value for unsigned int More... | |
| const long unsigned | c_ULongNokeyValue = ~(long unsigned)0 |
| nokey value for unsigned long More... | |
| const float | c_floatNokeyValue = 1e15 |
| nokey value for float More... | |
| const double | c_doubleNokeyValue = 1e20 |
| nokey value for double More... | |
define all the code written by Bin Wang.
| typedef unsigned short wb::_wb_HEAP_MODE_ |
| enum wb::ValueType |
define the value type
| Enumerator | |
|---|---|
| wbOPT_TRUE | is true if exist |
| wbOPT_FALSE | set false if exist |
| wbOPT_INT | integer |
| wbOPT_STRING | string |
| wbOPT_FLOAT | float |
Definition at line 32 of file wb-option.h.
|
inline |
hash for unsigned long
Definition at line 130 of file wb-lhash.h.
|
inline |
hash for pointer
Definition at line 137 of file wb-lhash.h.
|
inline |
hash for integral
Definition at line 143 of file wb-lhash.h.
|
inline |
hash for float
Definition at line 149 of file wb-lhash.h.
|
inline |
hash for double
Definition at line 154 of file wb-lhash.h.
|
inline |
hash for string
Definition at line 177 of file wb-lhash.h.
|
inline |
Definition at line 193 of file wb-lhash.h.
|
inline |
Definition at line 194 of file wb-lhash.h.
|
inline |
Copy a key.
Definition at line 48 of file wb-lhash.h.
|
inline |
Copy a string key.
Definition at line 50 of file wb-lhash.h.
|
inline |
Definition at line 115 of file wb-lhash.h.
|
inline |
Definition at line 116 of file wb-lhash.h.
|
inline |
Definition at line 117 of file wb-lhash.h.
|
inline |
Definition at line 118 of file wb-lhash.h.
|
inline |
Free a key.
Definition at line 55 of file wb-lhash.h.
|
inline |
Free a key, if the key is string.
Definition at line 57 of file wb-lhash.h.
|
inline |
Definition at line 81 of file wb-lhash.h.
|
inline |
Definition at line 82 of file wb-lhash.h.
|
inline |
Definition at line 83 of file wb-lhash.h.
|
inline |
Definition at line 84 of file wb-lhash.h.
|
inline |
Definition at line 85 of file wb-lhash.h.
|
inline |
Definition at line 86 of file wb-lhash.h.
|
inline |
Definition at line 87 of file wb-lhash.h.
|
inline |
Definition at line 88 of file wb-lhash.h.
|
inline |
Definition at line 89 of file wb-lhash.h.
|
inline |
Definition at line 90 of file wb-lhash.h.
|
inline |
Definition at line 98 of file wb-lhash.h.
|
inline |
Definition at line 99 of file wb-lhash.h.
|
inline |
Definition at line 100 of file wb-lhash.h.
|
inline |
Definition at line 101 of file wb-lhash.h.
|
inline |
Definition at line 102 of file wb-lhash.h.
|
inline |
Definition at line 103 of file wb-lhash.h.
|
inline |
Definition at line 104 of file wb-lhash.h.
|
inline |
Definition at line 105 of file wb-lhash.h.
|
inline |
Definition at line 106 of file wb-lhash.h.
|
inline |
Definition at line 107 of file wb-lhash.h.
| const double wb::c_doubleNokeyValue = 1e20 |
nokey value for double
Definition at line 74 of file wb-lhash.h.
| const float wb::c_floatNokeyValue = 1e15 |
nokey value for float
Definition at line 73 of file wb-lhash.h.
| const int wb::c_IntNokeyValue = (int)(1u << (sizeof(int) * 8 - 1)) |
nokey value for int
Definition at line 67 of file wb-lhash.h.
| const long long wb::c_LLongNokeyValue = (long long)(1LL << (sizeof(long long) * 8 - 1)) |
nokey value for longlong
Definition at line 69 of file wb-lhash.h.
| const long wb::c_LongNokeyValue = (long)(1uL << (sizeof(long) * 8 - 1)) |
nokey value for long
Definition at line 68 of file wb-lhash.h.
| const short wb::c_ShortNokeyValue = (short)(1u << (sizeof(short) * 8 - 1)) |
nokey value for short
Definition at line 66 of file wb-lhash.h.
| const unsigned wb::c_UIntNokeyValue = ~(unsigned)0 |
nokey value for unsigned int
Definition at line 71 of file wb-lhash.h.
| const long unsigned wb::c_ULongNokeyValue = ~(long unsigned)0 |
nokey value for unsigned long
Definition at line 72 of file wb-lhash.h.
| const short unsigned wb::c_UShortNokeyValue = ~(short unsigned)0 |
nokey value for unsigned short
Definition at line 70 of file wb-lhash.h.
| const float wb::cf_HashRatio = 0.8f |
fill-rate of the hash.
Definition at line 199 of file wb-lhash.h.
| const int wb::cn_default_max_len = 32 * 1024 |
default maximum length
Definition at line 41 of file wb-string.h.
| const int wb::cn_default_str_len = 10 |
default length of string
Definition at line 40 of file wb-string.h.
| const int wb::cn_MaxLHashBits = 31 |
the maximum bits number support by hast
Definition at line 198 of file wb-lhash.h.
| const int wb::cn_MinLHashBits = 3 |
if the bits of hash less than this value, using linear table
Definition at line 197 of file wb-lhash.h.