<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
    <title>Katabatic Documentation</title>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="dynsections.js"></script>
    <link   href="SoC.css" rel="stylesheet" type="text/css">
    <link   href="tabs.css" rel="stylesheet" type="text/css">
  </head>
    <h1 id="pagetop" class="header">Katabatic - Routing Toolbox</h1>
    <!--
    <center class="header">
      <table class="header">
        <tr>
          <td><a href="customSummary.html">Summary</a></td>
          <td><a href="namespaces.html">Namespaces</a></td>
          <td><a href="customHierarchy.html">Class Hierarchy</a></td>
          <td><a href="annotated.html">Classes</a></td>
          <td><a href="functions.html">Member Index</a></td>
        </tr>
      </table>
    </center>
    -->
    <br>
  <body onload="javascript:toggleLevel(1)">
<!-- Generated by Doxygen 1.8.14 -->
<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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceKatabatic.html">Katabatic</a></li><li class="navelem"><a class="el" href="classKatabatic_1_1GCellDensitySet.html">GCellDensitySet</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classKatabatic_1_1GCellDensitySet-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">GCellDensitySet Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> Set, sorted by density.  
 <a href="classKatabatic_1_1GCellDensitySet.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad74cbb404ad28f734f5759462aa9f363"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#ad74cbb404ad28f734f5759462aa9f363">GCellDensitySet</a> (unsigned int depth)</td></tr>
<tr class="separator:ad74cbb404ad28f734f5759462aa9f363"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d97169315528fca978d5e65a3cc8130"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#a5d97169315528fca978d5e65a3cc8130">GCellDensitySet</a> (unsigned int depth, const std::vector&lt; <a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *&gt; &amp;)</td></tr>
<tr class="separator:a5d97169315528fca978d5e65a3cc8130"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef015ff8dc7d34fcb907281f71bb0003"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#aef015ff8dc7d34fcb907281f71bb0003">~GCellDensitySet</a> ()</td></tr>
<tr class="separator:aef015ff8dc7d34fcb907281f71bb0003"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a644718bb2fb240de962dc3c9a1fdf0dc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#a644718bb2fb240de962dc3c9a1fdf0dc">empty</a> () const</td></tr>
<tr class="separator:a644718bb2fb240de962dc3c9a1fdf0dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a259cb5a711406a8c3e5d937eb9350cca"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#a259cb5a711406a8c3e5d937eb9350cca">size</a> () const</td></tr>
<tr class="separator:a259cb5a711406a8c3e5d937eb9350cca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bac89a45c1449ebdb28a778993cb8e5"><td class="memItemLeft" align="right" valign="top">const std::set&lt; <a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *, GCell::CompareByKey &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#a8bac89a45c1449ebdb28a778993cb8e5">getGCells</a> () const</td></tr>
<tr class="separator:a8bac89a45c1449ebdb28a778993cb8e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b97afb6d814ba80a24a49b3ad8e540b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#a6b97afb6d814ba80a24a49b3ad8e540b">insert</a> (<a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *)</td></tr>
<tr class="separator:a6b97afb6d814ba80a24a49b3ad8e540b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a743f7f98fe31b8a1c134aff01ba03acb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#a743f7f98fe31b8a1c134aff01ba03acb">erase</a> (<a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *)</td></tr>
<tr class="separator:a743f7f98fe31b8a1c134aff01ba03acb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89099ec88eadcadb942b7d64a6ffd7ee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#a89099ec88eadcadb942b7d64a6ffd7ee">unqueue</a> (<a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *)</td></tr>
<tr class="separator:a89099ec88eadcadb942b7d64a6ffd7ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac84efe46d8a3c409e85bc3420240c3c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKatabatic_1_1GCellDensitySet.html#ac84efe46d8a3c409e85bc3420240c3c2">requeue</a> ()</td></tr>
<tr class="separator:ac84efe46d8a3c409e85bc3420240c3c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> Set, sorted by density. </p>
<p>A small container helper to manage a set of <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> sorted by density on a specific layer <code>depth</code>.</p>
<p>The helper is implemented in term of a set. Once inserted in a set an element must not have is sorting key changed. But <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> density may change due to <a class="el" href="classKatabatic_1_1AutoSegment.html" title="Abstract base class for AutoSegment. ">AutoSegment</a> modifications during the lifetime of the set. To circumvent this problem, the <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> provide a key attribute to be used specifically with <a class="el" href="classKatabatic_1_1GCellDensitySet.html" title="GCell Set, sorted by density. ">GCellDensitySet</a>. This key act as a cached copy of the <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> density which is updated <em>only</em> by a call to <a class="el" href="classKatabatic_1_1GCell.html#a11beff0f0bec06d0f3e080969516dfc3">GCell::updateKey()</a> (and <em>not</em> <a class="el" href="classKatabatic_1_1GCell.html#a9b3455dce10eb98d0496175dd586528c">GCell::updateDensity()</a>). <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> which density have changed and key has to be updated must be signaled to set with the GCellDensityQueue::unqueue() method. When we want to update the sorting of the set on the new densities, we call <a class="el" href="classKatabatic_1_1GCellDensitySet.html#ac84efe46d8a3c409e85bc3420240c3c2">GCellDensitySet::requeue()</a> which, for each invalidated <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> do:</p><ul>
<li>Remove the <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> from the set.</li>
<li>Update the key (call <a class="el" href="classKatabatic_1_1GCell.html#a11beff0f0bec06d0f3e080969516dfc3">GCell::updateKey()</a>).</li>
<li>Reinsert the <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a> in the set (thus with the updated key).</li>
</ul>
<p>Typical usage: </p><div class="fragment"><div class="line"><a class="code" href="classKatabatic_1_1GCellDensitySet.html#ad74cbb404ad28f734f5759462aa9f363">GCellDensitySet</a> gcells ( 2, *(getGCellGrid()-&gt;getGCellVector()) );</div><div class="line"></div><div class="line"><span class="keywordflow">while</span> ( <span class="keyword">true</span> ) {</div><div class="line">    <span class="keywordtype">bool</span> optimized = <span class="keyword">false</span>;</div><div class="line"></div><div class="line">    std::set&lt;GCell*,GCell::CompareByKey&gt;::const_iterator igcell = gcells.getGCells().begin();</div><div class="line">    <span class="keywordflow">for</span> ( ; igcell != gcells.getGCells().end() ; ++igcell ) {</div><div class="line">        <span class="keywordflow">if</span> ( doSomeOptimization(*igcell) ) {</div><div class="line">          optimized = <span class="keyword">true</span>;</div><div class="line">          gcells.unqueue( *igcell );</div><div class="line">        }</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (not optimized) <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line">    gcells.requeue();</div><div class="line">}</div></div><!-- fragment --> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ad74cbb404ad28f734f5759462aa9f363"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad74cbb404ad28f734f5759462aa9f363">&#9670;&nbsp;</a></span>GCellDensitySet() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classKatabatic_1_1GCellDensitySet.html">GCellDensitySet</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>depth</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a new empty <a class="el" href="classKatabatic_1_1GCellDensitySet.html" title="GCell Set, sorted by density. ">GCellDensitySet</a>, sorting on density of layer <code>depth</code>. </p>

</div>
</div>
<a id="a5d97169315528fca978d5e65a3cc8130"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d97169315528fca978d5e65a3cc8130">&#9670;&nbsp;</a></span>GCellDensitySet() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classKatabatic_1_1GCellDensitySet.html">GCellDensitySet</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>depth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *&gt; &amp;&#160;</td>
          <td class="paramname"><em>gcells</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a new empty <a class="el" href="classKatabatic_1_1GCellDensitySet.html" title="GCell Set, sorted by density. ">GCellDensitySet</a>, sorting on density of layer <code>depth</code>. Load the queue with the GCells supplied in the <code>gcells</code> vector. </p>

<p class="reference">References <a class="el" href="classKatabatic_1_1GCellDensitySet.html#ac84efe46d8a3c409e85bc3420240c3c2">GCellDensitySet::requeue()</a>.</p>

</div>
</div>
<a id="aef015ff8dc7d34fcb907281f71bb0003"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef015ff8dc7d34fcb907281f71bb0003">&#9670;&nbsp;</a></span>~GCellDensitySet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">~<a class="el" href="classKatabatic_1_1GCellDensitySet.html">GCellDensitySet</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Delete a <a class="el" href="classKatabatic_1_1GCellDensitySet.html" title="GCell Set, sorted by density. ">GCellDensitySet</a>, if the queue is not empty, issue a warning. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a644718bb2fb240de962dc3c9a1fdf0dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a644718bb2fb240de962dc3c9a1fdf0dc">&#9670;&nbsp;</a></span>empty()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool empty </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</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><b>Returns:</b> <b>true</b> if the queue is empty. </p>

</div>
</div>
<a id="a259cb5a711406a8c3e5d937eb9350cca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a259cb5a711406a8c3e5d937eb9350cca">&#9670;&nbsp;</a></span>size()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t size </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</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><b>Returns:</b> the numbers of elements in the queue. </p>

</div>
</div>
<a id="a8bac89a45c1449ebdb28a778993cb8e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8bac89a45c1449ebdb28a778993cb8e5">&#9670;&nbsp;</a></span>getGCells()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const std::set&lt; <a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *, GCell::CompareByKey &gt; &amp; getGCells </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</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><b>Returns:</b> the list of GCells currently in the queue. </p>

</div>
</div>
<a id="a6b97afb6d814ba80a24a49b3ad8e540b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b97afb6d814ba80a24a49b3ad8e540b">&#9670;&nbsp;</a></span>insert()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t insert </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *&#160;</td>
          <td class="paramname"><em>gcell</em></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>Insert <code>gcell</code> into the set. </p>

</div>
</div>
<a id="a743f7f98fe31b8a1c134aff01ba03acb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a743f7f98fe31b8a1c134aff01ba03acb">&#9670;&nbsp;</a></span>erase()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t erase </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *&#160;</td>
          <td class="paramname"><em>gcell</em></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>Remove <code>gcell</code> from the set. </p>

</div>
</div>
<a id="a89099ec88eadcadb942b7d64a6ffd7ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89099ec88eadcadb942b7d64a6ffd7ee">&#9670;&nbsp;</a></span>unqueue()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void unqueue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classKatabatic_1_1GCell.html">GCell</a> *&#160;</td>
          <td class="paramname"><em>gcell</em></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>Invalidate <code>gcell</code>. The density of <code>gcell</code> may have changed and needs to be reinserted into the queue. It is temporarily set asides until the next call to <a class="el" href="classKatabatic_1_1GCellDensitySet.html#ac84efe46d8a3c409e85bc3420240c3c2">GCellDensitySet::requeue()</a>. </p>

</div>
</div>
<a id="ac84efe46d8a3c409e85bc3420240c3c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac84efe46d8a3c409e85bc3420240c3c2">&#9670;&nbsp;</a></span>requeue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void requeue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reinsert in the queue all the GCells that have been previously invalidated by a call to <a class="el" href="classKatabatic_1_1GCellDensitySet.html#a89099ec88eadcadb942b7d64a6ffd7ee">GCellDensitySet::unqueue()</a>. This function calls <a class="el" href="classKatabatic_1_1GCell.html#a11beff0f0bec06d0f3e080969516dfc3">GCell::updateKey()</a> before reinserting the <a class="el" href="classKatabatic_1_1GCell.html" title="Routing Global Cell. ">GCell</a>. </p>

<p class="reference">Referenced by <a class="el" href="classKatabatic_1_1GCellDensitySet.html#a5d97169315528fca978d5e65a3cc8130">GCellDensitySet::GCellDensitySet()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="GCell_8h_source.html">GCell.h</a></li>
<li>GCell.cpp</li>
<li>GCell.dox</li>
</ul>
</div><!-- contents -->
    <br>
    <hr>
    <table class="footer1">
      <tr>
        <td class="LFooter"><small>Generated by doxygen 1.8.14 on Sun Nov 21 2021</small></td>
        <td class="RFooter"><a href='#pagetop'><small>Return to top of page</small></a></td>
      </tr>
    </table>
    <table class="footer2">
      <tr>
        <td class="LFooter">Katabatic - Routing Toolbox</td>
        <td class="RFooter"><small>Copyright &#169; 2008-2020 Sorbonne Universite. All rights reserved</small></td>
      </tr>
    </table>
  </body>
</html>