Documentation for 4e3abd4601

This commit is contained in:
github-actions
2021-10-29 18:15:03 +00:00
parent a8572a8662
commit f9e919c5c5
119 changed files with 3435 additions and 2850 deletions

View File

@@ -99,33 +99,40 @@ $(document).ready(function(){initNavTree('d6/d7b/sudoku__solve_8cpp.html','../..
<p><a href="https://en.wikipedia.org/wiki/Sudoku" target="_blank">Sudoku Solver</a> algorithm.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;array&gt;</code><br />
<div class="textblock"><code>#include &lt;array&gt;</code><br />
<code>#include &lt;iostream&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for sudoku_solve.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/d8e/sudoku__solve_8cpp__incl.svg" width="163" height="127"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/d8e/sudoku__solve_8cpp__incl.svg" width="164" height="127"><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>
Namespaces</h2></td></tr>
<tr class="memitem:db/dc0/namespacebacktracking"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dc0/namespacebacktracking.html">backtracking</a></td></tr>
<tr class="memdesc:db/dc0/namespacebacktracking"><td class="mdescLeft">&#160;</td><td class="mdescRight">Backtracking algorithms. <br /></td></tr>
<tr class="memdesc:db/dc0/namespacebacktracking"><td class="mdescLeft">&#160;</td><td class="mdescRight">for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:d8/d9f/namespacesudoku__solver"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d9f/namespacesudoku__solver.html">sudoku_solver</a></td></tr>
<tr class="memdesc:d8/d9f/namespacesudoku__solver"><td class="mdescLeft">&#160;</td><td class="mdescRight">Functions for the <a href="https://en.wikipedia.org/wiki/Sudoku" target="_blank">Sudoku Solver</a> implementation. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</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:a80af16e57cfb6aaab2bf1da4c4db3308"><td class="memTemplParams" colspan="2">template&lt;size_t V&gt; </td></tr>
<tr class="memitem:a80af16e57cfb6aaab2bf1da4c4db3308"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/dc0/namespacebacktracking.html#a80af16e57cfb6aaab2bf1da4c4db3308">backtracking::isPossible</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;mat, int i, int j, int no, int n)</td></tr>
<tr class="separator:a80af16e57cfb6aaab2bf1da4c4db3308"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1a76e21cb3934368d01cea7672d3906"><td class="memTemplParams" colspan="2">template&lt;size_t V&gt; </td></tr>
<tr class="memitem:ae1a76e21cb3934368d01cea7672d3906"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/dc0/namespacebacktracking.html#ae1a76e21cb3934368d01cea7672d3906">backtracking::printMat</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;mat, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;starting_mat, int n)</td></tr>
<tr class="separator:ae1a76e21cb3934368d01cea7672d3906"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b98ee79cdbc02ffd7b1f786f9696892"><td class="memTemplParams" colspan="2">template&lt;size_t V&gt; </td></tr>
<tr class="memitem:a2b98ee79cdbc02ffd7b1f786f9696892"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/dc0/namespacebacktracking.html#a2b98ee79cdbc02ffd7b1f786f9696892">backtracking::solveSudoku</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;mat, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;starting_mat, int i, int j)</td></tr>
<tr class="separator:a2b98ee79cdbc02ffd7b1f786f9696892"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07dc6acffd0500de9bdbf16b3ade94b0"><td class="memTemplParams" colspan="2">template&lt;size_t V&gt; </td></tr>
<tr class="memitem:a07dc6acffd0500de9bdbf16b3ade94b0"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d6/d7b/sudoku__solve_8cpp.html#a07dc6acffd0500de9bdbf16b3ade94b0">backtracking::sudoku_solver::isPossible</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;mat, int i, int j, int no, int n)</td></tr>
<tr class="memdesc:a07dc6acffd0500de9bdbf16b3ade94b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if it's possible to place a number (<code>no</code> parameter) <a href="../../d6/d7b/sudoku__solve_8cpp.html#a07dc6acffd0500de9bdbf16b3ade94b0">More...</a><br /></td></tr>
<tr class="separator:a07dc6acffd0500de9bdbf16b3ade94b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab040a12d7684cd85fb3684f4211ea5ac"><td class="memTemplParams" colspan="2">template&lt;size_t V&gt; </td></tr>
<tr class="memitem:ab040a12d7684cd85fb3684f4211ea5ac"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d6/d7b/sudoku__solve_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac">backtracking::sudoku_solver::printMat</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;mat, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;starting_mat, int n)</td></tr>
<tr class="memdesc:ab040a12d7684cd85fb3684f4211ea5ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to print the matrix. <a href="../../d6/d7b/sudoku__solve_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac">More...</a><br /></td></tr>
<tr class="separator:ab040a12d7684cd85fb3684f4211ea5ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac911c8bca8556206ff64461b2424866b"><td class="memTemplParams" colspan="2">template&lt;size_t V&gt; </td></tr>
<tr class="memitem:ac911c8bca8556206ff64461b2424866b"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d6/d7b/sudoku__solve_8cpp.html#ac911c8bca8556206ff64461b2424866b">backtracking::sudoku_solver::solveSudoku</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;mat, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;starting_mat, int i, int j)</td></tr>
<tr class="memdesc:ac911c8bca8556206ff64461b2424866b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to implement the Sudoku algorithm. <a href="../../d6/d7b/sudoku__solve_8cpp.html#ac911c8bca8556206ff64461b2424866b">More...</a><br /></td></tr>
<tr class="separator:ac911c8bca8556206ff64461b2424866b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/d7b/sudoku__solve_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <a href="../../d6/d7b/sudoku__solve_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
@@ -135,6 +142,105 @@ Functions</h2></td></tr>
<dd>
<a href="https://github.com/Panquesito7" target="_blank">David Leal</a> </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a07dc6acffd0500de9bdbf16b3ade94b0" name="a07dc6acffd0500de9bdbf16b3ade94b0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07dc6acffd0500de9bdbf16b3ade94b0">&#9670;&nbsp;</a></span>isPossible()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t V&gt; </div>
<table class="memname">
<tr>
<td class="memname">bool backtracking::sudoku_solver::isPossible </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;&#160;</td>
<td class="paramname"><em>mat</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>j</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>no</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>n</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if it's possible to place a number (<code>no</code> parameter) </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">V</td><td>number of vertices in the array </td></tr>
</table>
</dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">mat</td><td>matrix where numbers are saved </td></tr>
<tr><td class="paramname">i</td><td>current index in rows </td></tr>
<tr><td class="paramname">j</td><td>current index in columns </td></tr>
<tr><td class="paramname">no</td><td>number to be added in matrix </td></tr>
<tr><td class="paramname">n</td><td>number of times loop will run </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if 'mat' is different from 'no' </dd>
<dd>
<code>false</code> if 'mat' equals to 'no' </dd></dl>
<p ><code>no</code> shouldn't be present in either row i or column j</p>
<p ><code>no</code> shouldn't be present in the 3*3 subgrid</p>
<div class="fragment"><div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> {<span class="comment"></span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment"> /// `no` shouldn&#39;t be present in either row i or column j</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"></span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> x = 0; x &lt; n; x++) {</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">if</span> (mat[x][j] == no || mat[i][x] == no) {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment"></span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment"> /// `no` shouldn&#39;t be present in the 3*3 subgrid</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment"></span> <span class="keywordtype">int</span> sx = (i / 3) * 3;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">int</span> sy = (j / 3) * 3;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> x = sx; x &lt; sx + 3; x++) {</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> y = sy; y &lt; sy + 3; y++) {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">if</span> (mat[x][y] == no) {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> }</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> }</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>}</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="../../d6/d7b/sudoku__solve_8cpp_a07dc6acffd0500de9bdbf16b3ade94b0_cgraph.svg" width="158" height="76"><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="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&nbsp;</a></span>main()</h2>
@@ -150,28 +256,29 @@ Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p >Main function </p>
<div class="fragment"><div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> {</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">const</span> <span class="keywordtype">int</span> V = 9;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;std::array &lt;int, V&gt;</a>, V&gt; mat = { </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {5, 3, 0, 0, 7, 0, 0, 0, 0},</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {6, 0, 0, 1, 9, 5, 0, 0, 0},</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {0, 9, 8, 0, 0, 0, 0, 6, 0},</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {8, 0, 0, 0, 6, 0, 0, 0, 3},</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {4, 0, 0, 8, 0, 3, 0, 0, 1},</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {7, 0, 0, 0, 2, 0, 0, 0, 6},</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {0, 6, 0, 0, 0, 0, 2, 8, 0},</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {0, 0, 0, 4, 1, 9, 0, 0, 5},</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;int, V&gt;</a> {0, 0, 0, 0, 8, 0, 0, 7, 9}</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> };</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> </div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> backtracking::printMat&lt;V&gt;(mat, mat, 9);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Solution &quot;</span> &lt;&lt; <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"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array &lt;std::array &lt;int, V&gt;</a>, V&gt; starting_mat = mat;</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> backtracking::solveSudoku&lt;V&gt;(mat, starting_mat, 0, 0);</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span>}</div>
<p>Main function. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<div class="fragment"><div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> {</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <span class="keyword">const</span> <span class="keywordtype">int</span> V = 9;</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;std::array&lt;int, V&gt;</a>, V&gt; mat = {</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{5, 3, 0, 0, 7, 0, 0, 0, 0},</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{6, 0, 0, 1, 9, 5, 0, 0, 0},</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{0, 9, 8, 0, 0, 0, 0, 6, 0},</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{8, 0, 0, 0, 6, 0, 0, 0, 3},</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{4, 0, 0, 8, 0, 3, 0, 0, 1},</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{7, 0, 0, 0, 2, 0, 0, 0, 6},</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{0, 6, 0, 0, 0, 0, 2, 8, 0},</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{0, 0, 0, 4, 1, 9, 0, 0, 5},</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;int, V&gt;</a>{0, 0, 0, 0, 8, 0, 0, 7, 9}};</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> backtracking::sudoku_solver::printMat&lt;V&gt;(mat, mat, 9);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Solution &quot;</span> &lt;&lt; <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"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;std::array&lt;int, V&gt;</a>, V&gt; starting_mat = mat;</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> backtracking::sudoku_solver::solveSudoku&lt;V&gt;(mat, starting_mat, 0, 0);</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span>}</div>
<div class="ttc" id="aarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a></div></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="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>
@@ -182,6 +289,195 @@ Here is the call graph for this function:</div>
</div>
</div>
</div>
</div>
<a id="ab040a12d7684cd85fb3684f4211ea5ac" name="ab040a12d7684cd85fb3684f4211ea5ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab040a12d7684cd85fb3684f4211ea5ac">&#9670;&nbsp;</a></span>printMat()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t V&gt; </div>
<table class="memname">
<tr>
<td class="memname">void backtracking::sudoku_solver::printMat </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;&#160;</td>
<td class="paramname"><em>mat</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;&#160;</td>
<td class="paramname"><em>starting_mat</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>n</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Utility function to print the matrix. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">V</td><td>number of vertices in array </td></tr>
</table>
</dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">mat</td><td>matrix where numbers are saved </td></tr>
<tr><td class="paramname">starting_mat</td><td>copy of mat, required by printMat for highlighting the differences </td></tr>
<tr><td class="paramname">n</td><td>number of times loop will run </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; i++) {</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt; n; j++) {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">if</span> (starting_mat[i][j] != mat[i][j]) {</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\033[93m&quot;</span> &lt;&lt; mat[i][j] &lt;&lt; <span class="stringliteral">&quot;\033[0m&quot;</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; mat[i][j] &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">if</span> ((j + 1) % 3 == 0) {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="charliteral">&#39;\t&#39;</span>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">if</span> ((i + 1) % 3 == 0) {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <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"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> }</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <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"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span>}</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="../../d6/d7b/sudoku__solve_8cpp_ab040a12d7684cd85fb3684f4211ea5ac_cgraph.svg" width="278" height="76"><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="ac911c8bca8556206ff64461b2424866b" name="ac911c8bca8556206ff64461b2424866b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac911c8bca8556206ff64461b2424866b">&#9670;&nbsp;</a></span>solveSudoku()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t V&gt; </div>
<table class="memname">
<tr>
<td class="memname">bool backtracking::sudoku_solver::solveSudoku </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;&#160;</td>
<td class="paramname"><em>mat</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; int, V &gt;, V &gt; &amp;&#160;</td>
<td class="paramname"><em>starting_mat</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>j</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Main function to implement the Sudoku algorithm. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">V</td><td>number of vertices in array </td></tr>
</table>
</dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">mat</td><td>matrix where numbers are saved </td></tr>
<tr><td class="paramname">starting_mat</td><td>copy of mat, required by printMat for highlighting the differences </td></tr>
<tr><td class="paramname">i</td><td>current index in rows </td></tr>
<tr><td class="paramname">j</td><td>current index in columns </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if 'no' was placed </dd>
<dd>
<code>false</code> if 'no' was not placed </dd></dl>
<p >Base Case</p>
<p >Solved for 9 rows already</p>
<p >Crossed the last Cell in the row</p>
<p >Blue Cell - Skip</p>
<p >White Cell Try to place every possible no</p>
<p >Place the 'no' - assuming a solution will exist</p>
<p >Couldn't find a solution loop will place the next <code>no</code>.</p>
<p ><a class="el" href="../../dd/d4f/class_solution.html">Solution</a> couldn't be found for any of the numbers provided</p>
<div class="fragment"><div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> {<span class="comment"></span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="comment"> /// Base Case</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="comment"></span> <span class="keywordflow">if</span> (i == 9) {<span class="comment"></span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="comment"> /// Solved for 9 rows already</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span><span class="comment"></span> printMat&lt;V&gt;(mat, starting_mat, 9);</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> }</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span><span class="comment"></span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="comment"> /// Crossed the last Cell in the row</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="comment"></span> <span class="keywordflow">if</span> (j == 9) {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> solveSudoku&lt;V&gt;(mat, starting_mat, i + 1, 0);</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> }</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="comment"></span> </div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="comment"> /// Blue Cell - Skip</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span><span class="comment"></span> <span class="keywordflow">if</span> (mat[i][j] != 0) {</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">return</span> solveSudoku&lt;V&gt;(mat, starting_mat, i, j + 1);</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }<span class="comment"></span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span><span class="comment"> /// White Cell</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="comment"> /// Try to place every possible no</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span><span class="comment"></span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> no = 1; no &lt;= 9; no++) {</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">if</span> (isPossible&lt;V&gt;(mat, i, j, no, 9)) {<span class="comment"></span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="comment"> /// Place the &#39;no&#39; - assuming a solution will exist</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="comment"></span> mat[i][j] = no;</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordtype">bool</span> solution_found = solveSudoku&lt;V&gt;(mat, starting_mat, i, j + 1);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keywordflow">if</span> (solution_found) {</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }<span class="comment"></span></div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="comment"> /// Couldn&#39;t find a solution</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="comment"> /// loop will place the next `no`.</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span><span class="comment"></span> }</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> }<span class="comment"></span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span><span class="comment"> /// Solution couldn&#39;t be found for any of the numbers provided</span></div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="comment"></span> mat[i][j] = 0;</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span>}</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="../../d6/d7b/sudoku__solve_8cpp_ac911c8bca8556206ff64461b2424866b_cgraph.svg" width="160" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
</div><!-- contents -->

View File

@@ -1,7 +1,7 @@
var sudoku__solve_8cpp =
[
[ "isPossible", "d6/d7b/sudoku__solve_8cpp.html#a80af16e57cfb6aaab2bf1da4c4db3308", null ],
[ "isPossible", "d6/d7b/sudoku__solve_8cpp.html#a07dc6acffd0500de9bdbf16b3ade94b0", null ],
[ "main", "d6/d7b/sudoku__solve_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "printMat", "d6/d7b/sudoku__solve_8cpp.html#ae1a76e21cb3934368d01cea7672d3906", null ],
[ "solveSudoku", "d6/d7b/sudoku__solve_8cpp.html#a2b98ee79cdbc02ffd7b1f786f9696892", null ]
[ "printMat", "d6/d7b/sudoku__solve_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac", null ],
[ "solveSudoku", "d6/d7b/sudoku__solve_8cpp.html#ac911c8bca8556206ff64461b2424866b", null ]
];

View File

@@ -0,0 +1,3 @@
<map id="backtracking::sudoku_solver::isPossible" name="backtracking::sudoku_solver::isPossible">
<area shape="rect" id="node1" title="Check if it&#39;s possible to place a number (no parameter)" alt="" coords="5,29,152,71"/>
</map>

View File

@@ -0,0 +1 @@
588777246f1bc4d0956090f200f69d87

View File

@@ -0,0 +1,29 @@
<?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 2.49.2 (20211016.1639)
-->
<!-- Title: backtracking::sudoku_solver::isPossible Pages: 1 -->
<svg width="118pt" height="57pt"
viewBox="0.00 0.00 118.00 57.00" 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 53)">
<title>backtracking::sudoku_solver::isPossible</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-53 114,-53 114,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Check if it&#39;s possible to place a number (no parameter)">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-30.5 110,-30.5 110,-0.5 0,-0.5"/>
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking::sudoku</text>
<text text-anchor="middle" x="55" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">_solver::isPossible</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node1</title>
<path fill="none" stroke="midnightblue" d="M35.83,-30.66C31.21,-40.06 37.6,-49 55,-49 65.6,-49 72.12,-45.68 74.55,-40.96"/>
<polygon fill="midnightblue" stroke="midnightblue" points="78.03,-40.52 74.17,-30.66 71.04,-40.78 78.03,-40.52"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,4 @@
<map id="backtracking::sudoku_solver::printMat" name="backtracking::sudoku_solver::printMat">
<area shape="rect" id="node1" title="Utility function to print the matrix." alt="" coords="5,29,152,71"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="200,37,272,63"/>
</map>

View File

@@ -0,0 +1 @@
5f5b66a954df84d108cb4d89a21a2305

View File

@@ -0,0 +1,44 @@
<?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 2.49.2 (20211016.1639)
-->
<!-- Title: backtracking::sudoku_solver::printMat Pages: 1 -->
<svg width="208pt" height="57pt"
viewBox="0.00 0.00 208.00 57.00" 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 53)">
<title>backtracking::sudoku_solver::printMat</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-53 204,-53 204,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Utility function to print the matrix.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-30.5 110,-30.5 110,-0.5 0,-0.5"/>
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking::sudoku</text>
<text text-anchor="middle" x="55" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">_solver::printMat</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge2" class="edge">
<title>Node1&#45;&gt;Node1</title>
<path fill="none" stroke="midnightblue" d="M34.44,-30.66C29.48,-40.06 36.33,-49 55,-49 66.38,-49 73.36,-45.68 75.97,-40.96"/>
<polygon fill="midnightblue" stroke="midnightblue" points="79.45,-40.51 75.56,-30.66 72.46,-40.79 79.45,-40.51"/>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="146,-6 146,-25 200,-25 200,-6 146,-6"/>
<text text-anchor="middle" x="173" y="-13" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M110.26,-15.5C118.87,-15.5 127.59,-15.5 135.66,-15.5"/>
<polygon fill="midnightblue" stroke="midnightblue" points="135.83,-19 145.83,-15.5 135.83,-12 135.83,-19"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,3 @@
<map id="backtracking::sudoku_solver::solveSudoku" name="backtracking::sudoku_solver::solveSudoku">
<area shape="rect" id="node1" title="Main function to implement the Sudoku algorithm." alt="" coords="5,29,155,71"/>
</map>

View File

@@ -0,0 +1 @@
ba63a170eb3df4de7c60bcaaeceebe02

View File

@@ -0,0 +1,29 @@
<?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 2.49.2 (20211016.1639)
-->
<!-- Title: backtracking::sudoku_solver::solveSudoku Pages: 1 -->
<svg width="120pt" height="57pt"
viewBox="0.00 0.00 120.00 57.00" 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 53)">
<title>backtracking::sudoku_solver::solveSudoku</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-53 116,-53 116,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Main function to implement the Sudoku algorithm.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-30.5 112,-30.5 112,-0.5 0,-0.5"/>
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking::sudoku</text>
<text text-anchor="middle" x="56" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">_solver::solveSudoku</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node1</title>
<path fill="none" stroke="midnightblue" d="M36.48,-30.66C31.78,-40.06 38.28,-49 56,-49 66.8,-49 73.43,-45.68 75.9,-40.96"/>
<polygon fill="midnightblue" stroke="midnightblue" points="79.39,-40.52 75.52,-30.66 72.39,-40.78 79.39,-40.52"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,4 +1,4 @@
<map id="main" name="main">
<area shape="rect" id="node1" title=" " alt="" coords="5,5,56,32"/>
<area shape="rect" id="node1" title="Main function." alt="" coords="5,5,56,32"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="104,5,176,32"/>
</map>

View File

@@ -1 +1 @@
85270aea331ae2e33b0af08bba3538a8
4b2b7a86ed024f51a94096c684cf2192

View File

@@ -12,7 +12,7 @@
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title=" ">
<g id="a_node1"><a xlink:title="Main function.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-19.5 38,-19.5 38,-0.5 0,-0.5"/>
<text text-anchor="middle" x="19" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB