CTrie< Trie > Class Template Reference

Inheritance diagram for CTrie< Trie >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class Trie>
class CTrie< Trie >

class Trie

Definition at line 134 of file Trie.h.


Public Member Functions

 CTrie (INT d, bool p_use_compact_terminal_nodes=true)
 CTrie (const CTrie &to_copy)
 ~CTrie ()
const CTrieoperator= (const CTrie &to_copy)
bool compare_traverse (INT node, const CTrie &other, INT other_node)
bool compare (const CTrie &other)
bool find_node (INT node, INT *trace, INT &trace_len) const
INT find_deepest_node (INT start_node, INT &deepest_node) const
void display_node (INT node) const
void destroy ()
void set_degree (INT d)
void create (INT len, bool p_use_compact_terminal_nodes=true)
void delete_trees (bool p_use_compact_terminal_nodes=true)
void add_to_trie (int i, INT seq_offset, INT *vec, float alpha, DREAL *weights, bool degree_times_position_weights)
DREAL compute_abs_weights_tree (INT tree, INT depth)
DREALcompute_abs_weights (int &len)
DREAL compute_by_tree_helper (INT *vec, INT len, INT seq_pos, INT tree_pos, INT weight_pos, DREAL *weights, bool degree_times_position_weights)
void compute_by_tree_helper (INT *vec, INT len, INT seq_pos, INT tree_pos, INT weight_pos, DREAL *LevelContrib, DREAL factor, INT mkl_stepsize, DREAL *weights, bool degree_times_position_weights)
void compute_scoring_helper (INT tree, INT i, INT j, DREAL weight, INT d, INT max_degree, INT num_feat, INT num_sym, INT sym_offset, INT offs, DREAL *result)
void add_example_to_tree_mismatch_recursion (INT tree, INT i, DREAL alpha, INT *vec, INT len_rem, INT degree_rec, INT mismatch_rec, INT max_mismatch, DREAL *weights)
void traverse (INT tree, const INT p, struct TreeParseInfo info, const INT depth, INT *const x, const INT k)
void count (const DREAL w, const INT depth, const struct TreeParseInfo info, const INT p, INT *x, const INT k)
INT compact_nodes (INT start_node, INT depth, DREAL *weights)
DREAL get_cumulative_score (INT pos, ULONG seq, INT deg, DREAL *weights)
void fill_backtracking_table_recursion (Trie *tree, INT depth, ULONG seq, DREAL value, CDynamicArray< ConsensusEntry > *table, DREAL *weights)
void fill_backtracking_table (INT pos, CDynamicArray< ConsensusEntry > *prev, CDynamicArray< ConsensusEntry > *cur, bool cumulative, DREAL *weights)
void POIMs_extract_W (DREAL *const *const W, const INT K)
void POIMs_precalc_SLR (const DREAL *const distrib)
void POIMs_get_SLR (const INT parentIdx, const INT sym, const int depth, DREAL *S, DREAL *L, DREAL *R)
void POIMs_add_SLR (DREAL *const *const poims, const INT K, const INT debug)
bool get_use_compact_terminal_nodes ()
void set_use_compact_terminal_nodes (bool p_use_compact_terminal_nodes)
INT get_num_used_nodes ()
void set_position_weights (const DREAL *p_position_weights)
INT get_node (bool last_node=false)
void check_treemem ()
void set_weights_in_tree (bool weights_in_tree_)
bool get_weights_in_tree ()
void POIMs_extract_W_helper (const INT nodeIdx, const int depth, const INT offset, const INT y0, DREAL *const *const W, const INT K)
void POIMs_calc_SLR_helper1 (const DREAL *const distrib, const INT i, const INT nodeIdx, INT left_tries_idx[4], const int depth, INT const lastSym, DREAL *S, DREAL *L, DREAL *R)
void POIMs_calc_SLR_helper2 (const DREAL *const distrib, const INT i, const INT nodeIdx, INT left_tries_idx[4], const int depth, DREAL *S, DREAL *L, DREAL *R)
void POIMs_add_SLR_helper1 (const INT nodeIdx, const int depth, const INT i, const INT y0, DREAL *const *const poims, const INT K, const INT debug)
void POIMs_add_SLR_helper2 (DREAL *const *const poims, const int K, const int k, const INT i, const INT y, const DREAL valW, const DREAL valS, const DREAL valL, const DREAL valR, const INT debug)

Public Attributes

INT NUM_SYMS

Static Public Attributes

static CParallel parallel
static CIO io
static CVersion version

Protected Attributes

INT length
INTtrees
INT degree
DREAL const * position_weights
Trie * TreeMem
INT TreeMemPtr
INT TreeMemPtrMax
bool use_compact_terminal_nodes
bool weights_in_tree
INTnofsKmers

Constructor & Destructor Documentation

template<class Trie>
CTrie< Trie >::CTrie ( INT  d,
bool  p_use_compact_terminal_nodes = true 
)

constructor

Parameters:
d degree
p_use_compact_terminal_nodes if compact terminal nodes shall be used

Definition at line 586 of file Trie.h.

template<class Trie>
CTrie< Trie >::CTrie ( const CTrie< Trie > &  to_copy  ) 

copy constructor

Definition at line 602 of file Trie.h.

template<class Trie>
CTrie< Trie >::~CTrie (  ) 

Definition at line 1031 of file Trie.h.


Member Function Documentation

template<class Trie>
const CTrie< Trie > & CTrie< Trie >::operator= ( const CTrie< Trie > &  to_copy  ) 

overload operator =

Definition at line 630 of file Trie.h.

template<class Trie>
bool CTrie< Trie >::compare_traverse ( INT  node,
const CTrie< Trie > &  other,
INT  other_node 
)

compare traverse

Parameters:
node node
other other trie
other_node other node
Returns:
if comparison was successful

Definition at line 828 of file Trie.h.

template<class Trie>
bool CTrie< Trie >::compare ( const CTrie< Trie > &  other  ) 

compare

Parameters:
other other trie
Returns:
if comparison was successful

Definition at line 914 of file Trie.h.

template<class Trie>
bool CTrie< Trie >::find_node ( INT  node,
INT trace,
INT trace_len 
) const

find node

Parameters:
node node to find
trace trace
trace_len length of trace

Definition at line 927 of file Trie.h.

template<class Trie>
INT CTrie< Trie >::find_deepest_node ( INT  start_node,
INT deepest_node 
) const

find deepest node

Parameters:
start_node start node
deepest_node deepest node will be stored in here
Returns:
depth of deepest node

Definition at line 664 of file Trie.h.

template<class Trie>
void CTrie< Trie >::display_node ( INT  node  )  const

display node

Parameters:
node node to display

Definition at line 967 of file Trie.h.

template<class Trie>
void CTrie< Trie >::destroy (  ) 

destroy

Definition at line 1038 of file Trie.h.

template<class Trie>
void CTrie< Trie >::set_degree ( INT  d  ) 

set degree

Parameters:
d new degree

Definition at line 1053 of file Trie.h.

template<class Trie>
void CTrie< Trie >::create ( INT  len,
bool  p_use_compact_terminal_nodes = true 
)

create

Parameters:
len length of new trie
p_use_compact_terminal_nodes if compact terminal nodes shall be used

Definition at line 1059 of file Trie.h.

template<class Trie>
void CTrie< Trie >::delete_trees ( bool  p_use_compact_terminal_nodes = true  ) 

delete trees

Parameters:
p_use_compact_terminal_nodes if compact terminal nodes shall be used

Definition at line 1073 of file Trie.h.

template<class Trie>
void CTrie< Trie >::add_to_trie ( int  i,
INT  seq_offset,
INT vec,
float  alpha,
DREAL weights,
bool  degree_times_position_weights 
)

add to trie

Parameters:
i i
seq_offset sequence offset
vec vector
alpha alpha
weights weights
degree_times_position_weights if degree times position weights shall be applied

Definition at line 1389 of file Trie.h.

template<class Trie>
DREAL CTrie< Trie >::compute_abs_weights_tree ( INT  tree,
INT  depth 
)

compute absolute weights tree

Parameters:
tree tree to compute for
depth depth
Returns:
computed absolute weights tree

Definition at line 1086 of file Trie.h.

template<class Trie>
DREAL * CTrie< Trie >::compute_abs_weights ( int &  len  ) 

compute absolute weights

Parameters:
len length
Returns:
computed absolute weights

Definition at line 1115 of file Trie.h.

template<class Trie>
DREAL CTrie< Trie >::compute_by_tree_helper ( INT vec,
INT  len,
INT  seq_pos,
INT  tree_pos,
INT  weight_pos,
DREAL weights,
bool  degree_times_position_weights 
)

compute by tree helper

Parameters:
vec vector
len length
seq_pos sequence position
tree_pos tree position
weight_pos weight position
weights 
degree_times_position_weights if degree times position weights shall be applied
Returns:
a computed value

Definition at line 1613 of file Trie.h.

template<class Trie>
void CTrie< Trie >::compute_by_tree_helper ( INT vec,
INT  len,
INT  seq_pos,
INT  tree_pos,
INT  weight_pos,
DREAL LevelContrib,
DREAL  factor,
INT  mkl_stepsize,
DREAL weights,
bool  degree_times_position_weights 
)

compute by tree helper

Parameters:
vec vector
len length
seq_pos sequence position
tree_pos tree position
weight_pos weight position
LevelContrib level contribution
factor factor
mkl_stepsize MKL stepsize
weights 
degree_times_position_weights if degree times position weights shall be applied

Definition at line 1688 of file Trie.h.

template<class Trie>
void CTrie< Trie >::compute_scoring_helper ( INT  tree,
INT  i,
INT  j,
DREAL  weight,
INT  d,
INT  max_degree,
INT  num_feat,
INT  num_sym,
INT  sym_offset,
INT  offs,
DREAL result 
)

compute scoring helper

Parameters:
tree tree
i i
j j
weight weight
d degree
max_degree maximum degree
num_feat number of features
num_sym number of symbols
sym_offset symbol offset
offs offsets
result result

Definition at line 1247 of file Trie.h.

template<class Trie>
void CTrie< Trie >::add_example_to_tree_mismatch_recursion ( INT  tree,
INT  i,
DREAL  alpha,
INT vec,
INT  len_rem,
INT  degree_rec,
INT  mismatch_rec,
INT  max_mismatch,
DREAL weights 
)

add example to tree mismatch recursion

Parameters:
tree tree
i i
alpha alpha
vec vector
len_rem length of rem
degree_rec degree rec
mismatch_rec mismatch rec
max_mismatch maximum mismatch
weights weights

Definition at line 1135 of file Trie.h.

template<class Trie>
void CTrie< Trie >::traverse ( INT  tree,
const INT  p,
struct TreeParseInfo  info,
const INT  depth,
INT *const   x,
const INT  k 
)

traverse

Parameters:
tree tree
p p
info tree parse info
depth depth
x x
k k

Definition at line 1289 of file Trie.h.

template<class Trie>
void CTrie< Trie >::count ( const DREAL  w,
const INT  depth,
const struct TreeParseInfo  info,
const INT  p,
INT x,
const INT  k 
)

count

Parameters:
w w
depth depth
info tree parse info
p p
x x
k 

Definition at line 1337 of file Trie.h.

template<class Trie>
INT CTrie< Trie >::compact_nodes ( INT  start_node,
INT  depth,
DREAL weights 
)

compact nodes

Parameters:
start_node start node
depth depth
weights weights

Definition at line 720 of file Trie.h.

template<class Trie>
DREAL CTrie< Trie >::get_cumulative_score ( INT  pos,
ULONG  seq,
INT  deg,
DREAL weights 
)

get cumulative score

Parameters:
pos position
seq sequence
deg degree
weights weights
Returns:
cumulative score

Definition at line 1946 of file Trie.h.

template<class Trie>
void CTrie< Trie >::fill_backtracking_table_recursion ( Trie *  tree,
INT  depth,
ULONG  seq,
DREAL  value,
CDynamicArray< ConsensusEntry > *  table,
DREAL weights 
)

fill backtracking table recursion

Parameters:
tree tree
depth depth
seq sequence
value value
table table of concensus entries
weights weights

Definition at line 1906 of file Trie.h.

template<class Trie>
void CTrie< Trie >::fill_backtracking_table ( INT  pos,
CDynamicArray< ConsensusEntry > *  prev,
CDynamicArray< ConsensusEntry > *  cur,
bool  cumulative,
DREAL weights 
)

fill backtracking table

Parameters:
pos position
prev previous concencus entry
cur current concensus entry
cumulative if is cumulative
weights weights

Definition at line 1977 of file Trie.h.

template<class Trie>
void CTrie< Trie >::POIMs_extract_W ( DREAL *const *const   W,
const INT  K 
)

POIMs extract W

Parameters:
W W
K K

template<class Trie>
void CTrie< Trie >::POIMs_precalc_SLR ( const DREAL *const   distrib  ) 

POIMs precalc SLR

Parameters:
distrib distribution

template<class Trie>
void CTrie< Trie >::POIMs_get_SLR ( const INT  parentIdx,
const INT  sym,
const int  depth,
DREAL S,
DREAL L,
DREAL R 
)

POIMs get SLR

Parameters:
parentIdx parent index
sym symbol
depth depth
S will point to S
L will point to L
R will point to R

template<class Trie>
void CTrie< Trie >::POIMs_add_SLR ( DREAL *const *const   poims,
const INT  K,
const INT  debug 
)

POIMs add SLR

Parameters:
poims POIMs
K K
debug debug level

template<class Trie>
bool CTrie< Trie >::get_use_compact_terminal_nodes (  ) 

get use compact terminal nodes

Returns:
if compact terminal nodes are used

Definition at line 398 of file Trie.h.

template<class Trie>
void CTrie< Trie >::set_use_compact_terminal_nodes ( bool  p_use_compact_terminal_nodes  ) 

set use compact terminal nodes

Parameters:
p_use_compact_terminal_nodes if compact terminal nodes shall be used

Definition at line 408 of file Trie.h.

template<class Trie>
INT CTrie< Trie >::get_num_used_nodes (  ) 

get number of used nodes

Returns:
number of used nodes

Definition at line 417 of file Trie.h.

template<class Trie>
void CTrie< Trie >::set_position_weights ( const DREAL p_position_weights  ) 

set position weights

Parameters:
p_position_weights new position weights

Definition at line 426 of file Trie.h.

template<class Trie>
INT CTrie< Trie >::get_node ( bool  last_node = false  ) 

get node

Returns:
node

Definition at line 435 of file Trie.h.

template<class Trie>
void CTrie< Trie >::check_treemem (  ) 

check tree memory usage

Definition at line 459 of file Trie.h.

template<class Trie>
void CTrie< Trie >::set_weights_in_tree ( bool  weights_in_tree_  ) 

set weights in tree

Parameters:
weights_in_tree_ if weights shall be in tree

Definition at line 476 of file Trie.h.

template<class Trie>
bool CTrie< Trie >::get_weights_in_tree (  ) 

get weights in tree

Returns:
if weights are in tree

Definition at line 485 of file Trie.h.

template<class Trie>
void CTrie< Trie >::POIMs_extract_W_helper ( const INT  nodeIdx,
const int  depth,
const INT  offset,
const INT  y0,
DREAL *const *const   W,
const INT  K 
)

POIMs extract W helper

Parameters:
nodeIdx node index
depth depth
offset offset
y0 y0
W W
K K

template<class Trie>
void CTrie< Trie >::POIMs_calc_SLR_helper1 ( const DREAL *const   distrib,
const INT  i,
const INT  nodeIdx,
INT  left_tries_idx[4],
const int  depth,
INT const   lastSym,
DREAL S,
DREAL L,
DREAL R 
)

POIMs calc SLR helper

Parameters:
distrib distribution
i i
nodeIdx node index
left_tries_idx left tries index
depth depth
lastSym last symbol
S S
L L
R R

template<class Trie>
void CTrie< Trie >::POIMs_calc_SLR_helper2 ( const DREAL *const   distrib,
const INT  i,
const INT  nodeIdx,
INT  left_tries_idx[4],
const int  depth,
DREAL S,
DREAL L,
DREAL R 
)

POIMs calc SLR helper 2

Parameters:
distrib distribution
i i
nodeIdx node index
left_tries_idx left tries index
depth depth
S S
L L
R R

template<class Trie>
void CTrie< Trie >::POIMs_add_SLR_helper1 ( const INT  nodeIdx,
const int  depth,
const INT  i,
const INT  y0,
DREAL *const *const   poims,
const INT  K,
const INT  debug 
)

POIMs add SLR helper 1

Parameters:
nodeIdx node index
depth depth
i i
y0 y0
poims POIMs
K K
debug debug level

template<class Trie>
void CTrie< Trie >::POIMs_add_SLR_helper2 ( DREAL *const *const   poims,
const int  K,
const int  k,
const INT  i,
const INT  y,
const DREAL  valW,
const DREAL  valS,
const DREAL  valL,
const DREAL  valR,
const INT  debug 
)

POIMs add SLR helper 2

Parameters:
poims POIMs
K K
k k
i i
y y
valW value W
valS value S
valL value L
valR value R
debug debug level


Member Data Documentation

template<class Trie>
INT CTrie< Trie >::NUM_SYMS

number of symbols

Definition at line 556 of file Trie.h.

template<class Trie>
INT CTrie< Trie >::length [protected]

length

Definition at line 560 of file Trie.h.

template<class Trie>
INT* CTrie< Trie >::trees [protected]

trees

Definition at line 562 of file Trie.h.

template<class Trie>
INT CTrie< Trie >::degree [protected]

degree

Definition at line 565 of file Trie.h.

template<class Trie>
DREAL const* CTrie< Trie >::position_weights [protected]

position weights

Definition at line 567 of file Trie.h.

template<class Trie>
Trie* CTrie< Trie >::TreeMem [protected]

tree memory

Definition at line 570 of file Trie.h.

template<class Trie>
INT CTrie< Trie >::TreeMemPtr [protected]

tree memory pointer

Definition at line 572 of file Trie.h.

template<class Trie>
INT CTrie< Trie >::TreeMemPtrMax [protected]

tree memory pointer maximum

Definition at line 574 of file Trie.h.

template<class Trie>
bool CTrie< Trie >::use_compact_terminal_nodes [protected]

if compact terminal nodes are used

Definition at line 576 of file Trie.h.

template<class Trie>
bool CTrie< Trie >::weights_in_tree [protected]

if weights are in tree

Definition at line 579 of file Trie.h.

template<class Trie>
INT* CTrie< Trie >::nofsKmers [protected]

nofsKmers

Definition at line 582 of file Trie.h.

CParallel CSGObject::parallel [static, inherited]

Definition at line 105 of file SGObject.h.

CIO CSGObject::io [static, inherited]

Definition at line 106 of file SGObject.h.

CVersion CSGObject::version [static, inherited]

Definition at line 107 of file SGObject.h.


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

SHOGUN Machine Learning Toolbox - Documentation