mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-25 14:23:03 +08:00
Documentation for 0d766b0f8a
This commit is contained in:
@@ -129,13 +129,13 @@ Public Attributes</h2></td></tr>
|
||||
size_t </td><td class="memItemRight" valign="bottom"><b>n</b> = 0</td></tr>
|
||||
<tr class="memdesc:ad71ecd43d0af1127df5f4006258f9635"><td class="mdescLeft"> </td><td class="mdescRight">size of input array. <br /></td></tr>
|
||||
<tr class="separator:ad71ecd43d0af1127df5f4006258f9635"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ab78620742305a35ff2f8d61179f47d3e" id="r_ab78620742305a35ff2f8d61179f47d3e"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< int64_t, <a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="#ab78620742305a35ff2f8d61179f47d3e">A</a> = {}</td></tr>
|
||||
<tr class="memitem:ab78620742305a35ff2f8d61179f47d3e" id="r_ab78620742305a35ff2f8d61179f47d3e"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< int64_t, <a class="el" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="#ab78620742305a35ff2f8d61179f47d3e">A</a> = {}</td></tr>
|
||||
<tr class="memdesc:ab78620742305a35ff2f8d61179f47d3e"><td class="mdescLeft"> </td><td class="mdescRight">input array to perform RMQ. <br /></td></tr>
|
||||
<tr class="separator:ab78620742305a35ff2f8d61179f47d3e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ad36b9a20fed47b068e407008c04e9f81" id="r_ad36b9a20fed47b068e407008c04e9f81"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< int64_t, <a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> >, <a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#af7db62f21983565c64d5d42d2a49888e">M</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad36b9a20fed47b068e407008c04e9f81">ST</a> {}</td></tr>
|
||||
<tr class="memitem:ad36b9a20fed47b068e407008c04e9f81" id="r_ad36b9a20fed47b068e407008c04e9f81"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< int64_t, <a class="el" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> >, <a class="el" href="../../d8/dab/sparse__table_8cpp.html#af7db62f21983565c64d5d42d2a49888e">M</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad36b9a20fed47b068e407008c04e9f81">ST</a> {}</td></tr>
|
||||
<tr class="memdesc:ad36b9a20fed47b068e407008c04e9f81"><td class="mdescLeft"> </td><td class="mdescRight">the sparse table storing <code>min()</code> values for given interval. <br /></td></tr>
|
||||
<tr class="separator:ad36b9a20fed47b068e407008c04e9f81"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6cf72f93b1551f0d943c585b4f173be3" id="r_a6cf72f93b1551f0d943c585b4f173be3"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< int64_t, <a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="#a6cf72f93b1551f0d943c585b4f173be3">LOG</a> = {}</td></tr>
|
||||
<tr class="memitem:a6cf72f93b1551f0d943c585b4f173be3" id="r_a6cf72f93b1551f0d943c585b4f173be3"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< int64_t, <a class="el" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="#a6cf72f93b1551f0d943c585b4f173be3">LOG</a> = {}</td></tr>
|
||||
<tr class="memdesc:a6cf72f93b1551f0d943c585b4f173be3"><td class="mdescLeft"> </td><td class="mdescRight">where floor(log2(i)) are precomputed. <br /></td></tr>
|
||||
<tr class="separator:a6cf72f93b1551f0d943c585b4f173be3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
@@ -207,7 +207,7 @@ size_t </td><td class="memItemRight" valign="bottom"><b>n</b> = 0</td></tr>
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a><int64_t, <a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>> data_structures::sparse_table::Sparse_table::A = {}</td>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a><int64_t, <a class="el" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>> data_structures::sparse_table::Sparse_table::A = {}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -225,7 +225,7 @@ size_t </td><td class="memItemRight" valign="bottom"><b>n</b> = 0</td></tr>
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a><int64_t, <a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>> data_structures::sparse_table::Sparse_table::LOG = {}</td>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a><int64_t, <a class="el" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>> data_structures::sparse_table::Sparse_table::LOG = {}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -242,7 +242,7 @@ size_t </td><td class="memItemRight" valign="bottom"><b>n</b> = 0</td></tr>
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a><<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a><int64_t, <a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>>, <a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html#af7db62f21983565c64d5d42d2a49888e">M</a>> data_structures::sparse_table::Sparse_table::ST {}</td>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a><<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a><int64_t, <a class="el" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>>, <a class="el" href="../../d8/dab/sparse__table_8cpp.html#af7db62f21983565c64d5d42d2a49888e">M</a>> data_structures::sparse_table::Sparse_table::ST {}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -253,7 +253,7 @@ size_t </td><td class="memItemRight" valign="bottom"><b>n</b> = 0</td></tr>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li>data_structures/<a class="el" href="../../d6/d42/data__structures_2sparse__table_8cpp.html">sparse_table.cpp</a></li>
|
||||
<li>data_structures/<a class="el" href="../../d8/dab/sparse__table_8cpp.html">sparse_table.cpp</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
|
||||
@@ -114,12 +114,13 @@ $(function(){initNavTree('da/d52/minimum__edit__distance_8cpp.html','../../'); i
|
||||
<p>Implementation of <a href="https://en.wikipedia.org/wiki/Edit_distance" target="_blank">Minimum Edit Distance</a> using Dynamic Programing.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for minimum_edit_distance.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/d3d/minimum__edit__distance_8cpp__incl.svg" width="252" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/d3d/minimum__edit__distance_8cpp__incl.svg" width="336" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
@@ -208,43 +209,48 @@ Algorithm</h3>
|
||||
<p>If last characters are same, ignore last char and recur for remaining string</p>
|
||||
<p>If the last character is different, consider all possibilities and find the minimum</p>
|
||||
<p>returning the minimum cost of operations needed to convert str1 to str2</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 89</span><span class="comment"> /// Create a table to store results of subproblems</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<uint64_t></a>><a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>(m+1, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a>(n+1)); <span class="comment">/// creasting 2D vector dp to store the results of subproblems</span></div>
|
||||
<div class="line"><span class="lineno"> 91</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 92</span><span class="comment"> /// Fill d[][] in bottom up manner</span></div>
|
||||
<div class="line"><span class="lineno"> 93</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = 0; i <= m; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="keywordflow">for</span> (uint64_t j = 0; j <= n; j++) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 95</span><span class="comment"> /// If first string is empty, only option is to</span></div>
|
||||
<div class="line"><span class="lineno"> 96</span><span class="comment"> /// insert all characters of second string</span></div>
|
||||
<div class="line"><span class="lineno"> 97</span><span class="comment"></span> <span class="keywordflow">if</span> (i == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = j; <span class="comment">/// Minimum operations = j</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 93</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 94</span><span class="comment"> /// Create a table to store results of subproblems</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<uint64_t></a>> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>(</div>
|
||||
<div class="line"><span class="lineno"> 96</span> m + 1,</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<uint64_t></a>(</div>
|
||||
<div class="line"><span class="lineno"> 98</span> n +</div>
|
||||
<div class="line"><span class="lineno"> 99</span> 1)); <span class="comment">/// creasting 2D vector dp to store the results of subproblems</span></div>
|
||||
<div class="line"><span class="lineno"> 100</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 101</span><span class="comment"> /// If second string is empty, only option is to</span></div>
|
||||
<div class="line"><span class="lineno"> 102</span><span class="comment"> /// remove all characters of second string</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (j == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 104</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = i; <span class="comment">/// Minimum operations = i</span></div>
|
||||
<div class="line"><span class="lineno"> 105</span> }</div>
|
||||
<div class="line"><span class="lineno"> 106</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 107</span><span class="comment"> /// If last characters are same, ignore last char</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span><span class="comment"> /// and recur for remaining string</span></div>
|
||||
<div class="line"><span class="lineno"> 109</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (str1[i - 1] == str2[j - 1]) {</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j - 1];</div>
|
||||
<div class="line"><span class="lineno"> 111</span> }</div>
|
||||
<div class="line"><span class="lineno"> 112</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 113</span><span class="comment"> /// If the last character is different, consider all</span></div>
|
||||
<div class="line"><span class="lineno"> 114</span><span class="comment"> /// possibilities and find the minimum</span></div>
|
||||
<div class="line"><span class="lineno"> 115</span><span class="comment"></span> <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 116</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a>(<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j - 1], <span class="comment">// Insert</span></div>
|
||||
<div class="line"><span class="lineno"> 117</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j], <span class="comment">// Remove</span></div>
|
||||
<div class="line"><span class="lineno"> 118</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j - 1]); <span class="comment">// Replace</span></div>
|
||||
<div class="line"><span class="lineno"> 119</span> }</div>
|
||||
<div class="line"><span class="lineno"> 120</span> }</div>
|
||||
<div class="line"><span class="lineno"> 121</span> }</div>
|
||||
<div class="line"><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[m][n]; <span class="comment">/// returning the minimum cost of operations needed to convert str1 to str2</span></div>
|
||||
<div class="line"><span class="lineno"> 124</span>}</div>
|
||||
<div class="line"><span class="lineno"> 101</span><span class="comment"> /// Fill d[][] in bottom up manner</span></div>
|
||||
<div class="line"><span class="lineno"> 102</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = 0; i <= m; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 103</span> <span class="keywordflow">for</span> (uint64_t j = 0; j <= n; j++) {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 104</span><span class="comment"> /// If first string is empty, only option is to</span></div>
|
||||
<div class="line"><span class="lineno"> 105</span><span class="comment"> /// insert all characters of second string</span></div>
|
||||
<div class="line"><span class="lineno"> 106</span><span class="comment"></span> <span class="keywordflow">if</span> (i == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = j; <span class="comment">/// Minimum operations = j</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span> }</div>
|
||||
<div class="line"><span class="lineno"> 109</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 110</span><span class="comment"> /// If second string is empty, only option is to</span></div>
|
||||
<div class="line"><span class="lineno"> 111</span><span class="comment"> /// remove all characters of second string</span></div>
|
||||
<div class="line"><span class="lineno"> 112</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (j == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 113</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = i; <span class="comment">/// Minimum operations = i</span></div>
|
||||
<div class="line"><span class="lineno"> 114</span> }</div>
|
||||
<div class="line"><span class="lineno"> 115</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 116</span><span class="comment"> /// If last characters are same, ignore last char</span></div>
|
||||
<div class="line"><span class="lineno"> 117</span><span class="comment"> /// and recur for remaining string</span></div>
|
||||
<div class="line"><span class="lineno"> 118</span><span class="comment"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (str1[i - 1] == str2[j - 1]) {</div>
|
||||
<div class="line"><span class="lineno"> 119</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j - 1];</div>
|
||||
<div class="line"><span class="lineno"> 120</span> }</div>
|
||||
<div class="line"><span class="lineno"> 121</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 122</span><span class="comment"> /// If the last character is different, consider all</span></div>
|
||||
<div class="line"><span class="lineno"> 123</span><span class="comment"> /// possibilities and find the minimum</span></div>
|
||||
<div class="line"><span class="lineno"> 124</span><span class="comment"></span> <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 125</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j] = 1 + <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">min</a>(<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i][j - 1], <span class="comment">// Insert</span></div>
|
||||
<div class="line"><span class="lineno"> 126</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j], <span class="comment">// Remove</span></div>
|
||||
<div class="line"><span class="lineno"> 127</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[i - 1][j - 1]); <span class="comment">// Replace</span></div>
|
||||
<div class="line"><span class="lineno"> 128</span> }</div>
|
||||
<div class="line"><span class="lineno"> 129</span> }</div>
|
||||
<div class="line"><span class="lineno"> 130</span> }</div>
|
||||
<div class="line"><span class="lineno"> 131</span> </div>
|
||||
<div class="line"><span class="lineno"> 132</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>[m][n]; <span class="comment">/// returning the minimum cost of operations needed to</span><span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 133</span><span class="comment"> /// convert str1 to str2</span></div>
|
||||
<div class="line"><span class="lineno"> 134</span><span class="comment"></span>}</div>
|
||||
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
|
||||
<div class="ttc" id="anamespacedp_html"><div class="ttname"><a href="../../df/d88/namespacedp.html">dp</a></div><div class="ttdoc">for std::vector</div><div class="ttdef"><b>Definition</b> partition_problem.cpp:39</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
@@ -279,11 +285,11 @@ Algorithm</h3>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 160</span> {</div>
|
||||
<div class="line"><span class="lineno"> 161</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 162</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 163</span>}</div>
|
||||
<div class="ttc" id="aminimum__edit__distance_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> minimum_edit_distance.cpp:132</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 173</span> {</div>
|
||||
<div class="line"><span class="lineno"> 174</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 176</span>}</div>
|
||||
<div class="ttc" id="aminimum__edit__distance_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> minimum_edit_distance.cpp:142</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -333,17 +339,16 @@ z if <code>z</code> is the minimum value </dd></dl>
|
||||
<p>returns x, if x is the minimum value</p>
|
||||
<p>returns y, if y is the minimum value</p>
|
||||
<p>returns z if z is the minimum value</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 63</span> {</div>
|
||||
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">if</span> (x <= y && x <= z) {</div>
|
||||
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">return</span> x; <span class="comment">/// returns x, if x is the minimum value</span></div>
|
||||
<div class="line"><span class="lineno"> 66</span> }</div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">if</span> (y <= x && y <= z) {</div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="keywordflow">return</span> y; <span class="comment">/// returns y, if y is the minimum value</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> }</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">return</span> z; <span class="comment">/// returns z if z is the minimum value</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> }</div>
|
||||
<div class="line"><span class="lineno"> 73</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 68</span> {</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">if</span> (x <= y && x <= z) {</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">return</span> x; <span class="comment">/// returns x, if x is the minimum value</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> }</div>
|
||||
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">if</span> (y <= x && y <= z) {</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">return</span> y; <span class="comment">/// returns y, if y is the minimum value</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">return</span> z; <span class="comment">/// returns z if z is the minimum value</span></div>
|
||||
<div class="line"><span class="lineno"> 76</span> }</div>
|
||||
<div class="line"><span class="lineno"> 77</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -372,31 +377,34 @@ z if <code>z</code> is the minimum value </dd></dl>
|
||||
|
||||
<p>Self-test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 132</span> {</div>
|
||||
<div class="line"><span class="lineno"> 133</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><span class="lineno"> 134</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str1 = <span class="stringliteral">"INTENTION"</span>; <span class="comment">// Sample input of 1st string</span></div>
|
||||
<div class="line"><span class="lineno"> 135</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str2 = <span class="stringliteral">"EXECUTION"</span>; <span class="comment">// Sample input of 2nd string</span></div>
|
||||
<div class="line"><span class="lineno"> 136</span> uint64_t expected_output1 = 5; <span class="comment">// Expected minimum cost</span></div>
|
||||
<div class="line"><span class="lineno"> 137</span> uint64_t output1 = <a class="code hl_function" href="#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a>(</div>
|
||||
<div class="line"><span class="lineno"> 138</span> str1, str2, str1.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>(), str2.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>()); <span class="comment">// calling the editDistDP function and storing the result on output1</span></div>
|
||||
<div class="line"><span class="lineno"> 139</span> assert(output1 == expected_output1); <span class="comment">// comparing the output with the expected output</span></div>
|
||||
<div class="line"><span class="lineno"> 140</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Minimum Number of Operations Required: "</span> << output1</div>
|
||||
<div class="line"><span class="lineno"> 141</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 142</span> </div>
|
||||
<div class="line"><span class="lineno"> 143</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><span class="lineno"> 144</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str3 = <span class="stringliteral">"SATURDAY"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 145</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str4 = <span class="stringliteral">"SUNDAY"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 146</span> uint64_t expected_output2 = 3;</div>
|
||||
<div class="line"><span class="lineno"> 147</span> uint64_t output2 = <a class="code hl_function" href="#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a>(</div>
|
||||
<div class="line"><span class="lineno"> 148</span> str3, str4, str3.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>(), str4.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>());</div>
|
||||
<div class="line"><span class="lineno"> 149</span> assert(output2 == expected_output2);</div>
|
||||
<div class="line"><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Minimum Number of Operations Required: "</span> << output2</div>
|
||||
<div class="line"><span class="lineno"> 151</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 152</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 142</span> {</div>
|
||||
<div class="line"><span class="lineno"> 143</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><span class="lineno"> 144</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str1 = <span class="stringliteral">"INTENTION"</span>; <span class="comment">// Sample input of 1st string</span></div>
|
||||
<div class="line"><span class="lineno"> 145</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str2 = <span class="stringliteral">"EXECUTION"</span>; <span class="comment">// Sample input of 2nd string</span></div>
|
||||
<div class="line"><span class="lineno"> 146</span> uint64_t expected_output1 = 5; <span class="comment">// Expected minimum cost</span></div>
|
||||
<div class="line"><span class="lineno"> 147</span> uint64_t output1 = <a class="code hl_function" href="#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a>(</div>
|
||||
<div class="line"><span class="lineno"> 148</span> str1, str2, str1.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>(),</div>
|
||||
<div class="line"><span class="lineno"> 149</span> str2.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>()); <span class="comment">// calling the editDistDP function and storing the</span></div>
|
||||
<div class="line"><span class="lineno"> 150</span> <span class="comment">// result on output1</span></div>
|
||||
<div class="line"><span class="lineno"> 151</span> assert(output1 ==</div>
|
||||
<div class="line"><span class="lineno"> 152</span> expected_output1); <span class="comment">// comparing the output with the expected output</span></div>
|
||||
<div class="line"><span class="lineno"> 153</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Minimum Number of Operations Required: "</span> << output1</div>
|
||||
<div class="line"><span class="lineno"> 154</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><span class="lineno"> 156</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><span class="lineno"> 157</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str3 = <span class="stringliteral">"SATURDAY"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 158</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> str4 = <span class="stringliteral">"SUNDAY"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 159</span> uint64_t expected_output2 = 3;</div>
|
||||
<div class="line"><span class="lineno"> 160</span> uint64_t output2 = <a class="code hl_function" href="#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a>(</div>
|
||||
<div class="line"><span class="lineno"> 161</span> str3, str4, str3.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>(), str4.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>());</div>
|
||||
<div class="line"><span class="lineno"> 162</span> assert(output2 == expected_output2);</div>
|
||||
<div class="line"><span class="lineno"> 163</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Minimum Number of Operations Required: "</span> << output2</div>
|
||||
<div class="line"><span class="lineno"> 164</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 165</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="aminimum__edit__distance_8cpp_html_ade2fcfe0359f3c7691bfaa04b14943e2"><div class="ttname"><a href="#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a></div><div class="ttdeci">uint64_t editDistDP(std::string str1, std::string str2, uint64_t m, uint64_t n)</div><div class="ttdoc">Calculates and stores the result of all the sub-problems, so that we don't have to recur to compute t...</div><div class="ttdef"><b>Definition</b> minimum_edit_distance.cpp:88</div></div>
|
||||
<div class="ttc" id="aminimum__edit__distance_8cpp_html_ade2fcfe0359f3c7691bfaa04b14943e2"><div class="ttname"><a href="#ade2fcfe0359f3c7691bfaa04b14943e2">dynamic_programming::minimum_edit_distance::editDistDP</a></div><div class="ttdeci">uint64_t editDistDP(std::string str1, std::string str2, uint64_t m, uint64_t n)</div><div class="ttdoc">Calculates and stores the result of all the sub-problems, so that we don't have to recur to compute t...</div><div class="ttdef"><b>Definition</b> minimum_edit_distance.cpp:92</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">std::string::length</a></div><div class="ttdeci">T length(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
|
||||
@@ -143,7 +143,7 @@ Functions</h2></td></tr>
|
||||
<p>Operations on Data Structures</p>
|
||||
<p>For assert For IO operations For <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue</a></p>
|
||||
<p>Operations on Data Structures</p>
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/count.html">std::count</a> for assert for tolower for string operations for IO Operations</p>
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/count.html">std::count</a> for assert for tolower for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> for string operations for IO Operations</p>
|
||||
<p>Operations on data structures </p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="adaf9a06f0c236c2d95c97e441ea2d12e" name="adaf9a06f0c236c2d95c97e441ea2d12e"></a>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<map id="dynamic_programming/abbreviation.cpp" name="dynamic_programming/abbreviation.cpp">
|
||||
<area shape="rect" id="Node000001" title="Implementation of Abbrievation" alt="" coords="96,5,248,46"/>
|
||||
<area shape="rect" id="Node000001" title="Implementation of Abbrievation" alt="" coords="137,5,290,46"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,70,120"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="140,49,73,88,70,83,137,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,94,165,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="164,48,146,81,141,79,159,45"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="190,94,243,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="185,45,204,79,200,82,181,48"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="268,94,325,120"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="204,44,266,83,263,88,201,49"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="171,49,79,90,77,85,168,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,94,154,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="193,48,151,86,147,82,190,44"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="178,94,249,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="216,46,216,78,211,78,211,46"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="274,94,327,120"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="237,44,277,81,274,85,233,48"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="352,94,409,120"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="256,44,342,85,340,89,254,49"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
bfc9221434b7aadf2410099c3ae46c3a
|
||||
3a94bee802ec80875a2245cb5b5f4a4a
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/abbreviation.cpp Pages: 1 -->
|
||||
<svg width="248pt" height="94pt"
|
||||
viewBox="0.00 0.00 247.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="311pt" height="94pt"
|
||||
viewBox="0.00 0.00 310.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of Abbrievation">
|
||||
<polygon fill="#999999" stroke="#666666" points="182.25,-85.75 68,-85.75 68,-55.25 182.25,-55.25 182.25,-85.75"/>
|
||||
<text text-anchor="start" x="76" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
|
||||
<text text-anchor="middle" x="125.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/abbreviation.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="213.25,-85.75 99,-85.75 99,-55.25 213.25,-55.25 213.25,-85.75"/>
|
||||
<text text-anchor="start" x="107" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
|
||||
<text text-anchor="middle" x="156.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/abbreviation.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -42,8 +42,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M99.9,-54.8C84.52,-45.83 64.92,-34.41 49.51,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="51.32,-22.43 40.92,-20.42 47.8,-28.48 51.32,-22.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M123.16,-54.8C102.18,-45.44 75.22,-33.41 54.72,-24.27"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="56.31,-21.15 45.75,-20.27 53.46,-27.54 56.31,-21.15"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -51,8 +51,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 66.5,-19.25 66.5,0 111.75,0 111.75,-19.25"/>
|
||||
<text text-anchor="middle" x="89.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -60,8 +60,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M117.21,-54.95C113.09,-47.36 108,-37.99 103.56,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="106.63,-28.15 98.78,-21.03 100.48,-31.49 106.63,-28.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M139.56,-54.95C129.95,-46.5 117.81,-35.83 107.85,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="110.41,-24.67 100.59,-20.7 105.79,-29.93 110.41,-24.67"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -69,8 +69,8 @@
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="178.12,-19.25 138.12,-19.25 138.12,0 178.12,0 178.12,-19.25"/>
|
||||
<text text-anchor="middle" x="158.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="182.88,-19.25 129.38,-19.25 129.38,0 182.88,0 182.88,-19.25"/>
|
||||
<text text-anchor="middle" x="156.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -78,8 +78,8 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M133.28,-54.95C137.58,-47.28 142.91,-37.77 147.52,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="150.46,-31.46 152.3,-21.02 144.36,-28.03 150.46,-31.46"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M156.12,-54.95C156.12,-47.71 156.12,-38.84 156.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="159.63,-31.21 156.13,-21.21 152.63,-31.21 159.63,-31.21"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -87,8 +87,8 @@
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="239.62,-19.25 196.62,-19.25 196.62,0 239.62,0 239.62,-19.25"/>
|
||||
<text text-anchor="middle" x="218.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="241.12,-19.25 201.12,-19.25 201.12,0 241.12,0 241.12,-19.25"/>
|
||||
<text text-anchor="middle" x="221.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -96,8 +96,26 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M148.11,-54.95C162.14,-46.07 180.03,-34.74 194.22,-25.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="195.93,-28.82 202.51,-20.51 192.19,-22.9 195.93,-28.82"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M172.19,-54.95C181.42,-46.59 193.05,-36.05 202.66,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="204.92,-30.02 209.98,-20.72 200.22,-24.84 204.92,-30.02"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="302.62,-19.25 259.62,-19.25 259.62,0 302.62,0 302.62,-19.25"/>
|
||||
<text text-anchor="middle" x="281.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M187.35,-54.8C207.02,-45.53 232.27,-33.63 251.61,-24.52"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="253.03,-27.73 260.59,-20.3 250.05,-21.39 253.03,-27.73"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -4,17 +4,17 @@
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/abbreviation.cpp Pages: 1 -->
|
||||
<svg width="248pt" height="94pt"
|
||||
viewBox="0.00 0.00 247.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="311pt" height="94pt"
|
||||
viewBox="0.00 0.00 310.62 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 89.75)">
|
||||
<title>dynamic_programming/abbreviation.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Implementation of Abbrievation">
|
||||
<polygon fill="#999999" stroke="#666666" points="182.25,-85.75 68,-85.75 68,-55.25 182.25,-55.25 182.25,-85.75"/>
|
||||
<text text-anchor="start" x="76" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
|
||||
<text text-anchor="middle" x="125.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/abbreviation.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="213.25,-85.75 99,-85.75 99,-55.25 213.25,-55.25 213.25,-85.75"/>
|
||||
<text text-anchor="start" x="107" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
|
||||
<text text-anchor="middle" x="156.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/abbreviation.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -31,8 +31,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M99.9,-54.8C84.52,-45.83 64.92,-34.41 49.51,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="51.32,-22.43 40.92,-20.42 47.8,-28.48 51.32,-22.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M123.16,-54.8C102.18,-45.44 75.22,-33.41 54.72,-24.27"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="56.31,-21.15 45.75,-20.27 53.46,-27.54 56.31,-21.15"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -40,8 +40,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="119.88,-19.25 66.38,-19.25 66.38,0 119.88,0 119.88,-19.25"/>
|
||||
<text text-anchor="middle" x="93.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 66.5,-19.25 66.5,0 111.75,0 111.75,-19.25"/>
|
||||
<text text-anchor="middle" x="89.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cstdint</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -49,8 +49,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M117.21,-54.95C113.09,-47.36 108,-37.99 103.56,-29.82"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="106.63,-28.15 98.78,-21.03 100.48,-31.49 106.63,-28.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M139.56,-54.95C129.95,-46.5 117.81,-35.83 107.85,-27.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="110.41,-24.67 100.59,-20.7 105.79,-29.93 110.41,-24.67"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -58,8 +58,8 @@
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="178.12,-19.25 138.12,-19.25 138.12,0 178.12,0 178.12,-19.25"/>
|
||||
<text text-anchor="middle" x="158.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="182.88,-19.25 129.38,-19.25 129.38,0 182.88,0 182.88,-19.25"/>
|
||||
<text text-anchor="middle" x="156.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -67,8 +67,8 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M133.28,-54.95C137.58,-47.28 142.91,-37.77 147.52,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="150.46,-31.46 152.3,-21.02 144.36,-28.03 150.46,-31.46"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M156.12,-54.95C156.12,-47.71 156.12,-38.84 156.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="159.63,-31.21 156.13,-21.21 152.63,-31.21 159.63,-31.21"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -76,8 +76,8 @@
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="239.62,-19.25 196.62,-19.25 196.62,0 239.62,0 239.62,-19.25"/>
|
||||
<text text-anchor="middle" x="218.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="241.12,-19.25 201.12,-19.25 201.12,0 241.12,0 241.12,-19.25"/>
|
||||
<text text-anchor="middle" x="221.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -85,8 +85,26 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M148.11,-54.95C162.14,-46.07 180.03,-34.74 194.22,-25.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="195.93,-28.82 202.51,-20.51 192.19,-22.9 195.93,-28.82"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M172.19,-54.95C181.42,-46.59 193.05,-36.05 202.66,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="204.92,-30.02 209.98,-20.72 200.22,-24.84 204.92,-30.02"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="302.62,-19.25 259.62,-19.25 259.62,0 302.62,0 302.62,-19.25"/>
|
||||
<text text-anchor="middle" x="281.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M187.35,-54.8C207.02,-45.53 232.27,-33.63 251.61,-24.52"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="253.03,-27.73 260.59,-20.3 250.05,-21.39 253.03,-27.73"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -116,7 +116,7 @@ $(function(){initNavTree('da/d9a/class_graph.html','../../'); initResizable(true
|
||||
<div class="dynheader">
|
||||
Collaboration diagram for Graph:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/dc2/class_graph__coll__graph.svg" width="647" height="346"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d1/dc2/class_graph__coll__graph.svg" width="647" height="348"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
|
||||
@@ -172,9 +172,9 @@ int </td><td class="memItemRight" valign="bottom"><b>vertexNum</b></td></tr
|
||||
<tr class="memitem:a10ff9c6c323cf435f18e424dbb62235e" id="r_a10ff9c6c323cf435f18e424dbb62235e"><td class="memItemLeft" align="right" valign="top"><a id="a10ff9c6c323cf435f18e424dbb62235e" name="a10ff9c6c323cf435f18e424dbb62235e"></a>
|
||||
int </td><td class="memItemRight" valign="bottom"><b>edgeNum</b></td></tr>
|
||||
<tr class="separator:a10ff9c6c323cf435f18e424dbb62235e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a2a546eb4062eb56cb88eb0a381d10a12" id="r_a2a546eb4062eb56cb88eb0a381d10a12"><td class="memItemLeft" align="right" valign="top"><a id="a2a546eb4062eb56cb88eb0a381d10a12" name="a2a546eb4062eb56cb88eb0a381d10a12"></a>
|
||||
<a class="el" href="../../d7/d77/class_edge.html">Edge</a> * </td><td class="memItemRight" valign="bottom"><b>edges</b></td></tr>
|
||||
<tr class="separator:a2a546eb4062eb56cb88eb0a381d10a12"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a28d19ea9c7d111f55fee78331abe88bd" id="r_a28d19ea9c7d111f55fee78331abe88bd"><td class="memItemLeft" align="right" valign="top"><a id="a28d19ea9c7d111f55fee78331abe88bd" name="a28d19ea9c7d111f55fee78331abe88bd"></a>
|
||||
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="el" href="../../d7/d77/class_edge.html">Edge</a> > </td><td class="memItemRight" valign="bottom"><b>edges</b></td></tr>
|
||||
<tr class="separator:a28d19ea9c7d111f55fee78331abe88bd"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a268ba18d421817ad8713c2e92f19d82a" id="r_a268ba18d421817ad8713c2e92f19d82a"><td class="memItemLeft" align="right" valign="top"><a id="a268ba18d421817ad8713c2e92f19d82a" name="a268ba18d421817ad8713c2e92f19d82a"></a>
|
||||
int ** </td><td class="memItemRight" valign="bottom"><b>edges</b></td></tr>
|
||||
<tr class="separator:a268ba18d421817ad8713c2e92f19d82a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -253,13 +253,12 @@ int </td><td class="memItemRight" valign="bottom"><b>max_flow</b> = 0</td><
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 19</span> {</div>
|
||||
<div class="line"><span class="lineno"> 20</span> this->vertexNum = V;</div>
|
||||
<div class="line"><span class="lineno"> 21</span> this->edgeNum = E;</div>
|
||||
<div class="line"><span class="lineno"> 22</span> this->edges = (<a class="code hl_struct" href="../../d7/d77/class_edge.html">Edge</a> *)<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/c/malloc.html">malloc</a>(E * <span class="keyword">sizeof</span>(<a class="code hl_struct" href="../../d7/d77/class_edge.html">Edge</a>));</div>
|
||||
<div class="line"><span class="lineno"> 23</span> }</div>
|
||||
<div class="ttc" id="aclass_edge_html"><div class="ttname"><a href="../../d7/d77/class_edge.html">Edge</a></div><div class="ttdef"><b>Definition</b> bellman_ford.cpp:7</div></div>
|
||||
<div class="ttc" id="amalloc_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/c/malloc.html">std::malloc</a></div><div class="ttdeci">T malloc(T... args)</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 20</span> {</div>
|
||||
<div class="line"><span class="lineno"> 21</span> this->vertexNum = V;</div>
|
||||
<div class="line"><span class="lineno"> 22</span> this->edgeNum = E;</div>
|
||||
<div class="line"><span class="lineno"> 23</span> this->edges.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">reserve</a>(E);</div>
|
||||
<div class="line"><span class="lineno"> 24</span> }</div>
|
||||
<div class="ttc" id="areserve_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">std::vector::reserve</a></div><div class="ttdeci">T reserve(T... args)</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -285,15 +284,15 @@ int </td><td class="memItemRight" valign="bottom"><b>max_flow</b> = 0</td><
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 16</span> {</div>
|
||||
<div class="line"><span class="lineno"> 17</span> this->vertexNum = V;</div>
|
||||
<div class="line"><span class="lineno"> 18</span> this->edges = <span class="keyword">new</span> <span class="keywordtype">int</span> *[V];</div>
|
||||
<div class="line"><span class="lineno"> 19</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < V; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 20</span> this->edges[i] = <span class="keyword">new</span> <span class="keywordtype">int</span>[V];</div>
|
||||
<div class="line"><span class="lineno"> 21</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < V; j++) this->edges[i][j] = INT_MAX;</div>
|
||||
<div class="line"><span class="lineno"> 22</span> this->edges[i][i] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 23</span> }</div>
|
||||
<div class="line"><span class="lineno"> 24</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 17</span> {</div>
|
||||
<div class="line"><span class="lineno"> 18</span> this->vertexNum = V;</div>
|
||||
<div class="line"><span class="lineno"> 19</span> this->edges = <span class="keyword">new</span> <span class="keywordtype">int</span> *[V];</div>
|
||||
<div class="line"><span class="lineno"> 20</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < V; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 21</span> this->edges[i] = <span class="keyword">new</span> <span class="keywordtype">int</span>[V];</div>
|
||||
<div class="line"><span class="lineno"> 22</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < V; j++) this->edges[i][j] = INT_MAX;</div>
|
||||
<div class="line"><span class="lineno"> 23</span> this->edges[i][i] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 24</span> }</div>
|
||||
<div class="line"><span class="lineno"> 25</span> }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -319,10 +318,12 @@ int </td><td class="memItemRight" valign="bottom"><b>max_flow</b> = 0</td><
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 26</span> {</div>
|
||||
<div class="line"><span class="lineno"> 27</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < vertexNum; i++) <span class="keyword">delete</span>[] edges[i];</div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keyword">delete</span>[] edges;</div>
|
||||
<div class="line"><span class="lineno"> 29</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 27</span> {</div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < vertexNum; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 29</span> <span class="keyword">delete</span>[] edges[i];</div>
|
||||
<div class="line"><span class="lineno"> 30</span> }</div>
|
||||
<div class="line"><span class="lineno"> 31</span> <span class="keyword">delete</span>[] edges;</div>
|
||||
<div class="line"><span class="lineno"> 32</span> }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -547,16 +548,17 @@ int </td><td class="memItemRight" valign="bottom"><b>max_flow</b> = 0</td><
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 26</span> {</div>
|
||||
<div class="line"><span class="lineno"> 27</span> <span class="keyword">static</span> <span class="keywordtype">int</span> edgeInd = 0;</div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keywordflow">if</span> (edgeInd < this->edgeNum) {</div>
|
||||
<div class="line"><span class="lineno"> 29</span> <a class="code hl_struct" href="../../d7/d77/class_edge.html">Edge</a> newEdge;</div>
|
||||
<div class="line"><span class="lineno"> 30</span> newEdge.src = src;</div>
|
||||
<div class="line"><span class="lineno"> 31</span> newEdge.dst = dst;</div>
|
||||
<div class="line"><span class="lineno"> 32</span> newEdge.weight = weight;</div>
|
||||
<div class="line"><span class="lineno"> 33</span> this->edges[edgeInd++] = newEdge;</div>
|
||||
<div class="line"><span class="lineno"> 34</span> }</div>
|
||||
<div class="line"><span class="lineno"> 35</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 27</span> {</div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keyword">static</span> <span class="keywordtype">int</span> edgeInd = 0;</div>
|
||||
<div class="line"><span class="lineno"> 29</span> <span class="keywordflow">if</span> (edgeInd < this->edgeNum) {</div>
|
||||
<div class="line"><span class="lineno"> 30</span> <a class="code hl_struct" href="../../d7/d77/class_edge.html">Edge</a> newEdge;</div>
|
||||
<div class="line"><span class="lineno"> 31</span> newEdge.src = src;</div>
|
||||
<div class="line"><span class="lineno"> 32</span> newEdge.dst = dst;</div>
|
||||
<div class="line"><span class="lineno"> 33</span> newEdge.weight = weight;</div>
|
||||
<div class="line"><span class="lineno"> 34</span> this->edges[edgeInd++] = newEdge;</div>
|
||||
<div class="line"><span class="lineno"> 35</span> }</div>
|
||||
<div class="line"><span class="lineno"> 36</span> }</div>
|
||||
<div class="ttc" id="aclass_edge_html"><div class="ttname"><a href="../../d7/d77/class_edge.html">Edge</a></div><div class="ttdef"><b>Definition</b> bellman_ford.cpp:8</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -591,9 +593,9 @@ int </td><td class="memItemRight" valign="bottom"><b>max_flow</b> = 0</td><
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 32</span> {</div>
|
||||
<div class="line"><span class="lineno"> 33</span> this->edges[src][dst] = weight;</div>
|
||||
<div class="line"><span class="lineno"> 34</span> }</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 35</span> {</div>
|
||||
<div class="line"><span class="lineno"> 36</span> this->edges[src][dst] = weight;</div>
|
||||
<div class="line"><span class="lineno"> 37</span> }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
273
da/de8/dijkstra__greedy_8cpp.html
Normal file
273
da/de8/dijkstra__greedy_8cpp.html
Normal file
@@ -0,0 +1,273 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: greedy_algorithms/dijkstra_greedy.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('da/de8/dijkstra__greedy_8cpp.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#nested-classes">Classes</a> |
|
||||
<a href="#namespaces">Namespaces</a> |
|
||||
<a href="#func-members">Functions</a> </div>
|
||||
<div class="headertitle"><div class="title">dijkstra_greedy.cpp File Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p><a href="https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm" target="_blank">Dijkstra</a> algorithm implementation
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <climits></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for dijkstra_greedy.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/dc8/dijkstra__greedy_8cpp__incl.svg" width="335" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">greedy_algorithms::dijkstra::Graph</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Wrapper class for storing a graph. <a href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d90/namespacegreedy__algorithms.html">greedy_algorithms</a></td></tr>
|
||||
<tr class="memdesc:d2/d90/namespacegreedy__algorithms"><td class="mdescLeft"> </td><td class="mdescRight">for string class <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d2f/namespacegreedy__algorithms_1_1dijkstra.html">greedy_algorithms::dijkstra</a></td></tr>
|
||||
<tr class="memdesc:d2/d2f/namespacegreedy__algorithms_1_1dijkstra"><td class="mdescLeft"> </td><td class="mdescRight">Functions for the <a href="https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm" target="_blank">Dijkstra</a> algorithm implementation. <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:af6cb29ca6dc5771439f6ea7262058a71" id="r_af6cb29ca6dc5771439f6ea7262058a71"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d2f/namespacegreedy__algorithms_1_1dijkstra.html#af6cb29ca6dc5771439f6ea7262058a71">greedy_algorithms::dijkstra::minimum_distance</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int > mdist, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< bool > vset, int V)</td></tr>
|
||||
<tr class="memdesc:af6cb29ca6dc5771439f6ea7262058a71"><td class="mdescLeft"> </td><td class="mdescRight">Utility function that finds the vertex with the minimum distance in <code>mdist</code>. <br /></td></tr>
|
||||
<tr class="separator:af6cb29ca6dc5771439f6ea7262058a71"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a7341d7c76a6145e991cdd231f689fca8" id="r_a7341d7c76a6145e991cdd231f689fca8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d2f/namespacegreedy__algorithms_1_1dijkstra.html#a7341d7c76a6145e991cdd231f689fca8">greedy_algorithms::dijkstra::print</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int > dist, int V)</td></tr>
|
||||
<tr class="memdesc:a7341d7c76a6145e991cdd231f689fca8"><td class="mdescLeft"> </td><td class="mdescRight">Utility function to print the distances to vertices. <br /></td></tr>
|
||||
<tr class="separator:a7341d7c76a6145e991cdd231f689fca8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:af915876d0ca33cc71a6a6191a8cd3ccd" id="r_af915876d0ca33cc71a6a6191a8cd3ccd"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d2f/namespacegreedy__algorithms_1_1dijkstra.html#af915876d0ca33cc71a6a6191a8cd3ccd">greedy_algorithms::dijkstra::dijkstra</a> (<a class="el" href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">Graph</a> graph, int src)</td></tr>
|
||||
<tr class="memdesc:af915876d0ca33cc71a6a6191a8cd3ccd"><td class="mdescLeft"> </td><td class="mdescRight">The main function that finds the shortest path from a given source to all other vertices using Dijkstra's Algorithm. <br /></td></tr>
|
||||
<tr class="separator:af915876d0ca33cc71a6a6191a8cd3ccd"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a483bb8ccf42aaf7375a83e91490eda1e" id="r_a483bb8ccf42aaf7375a83e91490eda1e"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a483bb8ccf42aaf7375a83e91490eda1e">tests</a> ()</td></tr>
|
||||
<tr class="memdesc:a483bb8ccf42aaf7375a83e91490eda1e"><td class="mdescLeft"> </td><td class="mdescRight">Self-test implementations. <br /></td></tr>
|
||||
<tr class="separator:a483bb8ccf42aaf7375a83e91490eda1e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <br /></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm" target="_blank">Dijkstra</a> algorithm implementation </p>
|
||||
<p><em>Quote from Wikipedia.</em></p>
|
||||
<p><b>Dijkstra's algorithm</b> is an algorithm for finding the shortest paths between nodes in a weighted graph, which may represent, for example, road networks. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later.</p>
|
||||
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/Panquesito7" target="_blank">David Leal</a> </dd>
|
||||
<dd>
|
||||
<a href="https://github.com/arpanjain97" target="_blank">Arpan Jain</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int main </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 199</span> {</div>
|
||||
<div class="line"><span class="lineno"> 200</span> <a class="code hl_function" href="#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 201</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 202</span>}</div>
|
||||
<div class="ttc" id="adijkstra__greedy_8cpp_html_a483bb8ccf42aaf7375a83e91490eda1e"><div class="ttname"><a href="#a483bb8ccf42aaf7375a83e91490eda1e">tests</a></div><div class="ttdeci">static void tests()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> dijkstra_greedy.cpp:160</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../da/de8/dijkstra__greedy_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="159" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a483bb8ccf42aaf7375a83e91490eda1e" name="a483bb8ccf42aaf7375a83e91490eda1e"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a483bb8ccf42aaf7375a83e91490eda1e">◆ </a></span>tests()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">static void tests </td>
|
||||
<td>(</td>
|
||||
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Self-test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 160</span> {</div>
|
||||
<div class="line"><span class="lineno"> 161</span> <a class="code hl_class" href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">greedy_algorithms::dijkstra::Graph</a> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>(8);</div>
|
||||
<div class="line"><span class="lineno"> 162</span> </div>
|
||||
<div class="line"><span class="lineno"> 163</span> <span class="comment">// 1st test.</span></div>
|
||||
<div class="line"><span class="lineno"> 164</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(6, 2, 4);</div>
|
||||
<div class="line"><span class="lineno"> 165</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 6, 4);</div>
|
||||
<div class="line"><span class="lineno"> 166</span> </div>
|
||||
<div class="line"><span class="lineno"> 167</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[6][2] == 4);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> </div>
|
||||
<div class="line"><span class="lineno"> 169</span> <span class="comment">// 2nd test.</span></div>
|
||||
<div class="line"><span class="lineno"> 170</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(0, 1, 1);</div>
|
||||
<div class="line"><span class="lineno"> 171</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 0, 1);</div>
|
||||
<div class="line"><span class="lineno"> 172</span> </div>
|
||||
<div class="line"><span class="lineno"> 173</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[0][1] == 1);</div>
|
||||
<div class="line"><span class="lineno"> 174</span> </div>
|
||||
<div class="line"><span class="lineno"> 175</span> <span class="comment">// 3rd test.</span></div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(0, 2, 7);</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 0, 7);</div>
|
||||
<div class="line"><span class="lineno"> 178</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 2, 1);</div>
|
||||
<div class="line"><span class="lineno"> 179</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 1, 1);</div>
|
||||
<div class="line"><span class="lineno"> 180</span> </div>
|
||||
<div class="line"><span class="lineno"> 181</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[0][2] == 7);</div>
|
||||
<div class="line"><span class="lineno"> 182</span> </div>
|
||||
<div class="line"><span class="lineno"> 183</span> <span class="comment">// 4th test.</span></div>
|
||||
<div class="line"><span class="lineno"> 184</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 3, 3);</div>
|
||||
<div class="line"><span class="lineno"> 185</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(3, 1, 3);</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 4, 2);</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(4, 1, 2);</div>
|
||||
<div class="line"><span class="lineno"> 188</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 3, 2);</div>
|
||||
<div class="line"><span class="lineno"> 189</span> </div>
|
||||
<div class="line"><span class="lineno"> 190</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[1][3] == 3);</div>
|
||||
<div class="line"><span class="lineno"> 191</span> </div>
|
||||
<div class="line"><span class="lineno"> 192</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"All tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 193</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aclassgreedy__algorithms_1_1dijkstra_1_1_graph_html"><div class="ttname"><a href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">greedy_algorithms::dijkstra::Graph</a></div><div class="ttdoc">Wrapper class for storing a graph.</div><div class="ttdef"><b>Definition</b> dijkstra_greedy.cpp:35</div></div>
|
||||
<div class="ttc" id="anamespacegraph_html"><div class="ttname"><a href="../../df/dce/namespacegraph.html">graph</a></div><div class="ttdoc">Graph Algorithms.</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../da/de8/dijkstra__greedy_8cpp.html">dijkstra_greedy.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
9
da/de8/dijkstra__greedy_8cpp.js
Normal file
9
da/de8/dijkstra__greedy_8cpp.js
Normal file
@@ -0,0 +1,9 @@
|
||||
var dijkstra__greedy_8cpp =
|
||||
[
|
||||
[ "greedy_algorithms::dijkstra::Graph", "d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html", "d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph" ],
|
||||
[ "dijkstra", "da/de8/dijkstra__greedy_8cpp.html#af915876d0ca33cc71a6a6191a8cd3ccd", null ],
|
||||
[ "main", "da/de8/dijkstra__greedy_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "minimum_distance", "da/de8/dijkstra__greedy_8cpp.html#af6cb29ca6dc5771439f6ea7262058a71", null ],
|
||||
[ "print", "da/de8/dijkstra__greedy_8cpp.html#a7341d7c76a6145e991cdd231f689fca8", null ],
|
||||
[ "tests", "da/de8/dijkstra__greedy_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e", null ]
|
||||
];
|
||||
@@ -0,0 +1,5 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="Node000001" title="Main function." alt="" coords="5,5,55,31"/>
|
||||
<area shape="rect" id="Node000002" href="$da/de8/dijkstra__greedy_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e" title="Self-test implementations." alt="" coords="103,5,153,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="55,16,88,16,88,21,55,21"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
ed234f3308411cd94ef89d2c5e550bb7
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="119pt" height="27pt"
|
||||
viewBox="0.00 0.00 118.75 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Main function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../da/de8/dijkstra__greedy_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e" target="_top" xlink:title="Self-test implementations.">
|
||||
<polygon fill="white" stroke="#666666" points="110.75,-19.25 73,-19.25 73,0 110.75,0 110.75,-19.25"/>
|
||||
<text text-anchor="middle" x="91.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.14,-9.62C44.55,-9.62 53.37,-9.62 61.69,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.43,-13.13 71.43,-9.63 61.43,-6.13 61.43,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="119pt" height="27pt"
|
||||
viewBox="0.00 0.00 118.75 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Main function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../da/de8/dijkstra__greedy_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e" target="_top" xlink:title="Self-test implementations.">
|
||||
<polygon fill="white" stroke="#666666" points="110.75,-19.25 73,-19.25 73,0 110.75,0 110.75,-19.25"/>
|
||||
<text text-anchor="middle" x="91.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.14,-9.62C44.55,-9.62 53.37,-9.62 61.69,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.43,-13.13 71.43,-9.63 61.43,-6.13 61.43,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
Reference in New Issue
Block a user