📄 classtrie.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>APRIORI algorithm: Trie Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.9.1 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>Trie Class Reference</h1>This class represent a general Trie. <a href="#_details">More...</a><p><code>#include <<a class="el" href="Trie_8hpp-source.html">Trie.hpp</a>></code><p><a href="classTrie-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#a0">Trie</a> (const <a class="el" href="common_8hpp.html#a1">countertype</a> init_counter)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classTrie.html">Trie</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#a1">is_included</a> (const set< <a class="el" href="common_8hpp.html#a0">itemtype</a> > &an_itemset, set< <a class="el" href="common_8hpp.html#a0">itemtype</a> >::const_iterator item_it) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">It decides whether the given itemset is included in the trie or not. <a href="#a1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#a2">find_candidate</a> (vector< <a class="el" href="common_8hpp.html#a0">itemtype</a> >::const_iterator it_basket_upper_bound, vector< <a class="el" href="common_8hpp.html#a0">itemtype</a> >::const_iterator it_basket, const <a class="el" href="common_8hpp.html#a1">countertype</a> counter_incr)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Increases the counter for those itemsets that is contained by the given basket. <a href="#a2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#a3">delete_infrequent</a> (const double min_occurrence)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes the tries that represent infrequent itemsets. <a href="#a3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#a4">~Trie</a> ()</td></tr><tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#d0">add_empty_state</a> (const <a class="el" href="common_8hpp.html#a0">itemtype</a> item, const <a class="el" href="common_8hpp.html#a1">countertype</a> init_counter=0)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an empty state to the trie. <a href="#d0"></a><br></td></tr><tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="common_8hpp.html#a1">countertype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#r0">counter</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">counter stores the occurrence of the itemset represented by the Trie <a href="#r0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">vector< <a class="el" href="structEdge.html">Edge</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#r1">edgevector</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">edgevector stores the edges of the root the trie. <a href="#r1"></a><br></td></tr><tr><td colspan="2"><br><h2>Friends</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTrie.html#n0">Apriori_Trie</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class represent a general Trie. <p>We can regard the trie as a recursive data structure. It has a root node and a list of (sub)trie. We can reach a subtree by a labeled edge (link). Since the root of the trie represents an itemset the counter stands for the occurrence. For the sake of fast traversal we also store the length of the maximal path starting from the root, and the edges are stored ordered according to their label. <p><p>Definition at line <a class="el" href="Trie_8hpp-source.html#l00045">45</a> of file <a class="el" href="Trie_8hpp-source.html">Trie.hpp</a>.<hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="a0" doxytag="Trie::Trie"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">Trie::Trie </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="common_8hpp.html#a1">countertype</a> </td> <td class="mdname1" valign="top" nowrap> <em>init_counter</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>init_counter</em> </td><td>The initial counter of the new trie </td></tr> </table></dl><p>Definition at line <a class="el" href="Trie_8hpp-source.html#l00053">53</a> of file <a class="el" href="Trie_8hpp-source.html">Trie.hpp</a>.<p>Referenced by <a class="el" href="Trie_8cpp-source.html#l00123">add_empty_state()</a>. </td> </tr></table><a class="anchor" name="a4" doxytag="Trie::~Trie"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">Trie::~<a class="el" href="classTrie.html">Trie</a> </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="Trie_8cpp-source.html#l00111">111</a> of file <a class="el" href="Trie_8cpp-source.html">Trie.cpp</a>.<p>References <a class="el" href="Trie_8hpp-source.html#l00088">edgevector</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="d0" doxytag="Trie::add_empty_state"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void Trie::add_empty_state </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="common_8hpp.html#a0">itemtype</a> </td> <td class="mdname" nowrap> <em>item</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const <a class="el" href="common_8hpp.html#a1">countertype</a> </td> <td class="mdname" nowrap> <em>counter</em> = <code>0</code></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [private]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Adds an empty state to the trie. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>item</em> </td><td>The label of the new edge </td></tr> <tr><td valign="top"></td><td valign="top"><em>counter</em> </td><td>The initial counter of the new state </td></tr> </table></dl><p>Definition at line <a class="el" href="Trie_8cpp-source.html#l00123">123</a> of file <a class="el" href="Trie_8cpp-source.html">Trie.cpp</a>.<p>References <a class="el" href="Trie_8hpp-source.html#l00088">edgevector</a>, <a class="el" href="Trie_8hpp-source.html#l00031">Edge::label</a>, <a class="el" href="Trie_8hpp-source.html#l00032">Edge::subtrie</a>, and <a class="el" href="Trie_8hpp-source.html#l00053">Trie()</a>.<p>Referenced by <a class="el" href="Apriori__Trie_8cpp-source.html#l00121">Apriori_Trie::candidate_generation_assist()</a>, <a class="el" href="Apriori__Trie_8cpp-source.html#l00203">Apriori_Trie::delete_infrequent_two()</a>, and <a class="el" href="Apriori__Trie_8cpp-source.html#l00020">Apriori_Trie::insert_frequent_items()</a>. </td> </tr></table><a class="anchor" name="a3" doxytag="Trie::delete_infrequent"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void Trie::delete_infrequent </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const double </td> <td class="mdname1" valign="top" nowrap> <em>min_occurrence</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Deletes the tries that represent infrequent itemsets. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>min_occurrence</em> </td><td>The occurence threshold </td></tr> </table></dl><p>Definition at line <a class="el" href="Trie_8cpp-source.html#l00082">82</a> of file <a class="el" href="Trie_8cpp-source.html">Trie.cpp</a>.<p>References <a class="el" href="Trie_8hpp-source.html#l00088">edgevector</a>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -