<!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=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DGtal: testIndexedListWithBlocks.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<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.3/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.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">DGtal
   &#160;<span id="projectnumber">1.4.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('testIndexedListWithBlocks_8cpp.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="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">testIndexedListWithBlocks.cpp File Reference<div class="ingroups"><a class="el" href="group__Tests.html">DGtal Test Files</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;cstdio&gt;</code><br />
<code>#include &lt;cmath&gt;</code><br />
<code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;algorithm&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<code>#include &quot;DGtal/base/Common.h&quot;</code><br />
<code>#include &quot;DGtal/base/IndexedListWithBlocks.h&quot;</code><br />
<code>#include &quot;DGtal/base/Labels.h&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for testIndexedListWithBlocks.cpp:</div>
<div class="dyncontent">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="testIndexedListWithBlocks_8cpp__incl.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<p><a href="testIndexedListWithBlocks_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a8094f96118b5321654e1671f513371f8"><td class="memTemplParams" colspan="2">template&lt;typename Container1 , typename Container2 &gt; </td></tr>
<tr class="memitem:a8094f96118b5321654e1671f513371f8"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a> (Container1 &amp;c1, Container2 &amp;c2)</td></tr>
<tr class="separator:a8094f96118b5321654e1671f513371f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb55816b077724448f97188d1382fa18"><td class="memTemplParams" colspan="2">template&lt;typename VContainer1 , typename LContainer2 &gt; </td></tr>
<tr class="memitem:abb55816b077724448f97188d1382fa18"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a> (VContainer1 &amp;c1, LContainer2 &amp;c2, unsigned int idx, double v)</td></tr>
<tr class="separator:abb55816b077724448f97188d1382fa18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9db08367fde22d5480a196db41883ae0"><td class="memTemplParams" colspan="2">template&lt;typename VContainer1 , typename LContainer2 &gt; </td></tr>
<tr class="memitem:a9db08367fde22d5480a196db41883ae0"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="testIndexedListWithBlocks_8cpp.html#a9db08367fde22d5480a196db41883ae0">checkInsert</a> (VContainer1 &amp;v, LContainer2 &amp;l, unsigned int nb)</td></tr>
<tr class="separator:a9db08367fde22d5480a196db41883ae0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29ab22910bdfd3cc87f7f2d243ba0165"><td class="memTemplParams" colspan="2">template&lt;typename VContainer1 , typename LContainer2 &gt; </td></tr>
<tr class="memitem:a29ab22910bdfd3cc87f7f2d243ba0165"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="testIndexedListWithBlocks_8cpp.html#a29ab22910bdfd3cc87f7f2d243ba0165">erase</a> (VContainer1 &amp;c1, LContainer2 &amp;c2, unsigned int idx)</td></tr>
<tr class="separator:a29ab22910bdfd3cc87f7f2d243ba0165"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeeac00232988203f0ce1095bef3d655d"><td class="memTemplParams" colspan="2">template&lt;typename VContainer1 , typename LContainer2 &gt; </td></tr>
<tr class="memitem:aeeac00232988203f0ce1095bef3d655d"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="testIndexedListWithBlocks_8cpp.html#aeeac00232988203f0ce1095bef3d655d">checkErase</a> (VContainer1 &amp;v, LContainer2 &amp;l, unsigned int nb)</td></tr>
<tr class="separator:aeeac00232988203f0ce1095bef3d655d"><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="testIndexedListWithBlocks_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</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>
<div class="textblock"><p>This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
<dl class="section author"><dt>Author</dt><dd>Jacques-Olivier Lachaud (<code><a href="#" onclick="location.href='mai'+'lto:'+'jac'+'qu'+'es-'+'ol'+'ivi'+'er'+'.la'+'ch'+'aud'+'@u'+'niv'+'-s'+'avo'+'ie'+'.fr'; return false;">jacqu<span style="display: none;">.nosp@m.</span>es-o<span style="display: none;">.nosp@m.</span>livie<span style="display: none;">.nosp@m.</span>r.la<span style="display: none;">.nosp@m.</span>chaud<span style="display: none;">.nosp@m.</span>@uni<span style="display: none;">.nosp@m.</span>v-sav<span style="display: none;">.nosp@m.</span>oie.<span style="display: none;">.nosp@m.</span>fr</a></code> ) Laboratory of Mathematics (CNRS, UMR 5807), University of Savoie, France</dd></dl>
<dl class="section date"><dt>Date</dt><dd>2012/07/02</dd></dl>
<p>This file is part of the <a class="el" href="namespaceDGtal.html" title="DGtal is the top-level namespace which contains all DGtal functions and types.">DGtal</a> library </p>

<p class="definition">Definition in file <a class="el" href="testIndexedListWithBlocks_8cpp_source.html">testIndexedListWithBlocks.cpp</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="aeeac00232988203f0ce1095bef3d655d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeeac00232988203f0ce1095bef3d655d">&#9670;&nbsp;</a></span>checkErase()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename VContainer1 , typename LContainer2 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool checkErase </td>
          <td>(</td>
          <td class="paramtype">VContainer1 &amp;&#160;</td>
          <td class="paramname"><em>v</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LContainer2 &amp;&#160;</td>
          <td class="paramname"><em>l</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>nb</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00081">81</a> of file <a class="el" href="testIndexedListWithBlocks_8cpp_source.html">testIndexedListWithBlocks.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;{</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; nb; ++i )</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> idx = rand() % ( l.size() );</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;      <a class="code" href="testIndexedListWithBlocks_8cpp.html#a29ab22910bdfd3cc87f7f2d243ba0165">erase</a>( v, l, idx );</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l );</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;}</div>
<div class="ttc" id="atestIndexedListWithBlocks_8cpp_html_a29ab22910bdfd3cc87f7f2d243ba0165"><div class="ttname"><a href="testIndexedListWithBlocks_8cpp.html#a29ab22910bdfd3cc87f7f2d243ba0165">erase</a></div><div class="ttdeci">void erase(VContainer1 &amp;c1, LContainer2 &amp;c2, unsigned int idx)</div><div class="ttdef"><b>Definition:</b> <a href="testIndexedListWithBlocks_8cpp_source.html#l00073">testIndexedListWithBlocks.cpp:73</a></div></div>
<div class="ttc" id="atestIndexedListWithBlocks_8cpp_html_a8094f96118b5321654e1671f513371f8"><div class="ttname"><a href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a></div><div class="ttdeci">bool isEqual(Container1 &amp;c1, Container2 &amp;c2)</div><div class="ttdef"><b>Definition:</b> <a href="testIndexedListWithBlocks_8cpp_source.html#l00045">testIndexedListWithBlocks.cpp:45</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00073">erase()</a>, and <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00045">isEqual()</a>.</p>

<p class="reference">Referenced by <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00093">main()</a>.</p>

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

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename VContainer1 , typename LContainer2 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool checkInsert </td>
          <td>(</td>
          <td class="paramtype">VContainer1 &amp;&#160;</td>
          <td class="paramname"><em>v</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LContainer2 &amp;&#160;</td>
          <td class="paramname"><em>l</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>nb</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00060">60</a> of file <a class="el" href="testIndexedListWithBlocks_8cpp_source.html">testIndexedListWithBlocks.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;{</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; nb; ++i )</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> idx = rand() % ( l.size() + 1 );</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;      <span class="keywordtype">double</span> val = ( (double)rand() ) / RAND_MAX;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;      <a class="code" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a>( v, l, idx, val );</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    }</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l );</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;}</div>
<div class="ttc" id="atestIndexedListWithBlocks_8cpp_html_abb55816b077724448f97188d1382fa18"><div class="ttname"><a href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a></div><div class="ttdeci">void insert(VContainer1 &amp;c1, LContainer2 &amp;c2, unsigned int idx, double v)</div><div class="ttdef"><b>Definition:</b> <a href="testIndexedListWithBlocks_8cpp_source.html#l00052">testIndexedListWithBlocks.cpp:52</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00052">insert()</a>, and <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00045">isEqual()</a>.</p>

<p class="reference">Referenced by <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00093">main()</a>.</p>

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

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename VContainer1 , typename LContainer2 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void erase </td>
          <td>(</td>
          <td class="paramtype">VContainer1 &amp;&#160;</td>
          <td class="paramname"><em>c1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LContainer2 &amp;&#160;</td>
          <td class="paramname"><em>c2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>idx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00073">73</a> of file <a class="el" href="testIndexedListWithBlocks_8cpp_source.html">testIndexedListWithBlocks.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;{</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  c1.erase( c1.begin() + idx );</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  c2.erase( idx );</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">Referenced by <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00081">checkErase()</a>.</p>

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

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename VContainer1 , typename LContainer2 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void insert </td>
          <td>(</td>
          <td class="paramtype">VContainer1 &amp;&#160;</td>
          <td class="paramname"><em>c1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LContainer2 &amp;&#160;</td>
          <td class="paramname"><em>c2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="geometry_2volumes_2standardDigitalPolyhedronBuilder3D_8cpp-example.html#a21">geometry/volumes/standardDigitalPolyhedronBuilder3D.cpp</a>.</dd>
</dl>

<p class="definition">Definition at line <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00052">52</a> of file <a class="el" href="testIndexedListWithBlocks_8cpp_source.html">testIndexedListWithBlocks.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;{</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  c1.insert( c1.begin() + idx, v );</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;  c2.insert( idx, v );</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">Referenced by <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00060">checkInsert()</a>, and <a class="el" href="standardDigitalPolyhedronBuilder3D_8cpp_source.html#l00122">main()</a>.</p>

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

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Container1 , typename Container2 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool isEqual </td>
          <td>(</td>
          <td class="paramtype">Container1 &amp;&#160;</td>
          <td class="paramname"><em>c1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Container2 &amp;&#160;</td>
          <td class="paramname"><em>c2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00045">45</a> of file <a class="el" href="testIndexedListWithBlocks_8cpp_source.html">testIndexedListWithBlocks.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;{</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  <span class="keywordflow">return</span> ( c1.size() == c2.size() )</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    &amp;&amp; std::equal( c1.begin(), c1.end(), c2.begin() );</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">Referenced by <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00081">checkErase()</a>, <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00060">checkInsert()</a>, <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00093">main()</a>, and <a class="el" href="testVoxelComplex_8cpp_source.html#l00341">TEST_CASE_METHOD()</a>.</p>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00093">93</a> of file <a class="el" href="testIndexedListWithBlocks_8cpp_source.html">testIndexedListWithBlocks.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;{</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  <span class="keyword">typedef</span> <a class="code" href="classDGtal_1_1IndexedListWithBlocks.html">IndexedListWithBlocks&lt;double, 2, 10&gt;</a> MyIndexedList;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  BOOST_CONCEPT_ASSERT(( <a class="code" href="structboost_1_1Container.html">boost::Container&lt; MyIndexedList &gt;</a> ));</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  BOOST_CONCEPT_ASSERT(( <a class="code" href="structboost_1_1ForwardIterator.html">boost::ForwardIterator&lt; MyIndexedList::Iterator &gt;</a> ));</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  BOOST_CONCEPT_ASSERT(( <a class="code" href="structboost_1_1ForwardIterator.html">boost::ForwardIterator&lt; MyIndexedList::ConstIterator &gt;</a> ));</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nb = 0;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nbok = 0;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <a class="code" href="namespaceDGtal.html#a8fc7012708b0416880a5c8b12dfdf9dd">trace</a>.<a class="code" href="classDGtal_1_1Trace.html#a352b7160bf722e2f0bcbee5d0bad6ef3">beginBlock</a> ( <span class="stringliteral">&quot;Testing IndexedListWithBlocks&quot;</span> );</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  MyIndexedList l;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  vector&lt;double&gt; v;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l ) ? 1 : 0;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) l=&quot;</span> &lt;&lt; l &lt;&lt; std::endl; </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <a class="code" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a>( v, l, 0, 4.5 );</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l ) ? 1 : 0;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) l=&quot;</span> &lt;&lt; l &lt;&lt; std::endl; </div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  <a class="code" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a>( v, l, 0, 10.1 );</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l ) ? 1 : 0;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) l=&quot;</span> &lt;&lt; l &lt;&lt; std::endl; </div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  <a class="code" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a>( v, l, 1, 3.7 );</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l ) ? 1 : 0;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) l=&quot;</span> &lt;&lt; l &lt;&lt; std::endl; </div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;  <a class="code" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a>( v, l, 2, 8.4 );</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  <a class="code" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a>( v, l, 1, 2.1 );</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l ) ? 1 : 0;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) l=&quot;</span> &lt;&lt; l &lt;&lt; std::endl; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;  <a class="code" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a>( v, l, 2, -3.0 );</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l ) ? 1 : 0;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) l=&quot;</span> &lt;&lt; l &lt;&lt; std::endl; </div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;  <a class="code" href="testIndexedListWithBlocks_8cpp.html#abb55816b077724448f97188d1382fa18">insert</a>( v, l, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)v.size(), -13.1 );</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#a8094f96118b5321654e1671f513371f8">isEqual</a>( v, l ) ? 1 : 0;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) l=&quot;</span> &lt;&lt; l &lt;&lt; std::endl; </div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#a9db08367fde22d5480a196db41883ae0">checkInsert</a>( v, l, 10000 ) ? 1 : 0;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) 10000 insertions&quot;</span> &lt;&lt; std::endl; </div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;  ++nb; nbok += <a class="code" href="testIndexedListWithBlocks_8cpp.html#aeeac00232988203f0ce1095bef3d655d">checkErase</a>( v, l, 10000 ) ? 1 : 0;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  std::cout &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; nbok &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; nb &lt;&lt; <span class="stringliteral">&quot;) 10000 deletions l=&quot;</span> &lt;&lt; l &lt;&lt; std::endl; </div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  <a class="code" href="namespaceDGtal.html#a8fc7012708b0416880a5c8b12dfdf9dd">trace</a>.<a class="code" href="classDGtal_1_1Trace.html#afa3a2874289734884107b1ce68ccb93d">endBlock</a>();</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  <span class="keywordflow">return</span> ( nb == nbok ) ? 0 : 1;</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;}</div>
<div class="ttc" id="aclassDGtal_1_1IndexedListWithBlocks_html"><div class="ttname"><a href="classDGtal_1_1IndexedListWithBlocks.html">DGtal::IndexedListWithBlocks</a></div><div class="ttdoc">Aim: Represents a mixed list/array structure which is useful in some context. It is essentially a lis...</div><div class="ttdef"><b>Definition:</b> <a href="IndexedListWithBlocks_8h_source.html#l00093">IndexedListWithBlocks.h:94</a></div></div>
<div class="ttc" id="aclassDGtal_1_1Trace_html_a352b7160bf722e2f0bcbee5d0bad6ef3"><div class="ttname"><a href="classDGtal_1_1Trace.html#a352b7160bf722e2f0bcbee5d0bad6ef3">DGtal::Trace::beginBlock</a></div><div class="ttdeci">void beginBlock(const std::string &amp;keyword=&quot;&quot;)</div></div>
<div class="ttc" id="aclassDGtal_1_1Trace_html_afa3a2874289734884107b1ce68ccb93d"><div class="ttname"><a href="classDGtal_1_1Trace.html#afa3a2874289734884107b1ce68ccb93d">DGtal::Trace::endBlock</a></div><div class="ttdeci">double endBlock()</div></div>
<div class="ttc" id="anamespaceDGtal_html_a8fc7012708b0416880a5c8b12dfdf9dd"><div class="ttname"><a href="namespaceDGtal.html#a8fc7012708b0416880a5c8b12dfdf9dd">DGtal::trace</a></div><div class="ttdeci">Trace trace</div><div class="ttdef"><b>Definition:</b> <a href="Common_8h_source.html#l00153">Common.h:153</a></div></div>
<div class="ttc" id="astructboost_1_1Container_html"><div class="ttname"><a href="structboost_1_1Container.html">boost::Container</a></div><div class="ttdoc">Go to http://www.sgi.com/tech/stl/Container.html.</div><div class="ttdef"><b>Definition:</b> <a href="Boost_8dox_source.html#l00104">Boost.dox:104</a></div></div>
<div class="ttc" id="astructboost_1_1ForwardIterator_html"><div class="ttname"><a href="structboost_1_1ForwardIterator.html">boost::ForwardIterator</a></div><div class="ttdoc">Go to http://www.sgi.com/tech/stl/ForwardIterator.html.</div><div class="ttdef"><b>Definition:</b> <a href="Boost_8dox_source.html#l00040">Boost.dox:40</a></div></div>
<div class="ttc" id="atestIndexedListWithBlocks_8cpp_html_a9db08367fde22d5480a196db41883ae0"><div class="ttname"><a href="testIndexedListWithBlocks_8cpp.html#a9db08367fde22d5480a196db41883ae0">checkInsert</a></div><div class="ttdeci">bool checkInsert(VContainer1 &amp;v, LContainer2 &amp;l, unsigned int nb)</div><div class="ttdef"><b>Definition:</b> <a href="testIndexedListWithBlocks_8cpp_source.html#l00060">testIndexedListWithBlocks.cpp:60</a></div></div>
<div class="ttc" id="atestIndexedListWithBlocks_8cpp_html_aeeac00232988203f0ce1095bef3d655d"><div class="ttname"><a href="testIndexedListWithBlocks_8cpp.html#aeeac00232988203f0ce1095bef3d655d">checkErase</a></div><div class="ttdeci">bool checkErase(VContainer1 &amp;v, LContainer2 &amp;l, unsigned int nb)</div><div class="ttdef"><b>Definition:</b> <a href="testIndexedListWithBlocks_8cpp_source.html#l00081">testIndexedListWithBlocks.cpp:81</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="classDGtal_1_1Trace.html#a352b7160bf722e2f0bcbee5d0bad6ef3">DGtal::Trace::beginBlock()</a>, <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00081">checkErase()</a>, <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00060">checkInsert()</a>, <a class="el" href="classDGtal_1_1Trace.html#afa3a2874289734884107b1ce68ccb93d">DGtal::Trace::endBlock()</a>, <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00052">insert()</a>, <a class="el" href="testIndexedListWithBlocks_8cpp_source.html#l00045">isEqual()</a>, and <a class="el" href="Common_8h_source.html#l00153">DGtal::trace</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_59425e443f801f1f2fd8bbe4959a3ccf.html">tests</a></li><li class="navelem"><a class="el" href="dir_a49f9b051925a4cbbe82ac92a0123656.html">base</a></li><li class="navelem"><a class="el" href="testIndexedListWithBlocks_8cpp.html">testIndexedListWithBlocks.cpp</a></li>
    <li class="footer">Generated on Mon Dec 23 2024 13:18:55 for DGtal by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>