<trclass="memdesc:"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Structure to hold the matrix and dimensions. <ahref="../../dc/d18/structsudoku.html#details">More...</a><br/></td></tr>
<trclass="memitem:ga85d25d3b40017436f264a103685e4c55"><tdclass="memItemLeft"align="right"valign="top">bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df4/group__sudoku.html#ga85d25d3b40017436f264a103685e4c55">OKrow</a> (const struct <aclass="el"href="../../dc/d18/structsudoku.html">sudoku</a> *a, int x, int y, int v)</td></tr>
<trclass="memdesc:ga85d25d3b40017436f264a103685e4c55"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check if <code>x</code>^th row is valid. <ahref="../../d5/df4/group__sudoku.html#ga85d25d3b40017436f264a103685e4c55">More...</a><br/></td></tr>
<trclass="memitem:ga6503128d4f5ce0a0826f72f73f9e0b2a"><tdclass="memItemLeft"align="right"valign="top">bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df4/group__sudoku.html#ga6503128d4f5ce0a0826f72f73f9e0b2a">OKcol</a> (const struct <aclass="el"href="../../dc/d18/structsudoku.html">sudoku</a> *a, int x, int y, int v)</td></tr>
<trclass="memdesc:ga6503128d4f5ce0a0826f72f73f9e0b2a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check if <code>y</code>^th column is valid. <ahref="../../d5/df4/group__sudoku.html#ga6503128d4f5ce0a0826f72f73f9e0b2a">More...</a><br/></td></tr>
<trclass="memitem:ga1cd43df3f4187845ce186042fe53e6f1"><tdclass="memItemLeft"align="right"valign="top">bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df4/group__sudoku.html#ga1cd43df3f4187845ce186042fe53e6f1">OKbox</a> (const struct <aclass="el"href="../../dc/d18/structsudoku.html">sudoku</a> *a, int x, int y, int v)</td></tr>
<trclass="memdesc:ga1cd43df3f4187845ce186042fe53e6f1"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check if a 3x3 box is valid. <ahref="../../d5/df4/group__sudoku.html#ga1cd43df3f4187845ce186042fe53e6f1">More...</a><br/></td></tr>
<trclass="memitem:ga3a0ec150ac9d0cb6b28279d36d95d72f"><tdclass="memItemLeft"align="right"valign="top">bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df4/group__sudoku.html#ga3a0ec150ac9d0cb6b28279d36d95d72f">OK</a> (const struct <aclass="el"href="../../dc/d18/structsudoku.html">sudoku</a> *a, int x, int y, int v)</td></tr>
<trclass="memdesc:ga3a0ec150ac9d0cb6b28279d36d95d72f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check if element <code>v</code> is valid to place at (x,y) location. <ahref="../../d5/df4/group__sudoku.html#ga3a0ec150ac9d0cb6b28279d36d95d72f">More...</a><br/></td></tr>
<trclass="memdesc:ga702ff4f95dde780c7d04fcdd1021b6c1"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Print the matrix to stdout. <ahref="../../d5/df4/group__sudoku.html#ga702ff4f95dde780c7d04fcdd1021b6c1">More...</a><br/></td></tr>
<trclass="memitem:ga62e94fc39f116e2c81daed8f5437431b"><tdclass="memItemLeft"align="right"valign="top">bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d5/df4/group__sudoku.html#ga62e94fc39f116e2c81daed8f5437431b">get_next_unknown</a> (const struct <aclass="el"href="../../dc/d18/structsudoku.html">sudoku</a> *a, int *x, int *y)</td></tr>
<trclass="memdesc:ga62e94fc39f116e2c81daed8f5437431b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Find and get the location for next empty cell. <ahref="../../d5/df4/group__sudoku.html#ga62e94fc39f116e2c81daed8f5437431b">More...</a><br/></td></tr>
<trclass="memdesc:gadfe0ed5085b4775d8fa00b434cc0fdfc"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Function to solve a partially filled sudoku matrix. <ahref="../../d5/df4/group__sudoku.html#gadfe0ed5085b4775d8fa00b434cc0fdfc">More...</a><br/></td></tr>
<divclass="line"><aid="l00146"name="l00146"></a><spanclass="lineno"> 146</span><spanclass="keywordflow">for</span> (<spanclass="keywordtype">int</span> i = 0; i < a->N; i++)</div>
<p>Check if element <code>v</code> is valid to place at (x,y) location. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">a</td><td><aclass="el"href="../../dc/d18/structsudoku.html"title="Structure to hold the matrix and dimensions.">sudoku</a> to check </td></tr>
<tr><tdclass="paramname">x</td><td>row to place value </td></tr>
<tr><tdclass="paramname">y</td><td>column to place value </td></tr>
<tr><tdclass="paramname">v</td><td>value to check if it is valid </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><code>true</code> if valid </dd>
<divclass="line"><aid="l00113"name="l00113"></a><spanclass="lineno"> 113</span><spanclass="keywordtype">bool</span> result = <aclass="code hl_function"href="../../d5/df4/group__sudoku.html#ga85d25d3b40017436f264a103685e4c55">OKrow</a>(a, x, y, v);</div>
<divclass="line"><aid="l00115"name="l00115"></a><spanclass="lineno"> 115</span> result = <aclass="code hl_function"href="../../d5/df4/group__sudoku.html#ga6503128d4f5ce0a0826f72f73f9e0b2a">OKcol</a>(a, x, y, v);</div>
<divclass="line"><aid="l00117"name="l00117"></a><spanclass="lineno"> 117</span> result = <aclass="code hl_function"href="../../d5/df4/group__sudoku.html#ga1cd43df3f4187845ce186042fe53e6f1">OKbox</a>(a, x, y, v);</div>
<divclass="ttc"id="agroup__sudoku_html_ga1cd43df3f4187845ce186042fe53e6f1"><divclass="ttname"><ahref="../../d5/df4/group__sudoku.html#ga1cd43df3f4187845ce186042fe53e6f1">OKbox</a></div><divclass="ttdeci">bool OKbox(const struct sudoku *a, int x, int y, int v)</div><divclass="ttdoc">Check if a 3x3 box is valid.</div><divclass="ttdef"><b>Definition:</b> sudoku_solver.c:85</div></div>
<divclass="ttc"id="agroup__sudoku_html_ga6503128d4f5ce0a0826f72f73f9e0b2a"><divclass="ttname"><ahref="../../d5/df4/group__sudoku.html#ga6503128d4f5ce0a0826f72f73f9e0b2a">OKcol</a></div><divclass="ttdeci">bool OKcol(const struct sudoku *a, int x, int y, int v)</div><divclass="ttdoc">Check if y^th column is valid.</div><divclass="ttdef"><b>Definition:</b> sudoku_solver.c:67</div></div>
<divclass="ttc"id="agroup__sudoku_html_ga85d25d3b40017436f264a103685e4c55"><divclass="ttname"><ahref="../../d5/df4/group__sudoku.html#ga85d25d3b40017436f264a103685e4c55">OKrow</a></div><divclass="ttdeci">bool OKrow(const struct sudoku *a, int x, int y, int v)</div><divclass="ttdoc">Check if x^th row is valid.</div><divclass="ttdef"><b>Definition:</b> sudoku_solver.c:48</div></div>
<divclass="center"><iframescrolling="no"frameborder="0"src="../../d5/df4/group__sudoku_ga3a0ec150ac9d0cb6b28279d36d95d72f_cgraph.svg"width="163"height="139"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<divclass="line"><aid="l00087"name="l00087"></a><spanclass="lineno"> 87</span><spanclass="comment">/* get start indices of the box that the current (x,y) lies in</span></div>
<divclass="line"><aid="l00088"name="l00088"></a><spanclass="lineno"> 88</span><spanclass="comment"> remember that in C/C++, division operation always rounds towards</span></div>
<divclass="line"><aid="l00089"name="l00089"></a><spanclass="lineno"> 89</span><spanclass="comment"> -infinity for signed integers and towards 0 for unsigned integers</span></div>
<divclass="line"><aid="l00091"name="l00091"></a><spanclass="lineno"> 91</span><spanclass="keywordtype">int</span> bi = x - x % a->N2, bj = y - y % a->N2;</div>
<divclass="line"><aid="l00094"name="l00094"></a><spanclass="lineno"> 94</span><spanclass="keywordflow">for</span> (<spanclass="keywordtype">int</span> i = bi; i < (bi + a->N2); i++)</div>
<p>Check if <code>y</code>^th column is valid. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">a</td><td><aclass="el"href="../../dc/d18/structsudoku.html"title="Structure to hold the matrix and dimensions.">sudoku</a> to check </td></tr>
<divclass="line"><aid="l00069"name="l00069"></a><spanclass="lineno"> 69</span><spanclass="keywordflow">for</span> (<spanclass="keywordtype">int</span> i = 0; i < a->N; i++)</div>
<tr><tdclass="paramname">a</td><td><aclass="el"href="../../dc/d18/structsudoku.html"title="Structure to hold the matrix and dimensions.">sudoku</a> to check </td></tr>
<tr><tdclass="paramname">x</td><td>row to check </td></tr>
<divclass="line"><aid="l00186"name="l00186"></a><spanclass="lineno"> 186</span><spanclass="comment">/* try all possible values for the unknown */</span></div>
<divclass="line"><aid="l00187"name="l00187"></a><spanclass="lineno"> 187</span><spanclass="keywordflow">for</span> (uint8_t v = 1; v <= a->N; v++)</div>
<divclass="line"><aid="l00188"name="l00188"></a><spanclass="lineno"> 188</span> { <spanclass="comment">/* try all possible values 1 thru N */</span></div>
<divclass="line"><aid="l00193"name="l00193"></a><spanclass="lineno"> 193</span><spanclass="comment">/* if assignment checks satisfy, set the value and</span></div>
<divclass="line"><aid="l00194"name="l00194"></a><spanclass="lineno"> 194</span><spanclass="comment"> continue with remaining elements */</span></div>
<divclass="ttc"id="agroup__sudoku_html_ga3a0ec150ac9d0cb6b28279d36d95d72f"><divclass="ttname"><ahref="../../d5/df4/group__sudoku.html#ga3a0ec150ac9d0cb6b28279d36d95d72f">OK</a></div><divclass="ttdeci">bool OK(const struct sudoku *a, int x, int y, int v)</div><divclass="ttdoc">Check if element v is valid to place at (x,y) location.</div><divclass="ttdef"><b>Definition:</b> sudoku_solver.c:111</div></div>
<divclass="ttc"id="agroup__sudoku_html_ga62e94fc39f116e2c81daed8f5437431b"><divclass="ttname"><ahref="../../d5/df4/group__sudoku.html#ga62e94fc39f116e2c81daed8f5437431b">get_next_unknown</a></div><divclass="ttdeci">bool get_next_unknown(const struct sudoku *a, int *x, int *y)</div><divclass="ttdoc">Find and get the location for next empty cell.</div><divclass="ttdef"><b>Definition:</b> sudoku_solver.c:144</div></div>
<divclass="ttc"id="agroup__sudoku_html_gadfe0ed5085b4775d8fa00b434cc0fdfc"><divclass="ttname"><ahref="../../d5/df4/group__sudoku.html#gadfe0ed5085b4775d8fa00b434cc0fdfc">solve</a></div><divclass="ttdeci">bool solve(struct sudoku *a)</div><divclass="ttdoc">Function to solve a partially filled sudoku matrix.</div><divclass="ttdef"><b>Definition:</b> sudoku_solver.c:172</div></div>
<divclass="center"><iframescrolling="no"frameborder="0"src="../../d5/df4/group__sudoku_gadfe0ed5085b4775d8fa00b434cc0fdfc_cgraph.svg"width="356"height="139"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="../../doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.9.2 </li>