Documentation for 95ed72a452

This commit is contained in:
github-actions
2021-10-15 16:44:16 +00:00
parent 567c4ff764
commit 7e9f4857e2
365 changed files with 6848 additions and 4620 deletions

View File

@@ -145,7 +145,7 @@ Functions</h2></td></tr>
<p >for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> and <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></p>
<p >Mathematical algorithms</p>
<p >Given a recurrence relation; evaluate the value of nth term. For e.g., For fibonacci series, recurrence series is <code>f(n) = f(n-1) + f(n-2)</code> where <code>f(0) = 0</code> and <code>f(1) = 1</code>. Note that the method used only demonstrates recurrence relation with one variable (n), unlike <code>nCr</code> problem, since it has two (n, r)</p>
<h3><a class="anchor" id="autotoc_md77"></a>
<h3><a class="anchor" id="autotoc_md78"></a>
Algorithm</h3>
<p >This problem can be solved using matrix exponentiation method. </p><dl class="section see"><dt>See also</dt><dd>here for simple <a href="https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/math/modular_exponentiation.cpp" target="_blank">number exponentiation algorithm</a> or <a href="https://en.wikipedia.org/wiki/Exponentiation_by_squaring" target="_blank">explaination here</a>. </dd></dl>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AshishYUO" target="_blank">Ashish Daulatabad</a> for assert for IO operations for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> STL</dd></dl>

376
dd/dca/class_f_c_f_s.html Normal file
View File

@@ -0,0 +1,376 @@
<!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">
<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.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: FCFS&lt; S, T, E &gt; Class Template 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>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;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.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
/* @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&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(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&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('dd/dca/class_f_c_f_s.html','../../'); initResizable(); });
/* @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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="../../de/d8d/class_f_c_f_s-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">FCFS&lt; S, T, E &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Class which implements the <a class="el" href="../../dd/dca/class_f_c_f_s.html" title="Class which implements the FCFS scheduling algorithm.">FCFS</a> scheduling algorithm.
<a href="../../dd/dca/class_f_c_f_s.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8fbfe4d85f7576b4a7aade07d29fbd69"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">addProcess</a> (S id, T arrival, E burst)</td></tr>
<tr class="memdesc:a8fbfe4d85f7576b4a7aade07d29fbd69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds the process to the ready queue if it isn't already there. <a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">More...</a><br /></td></tr>
<tr class="separator:a8fbfe4d85f7576b4a7aade07d29fbd69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa25dbe30ba9930b5a7c1a6d11758bd91"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>&lt; S, T, E, double, double, double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a> ()</td></tr>
<tr class="memdesc:aa25dbe30ba9930b5a7c1a6d11758bd91"><td class="mdescLeft">&#160;</td><td class="mdescRight">Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algorithm. <a href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">More...</a><br /></td></tr>
<tr class="separator:aa25dbe30ba9930b5a7c1a6d11758bd91"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb361a612b18bb189aa6d3c49288b793"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793">printResult</a> ()</td></tr>
<tr class="memdesc:abb361a612b18bb189aa6d3c49288b793"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function for printing the status of each process after execution. <a href="../../dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793">More...</a><br /></td></tr>
<tr class="separator:abb361a612b18bb189aa6d3c49288b793"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:af2594e22a867b308e027623940193d46"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/priority_queue.html">priority_queue</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>&lt; S, T, E, double, double, double &gt;, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>&lt; S, T, E, double, double, double &gt; &gt;, <a class="el" href="../../de/d4a/class_compare.html">Compare</a>&lt; S, T, E &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a></td></tr>
<tr class="separator:af2594e22a867b308e027623940193d46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3abd3d9f23437599ff9a2131c8b631f"><td class="memItemLeft" align="right" valign="top"><a id="ac3abd3d9f23437599ff9a2131c8b631f" name="ac3abd3d9f23437599ff9a2131c8b631f"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>&lt; S, T, E, double, double, double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>result</b></td></tr>
<tr class="separator:ac3abd3d9f23437599ff9a2131c8b631f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86e9908699e2ff89557c01f1a4b47d83"><td class="memItemLeft" align="right" valign="top"><a id="a86e9908699e2ff89557c01f1a4b47d83" name="a86e9908699e2ff89557c01f1a4b47d83"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/unordered_set.html">unordered_set</a>&lt; S &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>idList</b></td></tr>
<tr class="separator:a86e9908699e2ff89557c01f1a4b47d83"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename S, typename T, typename E&gt;<br />
class FCFS&lt; S, T, E &gt;</div><p >Class which implements the <a class="el" href="../../dd/dca/class_f_c_f_s.html" title="Class which implements the FCFS scheduling algorithm.">FCFS</a> scheduling algorithm. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">S</td><td>Data type of Process ID </td></tr>
<tr><td class="paramname">T</td><td>Data type of Arrival time </td></tr>
<tr><td class="paramname">E</td><td>Data type of Burst time </td></tr>
</table>
</dd>
</dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a8fbfe4d85f7576b4a7aade07d29fbd69" name="a8fbfe4d85f7576b4a7aade07d29fbd69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8fbfe4d85f7576b4a7aade07d29fbd69">&#9670;&nbsp;</a></span>addProcess()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename S , typename T , typename E &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="../../dd/dca/class_f_c_f_s.html">FCFS</a>&lt; S, T, E &gt;::addProcess </td>
<td>(</td>
<td class="paramtype">S&#160;</td>
<td class="paramname"><em>id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T&#160;</td>
<td class="paramname"><em>arrival</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">E&#160;</td>
<td class="paramname"><em>burst</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds the process to the ready queue if it isn't already there. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">id</td><td>Process ID </td></tr>
<tr><td class="paramname">arrival</td><td>Arrival time of the process </td></tr>
<tr><td class="paramname">burst</td><td>Burst time of the process </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> {</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="comment">// Add if a process with process ID as id is not found in idList.</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">if</span> (idList.find(<span class="keywordtype">id</span>) == idList.end()) {</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple&lt;S, T, E, double, double, double&gt;</a> t =</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple/make_tuple.html">make_tuple</a>(<span class="keywordtype">id</span>, arrival, burst, 0, 0, 0);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>.push(t);</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> idList.insert(<span class="keywordtype">id</span>);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> }</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> }</div>
<div class="ttc" id="aclass_f_c_f_s_html_af2594e22a867b308e027623940193d46"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">FCFS::schedule</a></div><div class="ttdeci">priority_queue&lt; tuple&lt; S, T, E, double, double, double &gt;, vector&lt; tuple&lt; S, T, E, double, double, double &gt; &gt;, Compare&lt; S, T, E &gt; &gt; schedule</div><div class="ttdef"><b>Definition:</b> fcfs_scheduling.cpp:111</div></div>
<div class="ttc" id="amake_tuple_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/tuple/make_tuple.html">std::make_tuple</a></div><div class="ttdeci">T make_tuple(T... args)</div></div>
<div class="ttc" id="atuple_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/tuple.html">std::tuple</a></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="../../dd/dca/class_f_c_f_s_a8fbfe4d85f7576b4a7aade07d29fbd69_cgraph.svg" width="356" height="170"><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="abb361a612b18bb189aa6d3c49288b793" name="abb361a612b18bb189aa6d3c49288b793"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb361a612b18bb189aa6d3c49288b793">&#9670;&nbsp;</a></span>printResult()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename S , typename T , typename E &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="../../dd/dca/class_f_c_f_s.html">FCFS</a>&lt; S, T, E &gt;::printResult </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Utility function for printing the status of each process after execution. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> {</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> &lt;&lt; <span class="stringliteral">&quot;Status of all the proceses post completion is as follows:&quot;</span></div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a> &lt;&lt; <span class="stringliteral">&quot;Process ID&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a></div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> &lt;&lt; <span class="stringliteral">&quot;Arrival Time&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a> &lt;&lt; <span class="stringliteral">&quot;Burst Time&quot;</span></div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a> &lt;&lt; <span class="stringliteral">&quot;Completion Time&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17)</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a> &lt;&lt; <span class="stringliteral">&quot;Turnaround Time&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> &lt;&lt; <span class="stringliteral">&quot;Waiting Time&quot;</span> &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> </div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i &lt; result.size(); i++) {</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setprecision.html">std::setprecision</a>(2) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/fixed.html">std::fixed</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a></div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> &lt;&lt; get&lt;0&gt;(result[i]) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a></div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> &lt;&lt; get&lt;1&gt;(result[i]) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a></div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> &lt;&lt; get&lt;2&gt;(result[i]) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a></div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> &lt;&lt; get&lt;3&gt;(result[i]) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> &lt;&lt; get&lt;4&gt;(result[i]) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a>(17) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/left.html">left</a></div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> &lt;&lt; get&lt;5&gt;(result[i]) &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> }</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</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="afixed_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/fixed.html">std::fixed</a></div><div class="ttdeci">T fixed(T... args)</div></div>
<div class="ttc" id="aleft_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/left.html">std::left</a></div><div class="ttdeci">T left(T... args)</div></div>
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition:</b> matrix_exponentiation.cpp:36</div></div>
<div class="ttc" id="asetprecision_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/setprecision.html">std::setprecision</a></div><div class="ttdeci">T setprecision(T... args)</div></div>
<div class="ttc" id="asetw_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/setw.html">std::setw</a></div><div class="ttdeci">T setw(T... args)</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="../../dd/dca/class_f_c_f_s_abb361a612b18bb189aa6d3c49288b793_cgraph.svg" width="306" height="139"><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="aa25dbe30ba9930b5a7c1a6d11758bd91" name="aa25dbe30ba9930b5a7c1a6d11758bd91"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa25dbe30ba9930b5a7c1a6d11758bd91">&#9670;&nbsp;</a></span>scheduleForFcfs()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename S , typename T , typename E &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>&lt; S, T, E, double, double, double &gt; &gt; <a class="el" href="../../dd/dca/class_f_c_f_s.html">FCFS</a>&lt; S, T, E &gt;::scheduleForFcfs </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algorithm. </p>
<p ><a class="el" href="../../dd/dca/class_f_c_f_s.html" title="Class which implements the FCFS scheduling algorithm.">FCFS</a> is a non-preemptive algorithm in which the process which arrives first gets executed first. If two or more processes arrive together then the process with smaller process ID runs first (each process has a unique proces ID).</p>
<p >I used a min priority queue of tuples to accomplish this task. The processes are ordered by their arrival times. If arrival times of some processes are equal, then they are ordered by their process ID.</p>
<dl class="section return"><dt>Returns</dt><dd>void </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="comment">// Variable to keep track of time elapsed so far</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordtype">double</span> timeElapsed = 0;</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">while</span> (!<a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>.empty()) {</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/utility/tuple.html">tuple&lt;S, T, E, double, double, double&gt;</a> cur = <a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>.top();</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="comment">// If the current process arrived at time t2, the last process</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="comment">// completed its execution at time t1, and t2 &gt; t1.</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordflow">if</span> (get&lt;1&gt;(cur) &gt; timeElapsed) {</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> timeElapsed += get&lt;1&gt;(cur) - timeElapsed;</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> }</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> <span class="comment">// Add Burst time to time elapsed</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> timeElapsed += get&lt;2&gt;(cur);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> </div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="comment">// Completion time of the current process will be same as time</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="comment">// elapsed so far</span></div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> get&lt;3&gt;(cur) = timeElapsed;</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="comment">// Turnaround time = Completion time - Arrival time</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> get&lt;4&gt;(cur) = get&lt;3&gt;(cur) - get&lt;1&gt;(cur);</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> </div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="comment">// Waiting time = Turnaround time - Burst time</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> get&lt;5&gt;(cur) = get&lt;4&gt;(cur) - get&lt;2&gt;(cur);</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> result.push_back(cur);</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>.pop();</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> }</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> }</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="af2594e22a867b308e027623940193d46" name="af2594e22a867b308e027623940193d46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2594e22a867b308e027623940193d46">&#9670;&nbsp;</a></span>schedule</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename S , typename T , typename E &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/priority_queue.html">priority_queue</a>&lt;<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>&lt;S, T, E, double, double, double&gt;, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt;<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>&lt;S, T, E, double, double, double&gt; &gt;, <a class="el" href="../../de/d4a/class_compare.html">Compare</a>&lt;S, T, E&gt; &gt; <a class="el" href="../../dd/dca/class_f_c_f_s.html">FCFS</a>&lt; S, T, E &gt;::schedule</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p >Priority queue of schedules(stored as tuples) of processes. In each tuple 1st element: Process ID 2nd element: Arrival Time 3rd element: Burst time 4th element: Completion time 5th element: Turnaround time 6th element: Waiting time </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>cpu_scheduling_algorithms/<a class="el" href="../../df/d47/fcfs__scheduling_8cpp.html">fcfs_scheduling.cpp</a></li>
</ul>
</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="../../dd/dca/class_f_c_f_s.html">FCFS</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.9.2 </li>
</ul>
</div>
</body>
</html>

7
dd/dca/class_f_c_f_s.js Normal file
View File

@@ -0,0 +1,7 @@
var class_f_c_f_s =
[
[ "addProcess", "dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69", null ],
[ "printResult", "dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793", null ],
[ "scheduleForFcfs", "dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91", null ],
[ "schedule", "dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46", null ]
];

View File

@@ -0,0 +1,6 @@
<map id="FCFS::addProcess" name="FCFS::addProcess">
<area shape="rect" id="node1" title="Adds the process to the ready queue if it isn&#39;t already there." alt="" coords="5,64,140,91"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/end.html#" title=" " alt="" coords="188,5,351,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/find.html#" title=" " alt="" coords="203,57,336,98"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/insert.html#" title=" " alt="" coords="203,122,336,163"/>
</map>

View File

@@ -0,0 +1 @@
40be8724cd3544d6f4f7db4d23d50120

View File

@@ -0,0 +1,69 @@
<?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.1 (20210923.0004)
-->
<!-- Title: FCFS::addProcess Pages: 1 -->
<svg width="267pt" height="127pt"
viewBox="0.00 0.00 267.00 126.50" 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 122.5)">
<title>FCFS::addProcess</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-122.5 263,-122.5 263,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Adds the process to the ready queue if it isn&#39;t already there.">
<polygon fill="#bfbfbf" stroke="black" points="0,-55 0,-74 101,-74 101,-55 0,-55"/>
<text text-anchor="middle" x="50.5" y="-62" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::addProcess</text>
</a>
</g>
</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/container/unordered_set/end.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="137,-99 137,-118 259,-118 259,-99 137,-99"/>
<text text-anchor="middle" x="198" y="-106" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set::end</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="M83.07,-74.05C104.33,-80.48 132.59,-89.02 155.64,-95.99"/>
<polygon fill="midnightblue" stroke="midnightblue" points="154.91,-99.43 165.49,-98.97 156.93,-92.73 154.91,-99.43"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/find.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="148,-49.5 148,-79.5 248,-79.5 248,-49.5 148,-49.5"/>
<text text-anchor="start" x="156" y="-67.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
<text text-anchor="middle" x="198" y="-56.5" font-family="Helvetica,sans-Serif" font-size="10.00">::find</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2" class="edge">
<title>Node1&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M101.17,-64.5C112.87,-64.5 125.47,-64.5 137.55,-64.5"/>
<polygon fill="midnightblue" stroke="midnightblue" points="137.56,-68 147.56,-64.5 137.56,-61 137.56,-68"/>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/insert.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="148,-0.5 148,-30.5 248,-30.5 248,-0.5 148,-0.5"/>
<text text-anchor="start" x="156" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
<text text-anchor="middle" x="198" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::insert</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3" class="edge">
<title>Node1&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M79.9,-54.94C97.76,-48.92 121.38,-40.97 142.73,-33.78"/>
<polygon fill="midnightblue" stroke="midnightblue" points="143.99,-37.05 152.35,-30.54 141.76,-30.41 143.99,-37.05"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,6 @@
<map id="FCFS::printResult" name="FCFS::printResult">
<area shape="rect" id="node1" title="Utility function for printing the status of each process after execution." alt="" coords="5,56,133,83"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/fixed.html#" title=" " alt="" coords="203,5,279,32"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/setprecision.html#" title=" " alt="" coords="181,56,300,83"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/setw.html#" title=" " alt="" coords="203,107,278,133"/>
</map>

View File

@@ -0,0 +1 @@
fbc7b8c39328fdeb00baa02dadb94ca6

View File

@@ -0,0 +1,67 @@
<?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.1 (20210923.0004)
-->
<!-- Title: FCFS::printResult Pages: 1 -->
<svg width="229pt" height="104pt"
viewBox="0.00 0.00 229.00 104.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 100)">
<title>FCFS::printResult</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-100 225,-100 225,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Utility function for printing the status of each process after execution.">
<polygon fill="#bfbfbf" stroke="black" points="0,-38.5 0,-57.5 96,-57.5 96,-38.5 0,-38.5"/>
<text text-anchor="middle" x="48" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::printResult</text>
</a>
</g>
</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/fixed.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="148,-76.5 148,-95.5 205,-95.5 205,-76.5 148,-76.5"/>
<text text-anchor="middle" x="176.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::fixed</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="M80.92,-57.59C98.34,-62.82 119.99,-69.33 138.18,-74.79"/>
<polygon fill="midnightblue" stroke="midnightblue" points="137.3,-78.18 147.89,-77.7 139.32,-71.48 137.3,-78.18"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/setprecision.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="132,-38.5 132,-57.5 221,-57.5 221,-38.5 132,-38.5"/>
<text text-anchor="middle" x="176.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::setprecision</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2" class="edge">
<title>Node1&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M96.1,-48C104.39,-48 113.08,-48 121.54,-48"/>
<polygon fill="midnightblue" stroke="midnightblue" points="121.71,-51.5 131.71,-48 121.71,-44.5 121.71,-51.5"/>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/setw.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="148.5,-0.5 148.5,-19.5 204.5,-19.5 204.5,-0.5 148.5,-0.5"/>
<text text-anchor="middle" x="176.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::setw</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3" class="edge">
<title>Node1&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M80.92,-38.41C98.46,-33.14 120.3,-26.58 138.57,-21.09"/>
<polygon fill="midnightblue" stroke="midnightblue" points="139.73,-24.4 148.3,-18.17 137.72,-17.69 139.73,-24.4"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB